d1cd2474 |
1 | // $Id$ |
2 | // |
3 | // Class AliMUONChamberGeometry |
4 | // ----------------------------- |
5 | // Class for definititon of the MUON chamber positions in ALIC. |
6 | // |
7 | // Author: Ivana Hrivnacova, IPN Orsay |
8 | |
9 | #ifndef ALI_MUON_CHAMBER_GEOMETRY_H |
10 | #define ALI_MUON_CHAMBER_GEOMETRY_H |
11 | |
12 | #include <TObject.h> |
13 | |
14 | class TGeoTranslation; |
15 | class TGeoRotation; |
16 | class TGeoCombiTrans; |
17 | class TObjArray; |
18 | class TArrayI; |
19 | |
20 | class AliMUONChamber; |
21 | class AliMUONGeometryEnvelope; |
22 | |
23 | class AliMUONChamberGeometry : public TObject |
24 | { |
25 | public: |
26 | AliMUONChamberGeometry(Int_t chamberId); |
27 | AliMUONChamberGeometry(); |
28 | AliMUONChamberGeometry(const AliMUONChamberGeometry& rhs); |
29 | virtual ~AliMUONChamberGeometry(); |
30 | |
31 | // operators |
32 | AliMUONChamberGeometry& operator = (const AliMUONChamberGeometry& rhs); |
33 | |
34 | // methods |
35 | |
36 | // adding virtual envelopes |
37 | // (not placed in MC geometry, only logical assembly of volumes, |
38 | // cannot have more copies) |
39 | void AddEnvelope(const TString& name, Bool_t isVirtual); |
40 | void AddEnvelope(const TString& name, Bool_t isVirtual, |
41 | const TGeoTranslation& translation); |
42 | void AddEnvelope(const TString& name, Bool_t isVirtual, |
43 | const TGeoTranslation& translation, |
44 | const TGeoRotation& rotation); |
45 | |
46 | // adding non-virtual envelopes |
47 | // (placed in MC geometry with transformation composed |
48 | // of transformation of chamber and their transformation, |
49 | // can have more copies ) |
50 | void AddEnvelope(const TString& name, Int_t copyNo); |
51 | void AddEnvelope(const TString& name, Int_t copyNo, |
52 | const TGeoTranslation& translation); |
53 | void AddEnvelope(const TString& name, Int_t copyNo, |
54 | const TGeoTranslation& translation, |
55 | const TGeoRotation& rotation); |
56 | |
57 | // adding constituents to virtual envelopes |
58 | // (placed in MC geometry with transformation composed |
59 | // of transformation of chamber, envelope and their own |
60 | // transformation ) |
61 | void AddEnvelopeConstituent(const TString& name, const TString& envName, |
62 | Int_t copyNo); |
63 | void AddEnvelopeConstituent(const TString& name, const TString& envName, |
64 | Int_t copyNo, const TGeoTranslation& translation); |
65 | void AddEnvelopeConstituent(const TString& name, const TString& envName, |
66 | Int_t copyNo, const TGeoTranslation& translation, |
67 | const TGeoRotation& rotation); |
68 | |
69 | // adding constituents to virtual envelopes with specified shape |
70 | // parameters |
71 | // (placed in MC geometry with transformation composed |
72 | // of transformation of chamber, envelope and their own |
73 | // transformation ) |
74 | void AddEnvelopeConstituentParam(const TString& name, const TString& envName, |
75 | Int_t copyNo, Int_t npar, Double_t* param); |
76 | void AddEnvelopeConstituentParam(const TString& name, const TString& envName, |
77 | Int_t copyNo, const TGeoTranslation& translation, |
78 | Int_t npar, Double_t* param); |
79 | void AddEnvelopeConstituentParam(const TString& name, const TString& envName, |
80 | Int_t copyNo, const TGeoTranslation& translation, |
81 | const TGeoRotation& rotation, Int_t npar, Double_t* param); |
82 | |
83 | void SetMotherVolume(const TString& motherVolumeName); |
84 | void SetTranslation(const TGeoTranslation& translation); |
85 | void SetRotation(const TGeoRotation& rotation); |
86 | |
87 | void SetSensitiveVolume(Int_t volId); |
88 | void SetSensitiveVolume(const TString& name); |
89 | void SetDebug(Bool_t debug); |
90 | |
91 | // get methods |
92 | TString GetMotherVolume() const; |
93 | const TGeoCombiTrans* GetTransformation() const; |
94 | const TObjArray* GetEnvelopes() const; |
95 | Bool_t IsSensitiveVolume(Int_t volId) const; |
96 | |
97 | private: |
98 | // methods |
99 | AliMUONGeometryEnvelope* FindEnvelope(const TString& name) const; |
100 | |
101 | // data members |
102 | Int_t fChamberId; // the chamber Id |
103 | TString fMotherVolume; // mother volume name |
104 | TGeoCombiTrans* fTransformation;// the chamber transformation wrt to mother |
105 | // volume |
106 | TObjArray* fEnvelopes; // the envelopes names and transformations |
107 | // wrt to the chamber position in mother volume |
108 | Int_t fNofSensVolumeIds; // Number of sensitive volumes IDs |
109 | TArrayI* fSensVolumeIds; // Sensitive volumes IDs |
110 | Bool_t fDebug; // Switch for debugging |
111 | |
112 | ClassDef(AliMUONChamberGeometry,1) // MUON chamber geometry base class |
113 | }; |
114 | |
115 | // inline functions |
116 | |
117 | inline void AliMUONChamberGeometry::SetMotherVolume(const TString& motherVolumeName) |
118 | { fMotherVolume = motherVolumeName; } |
119 | |
120 | inline void AliMUONChamberGeometry::SetDebug(Bool_t debug) |
121 | { fDebug = debug; } |
122 | |
123 | inline TString AliMUONChamberGeometry::GetMotherVolume() const |
124 | { return fMotherVolume; } |
125 | |
126 | inline const TGeoCombiTrans* AliMUONChamberGeometry::GetTransformation() const |
127 | { return fTransformation; } |
128 | |
129 | inline const TObjArray* AliMUONChamberGeometry::GetEnvelopes() const |
130 | { return fEnvelopes; } |
131 | |
132 | #endif //ALI_MUON_V_CHAMBER_GEOMETRY_H |