]> git.uio.no Git - u/mrichter/AliRoot.git/blob - MUON/AliMUONSegFactory.cxx
Removing obsolete constants.
[u/mrichter/AliRoot.git] / MUON / AliMUONSegFactory.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 // --------------------------
23 // Class AliMUONSegFactory
24 // --------------------------
25 // New factory for building segmentations at all levels
26 // Authors: Ivana Hrivnacova, IPN Orsay
27
28 #include "AliMUONSegFactory.h"
29 #include "AliMUONConstants.h"
30 #include "AliMUONGeometryStore.h"
31 #include "AliMUONGeometryTransformer.h"
32 #include "AliMUONGeometryModule.h"
33 #include "AliMUONSegmentation.h"
34 #include "AliMUONGeometrySegmentation.h"
35 #include "AliMUONSt12QuadrantSegmentation.h"
36 #include "AliMUONSt345SlatSegmentation.h"
37 #include "AliMUONSt345SlatSegmentationV2.h"
38 #include "AliMUONTriggerSegmentation.h"
39 #include "AliMUONTriggerSegmentationV2.h"
40 #include "AliMUONTriggerConstants.h"
41
42 #include "AliMpDEManager.h"
43 #include "AliMpDEIterator.h"
44
45 #include "AliLog.h"
46
47 #include <Riostream.h>
48 #include <TSystem.h>
49 #include <TObjString.h>
50 #include <TMap.h>
51
52 /// \cond CLASSIMP
53 ClassImp(AliMUONSegFactory)
54 /// \endcond
55
56 //______________________________________________________________________________
57 AliMUONSegFactory::AliMUONSegFactory(const AliMUONGeometryTransformer* geometry)
58     : TObject(),
59       fMpSegFactory(),
60       fDESegmentations(),
61       fSegmentation(0),
62       fkTransformer(geometry)
63 {  
64 /// Standard constructor
65
66 }
67
68 //______________________________________________________________________________
69 AliMUONSegFactory::AliMUONSegFactory(const TString& volPathsFileName,
70                                      const TString& transformsFileName)
71     : TObject(),
72       fMpSegFactory(),
73       fDESegmentations(),
74       fSegmentation(0),
75       fkTransformer(0)
76 {  
77 /// Standard constructor
78
79   // Transformer
80   AliMUONGeometryTransformer* transformer = new AliMUONGeometryTransformer(true);
81   transformer->ReadGeometryData(volPathsFileName, transformsFileName);
82   fkTransformer = transformer;  
83 }
84
85 //______________________________________________________________________________
86   AliMUONSegFactory::AliMUONSegFactory()
87     : TObject(),      
88       fMpSegFactory(),
89       fDESegmentations(),
90       fSegmentation(0),
91       fkTransformer(0)
92 {
93 /// Default constructor
94 }
95
96 //______________________________________________________________________________
97
98 AliMUONSegFactory::~AliMUONSegFactory()
99 {
100 /// Destructor
101
102   //delete fSegmentation;
103         // The segmentation is supposed to be deleted in the client code
104 }
105
106 //
107 // Private methods
108 //
109
110 //______________________________________________________________________________
111 Bool_t AliMUONSegFactory::IsGeometryDefined(Int_t ichamber)
112 {
113 /// Return true, if det elements for the chamber with the given ichamber Id
114 /// are defined in geometry (the geometry builder for this chamber was activated)
115
116   if ( ! fkTransformer ||
117        ! fkTransformer->GetModuleTransformer(ichamber, false) )
118        
119     return kFALSE;
120   
121   return kTRUE;
122 }  
123
124 //__________________________________________________________________________
125 AliMUONSegmentation* AliMUONSegFactory::Segmentation()
126
127 /// Return the segmentation container, create it if it does not yet exist
128
129   if ( ! fSegmentation ) 
130     fSegmentation = new AliMUONSegmentation(AliMUONConstants::NCh());
131
132   return fSegmentation; 
133 }
134
135 //
136 // public methods
137 //
138
139 //______________________________________________________________________________
140 AliMpVSegmentation* 
141 AliMUONSegFactory::CreateMpSegmentation(Int_t detElemId, Int_t cath)
142 {
143 /// Create mapping segmentation for given detElemId and cath
144 /// using mapping manager
145
146   AliMpVSegmentation* mpSegmentation 
147     = fMpSegFactory.CreateMpSegmentation(detElemId, cath);
148
149   Segmentation()->AddMpSegmentation(mpSegmentation);
150   
151   return mpSegmentation;
152
153     
154 //______________________________________________________________________________
155 AliMUONVGeometryDESegmentation*  
156 AliMUONSegFactory::CreateDESegmentation(Int_t detElemId, Int_t cath)
157
158 /// Create DE segmentation, operating in local DE reference frame
159
160   // Check detElemId & cath  
161   if ( ! AliMpDEManager::IsValid(detElemId, cath, true) ) return 0;
162   
163   // Check if transformer is defined
164   if ( ! fkTransformer) {
165     AliErrorStream() << "Geometry transformer not defined" << endl;
166     return 0;
167   }  
168
169   // Only return it, if DE segmentation for this detElemId and cath
170   // was already defined
171   //
172   const AliMUONVGeometryDESegmentation* kdeSegmentation
173     = Segmentation()->GetDESegmentation(detElemId, cath, false);
174   if ( kdeSegmentation ) 
175     return const_cast<AliMUONVGeometryDESegmentation*>(kdeSegmentation);
176   
177   // Get module, create it if it does not exist 
178   //
179   Int_t moduleId = AliMUONGeometryStore::GetModuleId(detElemId);               
180   AliMUONGeometrySegmentation* moduleSegmentation
181     = Segmentation()->GetModuleSegmentation(moduleId, cath, false);
182   if (! moduleSegmentation) {
183     moduleSegmentation 
184       = new AliMUONGeometrySegmentation(
185                fkTransformer->GetModuleTransformer(moduleId));
186     Segmentation()->AddModuleSegmentation(moduleId, cath, moduleSegmentation);
187   }        
188    
189   // Get DE segmentation for this DE type, create it if it does not exist 
190   // 
191   AliMUONVGeometryDESegmentation* deSegmentation = 0;
192   TString deName = AliMpDEManager::GetDEName(detElemId, cath);
193   TObject* objSegmentation = fDESegmentations.Get(deName);
194   if ( objSegmentation ) 
195     deSegmentation = (AliMUONVGeometryDESegmentation*)objSegmentation;  
196     
197   if ( !deSegmentation ) {
198
199     // Get/Create mapping segmentation via mapping manager
200     AliMpVSegmentation* mpSegmentation 
201       = CreateMpSegmentation(detElemId, cath);
202  
203     AliMpStationType stationType = AliMpDEManager::GetStationType(detElemId);
204     AliMpPlaneType planeType = AliMpDEManager::GetPlaneType(detElemId, cath);
205     
206     switch (stationType) {
207
208       case kStation1:
209       case kStation2:
210         deSegmentation = new AliMUONSt12QuadrantSegmentation(
211                                  mpSegmentation, stationType, planeType);
212         //cout << "   new AliMUONSt12QuadrantSegmentation "
213         //     << StationTypeName(stationType) << "  "  
214         //     << PlaneTypeName(planeType) << "  "
215         //     << deName << endl;
216                                           
217         break;
218         
219       case kStation345:                   
220         deSegmentation = new AliMUONSt345SlatSegmentationV2(
221                                  mpSegmentation, detElemId, planeType); 
222         //cout << "   new AliMUONSt345SlatSegmentationV2 "                        
223         //     << StationTypeName(stationType) << "  "  
224         //     << PlaneTypeName(planeType) << "  "
225         //     << deName << endl;                                 
226         break;
227     
228       case kStationTrigger:               
229         deSegmentation = new AliMUONTriggerSegmentationV2(
230                                  mpSegmentation, detElemId, planeType); 
231         //cout << "   new AliMUONTriggerSegmentationV2 "                          
232         //     << StationTypeName(stationType) << "  "  
233         //     << PlaneTypeName(planeType) << "  "                        
234         //     << deName << endl;                                 
235         break;
236     }
237     
238     // Map new DE segmentation
239     fDESegmentations.Add(deName, deSegmentation);
240     Segmentation()->AddDESegmentation(deSegmentation);
241   }
242   
243   // Add  DE segmentation to module
244   //
245   moduleSegmentation->Add(detElemId, deName, deSegmentation);  
246   
247   return deSegmentation;
248 }        
249   
250
251 //______________________________________________________________________________
252 AliMUONGeometrySegmentation*  
253 AliMUONSegFactory::CreateModuleSegmentation(Int_t moduleId, Int_t cath)
254
255 /// Create module segmentation, operating in global reference frame
256 /// Detection elements are defined via DE names map.
257
258   // Check cathod & module Id 
259   if ( ! AliMpDEManager::IsValidCathod(cath, true) || 
260        ! AliMpDEManager::IsValidModuleId(moduleId, true) ) return 0;
261
262   AliMpDEIterator it;
263   for ( it.First(moduleId); ! it.IsDone(); it.Next() )
264     CreateDESegmentation(it.CurrentDE(), cath);
265   
266   return Segmentation()->GetModuleSegmentation(moduleId, cath);  
267 }  
268     
269 //______________________________________________________________________________
270 AliMUONSegmentation*  
271 AliMUONSegFactory::CreateSegmentation(const TString& option)
272 {
273 /// Create segmentations on all levels and return their container.
274
275   // Check options
276   if ( option != "default"   && 
277        option != "FactoryV2" && 
278        option != "FactoryV3" &&
279        option != "FactoryV4" &&
280        option != "new") {
281
282     AliErrorStream() << "Option " << option << " not defined." << endl;
283     return 0;
284   }         
285  
286   if ( option == "FactoryV2" ) { 
287     // Default segmentation version
288     for (Int_t moduleId = 0; moduleId<4; moduleId++)
289       for (Int_t cath = 0; cath < 2; cath++) {
290         if ( IsGeometryDefined(moduleId) ) 
291           CreateModuleSegmentation( moduleId, cath);
292     }
293     if ( IsGeometryDefined(4) )  BuildStation3();
294     if ( IsGeometryDefined(6) )  BuildStation4();
295     if ( IsGeometryDefined(8) )  BuildStation5();
296     if ( IsGeometryDefined(10))  BuildStation6();
297   }      
298        
299   if ( option == "FactoryV3" ) { 
300     // New slat segmentation
301     for (Int_t moduleId = 0; moduleId<10; moduleId++)
302       for (Int_t cath = 0; cath < 2; cath++) {
303         if ( IsGeometryDefined(moduleId) )
304            CreateModuleSegmentation( moduleId, cath);
305     }
306     if ( IsGeometryDefined(10) ) BuildStation6();
307   }      
308       
309   if (option == "default" || option == "new" || option == "FactoryV4" ) {    
310
311     for (Int_t moduleId = 0; moduleId<AliMUONConstants::NCh(); moduleId++)
312       for (Int_t cath = 0; cath < 2; cath++) {
313         if ( IsGeometryDefined(moduleId) )
314           CreateModuleSegmentation( moduleId, cath);
315     }
316   }
317   return Segmentation();
318 }
319
320 //
321 //  Functions for building old segmentations (not based on mapping)
322 // 
323        
324 //__________________________________________________________________________
325 void AliMUONSegFactory::BuildStation3() 
326 {
327 /// Configuration for Chamber TC5/6  (Station 3) ----------          
328
329   AliMUONGeometrySegmentation* segmentation[2];
330
331   //Slats Segmentations
332   AliMUONSt345SlatSegmentation *slatsegB[4]; // Types of segmentation for St3
333   AliMUONSt345SlatSegmentation *slatsegNB[4]; 
334   // Bending
335
336   Int_t ndiv[4] ={ 4, 4, 2, 1};  // densities zones 
337   for(Int_t i=0; i<4; i++) {
338     slatsegB[i] = new AliMUONSt345SlatSegmentation(1);
339     Segmentation()->AddDESegmentation(slatsegB[i]);  
340     slatsegB[i]->SetPadSize(10.,0.5);
341     slatsegB[i]->SetPadDivision(ndiv);
342     slatsegB[i]->SetId(1); // Id elt ????
343     slatsegB[i]->SetDAnod(AliMUONConstants::Pitch());
344     slatsegNB[i] = new AliMUONSt345SlatSegmentation(0);
345     Segmentation()->AddDESegmentation(slatsegNB[i]);  
346     slatsegNB[i]->SetPadSize(1./1.4,10.); // Nbending
347     slatsegNB[i]->SetPadDivision(ndiv);
348     slatsegNB[i]->SetId(1);
349     slatsegNB[i]->SetDAnod(AliMUONConstants::Pitch());
350   }
351
352   // Type 112200 for 500, 501, 508, 509, 510, 517 
353   // in Ch5 (similar for Ch6) for the futur official numbering
354   // Type 112200 for 503, 504, 505, 555, 554, 553 
355   // in Ch5 (similar for Ch6) actual numbering in the code to be changed in jan05
356   Int_t n0[4] = { 0, 2, 2, 0 };
357   slatsegB[0]->SetPcbBoards(n0);
358   slatsegB[0]->Init(0);
359   slatsegNB[0]->SetPcbBoards(n0);
360   slatsegNB[0]->Init(0);
361     
362   // Type 122200 for 502, 507, 511, 516 (similar in Ch6) 
363   // for future official numbering of ALICE
364   // Type 122200 for 502, 506, 556, 552 (similiarin Ch6) 
365   // for actual numbering in muon code to be changed in jan05
366   Int_t n1[4] = { 0, 1, 3, 0 }; 
367   slatsegB[1]->SetPcbBoards(n1);
368   slatsegB[1]->Init(0); 
369   slatsegNB[1]->SetPcbBoards(n1);
370   slatsegNB[1]->Init(0); 
371     
372   // Type 222000 for 503, 506, 512, 515 (similar in Ch6) 
373   // for future official numbering of ALICE
374   // Type 222000 for 501, 507, 557, 551 (similiarin Ch6) 
375   // for actual numbering in muon code to be changed in jan05
376   Int_t n2[4] = { 0, 0, 3, 0 };
377   slatsegB[2]->SetPcbBoards(n2);
378   slatsegB[2]->Init(0);
379   slatsegNB[2]->SetPcbBoards(n2);
380   slatsegNB[2]->Init(0);
381     
382   // Type 220000 for 504, 505, 513, 514 (similar in Ch6) 
383   // for future official numbering of ALICE
384   // Type 220000 for 500, 508, 558, 550 (similiarin Ch6) 
385   // for actual numbering in muon code to be changed in jan05
386   Int_t n3[4] = { 0, 0, 2, 0 };
387   slatsegB[3]->SetPcbBoards(n3);
388   slatsegB[3]->Init(0); 
389   slatsegNB[3]->SetPcbBoards(n3);
390   slatsegNB[3]->Init(0); 
391
392   for (Int_t chamber = 4; chamber < 6; chamber++) {
393
394     const AliMUONGeometryModuleTransformer* kModuleTransformer 
395       = fkTransformer->GetModuleTransformer(chamber);
396       
397     segmentation[0] = new AliMUONGeometrySegmentation(kModuleTransformer);
398     segmentation[1] = new AliMUONGeometrySegmentation(kModuleTransformer);
399         
400     // id detection elt for chamber 1
401     Int_t id0 = (chamber+1)*100;
402
403     // cathode 0
404     // type 220000
405     segmentation[0]->Add(id0+14, "Undefined", slatsegB[3]);
406     segmentation[0]->Add(id0+ 4, "Undefined", slatsegB[3]);  
407     segmentation[0]->Add(id0+13, "Undefined", slatsegB[3]);  
408     segmentation[0]->Add(id0+ 5, "Undefined", slatsegB[3]);
409     // type 222000
410     segmentation[0]->Add(id0+15, "Undefined", slatsegB[2]);
411     segmentation[0]->Add(id0+ 3, "Undefined", slatsegB[2]);  
412     segmentation[0]->Add(id0+12, "Undefined", slatsegB[2]);  
413     segmentation[0]->Add(id0+ 6, "Undefined", slatsegB[2]);
414     // type 122200
415     segmentation[0]->Add(id0+16, "Undefined", slatsegB[1]);
416     segmentation[0]->Add(id0+ 2, "Undefined", slatsegB[1]);  
417     segmentation[0]->Add(id0+11, "Undefined", slatsegB[1]);  
418     segmentation[0]->Add(id0+ 7, "Undefined", slatsegB[1]);
419     // type 112200
420     segmentation[0]->Add(id0+17, "Undefined", slatsegB[0]);
421     segmentation[0]->Add(id0,    "Undefined", slatsegB[0]);  
422     segmentation[0]->Add(id0+ 1, "Undefined", slatsegB[0]);  
423     segmentation[0]->Add(id0+10, "Undefined", slatsegB[0]);
424     segmentation[0]->Add(id0+ 9, "Undefined", slatsegB[0]);     
425     segmentation[0]->Add(id0+ 8, "Undefined", slatsegB[0]);
426     Segmentation()->AddModuleSegmentation(chamber, 0, segmentation[0]);   
427
428     // cathode 1
429     // type 220000
430     segmentation[1]->Add(id0+14, "Undefined", slatsegNB[3]);
431     segmentation[1]->Add(id0+ 4, "Undefined", slatsegNB[3]);  
432     segmentation[1]->Add(id0+13, "Undefined", slatsegNB[3]);  
433     segmentation[1]->Add(id0+ 5, "Undefined", slatsegNB[3]);
434     // type 222000
435     segmentation[1]->Add(id0+15, "Undefined", slatsegNB[2]);
436     segmentation[1]->Add(id0+ 3, "Undefined", slatsegNB[2]);  
437     segmentation[1]->Add(id0+12, "Undefined", slatsegNB[2]);  
438     segmentation[1]->Add(id0+ 6, "Undefined", slatsegNB[2]);
439     // type 122200
440     segmentation[1]->Add(id0+16, "Undefined", slatsegNB[1]);
441     segmentation[1]->Add(id0+ 2, "Undefined", slatsegNB[1]);  
442     segmentation[1]->Add(id0+11, "Undefined", slatsegNB[1]);  
443     segmentation[1]->Add(id0+ 7, "Undefined", slatsegNB[1]);
444     // type 112200
445     segmentation[1]->Add(id0+17, "Undefined", slatsegNB[0]);
446     segmentation[1]->Add(id0,    "Undefined", slatsegNB[0]);  
447     segmentation[1]->Add(id0+ 1, "Undefined", slatsegNB[0]);  
448     segmentation[1]->Add(id0+10, "Undefined", slatsegNB[0]);
449     segmentation[1]->Add(id0+ 9, "Undefined", slatsegNB[0]);     
450     segmentation[1]->Add(id0+ 8, "Undefined", slatsegNB[0]);
451     Segmentation()->AddModuleSegmentation(chamber, 1, segmentation[1]);   
452   }
453 }
454
455 //__________________________________________________________________________
456 void AliMUONSegFactory::BuildStation4() 
457 {
458 /// Configuration for Chamber TC7/8  (Station 4) ----------           
459
460   AliMUONGeometrySegmentation* segmentation[2];
461
462   //Slats Segmentations
463   AliMUONSt345SlatSegmentation *slatsegB[7]; // Types of segmentation for St4
464   AliMUONSt345SlatSegmentation *slatsegNB[7]; 
465   // Bending
466
467   Int_t ndiv[4] ={ 4, 4, 2, 1};  // densities zones 
468   for(Int_t i = 0; i < 7; i++) {
469     slatsegB[i] = new AliMUONSt345SlatSegmentation(1);
470     Segmentation()->AddDESegmentation(slatsegB[i]);  
471     slatsegB[i]->SetPadSize(10.,0.5);
472     slatsegB[i]->SetPadDivision(ndiv);
473     slatsegB[i]->SetId(1);
474     slatsegB[i]->SetDAnod(AliMUONConstants::Pitch());
475     slatsegNB[i] = new AliMUONSt345SlatSegmentation(0);
476     Segmentation()->AddDESegmentation(slatsegNB[i]);  
477     slatsegNB[i]->SetPadSize(1./1.4,10.); 
478     slatsegNB[i]->SetPadDivision(ndiv);
479     slatsegNB[i]->SetId(1);
480     slatsegNB[i]->SetDAnod(AliMUONConstants::Pitch());
481   }
482
483   Int_t n4[4] = { 0, 1, 2, 2 };
484   slatsegB[0]->SetPcbBoards(n4);
485   slatsegB[0]->Init(0); // 0 detection element id
486   slatsegNB[0]->SetPcbBoards(n4);
487   slatsegNB[0]->Init(0); // 0 detection element id
488     
489   // Type 112233 for 701, 712, 714, 725 in Ch7 (similar for Ch8) 
490   // for the futur official numbering
491   // Type 112233 for 705, 707, 755, 757 in Ch7 (similar for Ch8) 
492   // actual numbering in the code to be changed in jan05
493   // Type 112233 for 901, 902, 911, 912, 914, 915, 924, 925 in Ch9 
494   // (similar for Ch10) for the futur official numbering
495   // Type 112233 for 904, 905, 907, 908, 954, 955, 957, 958 in Ch9 
496   // (similar for Ch10) actual numbering in the code to be changed in jan05
497   Int_t n5[4] = { 0, 2, 2, 2 };
498   slatsegB[1]->SetPcbBoards(n5);
499   slatsegB[1]->Init(0); // 0 detection element id
500   slatsegNB[1]->SetPcbBoards(n5);
501   slatsegNB[1]->Init(0); // 0 detection element id
502     
503   // Type 112230 for 702, 711, 715, 724 in Ch7 (similar for Ch8) 
504   // for the futur official numbering
505   // Type 112230 for 704, 708, 754, 758 in Ch7 (similar for Ch8) 
506   // actual numbering in the code to be changed in jan05
507   Int_t n6[4] = { 0, 2, 2, 1 };
508   slatsegB[2]->SetPcbBoards(n6);
509   slatsegB[2]->Init(0); // 0 detection element id
510   slatsegNB[2]->SetPcbBoards(n6);
511   slatsegNB[2]->Init(0); // 0 detection element id
512     
513   // Type 222330 for 703, 710, 716, 723 in Ch7 (similar for Ch8) 
514   // for the futur official numbering
515   // Type 222330 for 703, 709, 753, 759 in Ch7 (similar for Ch8) 
516   // actual numbering in the code to be changed in jan05
517   Int_t n7[4] = { 0, 0, 3, 2 };
518   slatsegB[3]->SetPcbBoards(n7);
519   slatsegB[3]->Init(0); // 0 detection element id
520   slatsegNB[3]->SetPcbBoards(n7);
521   slatsegNB[3]->Init(0); // 0 detection element id
522     
523   // Type 223300 for 704, 709, 717, 722 in Ch7 (similar for Ch8) 
524   // for the futur official numbering
525   // Type 223300 for 702, 710, 752, 760 in Ch7 (similar for Ch8) 
526   // actual numbering in the code to be changed in jan05
527   Int_t n8[4] = { 0, 0, 2, 2 };
528   slatsegB[4]->SetPcbBoards(n8);
529   slatsegB[4]->Init(0); // 0 detection element id
530   slatsegNB[4]->SetPcbBoards(n8);
531   slatsegNB[4]->Init(0); // 0 detection element id
532     
533   // Type 333000 for 705, 708, 718, 721 in Ch7 (similar for Ch8) 
534   // for the futur official numbering
535   // Type 333000 for 701, 711, 751, 761 in Ch7 (similar for Ch8) 
536   // actual numbering in the code to be changed in jan05
537   // Type 333000 for 906, 907, 919, 920 in Ch9 (similar for Ch10) 
538   // for the futur official numbering
539   // Type 333000 for 900, 912, 950, 962 in Ch9 (similar for Ch10) 
540   // actual numbering in the code to be changed in jan05
541   Int_t n9[4] = { 0, 0, 0, 3 };
542   slatsegB[5]->SetPcbBoards(n9);
543   slatsegB[5]->Init(0); // 0 detection element id
544   slatsegNB[5]->SetPcbBoards(n9);
545   slatsegNB[5]->Init(0); // 0 detection element id
546     
547   // Type 330000 for 706, 707, 719, 720 in Ch7 (similar for Ch8) 
548   // for the futur official numbering
549   // Type 330000 for 700, 712, 750, 762 in Ch7 (similar for Ch8) 
550   // actual numbering in the code to be changed in jan05
551   Int_t n10[4] = { 0, 0, 0, 2 };
552   slatsegB[6]->SetPcbBoards(n10);
553   slatsegB[6]->Init(0); // 0 detection element id
554   slatsegNB[6]->SetPcbBoards(n10);
555   slatsegNB[6]->Init(0); // 0 detection element id
556
557
558   for (Int_t chamber = 6; chamber < 8; chamber++) {
559
560     const AliMUONGeometryModuleTransformer* kModuleTransformer 
561       = fkTransformer->GetModuleTransformer(chamber);
562       
563     segmentation[0] = new AliMUONGeometrySegmentation(kModuleTransformer);
564     segmentation[1] = new AliMUONGeometrySegmentation(kModuleTransformer);
565         
566     // id detection elt for chamber 1
567     Int_t id0 = (chamber+1)*100;
568
569     //--------------------------------------------------------
570     // Configuration for Chamber TC6/7  (Station 4) ----------           
571
572     // cathode 0
573     // type 122330
574     segmentation[0]->Add(id0+13, "Undefined", slatsegB[0]);
575     segmentation[0]->Add(id0   , "Undefined", slatsegB[0]);
576   
577     // type 112233
578     segmentation[0]->Add(id0+14, "Undefined", slatsegB[1]);
579     segmentation[0]->Add(id0+12, "Undefined", slatsegB[1]);  
580     segmentation[0]->Add(id0+25, "Undefined", slatsegB[1]);  
581     segmentation[0]->Add(id0+ 1, "Undefined", slatsegB[1]);
582    
583     // type 112230
584     segmentation[0]->Add(id0+15, "Undefined", slatsegB[2]);
585     segmentation[0]->Add(id0+11, "Undefined", slatsegB[2]);  
586     segmentation[0]->Add(id0+24, "Undefined", slatsegB[2]);  
587     segmentation[0]->Add(id0+ 2, "Undefined", slatsegB[2]);
588
589     // type 222330 
590     segmentation[0]->Add(id0+16, "Undefined", slatsegB[3]);
591     segmentation[0]->Add(id0+10, "Undefined", slatsegB[3]);  
592     segmentation[0]->Add(id0+23, "Undefined", slatsegB[3]);
593     segmentation[0]->Add(id0+ 3, "Undefined", slatsegB[3]);
594
595     // type 223300 
596     segmentation[0]->Add(id0+17, "Undefined", slatsegB[4]);
597     segmentation[0]->Add(id0+ 9, "Undefined", slatsegB[4]);  
598     segmentation[0]->Add(id0+22, "Undefined", slatsegB[4]);
599     segmentation[0]->Add(id0+ 4, "Undefined", slatsegB[4]);
600
601     // type 333000 
602     segmentation[0]->Add(id0+18, "Undefined", slatsegB[5]);
603     segmentation[0]->Add(id0+ 8, "Undefined", slatsegB[5]);  
604     segmentation[0]->Add(id0+21, "Undefined", slatsegB[5]);
605     segmentation[0]->Add(id0+ 5, "Undefined", slatsegB[5]);
606
607     // type 330000 
608     segmentation[0]->Add(id0+19, "Undefined", slatsegB[6]);
609     segmentation[0]->Add(id0+ 7, "Undefined", slatsegB[6]);  
610     segmentation[0]->Add(id0+20, "Undefined", slatsegB[6]);
611     segmentation[0]->Add(id0+ 6, "Undefined", slatsegB[6]);
612     Segmentation()->AddModuleSegmentation(chamber, 0, segmentation[0]);   
613
614     // cathode 1
615     // type 122330
616     segmentation[1]->Add(id0+13, "Undefined", slatsegNB[0]);
617     segmentation[1]->Add(id0   , "Undefined", slatsegNB[0]);
618
619     // type 112233
620     segmentation[1]->Add(id0+14, "Undefined", slatsegNB[1]);
621     segmentation[1]->Add(id0+12, "Undefined", slatsegNB[1]);  
622     segmentation[1]->Add(id0+25, "Undefined", slatsegNB[1]);  
623     segmentation[1]->Add(id0+ 1, "Undefined", slatsegNB[1]);
624   
625     // type 112230
626     segmentation[1]->Add(id0+15, "Undefined", slatsegNB[2]);
627     segmentation[1]->Add(id0+11, "Undefined", slatsegNB[2]);  
628     segmentation[1]->Add(id0+24, "Undefined", slatsegNB[2]);  
629     segmentation[1]->Add(id0+ 2, "Undefined", slatsegNB[2]);
630
631     // type 222330 
632     segmentation[1]->Add(id0+16, "Undefined", slatsegNB[3]);
633     segmentation[1]->Add(id0+10, "Undefined", slatsegNB[3]);  
634     segmentation[1]->Add(id0+23, "Undefined", slatsegNB[3]);
635     segmentation[1]->Add(id0+ 3, "Undefined", slatsegNB[3]);
636
637     // type 223300 
638     segmentation[1]->Add(id0+17, "Undefined", slatsegNB[4]);
639     segmentation[1]->Add(id0+ 9, "Undefined", slatsegNB[4]);  
640     segmentation[1]->Add(id0+22, "Undefined", slatsegNB[4]);
641     segmentation[1]->Add(id0+ 4, "Undefined", slatsegNB[4]);
642
643     // type 333000 
644     segmentation[1]->Add(id0+18, "Undefined", slatsegNB[5]);
645     segmentation[1]->Add(id0+ 8, "Undefined", slatsegNB[5]);  
646     segmentation[1]->Add(id0+21, "Undefined", slatsegNB[5]);
647     segmentation[1]->Add(id0+ 5, "Undefined", slatsegNB[5]);
648
649     // type 330000 
650     segmentation[1]->Add(id0+19, "Undefined", slatsegNB[6]);
651     segmentation[1]->Add(id0+ 7, "Undefined", slatsegNB[6]);  
652     segmentation[1]->Add(id0+20, "Undefined", slatsegNB[6]);
653     segmentation[1]->Add(id0+ 6, "Undefined", slatsegNB[6]);
654     Segmentation()->AddModuleSegmentation(chamber, 1, segmentation[1]);   
655   }
656 }
657
658 //__________________________________________________________________________
659 void AliMUONSegFactory::BuildStation5() 
660 {       
661 /// Configuration for Chamber TC9/10  (Station 5) ---------           
662
663   AliMUONGeometrySegmentation* segmentation[2];
664
665   //Slats Segmentations
666   AliMUONSt345SlatSegmentation *slatsegB[6]; // Types of segmentation for St5
667   AliMUONSt345SlatSegmentation *slatsegNB[6]; 
668   // Bending
669
670   Int_t ndiv[4] ={ 4, 4, 2, 1};  // densities zones 
671   for(Int_t i = 0; i < 6; i++) {
672     slatsegB[i] = new AliMUONSt345SlatSegmentation(1);
673     Segmentation()->AddDESegmentation(slatsegB[i]);  
674     slatsegB[i]->SetPadSize(10.,0.5);
675     slatsegB[i]->SetPadDivision(ndiv);
676     slatsegB[i]->SetId(1);
677     slatsegB[i]->SetDAnod(AliMUONConstants::Pitch());
678     slatsegNB[i] = new AliMUONSt345SlatSegmentation(0);
679     Segmentation()->AddDESegmentation(slatsegNB[i]);  
680     slatsegNB[i]->SetPadSize(1./1.4,10.); 
681     slatsegNB[i]->SetPadDivision(ndiv);
682     slatsegNB[i]->SetId(1);
683     slatsegNB[i]->SetDAnod(AliMUONConstants::Pitch());
684   }
685
686   // Type 122330 for 900, 913 in Ch9 (similar for Ch10) 
687   // for the futur official numbering
688   // Type 122330 for 906, 956 in Ch9 (similar for Ch10) 
689   // actual numbering in the code to be changed in jan05
690   Int_t n4[4] = { 0, 1, 2, 2 };
691   slatsegB[0]->SetPcbBoards(n4);
692   slatsegB[0]->Init(0); // 0 detection element id
693   slatsegNB[0]->SetPcbBoards(n4);
694   slatsegNB[0]->Init(0); // 0 detection element id
695     
696   // Type 112233 for 901, 902, 911, 912, 914, 915, 924, 925 in Ch9 
697   // (similar for Ch10) for the futur official numbering
698   // Type 112233 for 904, 905, 907, 908, 954, 955, 957, 958 in Ch9 
699   // (similar for Ch10) actual numbering in the code to be changed in jan05
700   Int_t n5[4] = { 0, 2, 2, 2 };
701   slatsegB[1]->SetPcbBoards(n5);
702   slatsegB[1]->Init(0); // 0 detection element id
703   slatsegNB[1]->SetPcbBoards(n5);
704   slatsegNB[1]->Init(0); // 0 detection element id
705
706   // Type 333000 for 906, 907, 919, 920 in Ch9 (similar for Ch10) 
707   // for the futur official numbering
708   // Type 333000 for 900, 912, 950, 962 in Ch9 (similar for Ch10) 
709   // actual numbering in the code to be changed in jan05
710   Int_t n9[4] = { 0, 0, 0, 3 };
711   slatsegB[2]->SetPcbBoards(n9);
712   slatsegB[2]->Init(0); // 0 detection element id
713   slatsegNB[2]->SetPcbBoards(n9);
714   slatsegNB[2]->Init(0); // 0 detection element id
715
716   // Type 222333 for 903, 910, 916, 923 in Ch9 (similar for Ch10) 
717   // for the futur official numbering
718   // Type 222333 for 903, 909, 953, 959 in Ch9 (similar for Ch10) 
719   // actual numbering in the code to be changed in jan05
720   Int_t n11[4] = { 0, 0, 3, 3 };
721   slatsegB[3]->SetPcbBoards(n11);
722   slatsegB[3]->Init(0); // 0 detection element id
723   slatsegNB[3]->SetPcbBoards(n11);
724   slatsegNB[3]->Init(0); // 0 detection element id
725   
726   // Type 223330 for 904, 909, 917, 922 in Ch9 (similar for Ch10) 
727   // for the futur official numbering
728   // Type 223330 for 902, 910, 952, 960 in Ch9 (similar for Ch10) 
729   // actual numbering in the code to be changed in jan05
730   Int_t n12[4] = { 0, 0, 2, 3 };
731   slatsegB[4]->SetPcbBoards(n12);
732   slatsegB[4]->Init(0); // 0 detection element id
733   slatsegNB[4]->SetPcbBoards(n12);
734   slatsegNB[4]->Init(0); // 0 detection element id
735     
736   // Type 333300 for 905, 908, 918, 921 in Ch9 (similar for Ch10) 
737   // for the futur official numbering
738   // Type 333300 for 901, 911, 951, 961 in Ch9 (similar for Ch10) 
739   // actual numbering in the code to be changed in jan05
740   Int_t n13[4] = { 0, 0, 0, 4 };
741   slatsegB[5]->SetPcbBoards(n13);
742   slatsegB[5]->Init(0); // 0 detection element id
743   slatsegNB[5]->SetPcbBoards(n13);
744   slatsegNB[5]->Init(0); // 0 detection element id
745
746   for (Int_t chamber = 8; chamber < 10; chamber++) {
747
748     const AliMUONGeometryModuleTransformer* kModuleTransformer 
749       = fkTransformer->GetModuleTransformer(chamber);
750       
751     segmentation[0] = new AliMUONGeometrySegmentation(kModuleTransformer);
752     segmentation[1] = new AliMUONGeometrySegmentation(kModuleTransformer);
753
754     // id detection elt for chamber 1
755     Int_t id0 = (chamber+1)*100;
756
757     //--------------------------------------------------------
758     // Configuration for Chamber TC8/9  (Station 5) ----------           
759
760     // cathode 0
761     // type 122330
762     segmentation[0]->Add(id0+13, "Undefined", slatsegB[0]);
763     segmentation[0]->Add(id0   , "Undefined", slatsegB[0]);
764   
765     // type 112233
766     segmentation[0]->Add(id0+15, "Undefined", slatsegB[1]);
767     segmentation[0]->Add(id0+14, "Undefined", slatsegB[1]);
768     segmentation[0]->Add(id0+12, "Undefined", slatsegB[1]);  
769     segmentation[0]->Add(id0+11, "Undefined", slatsegB[1]);  
770     segmentation[0]->Add(id0+24, "Undefined", slatsegB[1]);  
771     segmentation[0]->Add(id0+25, "Undefined", slatsegB[1]);  
772     segmentation[0]->Add(id0+ 1, "Undefined", slatsegB[1]);
773     segmentation[0]->Add(id0+ 2, "Undefined", slatsegB[1]);
774
775     // type 333000 
776     segmentation[0]->Add(id0+19, "Undefined", slatsegB[2]);
777     segmentation[0]->Add(id0+ 7, "Undefined", slatsegB[2]);  
778     segmentation[0]->Add(id0+20, "Undefined", slatsegB[2]);
779     segmentation[0]->Add(id0+ 6, "Undefined", slatsegB[2]);
780  
781     // type 222333 
782     segmentation[0]->Add(id0+16, "Undefined", slatsegB[3]);
783     segmentation[0]->Add(id0+10, "Undefined", slatsegB[3]);  
784     segmentation[0]->Add(id0+23, "Undefined", slatsegB[3]);
785     segmentation[0]->Add(id0+ 3, "Undefined", slatsegB[3]);
786  
787     // type 223330 
788     segmentation[0]->Add(id0+17, "Undefined", slatsegB[4]);
789     segmentation[0]->Add(id0+ 9, "Undefined", slatsegB[4]);  
790     segmentation[0]->Add(id0+22, "Undefined", slatsegB[4]);
791     segmentation[0]->Add(id0+ 4, "Undefined", slatsegB[4]);
792   
793     // type 333300 
794     segmentation[0]->Add(id0+18, "Undefined", slatsegB[5]);
795     segmentation[0]->Add(id0+ 8, "Undefined", slatsegB[5]);  
796     segmentation[0]->Add(id0+21, "Undefined", slatsegB[5]);
797     segmentation[0]->Add(id0+ 5, "Undefined", slatsegB[5]);
798     Segmentation()->AddModuleSegmentation(chamber, 0, segmentation[0]);   
799
800     // cathode 1
801     // type 122330
802     segmentation[1]->Add(id0+13, "Undefined", slatsegNB[0]);
803     segmentation[1]->Add(id0   , "Undefined", slatsegNB[0]);
804   
805     // type 112233
806     segmentation[1]->Add(id0+15, "Undefined", slatsegNB[1]);
807     segmentation[1]->Add(id0+14, "Undefined", slatsegNB[1]);
808     segmentation[1]->Add(id0+12, "Undefined", slatsegNB[1]);  
809     segmentation[1]->Add(id0+11, "Undefined", slatsegNB[1]);  
810     segmentation[1]->Add(id0+24, "Undefined", slatsegNB[1]);  
811     segmentation[1]->Add(id0+25, "Undefined", slatsegNB[1]);  
812     segmentation[1]->Add(id0+ 1, "Undefined", slatsegNB[1]);
813     segmentation[1]->Add(id0+ 2, "Undefined", slatsegNB[1]);
814
815     // type 333000 
816     segmentation[1]->Add(id0+19 , "Undefined", slatsegNB[2]);
817     segmentation[1]->Add(id0+ 7, "Undefined", slatsegNB[2]);  
818     segmentation[1]->Add(id0+20, "Undefined", slatsegNB[2]);
819     segmentation[1]->Add(id0+ 6, "Undefined", slatsegNB[2]);
820  
821     // type 222333 
822     segmentation[1]->Add(id0+16, "Undefined", slatsegNB[3]);
823     segmentation[1]->Add(id0+10, "Undefined", slatsegNB[3]);  
824     segmentation[1]->Add(id0+23, "Undefined", slatsegNB[3]);
825     segmentation[1]->Add(id0+ 3, "Undefined", slatsegNB[3]);
826  
827     // type 223330 
828     segmentation[1]->Add(id0+17, "Undefined", slatsegNB[4]);
829     segmentation[1]->Add(id0+ 9, "Undefined", slatsegNB[4]);  
830     segmentation[1]->Add(id0+22, "Undefined", slatsegNB[4]);
831     segmentation[1]->Add(id0+ 4, "Undefined", slatsegNB[4]);
832   
833     // type 333300 
834     segmentation[1]->Add(id0+18, "Undefined", slatsegNB[5]);
835     segmentation[1]->Add(id0+ 8, "Undefined", slatsegNB[5]);  
836     segmentation[1]->Add(id0+21, "Undefined", slatsegNB[5]);
837     segmentation[1]->Add(id0+ 5, "Undefined", slatsegNB[5]);
838     Segmentation()->AddModuleSegmentation(chamber, 1, segmentation[1]);   
839   }
840 }
841
842 //__________________________________________________________________________
843 void AliMUONSegFactory::BuildStation6() 
844
845 /// Configuration for Trigger stations
846
847  
848     AliMUONGeometrySegmentation *chamberSeg[2];
849
850     for (Int_t chamber = 10; chamber < 14; chamber++) {
851
852       //Trigger Segmentation
853       AliMUONTriggerSegmentation *trigSegX[9]; 
854       AliMUONTriggerSegmentation *trigSegY[9]; 
855       for(Int_t i=0; i<9; i++) {
856         trigSegX[i] = new AliMUONTriggerSegmentation(1);
857         trigSegY[i] = new AliMUONTriggerSegmentation(0);
858         Segmentation()->AddDESegmentation(trigSegX[i]);  
859         Segmentation()->AddDESegmentation(trigSegY[i]);  
860         trigSegX[i]->SetLineNumber(9-i);    
861         trigSegY[i]->SetLineNumber(9-i);    
862       }
863
864       //AliMUONChamber *iChamber, *iChamber1;
865       //iChamber1 = &fMUON->Chamber(10);
866       //iChamber  = &fMUON->Chamber(chamber);
867       //Float_t zpos1= iChamber1->Z();  
868       //Float_t zpos = iChamber->Z();        
869       Float_t zpos1= AliMUONConstants::DefaultChamberZ(10); 
870       Float_t zpos = AliMUONConstants::DefaultChamberZ(chamber);  
871       Float_t zRatio = zpos / zpos1;
872
873       // init
874       Float_t stripWidth[3]={0.,0.,0.};     // 1.0625 2.125 4.25
875       Float_t stripLength[4]={0.,0.,0.,0.}; // 17. 34. 51. 68.
876       for (Int_t i=0; i<3; i++) 
877         stripWidth[i]=AliMUONTriggerConstants::StripWidth(i)*zRatio;
878       for (Int_t i=0; i<4; i++) 
879         stripLength[i]=AliMUONTriggerConstants::StripLength(i)*zRatio;
880       Int_t nStrip[7]={0,0,0,0,0,0,0};    
881       Float_t stripYsize[7]={0.,0.,0.,0.,0.,0.,0.};
882       Float_t stripXsize[7]={0.,0.,0.,0.,0.,0.,0.};
883
884       // chamber 8 0 cathode 0
885       for (Int_t i=0; i<7; i++) nStrip[i]=16;
886       for (Int_t i=0; i<7; i++) stripYsize[i]=stripWidth[2];
887       for (Int_t i=0; i<6; i++) stripXsize[i]=stripLength[1];
888       stripXsize[6]=stripLength[2];
889       trigSegX[8]->Init(0,nStrip,stripYsize,stripXsize,0.); 
890       trigSegX[0]->Init(0,nStrip,stripYsize,stripXsize,0.); 
891
892       // chamber 8 7 1 0 cathode 1
893       for (Int_t i=0; i<6; i++) nStrip[i]=8;
894       nStrip[6]=16;
895       for (Int_t i=0; i<7; i++) stripYsize[i]=stripLength[3];  
896       for (Int_t i=0; i<7; i++) stripXsize[i]=stripWidth[2];
897       trigSegY[8]->Init(0,nStrip,stripYsize,stripXsize,0.);  
898       trigSegY[7]->Init(0,nStrip,stripYsize,stripXsize,0.);
899       trigSegY[1]->Init(0,nStrip,stripYsize,stripXsize,0.);
900       trigSegY[0]->Init(0,nStrip,stripYsize,stripXsize,0.);
901  
902       // chamber 7 6 2 1 cathode 0
903       for (Int_t i=0; i<6; i++) nStrip[i]=32;
904       nStrip[6]=16;  
905       for (Int_t i=0; i<6; i++) stripYsize[i]=stripWidth[1];
906       stripYsize[6]=stripWidth[2];
907       for (Int_t i=0; i<6; i++) stripXsize[i]=stripLength[1];
908       stripXsize[6]=stripLength[2];
909       trigSegX[7]->Init(0,nStrip,stripYsize,stripXsize,0.);  
910       trigSegX[6]->Init(0,nStrip,stripYsize,stripXsize,0.);
911       trigSegX[2]->Init(0,nStrip,stripYsize,stripXsize,0.);  
912       trigSegX[1]->Init(0,nStrip,stripYsize,stripXsize,0.);
913
914       // chamber 6 2 cathode 1
915       for (Int_t i=0; i<5; i++) nStrip[i]=16;
916       for (Int_t i=5; i<6; i++) nStrip[i]=8;
917       nStrip[6]=16;
918       for (Int_t i=0; i<7; i++) stripYsize[i]=stripLength[3];
919       for (Int_t i=0; i<5; i++) stripXsize[i]=stripWidth[1];
920       for (Int_t i=5; i<7; i++) stripXsize[i]=stripWidth[2];
921       trigSegY[6]->Init(0,nStrip,stripYsize,stripXsize,0.);  
922       trigSegY[2]->Init(0,nStrip,stripYsize,stripXsize,0.);  
923
924       // chamber 5 3 cathode 0
925       nStrip[0]=48;
926       for (Int_t i=1; i<3; i++) nStrip[i]=64;
927       for (Int_t i=3; i<6; i++) nStrip[i]=32;
928       nStrip[6]=16;  
929       for (Int_t i=0; i<3; i++) stripYsize[i]=stripWidth[0];
930       for (Int_t i=3; i<6; i++) stripYsize[i]=stripWidth[1];
931       stripYsize[6]=stripWidth[2];
932       for (Int_t i=0; i<6; i++) stripXsize[i]=stripLength[1];
933       stripXsize[6]=stripLength[2];
934       trigSegX[5]->Init(0,nStrip,stripYsize,stripXsize,stripLength[0]);  
935       trigSegX[3]->Init(0,nStrip,stripYsize,stripXsize,0.);
936
937       // chamber 5 3 cathode 1
938       for (Int_t i=0; i<5; i++) nStrip[i]=16;
939       for (Int_t i=5; i<6; i++) nStrip[5]=8;  
940       nStrip[6]=16;  
941       stripYsize[0]=stripLength[2];
942       for (Int_t i=1; i<7; i++) stripYsize[i]=stripLength[3];
943       for (Int_t i=0; i<5; i++) stripXsize[i]=stripWidth[1];
944       for (Int_t i=5; i<7; i++) stripXsize[i]=stripWidth[2];
945       trigSegY[5]->Init(0,nStrip,stripYsize,stripXsize,stripLength[0]);  
946       trigSegY[3]->Init(0,nStrip,stripYsize,stripXsize,0.);
947
948       // chamber 4 cathode 0
949       nStrip[0]=0;
950       for (Int_t i=1; i<3; i++) nStrip[i]=64;  
951       for (Int_t i=3; i<6; i++) nStrip[i]=32;  
952       nStrip[6]=16;
953       stripYsize[0]=0.;
954       for (Int_t i=1; i<3; i++) stripYsize[i]=stripWidth[0];
955       for (Int_t i=3; i<6; i++) stripYsize[i]=stripWidth[1];
956       stripYsize[6]=stripWidth[2];
957       stripXsize[0]=0;  
958       stripXsize[1]=stripLength[0];  
959       for (Int_t i=2; i<6; i++) stripXsize[i]=stripLength[1];
960       stripXsize[6]=stripLength[2];
961       trigSegX[4]->Init(0,nStrip,stripYsize,stripXsize,0.);  
962
963       // chamber 4 cathode 1
964       nStrip[0]=0;  
965       nStrip[1]=8;  
966       for (Int_t i=2; i<5; i++) nStrip[i]=16;
967       for (Int_t i=5; i<6; i++) nStrip[i]=8;
968       nStrip[6]=16;
969       stripYsize[0]=0.;  
970       for (Int_t i=1; i<7; i++) stripYsize[i]=stripLength[3];
971       stripXsize[0]=0.;
972       for (Int_t i=1; i<5; i++) stripXsize[i]=stripWidth[1];
973       for (Int_t i=5; i<7; i++) stripXsize[i]=stripWidth[2];
974       trigSegY[4]->Init(0,nStrip,stripYsize,stripXsize,0.);
975
976       const AliMUONGeometryModuleTransformer* kModuleTransformer 
977         = fkTransformer->GetModuleTransformer(chamber);
978       
979       chamberSeg[0] = new AliMUONGeometrySegmentation(kModuleTransformer);
980       chamberSeg[1] = new AliMUONGeometrySegmentation(kModuleTransformer);
981
982       Int_t icount=chamber-10;  // chamber counter (0 1 2 3)
983       Int_t id0=(10+icount+1)*100;
984
985
986       //  printf("in CreateTriggerSegmentation here 0 id0=%i \n",id0);  
987       chamberSeg[0]->Add(id0+0,  "Undefined", trigSegX[4]);
988       chamberSeg[0]->Add(id0+1,  "Undefined", trigSegX[5]);
989       chamberSeg[0]->Add(id0+2,  "Undefined", trigSegX[6]);
990       chamberSeg[0]->Add(id0+3,  "Undefined", trigSegX[7]);
991       chamberSeg[0]->Add(id0+4,  "Undefined", trigSegX[8]);
992       chamberSeg[0]->Add(id0+5,  "Undefined", trigSegX[8]);
993       chamberSeg[0]->Add(id0+6,  "Undefined", trigSegX[7]);
994       chamberSeg[0]->Add(id0+7,  "Undefined", trigSegX[6]);
995       chamberSeg[0]->Add(id0+8,  "Undefined", trigSegX[5]);
996       chamberSeg[0]->Add(id0+9,  "Undefined", trigSegX[4]);
997       chamberSeg[0]->Add(id0+10, "Undefined", trigSegX[3]);
998       chamberSeg[0]->Add(id0+11, "Undefined", trigSegX[2]);
999       chamberSeg[0]->Add(id0+12, "Undefined", trigSegX[1]);
1000       chamberSeg[0]->Add(id0+13, "Undefined", trigSegX[0]);
1001       chamberSeg[0]->Add(id0+14, "Undefined", trigSegX[0]);
1002       chamberSeg[0]->Add(id0+15, "Undefined", trigSegX[1]);
1003       chamberSeg[0]->Add(id0+16, "Undefined", trigSegX[2]);
1004       chamberSeg[0]->Add(id0+17, "Undefined", trigSegX[3]);
1005
1006       chamberSeg[1]->Add(id0+0,  "Undefined", trigSegY[4]);
1007       chamberSeg[1]->Add(id0+1,  "Undefined", trigSegY[5]);
1008       chamberSeg[1]->Add(id0+2,  "Undefined", trigSegY[6]);
1009       chamberSeg[1]->Add(id0+3,  "Undefined", trigSegY[7]);
1010       chamberSeg[1]->Add(id0+4,  "Undefined", trigSegY[8]);
1011       chamberSeg[1]->Add(id0+5,  "Undefined", trigSegY[8]);
1012       chamberSeg[1]->Add(id0+6,  "Undefined", trigSegY[7]);
1013       chamberSeg[1]->Add(id0+7,  "Undefined", trigSegY[6]);
1014       chamberSeg[1]->Add(id0+8,  "Undefined", trigSegY[5]);
1015       chamberSeg[1]->Add(id0+9,  "Undefined", trigSegY[4]);
1016       chamberSeg[1]->Add(id0+10, "Undefined", trigSegY[3]);
1017       chamberSeg[1]->Add(id0+11, "Undefined", trigSegY[2]);
1018       chamberSeg[1]->Add(id0+12, "Undefined", trigSegY[1]);
1019       chamberSeg[1]->Add(id0+13, "Undefined", trigSegY[0]);
1020       chamberSeg[1]->Add(id0+14, "Undefined", trigSegY[0]);
1021       chamberSeg[1]->Add(id0+15, "Undefined", trigSegY[1]);
1022       chamberSeg[1]->Add(id0+16, "Undefined", trigSegY[2]);
1023       chamberSeg[1]->Add(id0+17, "Undefined", trigSegY[3]);
1024
1025       Segmentation()->AddModuleSegmentation(chamber, 0, chamberSeg[0]);
1026       Segmentation()->AddModuleSegmentation(chamber, 1, chamberSeg[1]);
1027   
1028       //  printf("in CreateTriggerSegmentation here 1\n");  
1029       if (!id0) {
1030         AliWarning(Form("Segmentation for chamber %d is not yet defined",chamber));
1031         return ;      
1032       }
1033     }
1034 }
1035