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

Detailed Description

Definition at line 17 of file BFLHandler.h.


Constructor & Destructor Documentation

BFLHandler::BFLHandler ( Int_t  detector  ) 

Definition at line 24 of file BFLHandler.cxx.

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

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

Definition at line 59 of file BFLHandler.cxx.

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

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

BFLHandler::~BFLHandler (  ) 

Definition at line 73 of file BFLHandler.cxx.

References fInt.

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


Member Function Documentation

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

Definition at line 105 of file BFLHandler.cxx.

References fInt, and BFLInterpolation::GetB().

Referenced by BfldHandlerVoronoi::GetBFieldMeshCoord().

00107 {
00108     return fInt->GetB(GlobalPosVector,updateSeedPolygon);
00109 }

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 81 of file BFLHandler.cxx.

References exit(), and fBField.

Referenced by BFLHandler().

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

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().

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 22 Nov 2017 for loon by  doxygen 1.6.1