EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
PndCave.cxx
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file PndCave.cxx
1 /* Generated by Together */
2 
3 #include "FairMCApplication.h"
4 #include "PndCave.h"
5 #include "FairVolume.h"
6 #include "FairVolumeList.h"
7 #include "TGeoMCGeometry.h"
8 #include "TGeoManager.h"
9 #include "TGeoVolume.h"
10 #include "TGeoMedium.h"
11 
12 #include "FairGeoLoader.h"
13 #include "FairGeoInterface.h"
14 #include "PndGeoCave.h"
15 #include "FairGeoRootBuilder.h"
16 #include "FairRuntimeDb.h"
17 #include "PndGeoPassivePar.h"
18 #include "TObjArray.h"
19 #include "FairGeoVolume.h"
20 #include "FairGeoNode.h"
21 #include "FairRun.h"
22 
23 
25 void PndCave::ConstructGeometry()
26 {
28  FairGeoInterface *GeoInterface =loader->getGeoInterface();
29  PndGeoCave *MGeo=new PndGeoCave();
30  MGeo->setGeomFile(GetGeometryFileName());
31  GeoInterface->addGeoModule(MGeo);
32  Bool_t rc = GeoInterface->readSet(MGeo);
33  if ( rc ) MGeo->create(loader->getGeoBuilder());
34 
35  TList* volList = MGeo->getListOfVolumes();
36  // store geo parameter
37  FairRun *fRun = FairRun::Instance();
39  PndGeoPassivePar* par=(PndGeoPassivePar*)(rtdb->getContainer("PndGeoPassivePar"));
40  TObjArray *fSensNodes = par->GetGeoSensitiveNodes();
41  TObjArray *fPassNodes = par->GetGeoPassiveNodes();
42 
43  TListIter iter(volList);
44  FairGeoNode* node = NULL;
45  FairGeoVolume *aVol=NULL;
46 
47  while( (node = (FairGeoNode*)iter.Next()) ) {
48  aVol = dynamic_cast<FairGeoVolume*> ( node );
49  if ( node->isSensitive() ) {
50  fSensNodes->AddLast( aVol );
51  }else{
52  fPassNodes->AddLast( aVol );
53  }
54  }
55  par->setChanged();
56  par->setInputVersion(fRun->GetRunId(),1);
57 
58 }
60 }
61 
63 {
64 
65 }
66 PndCave::PndCave(const char * name, const char *Title)
67  : FairModule(name ,Title)
68 {
69  world[0] = 0;
70  world[1] = 0;
71  world[2] = 0;
72 }