PandaRoot
BSEmcStructure.h
Go to the documentation of this file.
1 //======================================================================
2 // Description:
3 // Class BSEmcStructure
4 //------------------------------------------------------------------------
5 
6 #ifndef BSEMCSTRUCTURE_HH
7 #define BSEMCSTRUCTURE_HH
8 
9 #include <map>
10 #include <memory>
11 #include <string>
12 
13 #include "Rtypes.h"
14 #include "RtypesCore.h"
15 #include "TObject.h"
16 #include "TString.h"
17 #include "TVector3.h"
18 
19 #include "BSEmcXtal.h"
20 
21 class TClonesArray;
22 class TGeoManager;
23 class TGeoTrap;
24 class TGeoNode;
26 class BSEmcXtal;
27 class TBuffer;
28 class TClass;
29 class TGeoShape;
30 class TMemberInspector;
31 
32 using DetIdToXtalMap = std::map<Int_t, std::unique_ptr<BSEmcXtal>>;
33 
42 class BSEmcStructure : public TObject {
43  public:
44  static BSEmcStructure *Instance();
45  static BSEmcStructure *Instance(TGeoManager *);
46 
47  virtual ~BSEmcStructure();
48 
49  const DetIdToXtalMap &GetDetIdXtalMap() const { return fDetectorIdXtalMap; };
50 
51  Bool_t IsDetIdXtalMapSet() const { return fDetectorIdXtalMap.size() != 0; }
52  void PrintCrystals(std::string, Int_t t_option = 1) const;
54  {
55  if (fDetectorIdXtalMap.size() == 0) {
57  }
58  }
59 
60  protected:
61  BSEmcStructure(TGeoManager *);
62  TGeoTrap *CreateFromTGeoBBox(const TGeoShape *t_shape) const;
63  TGeoTrap *CreateFromArb8(TGeoShape *t_shape) const;
64 
65  void ParseVolumeTree();
66 
67  private:
68  static BSEmcStructure *fInstance;
69 
70  Double_t fRescaleFactor{};
71  DetIdToXtalMap fDetectorIdXtalMap;
72  ClassDef(BSEmcStructure, 1)
73 };
74 
75 #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:46
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