FairRoot/PandaRoot
Functions
PndCave.cxx File Reference
#include "FairMCApplication.h"
#include "PndCave.h"
#include "FairVolume.h"
#include "FairVolumeList.h"
#include "TGeoMCGeometry.h"
#include "TGeoManager.h"
#include "TGeoVolume.h"
#include "TGeoMedium.h"
#include "FairGeoLoader.h"
#include "FairGeoInterface.h"
#include "PndGeoCave.h"
#include "FairGeoRootBuilder.h"
#include "FairRuntimeDb.h"
#include "PndGeoPassivePar.h"
#include "TObjArray.h"
#include "FairGeoVolume.h"
#include "FairGeoNode.h"
#include "FairRun.h"

Go to the source code of this file.

Functions

 ClassImp (PndCave) void PndCave
 

Function Documentation

ClassImp ( PndCave  )

Definition at line 24 of file PndCave.cxx.

References Bool_t, fRun, PndGeoPassivePar::GetGeoPassiveNodes(), PndGeoPassivePar::GetGeoSensitiveNodes(), par, and rtdb.

26 {
27  FairGeoLoader *loader=FairGeoLoader::Instance();
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();
38  FairRuntimeDb *rtdb= FairRun::Instance()->GetRuntimeDb();
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 }
TObjArray * GetGeoPassiveNodes()
Double_t par[3]
FairRunAna * fRun
Definition: hit_dirc.C:58
FairRuntimeDb * rtdb
Definition: hit_dirc.C:66
TObjArray * GetGeoSensitiveNodes()