/* Generated by Together */ #include "FairTarget.h" #include "FairGeoInterface.h" // for FairGeoInterface #include "FairGeoLoader.h" // for FairGeoLoader #include "FairGeoNode.h" // for FairGeoNode #include "FairGeoPassivePar.h" // for FairGeoPassivePar #include "FairGeoTarget.h" // for FairGeoTarget #include "FairGeoVolume.h" // for FairGeoVolume #include "FairRun.h" // for FairRun #include "FairRuntimeDb.h" // for FairRuntimeDb #include "TList.h" // for TListIter, TList (ptr only) #include "TObjArray.h" // for TObjArray #include "TString.h" // for TString #include // for NULL FairTarget::~FairTarget() { } FairTarget::FairTarget() : FairModule("FairTarget", "") { } FairTarget::FairTarget(const char* name, const char* title) : FairModule(name ,title) { } void FairTarget::ConstructGeometry() { FairGeoLoader* loader=FairGeoLoader::Instance(); FairGeoInterface* GeoInterface =loader->getGeoInterface(); FairGeoTarget* MGeo=new FairGeoTarget(); MGeo->setGeomFile(GetGeometryFileName()); GeoInterface->addGeoModule(MGeo); Bool_t rc = GeoInterface->readSet(MGeo); if ( rc ) { MGeo->create(loader->getGeoBuilder()); } TList* volList = MGeo->getListOfVolumes(); // store geo parameter FairRun* fRun = FairRun::Instance(); FairRuntimeDb* rtdb= FairRun::Instance()->GetRuntimeDb(); FairGeoPassivePar* par=(FairGeoPassivePar*)(rtdb->getContainer("FairGeoPassivePar")); TObjArray* fSensNodes = par->GetGeoSensitiveNodes(); TObjArray* fPassNodes = par->GetGeoPassiveNodes(); TListIter iter(volList); FairGeoNode* node = NULL; FairGeoVolume* aVol=NULL; while( (node = (FairGeoNode*)iter.Next()) ) { aVol = dynamic_cast ( node ); if ( node->isSensitive() ) { fSensNodes->AddLast( aVol ); } else { fPassNodes->AddLast( aVol ); } } ProcessNodes( volList ); par->setChanged(); par->setInputVersion(fRun->GetRunId(),1); } ClassImp(FairTarget)