]> git.uio.no Git - u/mrichter/AliRoot.git/blob - MUON/AliMUONSegFactoryV3.cxx
Removed - functionality of this class moved to geometry and mapping
[u/mrichter/AliRoot.git] / MUON / AliMUONSegFactoryV3.cxx
1 /**************************************************************************
2  * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
3  *                                                                        *
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 purpose. It is          *
13  * provided "as is" without express or implied warranty.                  *
14  **************************************************************************/
15
16 ////////////////////////////////////////////////////////////
17 //  Factory for muon chambers, segmentations and response //
18 ////////////////////////////////////////////////////////////
19
20 /* $Id$ */
21
22 #include <Riostream.h>
23 #include <TObjString.h>
24
25 #include "AliRun.h"
26 #include "AliLog.h"
27
28 #include "AliMpPlaneType.h"
29 #include "AliMpExMap.h"
30
31 #include "AliMUONSegFactoryV3.h"
32 #include "AliMUONConstants.h"
33 #include "AliMUONGeometryTransformer.h"
34 #include "AliMUONGeometryModule.h"
35 #include "AliMUONSegmentation.h"
36 #include "AliMUONGeometrySegmentation.h"
37 #include "AliMUONSt12QuadrantSegmentation.h"
38 #include "AliMUONSt345SlatSegmentationV2.h"
39 #include "AliMUONTriggerSegmentation.h"
40 #include "AliMUONTriggerConstants.h"
41
42 ClassImp(AliMUONSegFactoryV3)
43
44 //__________________________________________________________________________
45 AliMUONSegFactoryV3::AliMUONSegFactoryV3(const char* name)
46     : TNamed(name, ""),
47       fSegmentation(0),
48       fkGeomTransformer(0)
49 {  
50 /// Standard constructor
51
52   fSegmentation = new AliMUONSegmentation(AliMUONConstants::NCh());
53 }
54
55 //__________________________________________________________________________
56   AliMUONSegFactoryV3::AliMUONSegFactoryV3()
57     : TNamed(),
58       fSegmentation(0),
59       fkGeomTransformer(0)
60 {
61 /// Default constructor
62 }
63
64 //__________________________________________________________________________
65 AliMUONSegFactoryV3::AliMUONSegFactoryV3(const AliMUONSegFactoryV3& rhs)
66  : TNamed(rhs)
67 {
68 /// Protected copy constructor
69
70   AliFatal("Not implemented.");
71 }
72
73 //__________________________________________________________________________
74
75 AliMUONSegFactoryV3::~AliMUONSegFactoryV3()
76 {
77 /// Destructor
78
79
80   //delete fSegmentation;
81         // The segmentation is supposed to be deleted in the client code
82 }
83
84 //__________________________________________________________________________
85 AliMUONSegFactoryV3&  AliMUONSegFactoryV3::operator=(const AliMUONSegFactoryV3& rhs)
86 {
87   // Protected assignement operator
88
89   if (this == &rhs) return *this;
90
91   AliFatal("Not implemented.");
92     
93   return *this;  
94 }    
95           
96 //
97 // Private methods
98 //
99
100 //__________________________________________________________________________
101 Bool_t AliMUONSegFactoryV3::IsGeometryDefined(Int_t ichamber)
102 {
103 // Return true, if det elements for the chamber with the given ichamber Id
104 // are defined in geometry (the geometry builder for this chamber was activated)
105
106   if ( ! fkGeomTransformer ||
107        ! fkGeomTransformer->GetModuleTransformer(ichamber, false) )
108        
109     return kFALSE;
110   
111   return kTRUE;
112 }  
113
114 //_____________________________________________________________________________
115 Bool_t
116 AliMUONSegFactoryV3::ReadDENames(const TString& fileName, AliMpExMap& map)
117
118 /// Read det element names from the file specified by name
119 /// and fill the map 
120
121   // Open file
122   TString filePath(gSystem->ExpandPathName("${ALICE_ROOT}/MUON/data/"));
123   filePath += fileName;
124   std::ifstream in(filePath);
125   if (!in.good()) {
126     AliErrorClass(Form("Cannot read file %s", filePath.Data()));
127     return false;
128   }
129   
130   // Read file and fill the map
131   char line[80];
132   while ( in.getline(line,80) )
133   {    
134     if ( !isdigit(line[0]) ) continue;
135     TString sline(line);
136     
137     Ssiz_t pos = sline.First(' ');
138     Int_t detelemid = TString(sline(0,pos)).Atoi();
139     TObject* o = map.GetValue(detelemid);
140     if (!o)
141     {
142       map.Add(detelemid, new TObjString(sline(pos+1,sline.Length()-pos).Data()));
143     }
144   }
145   
146   // Close file
147   in.close();
148   return true;
149 }
150
151
152 //_____________________________________________________________________________
153 void
154 AliMUONSegFactoryV3::BuildChamber345(Int_t firstDetElemId, Int_t lastDetElemId,
155                                      const AliMpExMap& deNamesMap)
156 {
157   // Build a single chamber for stations 345.
158   // The first and lastDetElemId must correspond to the same chamber.
159         
160   Int_t ichamber = firstDetElemId/100 - 1;
161   Int_t test = lastDetElemId/100-1;
162   
163   if ( test != ichamber )
164         {
165                 AliFatal(Form("DetElemIds %d and %d not part of the same chamber !",
166                                                                         firstDetElemId,lastDetElemId));
167         }
168         
169   const Int_t kNPLANES = 2;
170   const AliMpPlaneType kptypes[kNPLANES] = { kBendingPlane, kNonBendingPlane };
171   
172   const AliMUONGeometryModuleTransformer* kModuleTransformer 
173     = fkGeomTransformer->GetModuleTransformer(ichamber);
174         
175   for ( Int_t iplane = 0; iplane < kNPLANES; ++iplane )
176         {
177                 AliMUONGeometrySegmentation* segmentation = 
178                 new AliMUONGeometrySegmentation(kModuleTransformer);
179                 
180                 for ( Int_t d = firstDetElemId; d <= lastDetElemId; ++d ) 
181                 {
182                         if ( !deNamesMap.GetValue(d) )
183             {
184               AliWarning(Form("You are requesting an invalid detElemId = %d, I am skipping it",d));
185               continue;
186             }
187                         
188                         AliMUONVGeometryDESegmentation* slatSeg = 
189             new AliMUONSt345SlatSegmentationV2(d,kptypes[iplane]);
190             
191                         fSegmentation->AddDESegmentation(slatSeg);
192
193                         TString deName = ((TObjString*)deNamesMap.GetValue(d))->GetString();
194                         segmentation->Add(d, deName, slatSeg);
195                 }
196                 
197                 fSegmentation->AddModuleSegmentation(ichamber, iplane, segmentation);
198         }
199 }
200
201 //__________________________________________________________________________
202 void AliMUONSegFactoryV3::BuildStation1() 
203 {
204 /// Station 1 
205
206   // Quadrant segmentations:
207   AliMUONSt12QuadrantSegmentation* bendSt1
208     = new AliMUONSt12QuadrantSegmentation(kStation1, kBendingPlane);
209   AliMUONSt12QuadrantSegmentation* nonbendSt1
210     = new AliMUONSt12QuadrantSegmentation(kStation1, kNonBendingPlane);
211   
212   // Add in the array (for safe deleting)  
213   fSegmentation->AddDESegmentation(bendSt1);  
214   fSegmentation->AddDESegmentation(nonbendSt1);  
215
216   AliMUONGeometrySegmentation* segmentation[2];
217
218   for (Int_t chamber = 0; chamber < 2; chamber++) {
219
220     const AliMUONGeometryModuleTransformer* kModuleTransformer 
221       = fkGeomTransformer->GetModuleTransformer(chamber);
222       
223     segmentation[0] = new AliMUONGeometrySegmentation(kModuleTransformer);
224     segmentation[1] = new AliMUONGeometrySegmentation(kModuleTransformer);
225         
226     // id detection elt for chamber 1
227     Int_t id0 = (chamber+1)*100;
228
229     // cathode 0
230     segmentation[0]->Add(id0,      "St1_Quadrant_I",   bendSt1);
231     segmentation[0]->Add(id0 +  1, "St1_Quadrant_II",  nonbendSt1); 
232     segmentation[0]->Add(id0 +  2, "St1_Quadrant_III", bendSt1);
233     segmentation[0]->Add(id0 +  3, "St1_Quadrant_IV",  nonbendSt1);
234     fSegmentation->AddModuleSegmentation(chamber, 0, segmentation[0]);   
235
236     // cathode 1
237     segmentation[1]->Add(id0,      "St1_Quadrant_I",   nonbendSt1);
238     segmentation[1]->Add(id0 +  1, "St1_Quadrant_II",  bendSt1);
239     segmentation[1]->Add(id0 +  2, "St1_Quadrant_III", nonbendSt1);
240     segmentation[1]->Add(id0 +  3, "St1_Quadrant_IV",  bendSt1);
241     fSegmentation->AddModuleSegmentation(chamber, 1, segmentation[1]);
242   }
243 }
244
245 //__________________________________________________________________________
246 void AliMUONSegFactoryV3::BuildStation2() 
247 {
248   //
249   //--------------------------------------------------------
250   // Configuration for Chamber TC3/4 (Station 2) -----------
251   ///^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
252
253   // Quadrant segmentations:
254   AliMUONSt12QuadrantSegmentation* bendSt2
255     = new AliMUONSt12QuadrantSegmentation(kStation2, kBendingPlane);
256   AliMUONSt12QuadrantSegmentation* nonbendSt2
257     = new AliMUONSt12QuadrantSegmentation(kStation2, kNonBendingPlane);
258
259   // Add in the array (for safe deleting)  
260   fSegmentation->AddDESegmentation(bendSt2);  
261   fSegmentation->AddDESegmentation(nonbendSt2);  
262
263   AliMUONGeometrySegmentation* segmentation[2];
264
265   for (Int_t chamber = 2; chamber < 4; chamber++) {
266
267     const AliMUONGeometryModuleTransformer* kModuleTransformer 
268       = fkGeomTransformer->GetModuleTransformer(chamber);
269       
270     segmentation[0] = new AliMUONGeometrySegmentation(kModuleTransformer);
271     segmentation[1] = new AliMUONGeometrySegmentation(kModuleTransformer);
272         
273     // id detection elt for chamber 1
274     Int_t id0 = (chamber+1)*100;
275
276     //--------------------------------------------------------
277     // Configuration for Chamber TC3/4  (Station 2) ----------           
278
279
280     // cathode 0
281     segmentation[0]->Add(id0,      "St2_Quadrant_I",   bendSt2);
282     segmentation[0]->Add(id0 +  1, "St2_Quadrant_II",  nonbendSt2); 
283     segmentation[0]->Add(id0 +  2, "St2_Quadrant_III", bendSt2);
284     segmentation[0]->Add(id0 +  3, "St2_Quadrant_IV",  nonbendSt2);
285     fSegmentation->AddModuleSegmentation(chamber, 0, segmentation[0]);   
286
287     // cathode 1
288     segmentation[1]->Add(id0,      "St2_Quadrant_I",   nonbendSt2);
289     segmentation[1]->Add(id0 +  1, "St2_Quadrant_II",  bendSt2);
290     segmentation[1]->Add(id0 +  2, "St2_Quadrant_III", nonbendSt2);
291     segmentation[1]->Add(id0 +  3, "St2_Quadrant_IV",  bendSt2);
292     fSegmentation->AddModuleSegmentation(chamber, 1, segmentation[1]);
293   }
294 }       
295         
296 //__________________________________________________________________________
297 void AliMUONSegFactoryV3::BuildStation3(const AliMpExMap& deNamesMap) 
298 {
299   BuildChamber345(500,517,deNamesMap);
300   BuildChamber345(600,617,deNamesMap);
301 }
302
303 //__________________________________________________________________________
304 void AliMUONSegFactoryV3::BuildStation4(const AliMpExMap& deNamesMap) 
305 {
306   BuildChamber345(700,725,deNamesMap);
307   BuildChamber345(800,825,deNamesMap);
308 }
309
310 //__________________________________________________________________________
311 void AliMUONSegFactoryV3::BuildStation5(const AliMpExMap& deNamesMap) 
312 {       
313   BuildChamber345(900,925,deNamesMap);
314   BuildChamber345(1000,1025,deNamesMap);
315 }
316
317 //__________________________________________________________________________
318 void AliMUONSegFactoryV3::BuildStation6() 
319
320  
321     AliMUONGeometrySegmentation *chamberSeg[2];
322
323     for (Int_t chamber = 10; chamber < 14; chamber++) {
324
325       //Trigger Segmentation
326       AliMUONTriggerSegmentation *trigSegX[9]; 
327       AliMUONTriggerSegmentation *trigSegY[9]; 
328       for(Int_t i=0; i<9; i++) {
329         trigSegX[i] = new AliMUONTriggerSegmentation(1);
330         trigSegY[i] = new AliMUONTriggerSegmentation(0);
331         fSegmentation->AddDESegmentation(trigSegX[i]);  
332         fSegmentation->AddDESegmentation(trigSegY[i]);  
333         trigSegX[i]->SetLineNumber(9-i);    
334         trigSegY[i]->SetLineNumber(9-i);    
335       }
336
337       //AliMUONChamber *iChamber, *iChamber1;
338       //iChamber1 = &fMUON->Chamber(10);
339       //iChamber  = &fMUON->Chamber(chamber);
340       //Float_t zpos1= iChamber1->Z();  
341       //Float_t zpos = iChamber->Z();        
342       Float_t zpos1= AliMUONConstants::DefaultChamberZ(10); 
343       Float_t zpos = AliMUONConstants::DefaultChamberZ(chamber);  
344       Float_t zRatio = zpos / zpos1;
345
346       // init
347       Float_t stripWidth[3]={0.,0.,0.};     // 1.0625 2.125 4.25
348       Float_t stripLength[4]={0.,0.,0.,0.}; // 17. 34. 51. 68.
349       for (Int_t i=0; i<3; i++) 
350         stripWidth[i]=AliMUONTriggerConstants::StripWidth(i)*zRatio;
351       for (Int_t i=0; i<4; i++) 
352         stripLength[i]=AliMUONTriggerConstants::StripLength(i)*zRatio;
353       Int_t nStrip[7]={0,0,0,0,0,0,0};    
354       Float_t stripYsize[7]={0.,0.,0.,0.,0.,0.,0.};
355       Float_t stripXsize[7]={0.,0.,0.,0.,0.,0.,0.};
356
357       // chamber 8 0 cathode 0
358       for (Int_t i=0; i<7; i++) nStrip[i]=16;
359       for (Int_t i=0; i<7; i++) stripYsize[i]=stripWidth[2];
360       for (Int_t i=0; i<6; i++) stripXsize[i]=stripLength[1];
361       stripXsize[6]=stripLength[2];
362       trigSegX[8]->Init(0,nStrip,stripYsize,stripXsize,0.); 
363       trigSegX[0]->Init(0,nStrip,stripYsize,stripXsize,0.); 
364
365       // chamber 8 7 1 0 cathode 1
366       for (Int_t i=0; i<6; i++) nStrip[i]=8;
367       nStrip[6]=16;
368       for (Int_t i=0; i<7; i++) stripYsize[i]=stripLength[3];  
369       for (Int_t i=0; i<7; i++) stripXsize[i]=stripWidth[2];
370       trigSegY[8]->Init(0,nStrip,stripYsize,stripXsize,0.);  
371       trigSegY[7]->Init(0,nStrip,stripYsize,stripXsize,0.);
372       trigSegY[1]->Init(0,nStrip,stripYsize,stripXsize,0.);
373       trigSegY[0]->Init(0,nStrip,stripYsize,stripXsize,0.);
374  
375       // chamber 7 6 2 1 cathode 0
376       for (Int_t i=0; i<6; i++) nStrip[i]=32;
377       nStrip[6]=16;  
378       for (Int_t i=0; i<6; i++) stripYsize[i]=stripWidth[1];
379       stripYsize[6]=stripWidth[2];
380       for (Int_t i=0; i<6; i++) stripXsize[i]=stripLength[1];
381       stripXsize[6]=stripLength[2];
382       trigSegX[7]->Init(0,nStrip,stripYsize,stripXsize,0.);  
383       trigSegX[6]->Init(0,nStrip,stripYsize,stripXsize,0.);
384       trigSegX[2]->Init(0,nStrip,stripYsize,stripXsize,0.);  
385       trigSegX[1]->Init(0,nStrip,stripYsize,stripXsize,0.);
386
387       // chamber 6 2 cathode 1
388       for (Int_t i=0; i<5; i++) nStrip[i]=16;
389       for (Int_t i=5; i<6; i++) nStrip[i]=8;
390       nStrip[6]=16;
391       for (Int_t i=0; i<7; i++) stripYsize[i]=stripLength[3];
392       for (Int_t i=0; i<5; i++) stripXsize[i]=stripWidth[1];
393       for (Int_t i=5; i<7; i++) stripXsize[i]=stripWidth[2];
394       trigSegY[6]->Init(0,nStrip,stripYsize,stripXsize,0.);  
395       trigSegY[2]->Init(0,nStrip,stripYsize,stripXsize,0.);  
396
397       // chamber 5 3 cathode 0
398       nStrip[0]=48;
399       for (Int_t i=1; i<3; i++) nStrip[i]=64;
400       for (Int_t i=3; i<6; i++) nStrip[i]=32;
401       nStrip[6]=16;  
402       for (Int_t i=0; i<3; i++) stripYsize[i]=stripWidth[0];
403       for (Int_t i=3; i<6; i++) stripYsize[i]=stripWidth[1];
404       stripYsize[6]=stripWidth[2];
405       for (Int_t i=0; i<6; i++) stripXsize[i]=stripLength[1];
406       stripXsize[6]=stripLength[2];
407       trigSegX[5]->Init(0,nStrip,stripYsize,stripXsize,stripLength[0]);  
408       trigSegX[3]->Init(0,nStrip,stripYsize,stripXsize,0.);
409
410       // chamber 5 3 cathode 1
411       for (Int_t i=0; i<5; i++) nStrip[i]=16;
412       for (Int_t i=5; i<6; i++) nStrip[5]=8;  
413       nStrip[6]=16;  
414       stripYsize[0]=stripLength[2];
415       for (Int_t i=1; i<7; i++) stripYsize[i]=stripLength[3];
416       for (Int_t i=0; i<5; i++) stripXsize[i]=stripWidth[1];
417       for (Int_t i=5; i<7; i++) stripXsize[i]=stripWidth[2];
418       trigSegY[5]->Init(0,nStrip,stripYsize,stripXsize,stripLength[0]);  
419       trigSegY[3]->Init(0,nStrip,stripYsize,stripXsize,0.);
420
421       // chamber 4 cathode 0
422       nStrip[0]=0;
423       for (Int_t i=1; i<3; i++) nStrip[i]=64;  
424       for (Int_t i=3; i<6; i++) nStrip[i]=32;  
425       nStrip[6]=16;
426       stripYsize[0]=0.;
427       for (Int_t i=1; i<3; i++) stripYsize[i]=stripWidth[0];
428       for (Int_t i=3; i<6; i++) stripYsize[i]=stripWidth[1];
429       stripYsize[6]=stripWidth[2];
430       stripXsize[0]=0;  
431       stripXsize[1]=stripLength[0];  
432       for (Int_t i=2; i<6; i++) stripXsize[i]=stripLength[1];
433       stripXsize[6]=stripLength[2];
434       trigSegX[4]->Init(0,nStrip,stripYsize,stripXsize,0.);  
435
436       // chamber 4 cathode 1
437       nStrip[0]=0;  
438       nStrip[1]=8;  
439       for (Int_t i=2; i<5; i++) nStrip[i]=16;
440       for (Int_t i=5; i<6; i++) nStrip[i]=8;
441       nStrip[6]=16;
442       stripYsize[0]=0.;  
443       for (Int_t i=1; i<7; i++) stripYsize[i]=stripLength[3];
444       stripXsize[0]=0.;
445       for (Int_t i=1; i<5; i++) stripXsize[i]=stripWidth[1];
446       for (Int_t i=5; i<7; i++) stripXsize[i]=stripWidth[2];
447       trigSegY[4]->Init(0,nStrip,stripYsize,stripXsize,0.);
448
449       const AliMUONGeometryModuleTransformer* kModuleTransformer 
450         = fkGeomTransformer->GetModuleTransformer(chamber);
451       
452       chamberSeg[0] = new AliMUONGeometrySegmentation(kModuleTransformer);
453       chamberSeg[1] = new AliMUONGeometrySegmentation(kModuleTransformer);
454
455       Int_t icount=chamber-10;  // chamber counter (0 1 2 3)
456       Int_t id0=(10+icount+1)*100;
457
458
459       //  printf("in CreateTriggerSegmentation here 0 id0=%i \n",id0);  
460       chamberSeg[0]->Add(id0+0,  "Undefined", trigSegX[4]);
461       chamberSeg[0]->Add(id0+1,  "Undefined", trigSegX[5]);
462       chamberSeg[0]->Add(id0+2,  "Undefined", trigSegX[6]);
463       chamberSeg[0]->Add(id0+3,  "Undefined", trigSegX[7]);
464       chamberSeg[0]->Add(id0+4,  "Undefined", trigSegX[8]);
465       chamberSeg[0]->Add(id0+5,  "Undefined", trigSegX[8]);
466       chamberSeg[0]->Add(id0+6,  "Undefined", trigSegX[7]);
467       chamberSeg[0]->Add(id0+7,  "Undefined", trigSegX[6]);
468       chamberSeg[0]->Add(id0+8,  "Undefined", trigSegX[5]);
469       chamberSeg[0]->Add(id0+9,  "Undefined", trigSegX[4]);
470       chamberSeg[0]->Add(id0+10, "Undefined", trigSegX[3]);
471       chamberSeg[0]->Add(id0+11, "Undefined", trigSegX[2]);
472       chamberSeg[0]->Add(id0+12, "Undefined", trigSegX[1]);
473       chamberSeg[0]->Add(id0+13, "Undefined", trigSegX[0]);
474       chamberSeg[0]->Add(id0+14, "Undefined", trigSegX[0]);
475       chamberSeg[0]->Add(id0+15, "Undefined", trigSegX[1]);
476       chamberSeg[0]->Add(id0+16, "Undefined", trigSegX[2]);
477       chamberSeg[0]->Add(id0+17, "Undefined", trigSegX[3]);
478
479       chamberSeg[1]->Add(id0+0,  "Undefined", trigSegY[4]);
480       chamberSeg[1]->Add(id0+1,  "Undefined", trigSegY[5]);
481       chamberSeg[1]->Add(id0+2,  "Undefined", trigSegY[6]);
482       chamberSeg[1]->Add(id0+3,  "Undefined", trigSegY[7]);
483       chamberSeg[1]->Add(id0+4,  "Undefined", trigSegY[8]);
484       chamberSeg[1]->Add(id0+5,  "Undefined", trigSegY[8]);
485       chamberSeg[1]->Add(id0+6,  "Undefined", trigSegY[7]);
486       chamberSeg[1]->Add(id0+7,  "Undefined", trigSegY[6]);
487       chamberSeg[1]->Add(id0+8,  "Undefined", trigSegY[5]);
488       chamberSeg[1]->Add(id0+9,  "Undefined", trigSegY[4]);
489       chamberSeg[1]->Add(id0+10, "Undefined", trigSegY[3]);
490       chamberSeg[1]->Add(id0+11, "Undefined", trigSegY[2]);
491       chamberSeg[1]->Add(id0+12, "Undefined", trigSegY[1]);
492       chamberSeg[1]->Add(id0+13, "Undefined", trigSegY[0]);
493       chamberSeg[1]->Add(id0+14, "Undefined", trigSegY[0]);
494       chamberSeg[1]->Add(id0+15, "Undefined", trigSegY[1]);
495       chamberSeg[1]->Add(id0+16, "Undefined", trigSegY[2]);
496       chamberSeg[1]->Add(id0+17, "Undefined", trigSegY[3]);
497
498       fSegmentation->AddModuleSegmentation(chamber, 0, chamberSeg[0]);
499       fSegmentation->AddModuleSegmentation(chamber, 1, chamberSeg[1]);
500   
501       //  printf("in CreateTriggerSegmentation here 1\n");  
502       if (!id0) {
503         AliWarning(Form("Segmentation for chamber %d is not yet defined",chamber));
504         return ;      
505       }
506     }
507 }
508
509 //__________________________________________________________________________
510 void AliMUONSegFactoryV3::Build(const AliMUONGeometryTransformer* geometry) 
511 {
512 /// Construct segmentation for all MUON stations
513 //
514
515   fkGeomTransformer = geometry;
516
517   // Build all stations
518   if (IsGeometryDefined(0))  BuildStation1();
519   if (IsGeometryDefined(2))  BuildStation2();
520   
521   AliMpExMap map1(kTRUE);
522   ReadDENames("denames_slat.dat", map1);
523   if (IsGeometryDefined(4))  BuildStation3(map1);
524   if (IsGeometryDefined(6))  BuildStation4(map1);
525   if (IsGeometryDefined(8))  BuildStation5(map1);
526
527   if (IsGeometryDefined(10)) BuildStation6();
528 }
529
530 //__________________________________________________________________________
531 void AliMUONSegFactoryV3::BuildStation(
532                                const AliMUONGeometryTransformer* geometry, 
533                                Int_t stationNumber) 
534 {
535 /// Construct segmentations for the given MUON station
536
537   fkGeomTransformer = geometry;
538
539   AliMpExMap map1(kTRUE);
540   ReadDENames("denames_slat.dat", map1);
541
542   switch (stationNumber) {    
543     case 1:  BuildStation1();     break;
544     case 2:  BuildStation2();     break;
545     case 3:  BuildStation3(map1); break;
546     case 4:  BuildStation4(map1); break;
547     case 5:  BuildStation5(map1); break;
548     case 6:  BuildStation6();     break;
549     
550     default: AliFatal("Wrong station number");
551   }  
552 }