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,
38 fIsVirtual(isVirtual),
44 // Standard constructor
46 if (TString(only) == TString("MANY")) fIsMANY = true;
48 // Create the envelope transformation
49 fTransformation = new TGeoCombiTrans("");
50 fConstituents = new TObjArray(20);
54 //______________________________________________________________________________
55 AliMUONGeometryEnvelope::AliMUONGeometryEnvelope(const TString& name,
65 // Standard constructor
67 if (TString(only) == TString("MANY")) fIsMANY = true;
69 // Create the envelope transformation
70 fTransformation = new TGeoCombiTrans("");
71 fConstituents = new TObjArray(20);
75 //______________________________________________________________________________
76 AliMUONGeometryEnvelope::AliMUONGeometryEnvelope()
82 // Default constructor
86 //______________________________________________________________________________
87 AliMUONGeometryEnvelope::AliMUONGeometryEnvelope(
88 const AliMUONGeometryEnvelope& rhs)
91 Fatal("Copy constructor",
92 "Copy constructor is not implemented.");
95 //______________________________________________________________________________
96 AliMUONGeometryEnvelope::~AliMUONGeometryEnvelope()
99 // Add deleting rotation matrices
101 delete fTransformation;
104 fConstituents->Delete();
105 delete fConstituents;
109 //______________________________________________________________________________
110 AliMUONGeometryEnvelope&
111 AliMUONGeometryEnvelope::operator = (const AliMUONGeometryEnvelope& rhs)
113 // check assignement to self
114 if (this == &rhs) return *this;
117 "Assignment operator is not implemented.");
126 //______________________________________________________________________________
127 void AliMUONGeometryEnvelope::AddConstituent(const TString& name, Int_t copyNo)
129 // Adds the volume with the specified name and transformation
130 // to the list of envelopes.
133 fConstituents->Add(new AliMUONGeometryConstituent(name, copyNo, 0, 0));
136 //______________________________________________________________________________
137 void AliMUONGeometryEnvelope::AddConstituent(const TString& name, Int_t copyNo,
138 const TGeoTranslation& translation)
140 // Adds the volume with the specified name and transformation
141 // to the list of envelopes.
145 ->Add(new AliMUONGeometryConstituent(name, copyNo, translation, 0, 0));
148 //______________________________________________________________________________
149 void AliMUONGeometryEnvelope::AddConstituent(const TString& name, Int_t copyNo,
150 const TGeoTranslation& translation,
151 const TGeoRotation& rotation)
153 // Adds the volume with the specified name and transformation
154 // to the list of envelopes.
158 ->Add(new AliMUONGeometryConstituent(
159 name, copyNo, translation, rotation, 0, 0));
162 //______________________________________________________________________________
163 void AliMUONGeometryEnvelope::AddConstituentParam(const TString& name,
164 Int_t copyNo, Int_t npar, Double_t* param)
166 // Adds the volume with the specified name and transformation
167 // to the list of envelopes.
171 ->Add(new AliMUONGeometryConstituent(name, copyNo, npar, param));
174 //______________________________________________________________________________
175 void AliMUONGeometryEnvelope::AddConstituentParam(const TString& name,
176 Int_t copyNo, const TGeoTranslation& translation,
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, npar, param));
188 //______________________________________________________________________________
189 void AliMUONGeometryEnvelope::AddConstituentParam(const TString& name,
190 Int_t copyNo, const TGeoTranslation& translation,
191 const TGeoRotation& rotation,
192 Int_t npar, Double_t* param)
194 // Adds the volume with the specified name and transformation
195 // to the list of envelopes.
199 ->Add(new AliMUONGeometryConstituent(
200 name, copyNo, translation, rotation, npar, param));
203 //______________________________________________________________________________
204 void AliMUONGeometryEnvelope::SetTranslation(const TGeoTranslation& translation)
206 // Sets the chamber position wrt ALIC.
210 ->SetTranslation(const_cast<Double_t*>(translation.GetTranslation()));
213 //______________________________________________________________________________
214 void AliMUONGeometryEnvelope::SetRotation(const TGeoRotation& rotation)
216 // Sets the chamber rotation wrt ALIC.
219 TGeoRotation* rot = new TGeoRotation();
220 rot->SetMatrix(const_cast<Double_t*>(rotation.GetRotationMatrix()));
222 fTransformation->SetRotation(rot);