EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
PndTarget.cxx
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file PndTarget.cxx
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 {
29  FairGeoInterface *GeoInterface =loader->getGeoInterface();
30  PndGeoTarget *MGeo=new PndGeoTarget();
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();
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