PandaRoot
BSEmcStructure.h
Go to the documentation of this file.
1 //****************************************************************************
2 //* This file is part of PandaRoot. *
3 //* *
4 //* PandaRoot is distributed under the terms of the *
5 //* GNU General Public License (GPL) version 3, *
6 //* copied verbatim in the file "LICENSE". *
7 //* *
8 //* Copyright (C) 2006 - 2024 FAIR GmbH and copyright holders of PandaRoot *
9 //* The copyright holders are listed in the file "COPYRIGHTHOLDERS". *
10 //* The authors are listed in the file "AUTHORS". *
11 //****************************************************************************
12 
13 //======================================================================
14 // Description:
15 // Class BSEmcStructure
16 //------------------------------------------------------------------------
17 
18 #ifndef BSEMCSTRUCTURE_HH
19 #define BSEMCSTRUCTURE_HH
20 
21 #include <map>
22 #include <memory>
23 #include <string>
24 
25 #include "Rtypes.h"
26 #include "RtypesCore.h"
27 #include "TObject.h"
28 #include "TString.h"
29 #include "TVector3.h"
30 
31 #include "BSEmcXtal.h"
32 
33 class TClonesArray;
34 class TGeoManager;
35 class TGeoTrap;
36 class TGeoNode;
38 class BSEmcXtal;
39 class TBuffer;
40 class TClass;
41 class TGeoShape;
42 class TMemberInspector;
43 
44 using DetIdToXtalMap = std::map<Int_t, std::unique_ptr<BSEmcXtal>>;
45 
54 class BSEmcStructure : public TObject {
55  public:
56  static BSEmcStructure *Instance();
57  static BSEmcStructure *Instance(TGeoManager *);
58 
59  virtual ~BSEmcStructure();
60 
61  const DetIdToXtalMap &GetDetIdXtalMap() const { return fDetectorIdXtalMap; };
62 
63  Bool_t IsDetIdXtalMapSet() const { return fDetectorIdXtalMap.size() != 0; }
64  void PrintCrystals(std::string, Int_t t_option = 1) const;
66  {
67  if (fDetectorIdXtalMap.size() == 0) {
69  }
70  }
71 
72  protected:
73  BSEmcStructure(TGeoManager *);
74  TGeoTrap *CreateFromTGeoBBox(const TGeoShape *t_shape) const;
75  TGeoTrap *CreateFromArb8(TGeoShape *t_shape) const;
76 
77  void ParseVolumeTree();
78 
79  private:
80  static BSEmcStructure *fInstance;
81 
82  Double_t fRescaleFactor{};
83  DetIdToXtalMap fDetectorIdXtalMap;
84  ClassDef(BSEmcStructure, 1)
85 };
86 
87 #endif /*BSEMCSTRUCTURE_HH*/
void ParseVolumeTree()
virtual ~BSEmcStructure()
Bool_t IsDetIdXtalMapSet() const
BSEmcStructure(TGeoManager *)
TGeoTrap * CreateFromTGeoBBox(const TGeoShape *t_shape) const
static BSEmcStructure * Instance()
void CreateDetIdXtalMap()
Parameter for crystal positions.
represents coordinates of one crystal
Definition: BSEmcXtal.h:58
std::map< Int_t, std::unique_ptr< BSEmcXtal > > DetIdToXtalMap
const DetIdToXtalMap & GetDetIdXtalMap() const
void PrintCrystals(std::string, Int_t t_option=1) const
geometry helper class to parse ROOT-Geometry Tree and create BSEmcXtal for each Emc-crystal ...
TGeoTrap * CreateFromArb8(TGeoShape *t_shape) const