- Supressed warning MainLoop failed
[u/mrichter/AliRoot.git] / MUON / AliMUONGeometryEnvelopeStore.h
CommitLineData
e118b27e 1/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
2 * See cxx source for full Copyright notice */
3
89cc3034 4// $Id$
692de412 5
6/// \ingroup geometry
7/// \class AliMUONGeometryEnvelopeStore
8/// \brief Store for temporary volumes envelopes
9///
10/// Class for definititon of the temporary volume envelopes
11/// used in geometry construction
12///
13/// Author: Ivana Hrivnacova, IPN Orsay
89cc3034 14
15#ifndef ALI_MUON_GEOMETRY_ENVELOPE_STORE_H
16#define ALI_MUON_GEOMETRY_ENVELOPE_STORE_H
17
18#include <TObject.h>
19#include <TString.h>
6cfb12b4 20#include <TGeoMatrix.h>
89cc3034 21
22class TGeoTranslation;
23class TGeoRotation;
24class TGeoCombiTrans;
25class TObjArray;
26class TArrayI;
27
28class AliMUONChamber;
29class AliMUONGeometryEnvelope;
e118b27e 30class AliMUONGeometryStore;
89cc3034 31
32class AliMUONGeometryEnvelopeStore : public TObject
33{
34 public:
e118b27e 35 AliMUONGeometryEnvelopeStore(AliMUONGeometryStore* detElements);
89cc3034 36 AliMUONGeometryEnvelopeStore();
37 AliMUONGeometryEnvelopeStore(const AliMUONGeometryEnvelopeStore& rhs);
38 virtual ~AliMUONGeometryEnvelopeStore();
39
40 // operators
e118b27e 41 AliMUONGeometryEnvelopeStore&
42 operator = (const AliMUONGeometryEnvelopeStore& rhs);
89cc3034 43
44 // methods
45
46 // adding virtual envelopes
47 // (not placed in MC geometry, only logical assembly of volumes,
48 // cannot have more copies)
49 void AddEnvelope(const TString& name, Int_t id,
50 Bool_t isVirtual, const char* only="ONLY");
51 void AddEnvelope(const TString& name, Int_t id,
52 Bool_t isVirtual,
53 const TGeoTranslation& translation,
54 const char* only="ONLY");
55 void AddEnvelope(const TString& name, Int_t id,
56 Bool_t isVirtual,
57 const TGeoTranslation& translation,
58 const TGeoRotation& rotation,
59 const char* only="ONLY");
60 void AddEnvelope(const TString& name, Int_t id,
61 Bool_t isVirtual,
62 const TGeoCombiTrans& transform,
63 const char* only="ONLY");
64
65 // adding non-virtual envelopes
66 // (placed in MC geometry with transformation composed
67 // of transformation of chamber and their transformation,
68 // can have more copies )
69 void AddEnvelope(const TString& name, Int_t id,
70 Int_t copyNo, const char* only="ONLY");
71 void AddEnvelope(const TString& name, Int_t id,
72 Int_t copyNo,
73 const TGeoTranslation& translation,
74 const char* only="ONLY");
75 void AddEnvelope(const TString& name, Int_t id,
76 Int_t copyNo,
77 const TGeoTranslation& translation,
78 const TGeoRotation& rotation,
79 const char* only="ONLY");
80 void AddEnvelope(const TString& name, Int_t id,
81 Int_t copyNo,
82 const TGeoCombiTrans& transform,
83 const char* only="ONLY");
84
85 // adding constituents to virtual envelopes
86 // (placed in MC geometry with transformation composed
87 // of transformation of chamber, envelope and their own
88 // transformation )
89 void AddEnvelopeConstituent(const TString& name, const TString& envName,
90 Int_t copyNo);
91 void AddEnvelopeConstituent(const TString& name, const TString& envName,
92 Int_t copyNo, const TGeoTranslation& translation);
93 void AddEnvelopeConstituent(const TString& name, const TString& envName,
94 Int_t copyNo, const TGeoTranslation& translation,
95 const TGeoRotation& rotation);
96 void AddEnvelopeConstituent(const TString& name, const TString& envName,
97 Int_t copyNo, const TGeoCombiTrans& transform);
98
99 // adding constituents to virtual envelopes with specified shape
100 // parameters
101 // (placed in MC geometry with transformation composed
102 // of transformation of chamber, envelope and their own
103 // transformation )
104 void AddEnvelopeConstituentParam(const TString& name, const TString& envName,
105 Int_t copyNo, Int_t npar, Double_t* param);
106 void AddEnvelopeConstituentParam(const TString& name, const TString& envName,
107 Int_t copyNo, const TGeoTranslation& translation,
108 Int_t npar, Double_t* param);
109 void AddEnvelopeConstituentParam(const TString& name, const TString& envName,
110 Int_t copyNo, const TGeoTranslation& translation,
111 const TGeoRotation& rotation, Int_t npar, Double_t* param);
112 void AddEnvelopeConstituentParam(const TString& name, const TString& envName,
113 Int_t copyNo, const TGeoCombiTrans& transform,
114 Int_t npar, Double_t* param);
115
116 void SetDebug(Bool_t debug);
6cfb12b4 117 void SetReferenceFrame(const TGeoCombiTrans& referenceFrame);
89cc3034 118
119 // Alignement
120 virtual Bool_t GetAlign() const;
121 virtual void SetAlign(Bool_t align);
122
123 // get methods
124 const TObjArray* GetEnvelopes() const;
e118b27e 125 Int_t GetNofDetElements() const;
89cc3034 126
127 private:
128 // methods
6ec9cd4e 129 TGeoHMatrix ConvertDETransform(const TGeoHMatrix& transform) const;
89cc3034 130 AliMUONGeometryEnvelope* FindEnvelope(const TString& name) const;
131 Bool_t AlignEnvelope(AliMUONGeometryEnvelope* envelope) const;
132
133 // data members
89cc3034 134 TObjArray* fEnvelopes; // the envelopes names and transformations
135 // wrt to the chamber position in mother volume
e118b27e 136 AliMUONGeometryStore* fDetElements; // detection elements
137 // used for alignement of enevelopes
6cfb12b4 138 TGeoCombiTrans fReferenceFrame; // the transformation from the builder
139 // reference frame to that of the transform
140 // data files
89cc3034 141 Bool_t fDebug; // Switch for debugging
142 Bool_t fAlign; // option to read transformations from a file
143
e118b27e 144 ClassDef(AliMUONGeometryEnvelopeStore,2) // Geometry envelope store
89cc3034 145};
146
147// inline functions
148
149inline void AliMUONGeometryEnvelopeStore::SetDebug(Bool_t debug)
150{ fDebug = debug; }
151
152inline Bool_t AliMUONGeometryEnvelopeStore::GetAlign() const
153{ return fAlign; }
154
155inline void AliMUONGeometryEnvelopeStore::SetAlign(Bool_t align)
156{ fAlign = align; }
157
158inline const TObjArray* AliMUONGeometryEnvelopeStore::GetEnvelopes() const
159{ return fEnvelopes; }
160
6cfb12b4 161inline void
162AliMUONGeometryEnvelopeStore::SetReferenceFrame(const TGeoCombiTrans& referenceFrame)
163{ fReferenceFrame = referenceFrame; }
164
89cc3034 165#endif //ALI_MUON_CHAMBER_ENVELOPE_STORE_H