]> git.uio.no Git - u/mrichter/AliRoot.git/blob - MUON/AliMUONGeometryModule.h
Addes script to compare Naiive, Poisson to Hits, Primaries
[u/mrichter/AliRoot.git] / MUON / AliMUONGeometryModule.h
1 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
2  * See cxx source for full Copyright notice                               */
3
4 /* $Id$ */
5 // Revision of includes 07/05/2004
6
7 /// \ingroup geometry
8 /// \class AliMUONGeometryModule
9 /// \brief Geometry parameters for detector module
10 ///
11 /// Class for definition of the detector module parameters
12 /// (the transformations of detection elements, mapping between
13 ///  sensitive volumes and detection elements).
14 ///
15 /// Author: Ivana Hrivnacova, IPN Orsay
16
17 #ifndef ALI_MUON_GEOMETRY_MODULE_H
18 #define ALI_MUON_GEOMETRY_MODULE_H
19
20 #include <TObject.h>
21 #include <TString.h>
22
23 class TGeoTranslation;
24 class TGeoRotation;
25 class TGeoCombiTrans;
26 class TObjArray;
27 class TArrayI;
28
29 class AliMUONGeometryEnvelope;
30 class AliMUONGeometryEnvelopeStore;
31 class AliMUONGeometryDetElement;
32 class AliMUONGeometryStore;
33 class AliMUONGeometrySVMap;
34 class AliMUONVGeometryDEIndexing;
35
36 class AliMUONGeometryModule : public TObject
37 {
38   public:
39     AliMUONGeometryModule(Int_t moduleId);
40     AliMUONGeometryModule();
41     virtual ~AliMUONGeometryModule();
42
43     // methods
44     void Global2Local(Int_t detElemId,
45                  Float_t xg, Float_t yg, Float_t zg, 
46                  Float_t& xl, Float_t& yl, Float_t& zl) const;
47     void Global2Local(Int_t detElemId,
48                  Double_t xg, Double_t yg, Double_t zg, 
49                  Double_t& xl, Double_t& yl, Double_t& zl) const;
50
51     void Local2Global(Int_t detElemId,
52                  Float_t xl, Float_t yl, Float_t zl, 
53                  Float_t& xg, Float_t& yg, Float_t& zg) const;
54     void Local2Global(Int_t detElemId,
55                  Double_t xl, Double_t yl, Double_t zl, 
56                  Double_t& xg, Double_t& yg, Double_t& zg) const;
57
58     // set methods
59     void  SetMotherVolume(const TString& motherVolumeName);
60     void  SetVolume(const TString& volumeName);
61     void  SetTranslation(const TGeoTranslation& translation);
62     void  SetRotation(const TGeoRotation& rotation);
63     
64     void  SetSensitiveVolume(Int_t volId);
65     void  SetSensitiveVolume(const TString& name);
66     void  SetAlign(Bool_t align);
67  
68     // get methods
69     Bool_t                 IsVirtual() const;  
70     Int_t                  GetModuleId() const;
71     TString                GetMotherVolume() const;
72     TString                GetVolume() const;
73     const TGeoCombiTrans*  GetTransformation() const;    
74     AliMUONGeometryDetElement* FindBySensitiveVolume(
75                                          const TString& volumePath) const;
76     AliMUONVGeometryDEIndexing*    GetDEIndexing() const;
77     AliMUONGeometryEnvelopeStore*  GetEnvelopeStore() const;
78     AliMUONGeometryStore*          GetDetElementStore() const;
79     AliMUONGeometryDetElement*     GetDetElement(Int_t detElemId) const;    
80     AliMUONGeometrySVMap*          GetSVMap() const;
81     Bool_t IsSensitiveVolume(Int_t volId) const; 
82     Bool_t IsSensitiveVolume(const TString& volName) const; 
83
84   protected:
85     AliMUONGeometryModule(const AliMUONGeometryModule& rhs);
86     // operators  
87     AliMUONGeometryModule& operator = (const AliMUONGeometryModule& rhs);
88
89   private:
90     // methods
91     Int_t  GetSVIndex(Int_t svVolId) const; 
92   
93     // data members
94     Bool_t           fIsVirtual;     // true if module is not represented
95                                      // by a real volume
96     Int_t            fModuleId;      // the module Id
97     TString          fMotherVolume;  // mother volume name
98     TString          fVolume;        // the volume name if not virtual
99     Int_t            fNofSVs;        // number of sensitive volumes   
100     TArrayI*         fSVVolumeIds;   // densitive volumes IDs  
101     TGeoCombiTrans*  fTransformation;// the module transformation wrt to mother
102                                      // volume
103     AliMUONGeometryEnvelopeStore* fEnvelopes;  // envelopes                                 
104     AliMUONVGeometryDEIndexing*   fDEIndexing; // DE indexing
105     AliMUONGeometryStore*         fDetElements;// detection elements
106     AliMUONGeometrySVMap*         fSVMap;      // sensitive volumes map
107  
108   ClassDef(AliMUONGeometryModule,2) // MUON geometry module class
109 };
110
111 // inline functions
112
113 inline void  
114 AliMUONGeometryModule::SetMotherVolume(const TString& motherVolumeName)
115 { fMotherVolume = motherVolumeName; }
116
117 inline Bool_t AliMUONGeometryModule::IsVirtual() const
118 { return fIsVirtual; }  
119
120 inline Int_t  AliMUONGeometryModule::GetModuleId() const
121 { return fModuleId; }
122
123 inline TString  AliMUONGeometryModule::GetMotherVolume() const
124 { return fMotherVolume; }
125
126 inline TString  AliMUONGeometryModule::GetVolume() const
127 { return fVolume; }
128
129 inline const TGeoCombiTrans* AliMUONGeometryModule::GetTransformation() const 
130 { return fTransformation; }
131
132 inline  AliMUONGeometryEnvelopeStore* 
133 AliMUONGeometryModule::GetEnvelopeStore() const
134 { return fEnvelopes; }
135
136 inline  AliMUONVGeometryDEIndexing* 
137 AliMUONGeometryModule::GetDEIndexing() const 
138 { return fDEIndexing; }
139
140 inline  AliMUONGeometryStore* AliMUONGeometryModule::GetDetElementStore() const
141 { return fDetElements; }
142
143 inline AliMUONGeometrySVMap* AliMUONGeometryModule::GetSVMap() const
144 { return fSVMap; }
145
146 #endif //ALI_MUON_GEOMETRY_MODULE_H