]> git.uio.no Git - u/mrichter/AliRoot.git/blob - MUON/AliMUONGeometryBuilder.cxx
a/ AliTRDCalibTask.cxx .h: one histo more to quantify the event selection if any...
[u/mrichter/AliRoot.git] / MUON / AliMUONGeometryBuilder.cxx
1 /**************************************************************************
2  * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
3  *      SigmaEffect_thetadegrees                                                                  *
4  * Author: The ALICE Off-line Project.                                    *
5  * Contributors are mentioned in the code where appropriate.              *
6  *                                                                        *
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 purpeateose. It is      *
13  * provided "as is" without express or implied warranty.                  *
14  **************************************************************************/
15
16 // $Id$
17
18 //-----------------------------------------------------------------------------
19 // Class AliMUONGeometryBuilder
20 // ----------------------------
21 // Manager class for geometry construction via geometry builders.
22 // Author: Ivana Hrivnacova, IPN Orsay
23 //-----------------------------------------------------------------------------
24
25 #include "AliMUONGeometryBuilder.h"
26 #include "AliMUONVGeometryBuilder.h"    
27 #include "AliMUONGeometry.h"
28 #include "AliMUONGeometryTransformer.h"
29 #include "AliMUONGeometryModule.h"      
30 #include "AliMUONGeometryModuleTransformer.h"   
31 #include "AliMUONGeometryEnvelope.h"    
32 #include "AliMUONGeometryEnvelopeStore.h"
33 #include "AliMUONGeometryDetElement.h"
34 #include "AliMUONGeometryConstituent.h"
35
36 #include "AliMpDEManager.h"
37
38 #include "AliModule.h"
39 #include "AliSimulation.h"
40 #include "AliLog.h"
41 #include "AliRun.h"
42
43 #include <TObjArray.h>
44 #include <TVirtualMC.h>
45 #include <TGeoManager.h>
46
47 // static data members
48  
49 const TString  AliMUONGeometryBuilder::fgkDefaultVolPathsFileName = "volpath.dat";   
50 const TString  AliMUONGeometryBuilder::fgkDefaultTransformFileName = "transform.dat";   
51 const TString  AliMUONGeometryBuilder::fgkDefaultSVMapFileName = "svmap.dat";    
52 const TString  AliMUONGeometryBuilder::fgkOutFileNameExtension = ".out";    
53
54 /// \cond CLASSIMP
55 ClassImp(AliMUONGeometryBuilder)
56 /// \endcond
57
58 // static functions
59
60 //______________________________________________________________________________
61 TGeoHMatrix AliMUONGeometryBuilder::Multiply(const TGeoMatrix& m1, 
62                                              const TGeoMatrix& m2)
63 {
64 /// Temporary fix for problem with matrix multiplication in Root 5.02/00
65
66   if (m1.IsIdentity() && m2.IsIdentity()) return TGeoHMatrix();
67   
68   if (m1.IsIdentity()) return m2;
69   
70   if (m2.IsIdentity()) return m1;
71   
72   return m1 * m2;
73 }
74
75 //______________________________________________________________________________
76 TGeoHMatrix AliMUONGeometryBuilder::Multiply(const TGeoMatrix& m1, 
77                                              const TGeoMatrix& m2,
78                                              const TGeoMatrix& m3)
79 {                                            
80 /// Temporary fix for problem with matrix multiplication in Root 5.02/00
81
82   if (m1.IsIdentity() && m2.IsIdentity() & m3.IsIdentity())  
83     return TGeoHMatrix();
84   
85   if (m1.IsIdentity()) return Multiply(m2, m3);
86   
87   if (m2.IsIdentity()) return Multiply(m1, m3);
88   
89   if (m3.IsIdentity()) return Multiply(m1, m2);
90   
91   return m1 * m2 * m3;
92 }
93
94 //______________________________________________________________________________
95 TGeoHMatrix AliMUONGeometryBuilder::Multiply(const TGeoMatrix& m1, 
96                                              const TGeoMatrix& m2,
97                                              const TGeoMatrix& m3,
98                                              const TGeoMatrix& m4)
99 {                                            
100 /// Temporary fix for problem with matrix multiplication in Root 5.02/00
101
102   if (m1.IsIdentity() && m2.IsIdentity() & m3.IsIdentity() & m4.IsIdentity())  
103     return TGeoHMatrix();
104   
105   if (m1.IsIdentity()) return Multiply(m2, m3, m4);
106   
107   if (m2.IsIdentity()) return Multiply(m1, m3, m4);
108   
109   if (m3.IsIdentity()) return Multiply(m1, m2, m4);
110   
111   if (m4.IsIdentity()) return Multiply(m1, m2, m3);
112   
113   return m1 * m2 * m3 * m4;
114 }
115
116 //______________________________________________________________________________
117 AliMUONGeometryBuilder::AliMUONGeometryBuilder(AliModule* module)
118   : TObject(),
119     fModule(module),
120     fAlign(false),
121     fTransformFileName(fgkDefaultTransformFileName),
122     fSVMapFileName(fgkDefaultSVMapFileName),
123     fGlobalTransformation(), 
124     fGeometryBuilders(0),
125     fGeometry(0)
126 {
127 /// Standard constructor
128
129   fGeometryBuilders = new TObjArray();
130   fGeometryBuilders->SetOwner(true);
131   
132   fGeometry = new AliMUONGeometry(true);
133
134   // Define the global transformation:
135   // Transformation from the old ALICE coordinate system to a new one:
136   // x->-x, z->-z 
137   TGeoRotation* rotGlobal 
138     = new TGeoRotation("rotGlobal", 90., 180., 90., 90., 180., 0.);
139   fGlobalTransformation = TGeoCombiTrans(0., 0., 0., rotGlobal);
140 }
141
142 //______________________________________________________________________________
143 AliMUONGeometryBuilder::AliMUONGeometryBuilder() 
144   : TObject(),
145     fModule(0),
146     fAlign(false),
147     fTransformFileName(),
148     fSVMapFileName(),
149     fGlobalTransformation(),
150     fGeometryBuilders(0),
151     fGeometry(0)
152 {
153 /// Default constructor
154
155
156 //______________________________________________________________________________
157 AliMUONGeometryBuilder::~AliMUONGeometryBuilder()
158 {
159 /// Destructor
160   
161   delete fGeometryBuilders;
162   delete fGeometry;
163 }
164
165 //
166 // private functions
167 //
168
169 //______________________________________________________________________________
170 void AliMUONGeometryBuilder::PlaceVolume(const TString& name, const TString& mName, 
171                             Int_t copyNo, const TGeoHMatrix& matrix, 
172                             Int_t npar, Double_t* param, const char* only,
173                             Bool_t makeAssembly) const
174 {
175 /// Place the volume specified by name with the given transformation matrix
176
177   if (makeAssembly)
178     gGeoManager->MakeVolumeAssembly(name.Data());
179
180   TGeoHMatrix transform(matrix);
181   // Do not apply global transformation 
182   // if mother volume was already placed in 
183   // the new system of coordinates (that is MUON in negative Z)
184   // (as it is applied on the mother volume)
185   if (mName == TString("DDIP"))
186     transform = fGlobalTransformation.Inverse() * transform;
187      
188   // Decompose transformation
189   const Double_t* xyz = transform.GetTranslation();
190   const Double_t* rm = transform.GetRotationMatrix();
191         
192   //cout << "Got translation: "
193   //     << xyz[0] << " " << xyz[1] << " " << xyz[2] << endl;
194         
195   //cout << "Got rotation: "
196   //     << rm[0] << " " << rm[1] << " " << rm[2] << endl
197   //     << rm[3] << " " << rm[4] << " " << rm[5] << endl
198   //     << rm[6] << " " << rm[7] << " " << rm[8] << endl;
199
200   // Check for presence of rotation
201   // (will be nice to be available in TGeo)
202   const Double_t kTolerance = 1e-04;
203   Bool_t isRotation = true; 
204   if (TMath::Abs(rm[0] - 1.) < kTolerance &&
205       TMath::Abs(rm[1] - 0.) < kTolerance &&
206       TMath::Abs(rm[2] - 0.) < kTolerance &&
207       TMath::Abs(rm[3] - 0.) < kTolerance &&
208       TMath::Abs(rm[4] - 1.) < kTolerance &&
209       TMath::Abs(rm[5] - 0.) < kTolerance &&
210       TMath::Abs(rm[6] - 0.) < kTolerance &&
211       TMath::Abs(rm[7] - 0.) < kTolerance &&
212       TMath::Abs(rm[8] - 1.) < kTolerance) isRotation = false; 
213
214   Int_t krot = 0;
215   if (isRotation) {
216     TGeoRotation rot;
217     rot.SetMatrix(const_cast<Double_t*>(transform.GetRotationMatrix()));
218     Double_t theta1, phi1, theta2, phi2, theta3, phi3;
219     rot.GetAngles(theta1, phi1, theta2, phi2, theta3, phi3);
220         
221     //cout << "angles: " 
222     //     << theta1 << " " << phi1 << " "
223     //     << theta2 << " " << phi2 << " "
224     //     << theta3 << " " << phi3 << endl;
225         
226     fModule->AliMatrix(krot, theta1, phi1, theta2, phi2, theta3, phi3);
227   }     
228         
229   // Place the volume
230   if (npar == 0)
231     gMC->Gspos(name, copyNo, mName, xyz[0], xyz[1], xyz[2] , krot, only);
232   else 
233     gMC->Gsposp(name, copyNo, mName, xyz[0], xyz[1], xyz[2] , krot, only,
234                 param, npar);
235
236
237 //______________________________________________________________________________
238 void AliMUONGeometryBuilder::CreateGeometryWithTGeo()
239 {
240 /// Construct geometry using geometry builders.
241 /// Virtual modules/envelopes are placed as TGeoVolume assembly
242
243   if (fAlign) {
244     // Read transformations from ASCII data file  
245     fGeometry->GetTransformer()
246       ->LoadGeometryData(fTransformFileName);
247   }    
248  
249   for (Int_t i=0; i<fGeometryBuilders->GetEntriesFast(); i++) {
250
251     // Get the builder
252     AliMUONVGeometryBuilder* builder
253       = (AliMUONVGeometryBuilder*)fGeometryBuilders->At(i);
254
255     // Create geometry + envelopes
256     //
257     builder->CreateGeometry();
258     builder->SetVolumes();
259     if (!fAlign) builder->SetTransformations();
260     
261     // Place module volumes and envelopes
262     //
263     for (Int_t j=0; j<builder->NofGeometries(); j++) {
264
265       AliMUONGeometryModule* geometry = builder->Geometry(j);
266       AliMUONGeometryModuleTransformer* transformer= geometry->GetTransformer();
267       const TGeoHMatrix* kModuleTransform = transformer->GetTransformation();
268       TString volName       = transformer->GetVolumeName(); 
269       TString motherVolName = transformer->GetMotherVolumeName(); 
270       
271       // Place the module volume
272       PlaceVolume(volName, motherVolName, 
273                   1, *kModuleTransform, 0, 0, "ONLY", geometry->IsVirtual());
274   
275       TGeoCombiTrans appliedGlobalTransform;
276       if (builder->ApplyGlobalTransformation())
277         appliedGlobalTransform = fGlobalTransformation;
278
279       // Loop over envelopes
280       const TObjArray* kEnvelopes 
281         = geometry->GetEnvelopeStore()->GetEnvelopes();
282       for (Int_t k=0; k<kEnvelopes->GetEntriesFast(); k++) {
283
284         // Get envelope
285         AliMUONGeometryEnvelope* env 
286           = (AliMUONGeometryEnvelope*)kEnvelopes->At(k);
287           
288         // Check consistency of detElemId and module Id
289         if ( env->GetUniqueID() > 0 && 
290              AliMpDEManager::GetGeomModuleId(env->GetUniqueID()) 
291              != geometry->GetModuleId() ) {
292              
293           AliErrorStream() 
294             << "Detection element " << env->GetUniqueID() 
295             << " is being placed in geometry module " << geometry->GetModuleId()
296             << " but should go in " 
297             << AliMpDEManager::GetGeomModuleId(env->GetUniqueID())
298             <<  endl;
299           AliFatal("Inconsistent IDs");
300         }          
301           
302         const TGeoCombiTrans* kEnvTrans = env->GetTransformation();
303         const char* only = "ONLY";
304         if (env->IsMANY()) only = "MANY";
305
306         if (env->IsVirtual() && env->GetConstituents()->GetEntriesFast() == 0 ) {
307           // virtual envelope + nof constituents = 0 
308           //         => not allowed;
309           //            empty virtual envelope has no sense 
310           AliFatal("Virtual envelope must have constituents.");
311           return;
312         }
313
314         if (!env->IsVirtual() && env->GetConstituents()->GetEntriesFast() > 0 ) {
315           // non virtual envelope + nof constituents > 0 
316           //        => not allowed;
317           //           use VMC to place constituents
318           AliFatal("Non virtual envelope cannot have constituents.");
319           return;
320         }
321
322         // Place envelope in geometry module by composed transformation:
323         // [Tglobal] * Tenv
324         TGeoHMatrix total 
325           = Multiply( appliedGlobalTransform, 
326                      (*kEnvTrans) );
327         PlaceVolume(env->GetName(), volName,
328                     env->GetCopyNo(), total, 0, 0, only, env->IsVirtual());
329         
330         if ( env->IsVirtual() )  {
331           //  Place constituents in the envelope
332           for  (Int_t l=0; l<env->GetConstituents()->GetEntriesFast(); l++) {
333             AliMUONGeometryConstituent* constituent
334               = (AliMUONGeometryConstituent*)env->GetConstituents()->At(l);
335  
336             PlaceVolume(constituent->GetName(), env->GetName(),
337                         constituent->GetCopyNo(),
338                         *constituent->GetTransformation() ,
339                         constituent->GetNpar(), constituent->GetParam(), only);
340           }
341         }
342       } // end of loop over envelopes
343     } // end of loop over builder geometries
344   } // end of loop over builders
345 }
346
347 //______________________________________________________________________________
348 void AliMUONGeometryBuilder::CreateGeometryWithoutTGeo()
349 {
350 /// Construct geometry using geometry builders.
351 /// Virtual modules/envelopes are not placed
352
353   if (fAlign) {
354     // Read transformations from ASCII data file  
355     fGeometry->GetTransformer()->LoadGeometryData(fTransformFileName);
356   }     
357
358   for (Int_t i=0; i<fGeometryBuilders->GetEntriesFast(); i++) {
359
360     // Get the builder
361     AliMUONVGeometryBuilder* builder
362       = (AliMUONVGeometryBuilder*)fGeometryBuilders->At(i);
363
364     // Create geometry + envelopes
365     //
366     builder->CreateGeometry();
367     if (!fAlign) builder->SetTransformations();
368     
369     // Place module volumes and envelopes
370     //
371     for (Int_t j=0; j<builder->NofGeometries(); j++) {
372
373       AliMUONGeometryModule* geometry = builder->Geometry(j);
374       AliMUONGeometryModuleTransformer* transformer= geometry->GetTransformer();
375       const TGeoHMatrix* kModuleTransform = transformer->GetTransformation();
376       TString volName       = transformer->GetVolumeName(); 
377       TString motherVolName = transformer->GetMotherVolumeName(); 
378       
379       // Place the module volume
380       if ( !geometry->IsVirtual() ) {
381           PlaceVolume(volName, motherVolName, 
382                       1, *kModuleTransform, 0, 0, "ONLY");
383       }               
384   
385       TGeoCombiTrans appliedGlobalTransform;
386       if (builder->ApplyGlobalTransformation())
387         appliedGlobalTransform = fGlobalTransformation;
388
389       // Loop over envelopes
390       const TObjArray* kEnvelopes 
391         = geometry->GetEnvelopeStore()->GetEnvelopes();
392       for (Int_t k=0; k<kEnvelopes->GetEntriesFast(); k++) {
393
394         // Get envelope
395         AliMUONGeometryEnvelope* env 
396           = (AliMUONGeometryEnvelope*)kEnvelopes->At(k);
397           
398         // Check consistency of detElemId and module Id
399         if ( env->GetUniqueID() > 0 && 
400              AliMpDEManager::GetGeomModuleId(env->GetUniqueID()) 
401              != geometry->GetModuleId() ) {
402              
403           AliErrorStream() 
404             << "Detection element " << env->GetUniqueID() 
405             << " is being placed in geometry module " << geometry->GetModuleId()
406             << " but should go in " 
407             << AliMpDEManager::GetGeomModuleId(env->GetUniqueID())
408             <<  endl;
409           AliFatal("Inconsistent IDs");
410         }          
411           
412         const TGeoCombiTrans* kEnvTrans = env->GetTransformation();
413         const char* only = "ONLY";
414         if (env->IsMANY()) only = "MANY";
415
416         if (env->IsVirtual() && env->GetConstituents()->GetEntriesFast() == 0 ) {
417           // virtual envelope + nof constituents = 0 
418           //         => not allowed;
419           //            empty virtual envelope has no sense 
420           AliFatal("Virtual envelope must have constituents.");
421           return;
422         }
423
424         if (!env->IsVirtual() && env->GetConstituents()->GetEntriesFast() > 0 ) {
425           // non virtual envelope + nof constituents > 0 
426           //        => not allowed;
427           //           use VMC to place constituents
428           AliFatal("Non virtual envelope cannot have constituents.");
429           return;
430         }
431
432         if (!env->IsVirtual() && env->GetConstituents()->GetEntriesFast() == 0 ) {
433           // non virtual envelope + nof constituents = 0 
434           //        => place envelope by composed transformation:
435           //           Tch * [Tglobal] * Tenv
436
437           // Compound chamber transformation with the envelope one
438           if (geometry->IsVirtual()) {
439              TGeoHMatrix total 
440                = Multiply( (*kModuleTransform), 
441                             appliedGlobalTransform, 
442                            (*kEnvTrans) );
443              PlaceVolume(env->GetName(), motherVolName,
444                          env->GetCopyNo(), total, 0, 0, only);
445           }
446           else {
447              TGeoHMatrix total 
448                = Multiply( appliedGlobalTransform, 
449                            (*kEnvTrans) );
450              PlaceVolume(env->GetName(), volName,
451                          env->GetCopyNo(), total, 0, 0, only);
452           }                      
453         }
454
455         if (env->IsVirtual() && env->GetConstituents()->GetEntriesFast() > 0 ) {
456           // virtual envelope + nof constituents > 0 
457           //         => do not place envelope and place constituents
458           //            by composed transformation:
459           //            Tch * [Tglobal] * Tenv * Tconst   
460
461           for  (Int_t l=0; l<env->GetConstituents()->GetEntriesFast(); l++) {
462             AliMUONGeometryConstituent* constituent
463               = (AliMUONGeometryConstituent*)env->GetConstituents()->At(l);
464  
465             // Compound chamber transformation with the envelope one + the constituent one
466             if (geometry->IsVirtual()) {
467               TGeoHMatrix total 
468                 = Multiply ( (*kModuleTransform),
469                              appliedGlobalTransform, 
470                              (*kEnvTrans), 
471                              (*constituent->GetTransformation()) );
472
473               PlaceVolume(constituent->GetName(), motherVolName,
474                           constituent->GetCopyNo(), total,
475                           constituent->GetNpar(), constituent->GetParam(), only);
476             }
477             else {                        
478               TGeoHMatrix total 
479                 = Multiply ( appliedGlobalTransform, 
480                              (*kEnvTrans),
481                              (*constituent->GetTransformation()) );
482
483               PlaceVolume(constituent->GetName(), volName,
484                           constituent->GetCopyNo(), total,
485                           constituent->GetNpar(), constituent->GetParam(), only);
486             }                     
487           }
488         }
489       } // end of loop over envelopes
490     } // end of loop over builder geometries
491   } // end of loop over builders
492 }
493
494 //_____________________________________________________________________________
495 void AliMUONGeometryBuilder::SetAlignToBuilder(AliMUONVGeometryBuilder* builder) const
496 {
497 /// Set align option to all geometry modules associated with the builder
498
499   for (Int_t j=0; j<builder->NofGeometries(); j++) {
500
501     AliMUONGeometryModule* geometry = builder->Geometry(j);
502   
503     geometry->SetAlign(fAlign);
504   }       
505 }            
506
507 //
508 // public functions
509 //
510
511 //_____________________________________________________________________________
512 void AliMUONGeometryBuilder::AddBuilder(AliMUONVGeometryBuilder* geomBuilder)
513 {
514 /// Add the geometry builder to the list
515
516   fGeometryBuilders->Add(geomBuilder);
517   
518   // Pass geometry modules created in the to the geometry parametrisation
519   for (Int_t i=0; i<geomBuilder->NofGeometries(); i++) {
520     fGeometry->AddModule(geomBuilder->Geometry(i));
521   }  
522   
523   if (geomBuilder->ApplyGlobalTransformation())
524     geomBuilder->SetReferenceFrame(fGlobalTransformation);
525   
526   SetAlignToBuilder(geomBuilder);
527 }
528
529 //______________________________________________________________________________
530 void AliMUONGeometryBuilder::CreateGeometry()
531 {
532 /// Construct geometry using geometry builders.
533
534   if ( gMC->IsRootGeometrySupported() ) {
535        
536    CreateGeometryWithTGeo();
537   } 
538   else
539    CreateGeometryWithoutTGeo();
540
541   for (Int_t i=0; i<fGeometryBuilders->GetEntriesFast(); i++) {
542
543     // Get the builder
544     AliMUONVGeometryBuilder* builder
545       = (AliMUONVGeometryBuilder*)fGeometryBuilders->At(i);
546  
547     // Update detection elements from built geometry
548     Bool_t create = ! fAlign;
549     builder->UpdateDetElements(create);
550   }
551 }
552
553 //_____________________________________________________________________________
554 void AliMUONGeometryBuilder::CreateMaterials()
555 {
556 /// Construct materials specific to modules via builders
557   
558   for (Int_t i=0; i<fGeometryBuilders->GetEntriesFast(); i++) {
559
560     // Get the builder
561     AliMUONVGeometryBuilder* builder
562       = (AliMUONVGeometryBuilder*)fGeometryBuilders->At(i);
563
564     // Create materials with each builder
565     if (builder) builder->CreateMaterials();
566   }
567 }
568
569 //______________________________________________________________________________
570 void AliMUONGeometryBuilder::InitGeometry(const TString& svmapFileName)
571 {
572 /// Initialize geometry
573
574   // Load alignement data from geometry if geometry is read from Root file
575   if ( AliSimulation::Instance()->IsGeometryFromFile() ) {
576     fAlign = true;
577     fGeometry->GetTransformer()->LoadGeometryData();
578  }    
579
580   // Read sensitive volume map from a file
581   fGeometry->ReadSVMap(svmapFileName);
582
583   // Set the chamber (sensitive region) GEANT identifier
584   //
585   for (Int_t i=0; i<fGeometryBuilders->GetEntriesFast(); i++) {
586
587     // Get the builder
588     AliMUONVGeometryBuilder* builder
589       = (AliMUONVGeometryBuilder*)fGeometryBuilders->At(i);
590
591     // Set sensitive volumes with each builder
592     builder->SetSensitiveVolumes();
593   }  
594 }
595
596 //________________________________________________________________
597 void AliMUONGeometryBuilder::UpdateInternalGeometry()
598 {
599 /// Update geometry after applying mis-alignment:
600 /// reload transformations in geometry builder.
601
602   fGeometry->GetTransformer()->LoadTransformations();
603 }
604
605 //______________________________________________________________________________
606 void AliMUONGeometryBuilder::WriteSVMaps(const TString& fileName, 
607                                          Bool_t rebuild, Bool_t writeEnvelopes)
608 {
609 /// Write sensitive volume maps into files per builder
610
611   // Rebuild sv maps
612   //
613   if (rebuild) 
614     for (Int_t i=0; i<fGeometryBuilders->GetEntriesFast(); i++) {
615
616       AliMUONVGeometryBuilder* builder
617         = (AliMUONVGeometryBuilder*)fGeometryBuilders->At(i);
618
619       builder->RebuildSVMaps(writeEnvelopes);
620     }  
621     
622   // Write maps in file
623   fGeometry->WriteSVMap(fileName);
624 }
625
626 //_____________________________________________________________________________
627 void AliMUONGeometryBuilder::SetAlign(Bool_t align)
628
629 /// Set the option for alignement
630
631   fAlign = align; 
632
633   for (Int_t i=0; i<fGeometryBuilders->GetEntriesFast(); i++) {
634
635     AliMUONVGeometryBuilder* builder
636       = (AliMUONVGeometryBuilder*)fGeometryBuilders->At(i);
637     
638     SetAlignToBuilder(builder); 
639   }   
640 }
641
642 //_____________________________________________________________________________
643 void AliMUONGeometryBuilder::SetAlign(const TString& fileName, Bool_t align)
644
645 /// Set the option for alignement and the transformations file name
646
647   fTransformFileName = fileName;
648   fAlign = align; 
649
650   for (Int_t i=0; i<fGeometryBuilders->GetEntriesFast(); i++) {
651
652     AliMUONVGeometryBuilder* builder
653       = (AliMUONVGeometryBuilder*)fGeometryBuilders->At(i);
654     
655     SetAlignToBuilder(builder); 
656   }   
657 }