3 // Class AliMUONGeometryEnvelope
4 // -----------------------------
5 // Helper class for definititon an assembly of volumes.
6 // Author: Ivana Hrivnacova, IPN Orsay
9 #include <TGeoMatrix.h>
11 #include <TObjArray.h>
13 #include "AliMUONGeometryEnvelope.h"
14 #include "AliMUONGeometryConstituent.h"
16 ClassImp(AliMUONGeometryEnvelope)
18 //______________________________________________________________________________
19 AliMUONGeometryEnvelope::AliMUONGeometryEnvelope(const TString& name,
23 fIsVirtual(isVirtual),
29 // Standard constructor
31 if (TString(only) == TString("MANY")) fIsMANY = true;
33 // Create the envelope transformation
34 fTransformation = new TGeoCombiTrans("");
35 fConstituents = new TObjArray(20);
39 //______________________________________________________________________________
40 AliMUONGeometryEnvelope::AliMUONGeometryEnvelope(const TString& name,
50 // Standard constructor
52 if (TString(only) == TString("MANY")) fIsMANY = true;
54 // Create the envelope transformation
55 fTransformation = new TGeoCombiTrans("");
56 fConstituents = new TObjArray(20);
60 //______________________________________________________________________________
61 AliMUONGeometryEnvelope::AliMUONGeometryEnvelope()
67 // Default constructor
71 //______________________________________________________________________________
72 AliMUONGeometryEnvelope::AliMUONGeometryEnvelope(
73 const AliMUONGeometryEnvelope& rhs)
76 Fatal("Copy constructor",
77 "Copy constructor is not implemented.");
80 //______________________________________________________________________________
81 AliMUONGeometryEnvelope::~AliMUONGeometryEnvelope()
84 // Add deleting rotation matrices
86 delete fTransformation;
89 fConstituents->Delete();
94 //______________________________________________________________________________
95 AliMUONGeometryEnvelope&
96 AliMUONGeometryEnvelope::operator = (const AliMUONGeometryEnvelope& rhs)
98 // check assignement to self
99 if (this == &rhs) return *this;
102 "Assignment operator is not implemented.");
111 //______________________________________________________________________________
112 void AliMUONGeometryEnvelope::AddConstituent(const TString& name, Int_t copyNo)
114 // Adds the volume with the specified name and transformation
115 // to the list of envelopes.
118 fConstituents->Add(new AliMUONGeometryConstituent(name, copyNo, 0, 0));
121 //______________________________________________________________________________
122 void AliMUONGeometryEnvelope::AddConstituent(const TString& name, Int_t copyNo,
123 const TGeoTranslation& translation)
125 // Adds the volume with the specified name and transformation
126 // to the list of envelopes.
130 ->Add(new AliMUONGeometryConstituent(name, copyNo, translation, 0, 0));
133 //______________________________________________________________________________
134 void AliMUONGeometryEnvelope::AddConstituent(const TString& name, Int_t copyNo,
135 const TGeoTranslation& translation,
136 const TGeoRotation& rotation)
138 // Adds the volume with the specified name and transformation
139 // to the list of envelopes.
143 ->Add(new AliMUONGeometryConstituent(
144 name, copyNo, translation, rotation, 0, 0));
147 //______________________________________________________________________________
148 void AliMUONGeometryEnvelope::AddConstituentParam(const TString& name,
149 Int_t copyNo, Int_t npar, Double_t* param)
151 // Adds the volume with the specified name and transformation
152 // to the list of envelopes.
156 ->Add(new AliMUONGeometryConstituent(name, copyNo, npar, param));
159 //______________________________________________________________________________
160 void AliMUONGeometryEnvelope::AddConstituentParam(const TString& name,
161 Int_t copyNo, const TGeoTranslation& translation,
162 Int_t npar, Double_t* param)
164 // Adds the volume with the specified name and transformation
165 // to the list of envelopes.
169 ->Add(new AliMUONGeometryConstituent(
170 name, copyNo, translation, npar, param));
173 //______________________________________________________________________________
174 void AliMUONGeometryEnvelope::AddConstituentParam(const TString& name,
175 Int_t copyNo, const TGeoTranslation& translation,
176 const TGeoRotation& rotation,
177 Int_t npar, Double_t* param)
179 // Adds the volume with the specified name and transformation
180 // to the list of envelopes.
184 ->Add(new AliMUONGeometryConstituent(
185 name, copyNo, translation, rotation, npar, param));
188 //______________________________________________________________________________
189 void AliMUONGeometryEnvelope::SetTranslation(const TGeoTranslation& translation)
191 // Sets the chamber position wrt ALIC.
195 ->SetTranslation(const_cast<Double_t*>(translation.GetTranslation()));
198 //______________________________________________________________________________
199 void AliMUONGeometryEnvelope::SetRotation(const TGeoRotation& rotation)
201 // Sets the chamber rotation wrt ALIC.
204 TGeoRotation* rot = new TGeoRotation();
205 rot->SetMatrix(const_cast<Double_t*>(rotation.GetRotationMatrix()));
207 fTransformation->SetRotation(rot);