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