FairRoot/PandaRoot
PndTarget.cxx
Go to the documentation of this file.
1 /* Generated by Together */
2 
3 #include "PndTarget.h"
4 #include "FairGeoLoader.h"
5 #include "FairGeoInterface.h"
6 #include "PndGeoTarget.h"
7 #include "FairGeoRootBuilder.h"
8 #include "FairRuntimeDb.h"
9 #include "PndGeoPassivePar.h"
10 #include "TObjArray.h"
11 #include "FairRun.h"
12 #include "FairGeoVolume.h"
13 #include "FairGeoNode.h"
14 
16 {
17 }
19 {
20 }
21 
22 PndTarget::PndTarget(const char * name, const char * title)
23  : FairModule(name ,title)
24 {
25 }
27 {
28  FairGeoLoader *loader=FairGeoLoader::Instance();
29  FairGeoInterface *GeoInterface =loader->getGeoInterface();
30  PndGeoTarget *MGeo=new PndGeoTarget();
31  MGeo->setGeomFile(GetGeometryFileName());
32  GeoInterface->addGeoModule(MGeo);
33  Bool_t rc = GeoInterface->readSet(MGeo);
34  if ( rc ) MGeo->create(loader->getGeoBuilder());
35 
36  TList* volList = MGeo->getListOfVolumes();
37  // store geo parameter
38  FairRun *fRun = FairRun::Instance();
39  FairRuntimeDb *rtdb= FairRun::Instance()->GetRuntimeDb();
40  PndGeoPassivePar* par=(PndGeoPassivePar*)(rtdb->getContainer("PndGeoPassivePar"));
41  TObjArray *fSensNodes = par->GetGeoSensitiveNodes();
42  TObjArray *fPassNodes = par->GetGeoPassiveNodes();
43 
44  TListIter iter(volList);
45  FairGeoNode* node = NULL;
46  FairGeoVolume *aVol=NULL;
47 
48  while( (node = (FairGeoNode*)iter.Next()) ) {
49  aVol = dynamic_cast<FairGeoVolume*> ( node );
50  if ( node->isSensitive() ) {
51  fSensNodes->AddLast( aVol );
52  }else{
53  fPassNodes->AddLast( aVol );
54  }
55  }
56  ProcessNodes( volList );
57  par->setChanged();
58  par->setInputVersion(fRun->GetRunId(),1);
59 
60 }
62 
63 
64 
TObjArray * GetGeoPassiveNodes()
Double_t par[3]
FairRunAna * fRun
Definition: hit_dirc.C:58
FairRuntimeDb * rtdb
Definition: hit_dirc.C:66
TString name
ClassImp(PndAnaContFact)
TObjArray * GetGeoSensitiveNodes()
virtual ~PndTarget()
Definition: PndTarget.cxx:15
virtual void ConstructGeometry()
Definition: PndTarget.cxx:26