FairRoot
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
FairModule.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 // -------------------------------------------------------------------------
9 // ----- FairModule source file -----
10 // ----- Created 06/01/04 by M. Al-Turany -----
11 // -------------------------------------------------------------------------
12 /* Generated by Together */
13 #include "FairModule.h"
14 
15 #include "FairGeoBuilder.h" // for FairGeoBuilder
16 #include "FairGeoInterface.h" // for FairGeoInterface
17 #include "FairGeoLoader.h" // for FairGeoLoader
18 #include "FairGeoMedia.h" // for FairGeoMedia
19 #include "FairGeoNode.h" // for FairGeoNode
20 #include "FairGeoParSet.h" // for FairBaseParSet
21 #include "FairMCApplication.h"
22 #include "FairRun.h" // for FairRun
23 #include "FairRuntimeDb.h" // for FairRuntimeDb
24 #include "FairVolume.h" // for FairVolume
25 #include "FairVolumeList.h" // for FairVolumeList
26 
27 #include <TBuffer.h> // for TBuffer, operator<<, etc
28 #include <TCollection.h> // for TIter
29 #include <TFile.h> // for TFile
30 #include <TGeoManager.h> // for TGeoManager, gGeoManager
31 #include <TGeoMaterial.h> // for TGeoMaterial
32 #include <TGeoMatrix.h> // for TGeoMatrix, TGeoHMatrix
33 #include <TGeoMedium.h> // for TGeoMedium
34 #include <TGeoNode.h> // for TGeoNode
35 #include <TGeoVolume.h> // for TGeoVolume
36 #include <TGeoVoxelFinder.h> // for TGeoVoxelFinder
37 #include <TKey.h> // for TKey
38 #include <TList.h> // for TList, TListIter
39 #include <TObjArray.h> // for TObjArray
40 #include <TObject.h> // for TObject
41 #include <TRefArray.h> // for TRefArray
42 #include <TSystem.h> // for TSystem, gSystem
43 #include <TVirtualMC.h>
44 
45 #ifdef ROOT_HAS_GDML
46 #include <TGDMLParse.h>
47 #endif
48 
49 #include <map>
50 #include <stdlib.h> // for getenv
51 #include <string.h> // for strcmp, strlen
52 
53 class FairGeoMedium;
54 
55 thread_local TArrayI* FairModule::volNumber = 0;
56 thread_local Int_t FairModule::fNbOfVolumes = 0;
57 thread_local FairVolumeList* FairModule::vList = 0;
58 thread_local TRefArray* FairModule::svList = 0;
59 
61 {
62  LOG(warn)
63  << "The method ConstructGeometry has to be implemented in the detector class which inherits from FairModule";
64 }
65 
67 {
68  LOG(debug2)
69  << "The method ConstructOpGeometry has to be implemented in the detector class which inherits from FairModule";
70 }
71 
73 
74 FairModule::FairModule(const char* Name, const char* title, Bool_t Active)
75  : TNamed(Name, title)
76  , fMotherVolumeName("")
77  , fgeoVer("Not defined")
78  , fgeoName("Not defined")
79  , fModId(-1)
80  , fActive(Active)
81  , fNbOfSensitiveVol(0)
82  , fVerboseLevel(0)
83  , flGeoPar(nullptr)
84  , fGeoSaved(kFALSE)
85  , fMC(nullptr)
86 {
87  if (!svList) {
88  svList = new TRefArray();
89  }
90  if (!vList) {
91  vList = new FairVolumeList();
92  }
93 }
94 
96  : TNamed(rhs)
97  , fMotherVolumeName(rhs.fMotherVolumeName)
98  , fgeoVer(rhs.fgeoVer)
99  , fgeoName(rhs.fgeoName)
100  , fModId(rhs.fModId)
101  , fActive(rhs.fActive)
102  , fNbOfSensitiveVol(rhs.fNbOfSensitiveVol)
103  , fVerboseLevel(rhs.fVerboseLevel)
104  , flGeoPar(nullptr)
105  , fGeoSaved(rhs.fGeoSaved)
106  , fMC(nullptr)
107 {
108  if (!svList) {
109  svList = new TRefArray();
110  for (Int_t i = 0; i < rhs.svList->GetEntries(); i++) {
111  svList->Add(rhs.svList->At(i));
112  }
113  }
114 
115  if (!vList) {
116  vList = new FairVolumeList();
117  for (Int_t i = 0; i < rhs.vList->getEntries(); i++) {
118  vList->addVolume(rhs.vList->At(i));
119  }
120  }
121 
122  // Initialize cached pointer to MC (on worker)
123  fMC = TVirtualMC::GetMC();
124 
125  // TO DO - add when we know what type is the elements of flGeoPar
126  // flGeoPar=new TObjArray();
127  // TIter it = rhs.flGeoPar->MakeIterator();
128  // Copy parameters
129  // TObject* obj;
130  // while((obj=it->Next())) {
131  // flGeoPar->Add(...);
132  //}
133 }
134 
136  : TNamed()
137  , fMotherVolumeName("")
138  , fgeoVer("Not defined")
139  , fgeoName("Not defined")
140  , fModId(-1)
141  , fActive(kFALSE)
142  , fNbOfSensitiveVol(0)
143  , fVerboseLevel(0)
144  , flGeoPar(nullptr)
145  , fGeoSaved(kFALSE)
146  , fMC(nullptr)
147 {}
148 
150 {
151  // check assignment to self
152  if (this == &rhs)
153  return *this;
154 
155  // base class assignment
156  TNamed::operator=(rhs);
157 
158  // assignment operator
160  fgeoVer = rhs.fgeoVer;
161  fgeoName = rhs.fgeoName;
162  fModId = rhs.fModId;
163  fActive = rhs.fActive;
166  flGeoPar = nullptr;
167  fGeoSaved = rhs.fGeoSaved;
168  fMC = TVirtualMC::GetMC();
169 
170  // TO DO - add when we know what type is the elements of flGeoPar
171  // flGeoPar=new TObjArray();
172  // TIter it = rhs.flGeoPar->MakeIterator();
173  // copy parameters
174  // TObject* obj;
175  // while((obj=it->Next())) {
176  // flGeoPar->Add(...);
177  //}
178 
179  return *this;
180 }
181 
182 void FairModule::Streamer(TBuffer& b)
183 {
184  TNamed::Streamer(b);
185 
186  if (b.IsReading()) {
187  fgeoVer.Streamer(b);
188  fgeoName.Streamer(b);
189  b >> fActive;
190  b >> fModId;
191  } else {
192  fgeoVer.Streamer(b);
193  fgeoName.Streamer(b);
194  b << fActive;
195  b << fModId;
196  }
197 }
198 
199 void FairModule::SetGeometryFileName(TString fname, TString)
200 {
201 
202  // If absolute path is given as argument, try to find it there.
203  // If the file don't exist break. Don't look anywhere else.
204  if (fname.BeginsWith("/")) {
205  if (gSystem->AccessPathName(fname.Data())) {
206  LOG(fatal) << fName << ": geometry file " << fname << " not found in absolut path!";
207  fgeoName = "";
208  } // file not found
209  fgeoName = fname;
210  LOG(debug) << fName << ": using geometry file " << fgeoName;
211  return;
212  }
213 
214  // If GEOMPATH is set, try to find the file there.
215  // If there is no such file go on to look in the default location.
216  TString userPath = getenv("GEOMPATH");
217  userPath.ReplaceAll("//", "/");
218  if (!userPath.IsNull()) {
219  if (!userPath.EndsWith("/")) {
220  userPath += "/";
221  }
222  fgeoName = userPath + fname;
223  if (!gSystem->AccessPathName(fgeoName.Data())) {
224  LOG(debug) << fName << ": using geometry file " << fgeoName;
225  return;
226  }
227  LOG(debug) << fName << ": geometry file " << fname << " not found in GEOMPATH " << userPath;
228  }
229 
230  // Look in the standard path
231  fgeoName = getenv("VMCWORKDIR");
232  fgeoName += "/geometry/" + fname;
233  if (!gSystem->AccessPathName(fgeoName.Data())) {
234  LOG(debug) << fName << ": using geometry file " << fgeoName;
235  return;
236  }
237 
238  // File not found
239  LOG(fatal) << fName << ": geometry file " << fname << " not found in standard path ";
240  fgeoName = "";
241  return;
242 }
243 
244 void FairModule::ProcessNodes(TList* aList)
245 {
247  LOG(fatal) << "Detected call to FairModule::ProcessNodes() \
248  while not in FairMCApplication::ConstructGeometry()\n\
249  Call templated function FairModule::ConstructASCIIGeometry()\
250  from ConstructGeometry() of your detector class. Aborting...";
251  }
252 
253  if (!svList) {
254  svList = new TRefArray();
255  }
256  if (!vList) {
257  vList = new FairVolumeList();
258  }
259 
260  TListIter iter(aList);
261  FairGeoNode* node = nullptr;
262  FairGeoNode* MotherNode = nullptr;
263  FairVolume* volume = nullptr;
265  FairGeoParSet* par = static_cast<FairGeoParSet*>(rtdb->getContainer("FairGeoParSet"));
266  TObjArray* fNodes = par->GetGeoNodes();
267  while ((node = static_cast<FairGeoNode*>(iter.Next()))) {
268 
269  node->calcLabTransform();
270  MotherNode = node->getMotherNode();
271  volume = new FairVolume(node->getTruncName(), fNbOfVolumes++);
272  volume->setRealName(node->GetName());
273  vList->addVolume(volume);
274  volume->setGeoNode(node);
275  volume->setCopyNo(node->getCopyNo());
276 
277  if (MotherNode != 0) {
278  volume->setMotherId(node->getMCid());
279  volume->setMotherCopyNo(MotherNode->getCopyNo());
280  }
281  FairGeoVolume* aVol = nullptr;
282 
283  if (node->isSensitive() && fActive) {
284  volume->setModId(fModId);
285  volume->SetModule(this);
286  svList->Add(volume);
287  aVol = dynamic_cast<FairGeoVolume*>(node);
288  fNodes->AddLast(aVol);
290  }
291  }
292 }
293 
295 {
296 
297  LOG(debug2) << "AddSensitiveVolume " << v->GetName();
298 
299  // Only register volumes which are not already registered
300  // Otherwise the stepping will be slowed down
301  if (!vList->findObject(v->GetName())) {
302  FairVolume* volume = nullptr;
303  volume = new FairVolume(v->GetName(), fNbOfVolumes++);
304  vList->addVolume(volume);
305  volume->setModId(fModId);
306  volume->SetModule(this);
307  svList->Add(volume);
309  }
310 }
311 
313 {
314  FairVolume* fv;
315  FairVolume* fvol = 0;
316  for (Int_t i = 0; i < vList->getEntries(); i++) {
317  fv = vList->At(i);
318  if ((fv->getGeoNode()) == fN) {
319  fvol = fv;
320  return fvol;
321  break;
322  }
323  }
324  return fvol;
325 }
326 
327 void FairModule::ConstructRootGeometry(TGeoMatrix* shiftM)
328 {
337  TGeoManager* OldGeo = gGeoManager;
338  TGeoManager* NewGeo = 0;
339  TGeoVolume* volume = 0;
340  ;
341  TFile* f = TFile::Open(GetGeometryFileName().Data());
342  TList* l = f->GetListOfKeys();
343  TKey* key;
344  TIter next(l);
345  TGeoNode* n = 0;
346  TGeoVolume* v1 = 0;
347  while ((key = static_cast<TKey*>(next()))) {
351  if (strcmp(key->GetClassName(), "TGeoManager") != 0) {
352  continue;
353  }
354  gGeoManager = 0;
355  NewGeo = static_cast<TGeoManager*>(key->ReadObj());
356  break;
357  }
358  if (NewGeo != 0) {
362  NewGeo->cd();
363  volume = static_cast<TGeoVolume*>(NewGeo->GetNode(0)->GetDaughter(0)->GetVolume());
364  v1 = volume->MakeCopyVolume(volume->GetShape());
365  // n=NewGeo->GetTopNode();
366  n = v1->GetNode(0);
367  // NewGeo=0;
368  // delete NewGeo; //move it to the end of the method
369 
370  } else {
375  key = static_cast<TKey*>(l->At(0)); // Get the first key in the list
376  volume = dynamic_cast<TGeoVolume*>(key->ReadObj());
377  if (volume != 0) {
378  n = volume->GetNode(0);
379  }
380  if (n != 0) {
381  v1 = n->GetVolume();
382  }
383  }
384 
385  if (v1 == 0) {
386  LOG(fatal) << "Could not find any geometry in file " << GetGeometryFileName().Data();
387  } else {
388  gGeoManager = OldGeo;
389  gGeoManager->cd();
390  // If AddToVolume is empty add the volume to the top volume Cave
391  // If it is defined check i´f the volume exists and if it exists add the volume from the root file
392  // to the already existing volume
393  TGeoVolume* Cave = nullptr;
394  if (0 == fMotherVolumeName.Length()) {
395  Cave = gGeoManager->GetTopVolume();
396  } else {
397  Cave = gGeoManager->GetVolume(fMotherVolumeName);
398  }
399  if (Cave != nullptr) {
401  gGeoManager->AddVolume(v1);
403  TGeoVoxelFinder* voxels = v1->GetVoxels();
404  if (voxels) {
405  voxels->SetNeedRebuild();
406  }
407 
408  // else { fLogger->Fatal(MESSAGE_ORIGIN, "\033[5m\033[31mFairModule::ConstructRootGeometry(): could not find
409  // voxels \033[0m"); }
410 
415  TGeoMatrix* M = n->GetMatrix();
416 
417  // very nasty!
418  TGeoHMatrix* M2 = new TGeoHMatrix(*M);
419 
420  // For debugging
421  // M2->Dump();
422  // const Double_t* transl1 = M2->GetTranslation();
423  // std::cout << transl1[0] << "\t" << transl1[1] << "\t" << transl1[2] << std::endl;
424  // if (shiftM) {
425  // shiftM->Dump();
426  // const Double_t* transl2 = shiftM->GetTranslation();
427  // std::cout << transl2[0] << "\t" << transl2[1] << "\t" << transl2[2] << std::endl;
428  //}
429 
430  if (shiftM) {
431  M2->Multiply(shiftM); // HACK!
432  }
433 
434  SetDefaultMatrixName(M2);
435 
436  // TODO
437  // I don't really understand this juggling with the matices,
438  // so, please, take care of how it works with my changes.
439  // Egor.
440 
442  gGeoManager->GetListOfMatrices()->Remove(M2);
443  TGeoHMatrix* global = gGeoManager->GetHMatrix();
444  gGeoManager->GetListOfMatrices()->Remove(global); // Remove the Identity matrix
447  Cave->AddNode(v1, 0, M2);
450  AssignMediumAtImport(v1);
454  ExpandNode(n);
455  delete NewGeo;
456  delete f;
457  } else {
458  LOG(fatal) << "Could not find the given mother volume " << fMotherVolumeName.Data()
459  << " where the geomanger should be added.";
460  }
461  }
462 }
463 
464 #ifdef ROOT_HAS_GDML
465 
466 void FairModule::ConstructGDMLGeometry(__attribute__((unused)) TGeoMatrix* posrot)
467 {
468  // Parse the GDML file
469  TFile* old = gFile;
470  TGDMLParse parser;
471  TGeoVolume* gdmlTop;
472  gdmlTop = parser.GDMLReadFile(GetGeometryFileName());
473 
474  // Change ID of media. TGDMLParse starts allways from 0. Need to shift.
475  ReAssignMediaId();
476 
477  // Add volume to the cave and go through it recursively
478  gGeoManager->GetTopVolume()->AddNode(gdmlTop, 1, posrot);
479  ExpandNodeForGDML(gGeoManager->GetTopVolume()->GetNode(gGeoManager->GetTopVolume()->GetNdaughters() - 1));
480  gFile = old;
481 }
482 
483 void FairModule::ExpandNodeForGDML(TGeoNode* curNode)
484 {
485  // Get pointer to volume and assign medium
486  TGeoVolume* curVol = curNode->GetVolume();
487  AssignMediumAtImport(curVol);
488 
489  // Check if the volume is sensitive
490  if ((this->InheritsFrom("FairDetector")) && IsSensitive(curVol->GetName())) {
491  LOG(debug2) << "Sensitive Volume " << curVol->GetName();
492  AddSensitiveVolume(curVol);
493  }
494 
496  if (curVol->GetNdaughters() != 0) {
497  TObjArray* NodeChildList = curVol->GetNodes();
498  TGeoNode* curNodeChild;
499  for (Int_t j = 0; j < NodeChildList->GetEntriesFast(); j++) {
500  curNodeChild = static_cast<TGeoNode*>(NodeChildList->At(j));
501  ExpandNodeForGDML(curNodeChild);
502  }
503  }
504 }
505 
506 #else
507 
508 void FairModule::ConstructGDMLGeometry(__attribute__((unused)) TGeoMatrix* posrot)
509 {
510  LOG(error) << "Could not construct magnet geometry from gdml file.";
511  LOG(error) << "The used ROOT version does not support gdml.";
512  LOG(error) << "Please recompile ROOT with gdml support.";
513  LOG(fatal) << "Stop execution at this point.";
514 }
515 
516 void FairModule::ExpandNodeForGDML(__attribute__((unused)) TGeoNode* curNode) {}
517 
518 #endif
519 
520 void FairModule::ReAssignMediaId()
521 {
522  // Initialise pointer to GeoBuilder
524  // Get list of TGeo media
525  TList* media = gGeoManager->GetListOfMedia();
526  // Loop over new media which are not in GeoBase and shift the ID
527  TGeoMedium* med;
528  // TGeoMedium* med2;
529  for (Int_t i = geoBuilder->GetNMedia(); i < media->GetEntries(); i++) {
530  med = static_cast<TGeoMedium*>(media->At(i));
531  med->SetId(i + 1);
532  }
533  // Change GeoBase medium index
534  geoBuilder->SetNMedia(media->GetEntries());
535 
536  // Revove dublicated materials
537  TList* materials = gGeoManager->GetListOfMaterials();
538  TIter next1(materials);
539  // map for existing materials
540  std::map<TString, Bool_t> mapMatName;
541  TGeoMaterial* mat;
542  while ((mat = static_cast<TGeoMaterial*>(next1()))) {
543  // If material exist - delete dublicated. If not - set the flag
544  if (mapMatName[mat->GetName()]) {
545  materials->Remove(mat);
546  } else {
547  mapMatName[mat->GetName()] = kTRUE;
548  }
549  }
550 }
551 
553 {
554  LOG(warn) << "The method ConstructASCIIGeometry has to be implemented in the detector class which inherits from "
555  "FairModule";
556 }
557 
558 //__________________________________________________________________________
559 Bool_t FairModule::IsSensitive(const std::string& name)
560 {
561  // LOG(warn) << "Implement IsSensitive in the detector class which inherits from FairModule";
562  // LOG(warn) << "For now calling the obsolete function CheckIfSensitive";
563 #pragma GCC diagnostic push
564 #pragma GCC diagnostic ignored "-Wdeprecated-declarations"
565  return CheckIfSensitive(name);
566 #pragma GCC diagnostic pop
567 }
568 
569 void FairModule::ExpandNode(TGeoNode* fN)
570 {
571  // FairGeoLoader* geoLoad = FairGeoLoader::Instance();
572  // FairGeoInterface* geoFace = geoLoad->getGeoInterface();
573  // FairGeoMedia* Media = geoFace->getMedia();
574  // FairGeoBuilder* geobuild=geoLoad->getGeoBuilder();
575  TGeoMatrix* Matrix = fN->GetMatrix();
576  if (gGeoManager->GetListOfMatrices()->FindObject(Matrix)) {
577  gGeoManager->GetListOfMatrices()->Remove(Matrix);
578  }
579  TGeoVolume* v1 = fN->GetVolume();
580  TObjArray* NodeList = v1->GetNodes();
581  for (Int_t Nod = 0; Nod < NodeList->GetEntriesFast(); Nod++) {
582  TGeoNode* fNode = static_cast<TGeoNode*>(NodeList->At(Nod));
583  TGeoMatrix* M = fNode->GetMatrix();
584  // M->SetDefaultName();
585  SetDefaultMatrixName(M);
586  if (fNode->GetNdaughters() > 0) {
587  ExpandNode(fNode);
588  }
589  TGeoVolume* v = fNode->GetVolume();
590  AssignMediumAtImport(v);
591  if (!gGeoManager->FindVolumeFast(v->GetName())) {
592  LOG(debug2) << "Register Volume " << v->GetName();
593  v->RegisterYourself();
594  }
595  if ((this->InheritsFrom("FairDetector")) && IsSensitive(v->GetName())) {
596  LOG(debug2) << "Sensitive Volume " << v->GetName();
598  }
599  v->GetShape()->AfterStreamer();
600  }
601 }
602 
603 void FairModule::SetDefaultMatrixName(TGeoMatrix* matrix)
604 {
605  // Copied from root TGeoMatrix::SetDefaultName() and modified (memory leak)
606  // If no name was supplied in the ctor, the type of transformation is checked.
607  // A letter will be prepended to the name :
608  // t - translation
609  // r - rotation
610  // s - scale
611  // c - combi (translation + rotation)
612  // g - general (tr+rot+scale)
613  // The index of the transformation in gGeoManager list of transformations will
614  // be appended.
615  if (!gGeoManager) {
616  return;
617  }
618  if (strlen(matrix->GetName())) {
619  return;
620  }
621  char type = 'n';
622  if (matrix->IsTranslation()) {
623  type = 't';
624  }
625  if (matrix->IsRotation()) {
626  type = 'r';
627  }
628  if (matrix->IsScale()) {
629  type = 's';
630  }
631  if (matrix->IsCombi()) {
632  type = 'c';
633  }
634  if (matrix->IsGeneral()) {
635  type = 'g';
636  }
637  TObjArray* matrices = gGeoManager->GetListOfMatrices();
638  Int_t index = 0;
639  if (matrices) {
640  index = matrices->GetEntriesFast() - 1;
641  }
642  matrix->SetName(Form("%c%i", type, index));
643 }
644 
645 void FairModule::AssignMediumAtImport(TGeoVolume* v)
646 {
647 
655 
656  TGeoMedium* med1 = v->GetMedium();
657 
658  if (med1) {
659  // In newer ROOT version also a TGeoVolumeAssembly has a material and medium.
660  // This medium is called dummy and is automatically set when the geometry is constructed.
661  // Since this material and medium is neither in the TGeoManager (at this point) nor in our
662  // ASCII file we have to create it the same way it is done in TGeoVolume::CreateDummyMedium()
663  // In the end the new medium and material has to be added to the TGeomanager, because this is
664  // not done automatically when using the default constructor. For all other constructors the
665  // newly created medium or material is added to the TGeomanger.
666  // Create the medium and material only the first time.
667  TString medName = static_cast<TString>(med1->GetName());
668  if (medName.EqualTo("dummy") && nullptr == gGeoManager->GetMedium(medName)) {
669 
670  TGeoMaterial* dummyMaterial = new TGeoMaterial();
671  dummyMaterial->SetName("dummy");
672 
673  TGeoMedium* dummyMedium = new TGeoMedium();
674  dummyMedium->SetName("dummy");
675  dummyMedium->SetMaterial(dummyMaterial);
676 
677  gGeoManager->GetListOfMedia()->Add(dummyMedium);
678  gGeoManager->AddMaterial(dummyMaterial);
679  }
680 
681  TGeoMaterial* mat1 = v->GetMaterial();
682  TGeoMaterial* newMat = gGeoManager->GetMaterial(mat1->GetName());
683  if (newMat == 0) {
686  FairGeoMedium* FairMedium = Media->getMedium(mat1->GetName());
687  if (!FairMedium) {
688  LOG(fatal) << "Material " << mat1->GetName() << "is not defined in ASCII file nor in Root file.";
689  // FairMedium=new FairGeoMedium(mat1->GetName());
690  // Media->addMedium(FairMedium);
691  } else {
692 
693  Int_t nmed = geobuild->createMedium(FairMedium);
694  v->SetMedium(gGeoManager->GetMedium(nmed));
695  gGeoManager->SetAllIndex();
696  }
697  } else {
699  TGeoMedium* med2 = gGeoManager->GetMedium(mat1->GetName());
700  v->SetMedium(med2);
701  }
702  } else {
703  if (strcmp(v->ClassName(), "TGeoVolumeAssembly") != 0) {
704  //[R.K.-3.3.08] // When there is NO material defined, set it to avoid conflicts in Geant
705  LOG(fatal) << "The volume " << v->GetName()
706  << "has no medium information and not an Assembly so we have to quit";
707  }
708  }
709 }
710 
712 {
713  Fatal("CloneModule", "Has to be overriden in multi-threading applications.");
714  return 0;
715 }
716 
virtual void SetGeometryFileName(TString fname, TString geoVer="0")
Definition: FairModule.cxx:199
void AddSensitiveVolume(TGeoVolume *v)
Definition: FairModule.cxx:294
void SetNMedia(const Int_t &nmed)
virtual void see Tutorial4 for examples LOG(warn)<< "This function is deprecated. Use FairAlignmentHandler instead
virtual void ConstructGeometry()
Definition: FairModule.cxx:60
list of container factories
Definition: FairRuntimeDb.h:24
FairGeoMedia * getMedia()
FairGeoNode * getMotherNode()
Definition: FairGeoNode.h:73
Int_t getMCid()
Definition: FairGeoVolume.h:64
static thread_local TRefArray * svList
Definition: FairModule.h:137
TObjArray * GetGeoNodes()
Definition: FairGeoParSet.h:67
FairGeoTransform * calcLabTransform()
virtual void ConstructOpGeometry()
Definition: FairModule.cxx:66
static thread_local Int_t fNbOfVolumes
Definition: FairModule.h:135
void setGeoNode(FairGeoNode *d)
Definition: FairVolume.h:43
FairGeoMedium * getMedium(const char *)
Bool_t isSensitive()
Definition: FairGeoNode.h:146
void ProcessNodes(TList *aList)
Definition: FairModule.cxx:244
FairGeoInterface * getGeoInterface()
Definition: FairGeoLoader.h:34
static FairGeoLoader * Instance()
static FairRun * Instance()
Definition: FairRun.cxx:31
FairGeoNode * getGeoNode()
Definition: FairVolume.h:60
Int_t fVerboseLevel
Definition: FairModule.h:161
Int_t getCopyNo()
virtual ~FairModule()
Definition: FairModule.cxx:72
ClassImp(FairEventBuilder)
Bool_t fGeoSaved
list of Detector Geometry parameters
Definition: FairModule.h:163
Bool_t fActive
Definition: FairModule.h:159
Int_t fModId
Definition: FairModule.h:158
virtual void ConstructGDMLGeometry(__attribute__((unused)) TGeoMatrix *posrot)
Definition: FairModule.cxx:508
static thread_local FairVolumeList * vList
Definition: FairModule.h:133
virtual void ConstructASCIIGeometry()
Definition: FairModule.cxx:552
TVirtualMC * fMC
flag for initialisation
Definition: FairModule.h:164
virtual void ExpandNode(TGeoNode *Node)
Definition: FairModule.cxx:569
static thread_local TArrayI * volNumber
Definition: FairModule.h:139
FairParSet * getContainer(const Text_t *)
void SetModule(FairModule *mod)
Definition: FairVolume.h:49
virtual void ExpandNodeForGDML(__attribute__((unused)) TGeoNode *curNode)
Definition: FairModule.cxx:516
const Int_t & GetNMedia() const
static FairMCApplication * Instance()
FairModule & operator=(const FairModule &)
Definition: FairModule.cxx:149
void addVolume(FairVolume *elem)
FairMQExParamsParOne * par
Int_t fNbOfSensitiveVol
Definition: FairModule.h:160
TList * flGeoPar
Definition: FairModule.h:162
virtual FairModule * CloneModule() const
Definition: FairModule.cxx:711
FairGeoBuilder * getGeoBuilder()
Definition: FairGeoLoader.h:35
virtual void ConstructRootGeometry(TGeoMatrix *shiftM=nullptr)
Definition: FairModule.cxx:327
FairRuntimeDb * GetRuntimeDb(void)
Definition: FairRun.h:80
const char * getTruncName()
Definition: FairGeoNode.h:106
void setMotherId(Int_t fM)
Definition: FairVolume.h:44
virtual TString GetGeometryFileName()
Definition: FairModule.h:60
TString fgeoName
Definition: FairModule.h:157
virtual Bool_t CheckIfSensitive(__attribute__((unused)) std::string name) __attribute__((deprecated("The method CheckIfSensitive is deprecated. Implement IsSensitive in the detector classes.")))
Definition: FairModule.h:99
virtual Bool_t IsSensitive(const std::string &name)
Definition: FairModule.cxx:559
TString fMotherVolumeName
Definition: FairModule.h:140
void setCopyNo(Int_t id)
Definition: FairVolume.h:41
void setModId(Int_t id)
Definition: FairVolume.h:40
virtual Int_t createMedium(FairGeoMedium *)=0
void setMotherCopyNo(Int_t CopyNo)
Definition: FairVolume.h:45
FairVolume * getFairVolume(FairGeoNode *fNode)
Definition: FairModule.cxx:312
void setRealName(TString name)
Definition: FairVolume.h:36
Int_t getEntries()
FairVolume * At(Int_t pos)
TString fgeoVer
Definition: FairModule.h:156
FairVolume * findObject(TString name)