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