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