FairRoot
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
FairCave.cxx
Go to the documentation of this file.
1 /********************************************************************************
2  * Copyright (C) 2014 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH *
3  * *
4  * This software is distributed under the terms of the *
5  * GNU Lesser General Public Licence (LGPL) version 3, *
6  * copied verbatim in the file "LICENSE" *
7  ********************************************************************************/
8 /* Generated by Together */
9 #include "FairCave.h"
10 
11 #include "FairGeoCave.h" // for FairGeoCave
12 #include "FairGeoInterface.h" // for FairGeoInterface
13 #include "FairGeoLoader.h" // for FairGeoLoader
14 #include "FairGeoNode.h" // for FairGeoNode
15 #include "FairGeoPassivePar.h" // for FairGeoPassivePar
16 #include "FairGeoVolume.h" // for FairGeoVolume
17 #include "FairRun.h" // for FairRun
18 #include "FairRuntimeDb.h" // for FairRuntimeDb
19 
20 #include <TList.h> // for TListIter, TList (ptr only)
21 #include <TObjArray.h> // for TObjArray
22 #include <TString.h> // for TString
23 
25 
27 {
29  FairGeoInterface* GeoInterface = loader->getGeoInterface();
30  FairGeoCave* MGeo = new FairGeoCave();
32  GeoInterface->addGeoModule(MGeo);
33  Bool_t rc = GeoInterface->readSet(MGeo);
34  if (rc) {
35  MGeo->create(loader->getGeoBuilder());
36  }
37 
38  TList* volList = MGeo->getListOfVolumes();
39  // store geo parameter
40  FairRun* fRun = FairRun::Instance();
42  FairGeoPassivePar* par = static_cast<FairGeoPassivePar*>(rtdb->getContainer("FairGeoPassivePar"));
43  TObjArray* fSensNodes = par->GetGeoSensitiveNodes();
44  TObjArray* fPassNodes = par->GetGeoPassiveNodes();
45 
46  TListIter iter(volList);
47  FairGeoNode* node = nullptr;
48  FairGeoVolume* aVol = nullptr;
49 
50  while ((node = static_cast<FairGeoNode*>(iter.Next()))) {
51  aVol = dynamic_cast<FairGeoVolume*>(node);
52  if (node->isSensitive()) {
53  fSensNodes->AddLast(aVol);
54  } else {
55  fPassNodes->AddLast(aVol);
56  }
57  }
58  par->setChanged();
59  par->setInputVersion(fRun->GetRunId(), 1);
60 }
61 
62 FairCave::FairCave(const FairCave& rhs)
63  : FairModule(rhs)
64 {
65  world[0] = rhs.world[0];
66  world[1] = rhs.world[1];
67  world[2] = rhs.world[2];
68 }
69 
71 
73 
74 FairCave::FairCave(const char* name, const char* Title)
75  : FairModule(name, Title)
76 {
77  world[0] = 0;
78  world[1] = 0;
79  world[2] = 0;
80 }
81 
82 FairModule* FairCave::CloneModule() const { return new FairCave(*this); }
list of container factories
Definition: FairRuntimeDb.h:24
Bool_t readSet(FairGeoSet *)
Bool_t isSensitive()
Definition: FairGeoNode.h:146
FairGeoInterface * getGeoInterface()
Definition: FairGeoLoader.h:34
static FairGeoLoader * Instance()
static FairRun * Instance()
Definition: FairRun.cxx:31
virtual FairModule * CloneModule() const
Definition: FairCave.cxx:82
void setChanged(Bool_t flag=kTRUE)
Definition: FairParSet.h:72
virtual void ConstructGeometry()
Definition: FairCave.cxx:26
void addGeoModule(FairGeoSet *)
virtual Bool_t create(FairGeoBuilder *)
Definition: FairGeoSet.cxx:452
ClassImp(FairEventBuilder)
FairParSet * getContainer(const Text_t *)
FairCave()
Definition: FairCave.cxx:70
TList * getListOfVolumes()
Definition: FairGeoSet.h:85
FairMQExParamsParOne * par
FairGeoBuilder * getGeoBuilder()
Definition: FairGeoLoader.h:35
void setInputVersion(Int_t v=-1, Int_t i=0)
Definition: FairParSet.h:51
FairRuntimeDb * GetRuntimeDb(void)
Definition: FairRun.h:80
void setGeomFile(const char *filename)
Definition: FairGeoSet.h:75
virtual ~FairCave()
Definition: FairCave.cxx:72
virtual TString GetGeometryFileName()
Definition: FairModule.h:60
TObjArray * GetGeoSensitiveNodes()
TObjArray * GetGeoPassiveNodes()
Int_t GetRunId()
Definition: FairRun.h:97