3 // Class AliMUONGeometryEnvelope
4 // -----------------------------
5 // Helper class for definititon an assembly of volumes.
7 // Author: Ivana Hrivnacova, IPN Orsay
9 #include <TGeoMatrix.h>
10 #include <TObjArray.h>
12 #include "AliMUONGeometryEnvelope.h"
13 #include "AliMUONGeometryConstituent.h"
15 ClassImp(AliMUONGeometryEnvelope)
17 //______________________________________________________________________________
18 AliMUONGeometryEnvelope::AliMUONGeometryEnvelope(const TString& name,
21 fIsVirtual(isVirtual),
26 // Standard constructor
28 // Create the envelope transformation
29 fTransformation = new TGeoCombiTrans("");
30 fConstituents = new TObjArray(20);
34 //______________________________________________________________________________
35 AliMUONGeometryEnvelope::AliMUONGeometryEnvelope(const TString& name,
43 // Standard constructor
45 // Create the envelope transformation
46 fTransformation = new TGeoCombiTrans("");
47 fConstituents = new TObjArray(20);
51 //______________________________________________________________________________
52 AliMUONGeometryEnvelope::AliMUONGeometryEnvelope()
58 // Default constructor
62 //______________________________________________________________________________
63 AliMUONGeometryEnvelope::AliMUONGeometryEnvelope(
64 const AliMUONGeometryEnvelope& rhs)
67 Fatal("Copy constructor",
68 "Copy constructor is not implemented.");
71 //______________________________________________________________________________
72 AliMUONGeometryEnvelope::~AliMUONGeometryEnvelope()
75 // Add deleting rotation matrices
77 delete fTransformation;
80 fConstituents->Delete();
85 //______________________________________________________________________________
86 AliMUONGeometryEnvelope&
87 AliMUONGeometryEnvelope::operator = (const AliMUONGeometryEnvelope& rhs)
89 // check assignement to self
90 if (this == &rhs) return *this;
93 "Assignment operator is not implemented.");
102 //______________________________________________________________________________
103 void AliMUONGeometryEnvelope::AddConstituent(const TString& name, Int_t copyNo)
105 // Adds the volume with the specified name and transformation
106 // to the list of envelopes.
109 fConstituents->Add(new AliMUONGeometryConstituent(name, copyNo, 0, 0));
112 //______________________________________________________________________________
113 void AliMUONGeometryEnvelope::AddConstituent(const TString& name, Int_t copyNo,
114 const TGeoTranslation& translation)
116 // Adds the volume with the specified name and transformation
117 // to the list of envelopes.
121 ->Add(new AliMUONGeometryConstituent(name, copyNo, translation, 0, 0));
124 //______________________________________________________________________________
125 void AliMUONGeometryEnvelope::AddConstituent(const TString& name, Int_t copyNo,
126 const TGeoTranslation& translation,
127 const TGeoRotation& rotation)
129 // Adds the volume with the specified name and transformation
130 // to the list of envelopes.
134 ->Add(new AliMUONGeometryConstituent(
135 name, copyNo, translation, rotation, 0, 0));
138 //______________________________________________________________________________
139 void AliMUONGeometryEnvelope::AddConstituentParam(const TString& name,
140 Int_t copyNo, Int_t npar, Double_t* param)
142 // Adds the volume with the specified name and transformation
143 // to the list of envelopes.
147 ->Add(new AliMUONGeometryConstituent(name, copyNo, npar, param));
150 //______________________________________________________________________________
151 void AliMUONGeometryEnvelope::AddConstituentParam(const TString& name,
152 Int_t copyNo, const TGeoTranslation& translation,
153 Int_t npar, Double_t* param)
155 // Adds the volume with the specified name and transformation
156 // to the list of envelopes.
160 ->Add(new AliMUONGeometryConstituent(
161 name, copyNo, translation, npar, param));
164 //______________________________________________________________________________
165 void AliMUONGeometryEnvelope::AddConstituentParam(const TString& name,
166 Int_t copyNo, const TGeoTranslation& translation,
167 const TGeoRotation& rotation,
168 Int_t npar, Double_t* param)
170 // Adds the volume with the specified name and transformation
171 // to the list of envelopes.
175 ->Add(new AliMUONGeometryConstituent(
176 name, copyNo, translation, rotation, npar, param));
179 //______________________________________________________________________________
180 void AliMUONGeometryEnvelope::SetTranslation(const TGeoTranslation& translation)
182 // Sets the chamber position wrt ALIC.
186 ->SetTranslation(const_cast<Double_t*>(translation.GetTranslation()));
189 //______________________________________________________________________________
190 void AliMUONGeometryEnvelope::SetRotation(const TGeoRotation& rotation)
192 // Sets the chamber rotation wrt ALIC.
195 TGeoRotation* rot = new TGeoRotation();
196 rot->SetMatrix(const_cast<Double_t*>(rotation.GetRotationMatrix()));
198 fTransformation->SetRotation(rot);