1 /**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
7 * Permission to use, copy, modify and distribute this software and its *
8 * documentation strictly for non-commercial purposes is hereby granted *
9 * without fee, provided that the above copyright notice appears in all *
10 * copies and that both the copyright notice and this permission notice *
11 * appear in the supporting documentation. The authors make no claims *
12 * about the suitability of this software for any purpose. It is *
13 * provided "as is" without express or implied warranty. *
14 **************************************************************************/
18 // Class AliMUONGeometryEnvelope
19 // -----------------------------
20 // Helper class for definititon an assembly of volumes.
21 // Author: Ivana Hrivnacova, IPN Orsay
24 #include <TGeoMatrix.h>
26 #include <TObjArray.h>
28 #include "AliMUONGeometryEnvelope.h"
29 #include "AliMUONGeometryConstituent.h"
31 ClassImp(AliMUONGeometryEnvelope)
33 //______________________________________________________________________________
34 AliMUONGeometryEnvelope::AliMUONGeometryEnvelope(const TString& name,
39 fIsVirtual(isVirtual),
45 // Standard constructor
47 if (TString(only) == TString("MANY")) fIsMANY = true;
49 // Create the envelope transformation
50 fTransformation = new TGeoCombiTrans("");
51 fConstituents = new TObjArray(20);
58 //______________________________________________________________________________
59 AliMUONGeometryEnvelope::AliMUONGeometryEnvelope(const TString& name,
70 // Standard constructor
72 if (TString(only) == TString("MANY")) fIsMANY = true;
74 // Create the envelope transformation
75 fTransformation = new TGeoCombiTrans("");
76 fConstituents = new TObjArray(20);
83 //______________________________________________________________________________
84 AliMUONGeometryEnvelope::AliMUONGeometryEnvelope()
92 // Default constructor
96 //______________________________________________________________________________
97 AliMUONGeometryEnvelope::AliMUONGeometryEnvelope(
98 const AliMUONGeometryEnvelope& rhs)
101 Fatal("Copy constructor",
102 "Copy constructor is not implemented.");
105 //______________________________________________________________________________
106 AliMUONGeometryEnvelope::~AliMUONGeometryEnvelope()
109 // Add deleting rotation matrices
111 delete fTransformation;
114 fConstituents->Delete();
115 delete fConstituents;
119 //______________________________________________________________________________
120 AliMUONGeometryEnvelope&
121 AliMUONGeometryEnvelope::operator = (const AliMUONGeometryEnvelope& rhs)
123 // check assignement to self
124 if (this == &rhs) return *this;
127 "Assignment operator is not implemented.");
136 //______________________________________________________________________________
137 void AliMUONGeometryEnvelope::AddConstituent(const TString& name, Int_t copyNo)
139 // Adds the volume with the specified name and transformation
140 // to the list of envelopes.
143 fConstituents->Add(new AliMUONGeometryConstituent(name, copyNo, 0, 0));
146 //______________________________________________________________________________
147 void AliMUONGeometryEnvelope::AddConstituent(const TString& name, Int_t copyNo,
148 const TGeoTranslation& translation)
150 // Adds the volume with the specified name and transformation
151 // to the list of envelopes.
155 ->Add(new AliMUONGeometryConstituent(name, copyNo, translation, 0, 0));
158 //______________________________________________________________________________
159 void AliMUONGeometryEnvelope::AddConstituent(const TString& name, Int_t copyNo,
160 const TGeoTranslation& translation,
161 const TGeoRotation& rotation)
163 // Adds the volume with the specified name and transformation
164 // to the list of envelopes.
168 ->Add(new AliMUONGeometryConstituent(
169 name, copyNo, translation, rotation, 0, 0));
172 //______________________________________________________________________________
173 void AliMUONGeometryEnvelope::AddConstituent(const TString& name, Int_t copyNo,
174 const TGeoCombiTrans& transform )
176 // Adds the volume with the specified name and transformation
177 // to the list of envelopes.
181 ->Add(new AliMUONGeometryConstituent(
182 name, copyNo, transform, 0, 0));
185 //______________________________________________________________________________
186 void AliMUONGeometryEnvelope::AddConstituentParam(const TString& name,
187 Int_t copyNo, Int_t npar, Double_t* param)
189 // Adds the volume with the specified name and transformation
190 // to the list of envelopes.
194 ->Add(new AliMUONGeometryConstituent(name, copyNo, npar, param));
197 //______________________________________________________________________________
198 void AliMUONGeometryEnvelope::AddConstituentParam(const TString& name,
199 Int_t copyNo, const TGeoTranslation& translation,
200 Int_t npar, Double_t* param)
202 // Adds the volume with the specified name and transformation
203 // to the list of envelopes.
207 ->Add(new AliMUONGeometryConstituent(
208 name, copyNo, translation, npar, param));
211 //______________________________________________________________________________
212 void AliMUONGeometryEnvelope::AddConstituentParam(const TString& name,
213 Int_t copyNo, const TGeoTranslation& translation,
214 const TGeoRotation& rotation,
215 Int_t npar, Double_t* param)
217 // Adds the volume with the specified name and transformation
218 // to the list of envelopes.
222 ->Add(new AliMUONGeometryConstituent(
223 name, copyNo, translation, rotation, npar, param));
226 //______________________________________________________________________________
227 void AliMUONGeometryEnvelope::AddConstituentParam(const TString& name,
229 const TGeoCombiTrans& transform,
230 Int_t npar, Double_t* param)
232 // Adds the volume with the specified name and transformation
233 // to the list of envelopes.
237 ->Add(new AliMUONGeometryConstituent(
238 name, copyNo, transform, npar, param));
241 //______________________________________________________________________________
242 void AliMUONGeometryEnvelope::SetTranslation(const TGeoTranslation& translation)
244 // Sets the envelope position
248 ->SetTranslation(const_cast<Double_t*>(translation.GetTranslation()));
251 //______________________________________________________________________________
252 void AliMUONGeometryEnvelope::SetRotation(const TGeoRotation& rotation)
254 // Sets the enevlope rotation
257 TGeoRotation* rot = new TGeoRotation();
258 rot->SetMatrix(const_cast<Double_t*>(rotation.GetRotationMatrix()));
260 fTransformation->SetRotation(rot);
263 //______________________________________________________________________________
264 void AliMUONGeometryEnvelope::SetTransform(const TGeoCombiTrans& transform)
266 // Sets the enevlope transformation
270 ->SetTranslation(const_cast<Double_t*>(transform.GetTranslation()));
272 TGeoRotation* rot = new TGeoRotation();
273 rot->SetMatrix(const_cast<Double_t*>(transform.GetRotationMatrix()));
275 fTransformation->SetRotation(rot);