2 #include "StiMasterDetectorBuilder.h"
3 #include "TGeoManager.h"
4 #include "StiDetector.h"
6 StiMasterDetectorBuilder::StiMasterDetectorBuilder(
bool active)
10 StiMasterDetectorBuilder::~StiMasterDetectorBuilder()
26 if (! gGeoManager) StiVMCToolKit::GetVMC();
28 StMaker *chain=StMaker::GetChain();
30 LOG_INFO <<
"We are StiMasterDetectorBuilder::build() and will clone the geometry if exists" << endm;
32 TDatime t = chain->StMaker::GetDBTime();
33 LOG_INFO <<
"Timestamp check - Date/Time from chain is " << t.GetDate() <<
"/" << t.GetTime() << endm;
39 LOG_INFO <<
"StiMasterDetectorBuilder::build() : Create clone of VmcGeometry by reinitialization for reconstruction" <<endm;
40 TDataSet *set = chain->GetDataBase(
"VmcGeometry/Geometry", &chain->StMaker::GetDBTime());
44 LOG_INFO <<
"StiMasterDetectorBuilder::build() : Started"<<endm;
45 vector<StiDetectorBuilder*>::iterator iter;
51 LOG_INFO <<
"StiMasterDetectorBuilder::build() : Calling Group Builder named: " << (*iter)->getName() << endm;
52 if (!*iter) { LOG_INFO <<
" pointer is corrupted!!!!!!!!!!!!!!!!!!!" << endm; }
53 (*iter)->build(source);
54 nRows+=(*iter)->getNRows();
56 LOG_INFO <<
"StiMasterDetectorBuilder::build() : Will build local array" << endm;
63 LOG_INFO <<
"StiMasterDetectorBuilder::build() : Builder: " << (*iter)->getName() << endm;
64 for (
unsigned int i=0;i<(*iter)->getNRows();i++)
66 LOG_INFO <<
"StiMasterDetectorBuilder::build() : row: " << row;
67 unsigned int nSectors = (*iter)->getNSectors(i);
68 setNSectors(row,nSectors);
70 for (
unsigned int sector=0;sector<nSectors;sector++)
72 StiDetector *detector = (*iter)->getDetector(i,sector);
73 if (!ifrow && detector) { LOG_INFO <<
"\t" << detector->
getName(); ifrow++; }
74 setDetector(row,sector,detector);
80 cout <<
"StiMasterDetectorBuilder::build() -I- Done"<<endl;
87 vector<StiDetectorBuilder*>::const_iterator iter;
92 if((*iter)->hasMore())
return true;
102 vector<StiDetectorBuilder*>::const_iterator iter;
107 if((*iter)->hasMore())
return (*iter)->next();
120 vector<StiDetectorBuilder*>::const_iterator iter;
125 if((*iter)->isName(name))
return *iter;
127 cout <<
"StiMasterDetectorBuilder::get(const string & name) -E- Requested object not found" << endl;
virtual bool hasMore() const
virtual void setNRows(UInt_t nRows)
virtual StiDetector * next()
virtual void build(StMaker &source)
const string & getName() const
Get the name of the object.