Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

BFLHandler Class Reference

#include <BFLHandler.h>

List of all members.

Public Member Functions

 BFLHandler (Int_t detector)
 BFLHandler (Char_t VoronoiFile[], Char_t MeshFile[], Char_t BFieldFile[])
 ~BFLHandler ()
TVector3 GetBField (const TVector3 &GlobalPosVector, const Bool_t updateSeedPolygon=kFALSE)
virtual BFLCacheGetCache (void)
virtual void SetCache (BFLCache *cache)
virtual void SetVoronoi (BFLWingedEdge *vor)
virtual void SetBField (TObjArray *bfield)
virtual void SetInterpolant (BfldInterpMethod::InterpMethod_t interp)
virtual void SetLastPolygAsSeed (void)

Private Member Functions

Int_t LoadBField (Char_t GeomFile[])

Private Attributes

BFLInterpolationfInt
BFLWingedEdgefVor
TObjArray * fBField


Constructor & Destructor Documentation

BFLHandler::BFLHandler Int_t  detector  ) 
 

Definition at line 22 of file BFLHandler.cxx.

00023 {
00024   Char_t VoronoiFile[] = "NearDetVorD.default";
00025   Char_t MeshFile[]    = "NearDetMesh.default";
00026   Char_t BFieldFile[]  = "NearDetBFld.default";
00027   
00028   switch(DetectorToLoadDefaults) {
00029     case (1):
00030        strcpy(VoronoiFile,"FarDetVorD.default");
00031        strcpy(MeshFile,   "FarDetMesh.default");
00032        strcpy(BFieldFile, "FarDetBFld.default");
00033        break;
00034     case (0): 
00035        strcpy(VoronoiFile,"NearDetVorD.default");
00036        strcpy(MeshFile,   "NearDetMesh.default");
00037        strcpy(BFieldFile, "NearDetBFld.default");
00038        break;
00039     default:      
00040        strcpy(VoronoiFile,"NearDetVorD.default");
00041        strcpy(MeshFile,   "NearDetMesh.default");
00042        strcpy(BFieldFile, "NearDetBFld.default");
00043        break;
00044   } 
00045   
00046   fBField = new TObjArray(1000);     /* BF Vectors */ 
00047   fVor = new BFLWingedEdge();        /* A Voronoi diagram object */
00048 
00049   LoadBField(BFieldFile);            /* Fill fBField */ 
00050   fVor->Load(VoronoiFile);           /* Fill fVor */ 
00051   fVor->LoadNodalSet(MeshFile);      /* Fill fGenerators */
00052 
00053   fInt = new BFLInterpolation(fBField, fVor); 
00054 }

BFLHandler::BFLHandler Char_t  VoronoiFile[],
Char_t  MeshFile[],
Char_t  BFieldFile[]
 

Definition at line 57 of file BFLHandler.cxx.

References fBField, fInt, fVor, BFLWingedEdge::Load(), LoadBField(), and BFLWingedEdge::LoadNodalSet().

00059 { 
00060   fBField = new TObjArray(1000);     /* BF Vectors */ 
00061   fVor = new BFLWingedEdge();        /* A Voronoi diagram object */
00062   
00063   LoadBField(BFieldFile);            /* Fill fBField */ 
00064   fVor->Load(VoronoiFile);           /* Fill fVor */ 
00065   fVor->LoadNodalSet(MeshFile); 
00066   
00067   fInt = new BFLInterpolation(fBField, fVor); 
00068 }

BFLHandler::~BFLHandler  ) 
 

Definition at line 71 of file BFLHandler.cxx.

References fInt.

00072 {
00073     delete fInt;    fInt=0;
00074     // already done by BFLInterpolation //delete fVor;    fVor=0;
00075     // already done by BFLInterpolation //delete fBField; fBField=0;
00076 }


Member Function Documentation

TVector3 BFLHandler::GetBField const TVector3 &  GlobalPosVector,
const Bool_t  updateSeedPolygon = kFALSE
 

Definition at line 103 of file BFLHandler.cxx.

References fInt, and BFLInterpolation::GetB().

Referenced by BfldHandlerVoronoi::GetBFieldMeshCoord().

00105 {
00106     return fInt->GetB(GlobalPosVector,updateSeedPolygon);
00107 }

virtual BFLCache* BFLHandler::GetCache void   )  [inline, virtual]
 

Definition at line 28 of file BFLHandler.h.

References fInt, and BFLInterpolation::GetCache().

00028 { return fInt->GetCache(); } 

Int_t BFLHandler::LoadBField Char_t  GeomFile[]  )  [private]
 

Definition at line 79 of file BFLHandler.cxx.

References fBField.

Referenced by BFLHandler().

00080 {
00081   Int_t NodeID = 0;
00082   Float_t bx, by, bz;
00083   Int_t NodeIDLast = -999;
00084   
00085   ifstream DATA(BFieldFile,std::ios::in);
00086   if(!DATA) {
00087      cerr << "No such file: " << BFieldFile << endl;
00088      exit(1);
00089   }
00090 
00091   while(!DATA.eof()){
00092      DATA >> NodeID >> bx >> by >> bz; 
00093      if (NodeID != NodeIDLast) 
00094         fBField->AddAtAndExpand(new TVector3(bx,by,bz),NodeID);     
00095      NodeIDLast = NodeID;
00096   }
00097   DATA.close(); 
00098 
00099   return 0;
00100 } 

virtual void BFLHandler::SetBField TObjArray *  bfield  )  [inline, virtual]
 

Definition at line 31 of file BFLHandler.h.

References fBField.

00031 { fBField = bfield; }

virtual void BFLHandler::SetCache BFLCache cache  )  [inline, virtual]
 

Definition at line 29 of file BFLHandler.h.

References fInt, and BFLInterpolation::SetCache().

00029 { fInt->SetCache(cache); }

virtual void BFLHandler::SetInterpolant BfldInterpMethod::InterpMethod_t  interp  )  [inline, virtual]
 

Definition at line 32 of file BFLHandler.h.

References fInt, and BFLInterpolation::SetInterpolant().

Referenced by BfldHandlerVoronoi::SetCostasInterpMethod().

00032                                                                            {
00033             fInt->SetInterpolant(interp);
00034         }

virtual void BFLHandler::SetLastPolygAsSeed void   )  [inline, virtual]
 

Definition at line 35 of file BFLHandler.h.

References fInt, BFLInterpolation::GetLastPolygon(), and BFLInterpolation::SetSearchSeed().

00035                                               {
00036            fInt->SetSearchSeed(fInt->GetLastPolygon());
00037         }

virtual void BFLHandler::SetVoronoi BFLWingedEdge vor  )  [inline, virtual]
 

Definition at line 30 of file BFLHandler.h.

References fVor.

00030 { fVor = vor; }


Member Data Documentation

TObjArray* BFLHandler::fBField [private]
 

Definition at line 42 of file BFLHandler.h.

Referenced by BFLHandler(), LoadBField(), and SetBField().

BFLInterpolation* BFLHandler::fInt [private]
 

Definition at line 40 of file BFLHandler.h.

Referenced by BFLHandler(), GetBField(), GetCache(), SetCache(), SetInterpolant(), SetLastPolygAsSeed(), and ~BFLHandler().

BFLWingedEdge* BFLHandler::fVor [private]
 

Definition at line 41 of file BFLHandler.h.

Referenced by BFLHandler(), and SetVoronoi().


The documentation for this class was generated from the following files:
Generated on Mon Feb 15 11:08:48 2010 for loon by  doxygen 1.3.9.1