Logging of Debug, Info and Error Messages follwing AliRoot Standard http://aliweb...
[u/mrichter/AliRoot.git] / MUON / AliMUONFactory.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 "AliMUONFactory.h"
23 #include "AliMUON.h"
24 #include "AliMUONChamber.h"
25 #include "AliMUONResponseV0.h"
26 #include "AliMUONResponseTrigger.h"
27 #include "AliMUONSegmentationV01.h"
28 #include "AliMUONSegmentationV02.h"
29 #include "AliMUONSegmentationSlat.h"
30 #include "AliMUONSegmentationSlatN.h"
31 #include "AliMUONSegmentationTriggerX.h"
32 #include "AliMUONSegmentationTriggerY.h"
33 #include "AliLog.h"
34
35 ClassImp(AliMUONFactory)
36
37 //__________________________________________________________________________
38 AliMUONFactory::AliMUONFactory()
39   : TObject(),
40     fMUON(0),
41     fResponse0(0)
42 {
43 //
44 }
45
46 //__________________________________________________________________________
47 AliMUONFactory::AliMUONFactory(const AliMUONFactory& rhs)
48   : TObject(rhs)
49 {
50 // Protected copy constructor
51
52   AliFatal("Not implemented.");
53 }
54
55 //__________________________________________________________________________
56
57 AliMUONFactory::~AliMUONFactory()
58 {
59 //
60 }
61
62 //__________________________________________________________________________
63 AliMUONFactory&  AliMUONFactory::operator=(const AliMUONFactory& rhs)
64 {
65 // Protected assignement operator
66
67   if (this == &rhs) return *this;
68
69   AliFatal("Not implemented.");
70     
71   return *this;  
72 }    
73           
74 //__________________________________________________________________________
75 void AliMUONFactory::BuildCommon() 
76 {
77 //
78 // Construct the default response.
79 //
80
81         // Default response: 5 mm of gas
82         fResponse0 = new AliMUONResponseV0;
83         fResponse0->SetSqrtKx3AndDeriveKx2Kx4(0.7131); // sqrt(0.5085)
84         fResponse0->SetSqrtKy3AndDeriveKy2Ky4(0.7642); // sqrt(0.5840)
85         fResponse0->SetPitch(0.25); // anode-cathode distance
86         fResponse0->SetSigmaIntegration(10.);
87         fResponse0->SetChargeSlope(10);
88         fResponse0->SetChargeSpread(0.18, 0.18);
89         fResponse0->SetMaxAdc(4096);
90         fResponse0->SetSaturation(3000);
91         fResponse0->SetZeroSuppression(6);
92 }       
93         
94 //__________________________________________________________________________
95 void AliMUONFactory::BuildStation1() 
96 {
97 //--------------------------------------------------------
98 // Configuration for Chamber TC1/2  (Station 1) ----------           
99 //^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
100
101         // Response for 4 mm of gas (station 1)
102         // automatic consistency with width of sensitive medium in CreateGeometry ????
103         AliMUONResponseV0* responseSt1 = new AliMUONResponseV0;
104         // Mathieson parameters from L.Kharmandarian's thesis, page 190
105         responseSt1->SetSqrtKx3AndDeriveKx2Kx4(0.7000); // sqrt(0.4900)
106         responseSt1->SetSqrtKy3AndDeriveKy2Ky4(0.7550); // sqrt(0.5700)
107         responseSt1->SetPitch(0.20); // anode-cathode distance
108         responseSt1->SetSigmaIntegration(10.);
109         // ChargeSlope larger to compensate for the smaller anode-cathode distance
110         // and keep the same most probable ADC channel for mip's
111         responseSt1->SetChargeSlope(62.5); 
112         // assumed proportionality to anode-cathode distance for ChargeSpread
113         responseSt1->SetChargeSpread(0.144, 0.144);
114         responseSt1->SetMaxAdc(4096);
115         responseSt1->SetSaturation(3000);
116         responseSt1->SetZeroSuppression(6);
117         
118         //--------------------------------------------------------
119         // Configuration for Chamber TC1/2  (Station 1) ----------           
120
121         Float_t rseg1[4]={17.5, 55.2, 71.3, 95.5};
122         Int_t   nseg1[4]={4, 4, 2, 1};
123 //
124         Int_t chamber=1;
125 //      ^^^^^^^^^^^^^^^^
126         fMUON->SetNsec(chamber-1,2);
127 //
128         AliMUONSegmentationV01 *seg11=new AliMUONSegmentationV01(4);
129         
130         seg11->SetSegRadii(rseg1);
131         seg11->SetPadSize(2.4, 0.4); // smaller pad size
132         seg11->SetDAnod(0.20); // smaller distance between anode wires
133         seg11->SetPadDivision(nseg1);
134         
135         fMUON->SetSegmentationModel(chamber-1, 1, seg11);
136         
137         AliMUONSegmentationV02 *seg12=new AliMUONSegmentationV02(4);
138         seg12->SetSegRadii(rseg1); 
139         seg12->SetPadSize(0.6, 1.6); // smaller pad size
140         seg12->SetDAnod(0.20); // smaller distance between anode wires
141         seg12->SetPadDivision(nseg1);
142         
143         fMUON->SetSegmentationModel(chamber-1, 2, seg12);
144         
145         fMUON->SetResponseModel(chamber-1, responseSt1); // special response        
146         fMUON->Chamber(chamber-1).SetChargeCorrel(0.11); // 11% charge spread
147         
148         chamber=2;
149 //      ^^^^^^^^^
150 //
151         fMUON->SetNsec(chamber-1,2);
152 //
153         AliMUONSegmentationV01 *seg21=new AliMUONSegmentationV01(4);
154         seg21->SetSegRadii(rseg1);
155         seg21->SetPadSize(2.4, 0.4); // smaller pad size
156         seg21->SetDAnod(0.20); // smaller distance between anode wires
157         seg21->SetPadDivision(nseg1);
158         fMUON->SetSegmentationModel(chamber-1, 1, seg21);
159 //
160         AliMUONSegmentationV02 *seg22=new AliMUONSegmentationV02(4);
161         seg22->SetSegRadii(rseg1); 
162         seg22->SetPadSize(0.6, 1.6); // smaller pad size
163         seg22->SetDAnod(0.20); // smaller distance between anode wires
164         seg22->SetPadDivision(nseg1);
165         fMUON->SetSegmentationModel(chamber-1, 2, seg22);
166         
167         fMUON->SetResponseModel(chamber-1, responseSt1); // special response
168         fMUON->Chamber(chamber-1).SetChargeCorrel(0.11); // 11% charge spread
169         
170 }
171
172 //__________________________________________________________________________
173 void AliMUONFactory::BuildStation2() 
174 {
175 //
176 //--------------------------------------------------------
177 // Configuration for Chamber TC3/4 (Station 2) -----------
178 ///^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
179 // Float_t rseg2[4]={23.5, 87.7, 122.4, 122.5};
180
181         Float_t rseg2[4]={23.5, 53.5, 90.5, 122.5};       
182         Int_t   nseg2[4]={4, 4, 2, 1};
183 //
184         Int_t chamber=3;
185 //      ^^^^^^^^^^^^^^^^
186         fMUON->SetNsec(chamber-1,2);
187 //
188         AliMUONSegmentationV01 *seg31=new AliMUONSegmentationV01(4);
189         seg31->SetSegRadii(rseg2);
190         seg31->SetPadSize(3.0, 0.5);
191         seg31->SetDAnod(3.0/3./4);
192         seg31->SetPadDivision(nseg2);
193         fMUON->SetSegmentationModel(chamber-1, 1, seg31);
194 //
195         AliMUONSegmentationV02 *seg32=new AliMUONSegmentationV02(4);
196         seg32->SetSegRadii(rseg2); 
197         seg32->SetPadSize(0.75, 2.0);
198         seg32->SetPadDivision(nseg2);
199         seg32->SetDAnod(3.0/3./4);
200         
201         fMUON->SetSegmentationModel(chamber-1, 2, seg32);
202         
203         fMUON->SetResponseModel(chamber-1, fResponse0);     
204         fMUON->Chamber(chamber-1).SetChargeCorrel(0.11); // 11% charge spread
205         
206         chamber=4;
207 //      ^^^^^^^^^
208 //
209         fMUON->SetNsec(chamber-1,2);
210 //
211         AliMUONSegmentationV01 *seg41=new AliMUONSegmentationV01(4);
212         seg41->SetSegRadii(rseg2);
213         seg41->SetPadSize(3.0, 0.5);
214         seg41->SetDAnod(3.0/3./4);
215         seg41->SetPadDivision(nseg2);
216         fMUON->SetSegmentationModel(chamber-1, 1, seg41);
217 //
218         AliMUONSegmentationV02 *seg42=new AliMUONSegmentationV02(4);
219         seg42->SetSegRadii(rseg2); 
220         seg42->SetPadSize(0.75, 2.0);
221         seg42->SetPadDivision(nseg2);
222         seg42->SetDAnod(3.0/3./4);
223         
224         fMUON->SetSegmentationModel(chamber-1, 2, seg42);
225         
226         fMUON->SetResponseModel(chamber-1, fResponse0);     
227         fMUON->Chamber(chamber-1).SetChargeCorrel(0.11); // 11% charge spread
228 }       
229         
230         
231 //__________________________________________________________________________
232 void AliMUONFactory::BuildStation3() 
233 {
234 //--------------------------------------------------------
235 // Configuration for Chamber TC5/6  (Station 3) ----------          
236 //^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
237
238         Int_t   nseg3[4]={4, 4, 2, 1};
239         Int_t   npcb5[36] = {0,0,2,0,
240                              0,0,3,0,
241                              0,1,3,0,
242                              0,2,2,0,
243                              0,2,2,0, 
244                              0,2,2,0, 
245                              0,1,3,0, 
246                              0,0,3,0,
247                              0,0,2,0};
248         
249         Float_t shift = 1.5/2.;
250         Float_t xpos5[9]    = {4.5, 4.5, 4.5, 4.5, 4.5, 4.5, 4.5, 4.5, 4.5};
251         Float_t ypos5       = -(20.+4.*(40.-2.*shift));
252         
253         Int_t chamber=5;
254         fMUON->SetNsec(chamber-1,2);
255         AliMUONSegmentationSlat *seg51=new AliMUONSegmentationSlat(4);
256         seg51->SetNSlats(9); 
257         seg51->SetShift(shift);  
258         seg51->SetNPCBperSector(npcb5); 
259         seg51->SetSlatXPositions(xpos5);
260         seg51->SetSlatYPosition(ypos5);
261         seg51->SetPadSize(10.,0.5);
262         seg51->SetDAnod(0.25);
263         seg51->SetPadDivision(nseg3);
264         fMUON->SetSegmentationModel(chamber-1, 1, seg51);
265         
266         AliMUONSegmentationSlatN *seg52=new AliMUONSegmentationSlatN(4);
267         seg52->SetNSlats(9); 
268         seg52->SetShift(shift);  
269         seg52->SetNPCBperSector(npcb5); 
270         seg52->SetSlatXPositions(xpos5);
271         seg52->SetSlatYPosition(ypos5);
272         seg52->SetPadSize(1., 10.); // DeltaX(non bending) = 2 * DeltaY(bending)
273         seg52->SetDAnod(0.25);
274         seg52->SetPadDivision(nseg3);
275         fMUON->SetSegmentationModel(chamber-1, 2, seg52);
276         fMUON->SetResponseModel(chamber-1, fResponse0);      
277         fMUON->Chamber(chamber-1).SetChargeCorrel(0.11); // 11% charge spread
278         
279         chamber=6;
280         fMUON->SetNsec(chamber-1,2);
281         AliMUONSegmentationSlat *seg61=new AliMUONSegmentationSlat(4);
282         seg61->SetNSlats(9); 
283         seg61->SetShift(shift);  
284         seg61->SetNPCBperSector(npcb5); 
285         seg61->SetSlatXPositions(xpos5);
286         seg61->SetSlatYPosition(ypos5);
287         seg61->SetPadSize(10.,0.5);
288         seg61->SetDAnod(0.25);
289         seg61->SetPadDivision(nseg3);
290         fMUON->SetSegmentationModel(chamber-1, 1, seg61);
291         
292         AliMUONSegmentationSlatN *seg62=new AliMUONSegmentationSlatN(4);
293         seg62->SetNSlats(9); 
294         seg62->SetShift(shift);  
295         seg62->SetNPCBperSector(npcb5); 
296         seg62->SetSlatXPositions(xpos5);
297         seg62->SetSlatYPosition(ypos5);
298         seg62->SetPadSize(1., 10.); // DeltaX(non bending) = 2 * DeltaY(bending)
299         seg62->SetDAnod(0.25);
300         seg62->SetPadDivision(nseg3);
301         fMUON->SetSegmentationModel(chamber-1, 2, seg62);
302         fMUON->SetResponseModel(chamber-1, fResponse0);      
303         fMUON->Chamber(chamber-1).SetChargeCorrel(0.11); // 11% charge spread
304 }
305
306         
307 //__________________________________________________________________________
308 void AliMUONFactory::BuildStation4() 
309 {
310 //--------------------------------------------------------
311 // Configuration for Chamber TC7/8  (Station 4) ----------           
312 //^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
313
314         Int_t   nseg4[4]={4, 4, 2, 1};
315         
316         Int_t chamber=7;
317 //      ^^^^^^^^^^^^^^^^
318         
319         fMUON->SetNsec(chamber-1,2);
320 //
321         AliMUONSegmentationSlat *seg71=new AliMUONSegmentationSlat(4);
322         Float_t shift = 1.5/2.;
323         Int_t npcb7[52] = {0,0,0,2,
324                            0,0,0,3,
325                            0,0,2,2,
326                            0,0,3,2,
327                            0,2,2,1,
328                            0,2,2,2,
329                            0,1,2,2, 
330                            0,2,2,2, 
331                            0,2,2,1, 
332                            0,0,3,2, 
333                            0,0,2,2, 
334                            0,0,0,3,
335                            0,0,0,2};
336         Float_t xpos7[13]   = {4.5, 4.5, 4.5, 4.5, 4.5, 4.5, 44., 4.5, 4.5, 4.5, 4.5, 4.5, 4.5};
337         Float_t ypos7       = -(20.+6.*(40.-2.*shift));  
338         
339         seg71->SetNSlats(13);  
340         seg71->SetShift(shift);  
341         seg71->SetNPCBperSector(npcb7); 
342         seg71->SetSlatXPositions(xpos7);
343         seg71->SetSlatYPosition(ypos7);
344         
345         seg71->SetPadSize(10.,0.5);
346         seg71->SetDAnod(0.25);
347         seg71->SetPadDivision(nseg4);
348         fMUON->SetSegmentationModel(chamber-1, 1, seg71);
349         
350         AliMUONSegmentationSlatN *seg72=new AliMUONSegmentationSlatN(4);
351         
352         fMUON->SetSegmentationModel(chamber-1, 2, seg72);
353         seg72->SetNSlats(13);  
354         seg72->SetShift(shift);   
355         seg72->SetNPCBperSector(npcb7); 
356         seg72->SetSlatXPositions(xpos7);
357         seg72->SetSlatYPosition(ypos7);
358         seg72->SetPadSize(1., 10.); // DeltaX(non bending) = 2 * DeltaY(bending)
359         seg72->SetDAnod(0.25);
360         seg72->SetPadDivision(nseg4);
361         
362         fMUON->SetResponseModel(chamber-1, fResponse0);     
363         fMUON->Chamber(chamber-1).SetChargeCorrel(0.11); // 11% charge spread
364         
365         chamber=8;
366 //      ^^^^^^^^^
367         fMUON->SetNsec(chamber-1,2);
368 //
369         AliMUONSegmentationSlat *seg81=new AliMUONSegmentationSlat(4);
370         
371         seg81->SetNSlats(13);  
372         seg81->SetShift(shift);  
373         seg81->SetNPCBperSector(npcb7); 
374         seg81->SetSlatXPositions(xpos7);
375         seg81->SetSlatYPosition(ypos7);
376         seg81->SetPadSize(10.,0.5);
377         seg81->SetDAnod(0.25);
378         seg81->SetPadDivision(nseg4);
379         fMUON->SetSegmentationModel(chamber-1, 1, seg81);
380         
381         AliMUONSegmentationSlat *seg82=new AliMUONSegmentationSlatN(4);
382         
383         fMUON->SetSegmentationModel(chamber-1, 2, seg82);
384         seg82->SetNSlats(13);  
385         seg82->SetShift(shift);  
386         seg82->SetNPCBperSector(npcb7); 
387         seg82->SetSlatXPositions(xpos7);
388         seg82->SetSlatYPosition(ypos7);
389         seg82->SetPadSize(1., 10.); // DeltaX(non bending) = 2 * DeltaY(bending)
390         seg82->SetDAnod(0.25);
391         seg82->SetPadDivision(nseg4);
392         
393         fMUON->SetResponseModel(chamber-1, fResponse0);     
394         fMUON->Chamber(chamber-1).SetChargeCorrel(0.11); // 11% charge spread
395 }
396
397 //__________________________________________________________________________
398 void AliMUONFactory::BuildStation5() 
399 {       
400 //--------------------------------------------------------
401 // Configuration for Chamber TC9/10  (Station 5) ---------           
402 //^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
403
404         Int_t chamber=9;
405 //      ^^^^^^^^^^^^^^^^
406
407         fMUON->SetNsec(chamber-1,2);
408 //
409         AliMUONSegmentationSlat *seg91=new AliMUONSegmentationSlat(4);
410
411         Int_t   nseg4[4]={4, 4, 2, 1};
412         Float_t shift = 1.5/2.;
413         Int_t   npcb9[52] = {0,0,0,3,
414                              0,0,0,4,
415                              0,0,2,3,
416                              0,0,3,3,
417                              0,2,2,2,
418                              0,2,2,2,
419                              0,1,2,2, 
420                              0,2,2,2, 
421                              0,2,2,2, 
422                              0,0,3,3, 
423                              0,0,2,3, 
424                              0,0,0,4, 
425                              0,0,0,3};   
426         
427         Float_t xpos9[13]   = {4.5, 4.5, 4.5, 4.5, 4.5, 4.5, 44., 4.5, 4.5, 4.5, 4.5, 4.5, 4.5};
428         Float_t ypos9       = -(20.+6.*(40.-2.*shift));
429         
430         seg91->SetNSlats(13);  
431         seg91->SetShift(shift);  
432         seg91->SetNPCBperSector(npcb9); 
433         seg91->SetSlatXPositions(xpos9);
434         seg91->SetSlatYPosition(ypos9);
435         seg91->SetPadSize(10.,0.5);
436         seg91->SetDAnod(0.25);
437         seg91->SetPadDivision(nseg4);
438         fMUON->SetSegmentationModel(chamber-1, 1, seg91);
439         
440         AliMUONSegmentationSlatN *seg92=new AliMUONSegmentationSlatN(4);
441         
442         fMUON->SetSegmentationModel(chamber-1, 2, seg92);
443         seg92->SetNSlats(13);  
444         seg92->SetShift(shift);   
445         seg92->SetNPCBperSector(npcb9); 
446         seg92->SetSlatXPositions(xpos9);
447         seg92->SetSlatYPosition(ypos9);
448         seg92->SetPadSize(1., 10.); // DeltaX(non bending) = 2 * DeltaY(bending)
449         seg92->SetDAnod(0.25);
450         seg92->SetPadDivision(nseg4);
451         
452         fMUON->SetResponseModel(chamber-1, fResponse0);     
453         fMUON->Chamber(chamber-1).SetChargeCorrel(0.11); // 11% charge spread
454         
455         chamber=10;
456 //      ^^^^^^^^^
457         fMUON->SetNsec(chamber-1,2);
458 //
459         AliMUONSegmentationSlat *seg101=new AliMUONSegmentationSlat(4);
460         
461         seg101->SetNSlats(13);  
462         seg101->SetShift(shift);  
463         seg101->SetNPCBperSector(npcb9); 
464         seg101->SetSlatXPositions(xpos9);
465         seg101->SetSlatYPosition(ypos9);
466         seg101->SetPadSize(10.,0.5);
467         seg101->SetDAnod(0.25);
468         seg101->SetPadDivision(nseg4);
469         fMUON->SetSegmentationModel(chamber-1, 1, seg101);
470         
471         AliMUONSegmentationSlatN *seg102=new AliMUONSegmentationSlatN(4);
472         
473         fMUON->SetSegmentationModel(chamber-1, 2, seg102);
474         seg102->SetNSlats(13);  
475         seg102->SetShift(shift);   
476         seg102->SetNPCBperSector(npcb9); 
477         seg102->SetSlatXPositions(xpos9);
478         seg102->SetSlatYPosition(ypos9);
479         seg102->SetPadSize(1., 10.); // DeltaX(non bending) = 2 * DeltaY(bending)
480         seg102->SetDAnod(0.25);
481         seg102->SetPadDivision(nseg4);
482         
483         fMUON->SetResponseModel(chamber-1, fResponse0);     
484         fMUON->Chamber(chamber-1).SetChargeCorrel(0.11); // 11% charge spread
485 }
486
487 //__________________________________________________________________________
488 void AliMUONFactory::BuildStation6() 
489 {       
490 //--------------------------------------------------------
491 // Configuration for Trigger Stations -------------------- 
492 //^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
493
494 // Cluster-size off
495         AliMUONResponseTrigger* responseTrigger0 =  new AliMUONResponseTrigger;
496 // Cluster-size on  
497 // AliMUONResponseTriggerV1* responseTrigger0 =  new AliMUONResponseTriggerV1;
498  
499         Int_t chamber=11;
500         fMUON->SetNsec(chamber-1,2);
501         AliMUONSegmentationTriggerX *seg111=new AliMUONSegmentationTriggerX;
502         fMUON->SetSegmentationModel(chamber-1, 1, seg111);
503         AliMUONSegmentationTriggerY *seg112=new AliMUONSegmentationTriggerY;
504         fMUON->SetSegmentationModel(chamber-1, 2, seg112);
505         
506         fMUON->SetResponseModel(chamber-1, responseTrigger0);      
507         fMUON->Chamber(chamber-1).SetChargeCorrel(0); // same charge on cathodes
508         
509  
510         chamber=12;
511         fMUON->SetNsec(chamber-1,2);
512         AliMUONSegmentationTriggerX *seg121=new AliMUONSegmentationTriggerX;
513         fMUON->SetSegmentationModel(chamber-1, 1, seg121);
514         AliMUONSegmentationTriggerY *seg122=new AliMUONSegmentationTriggerY;
515         fMUON->SetSegmentationModel(chamber-1, 2, seg122);
516         
517         fMUON->SetResponseModel(chamber-1, responseTrigger0);
518         fMUON->Chamber(chamber-1).SetChargeCorrel(0); // same charge on cathodes
519         
520         chamber=13;
521         fMUON->SetNsec(chamber-1,2);
522         AliMUONSegmentationTriggerX *seg131=new AliMUONSegmentationTriggerX;
523         fMUON->SetSegmentationModel(chamber-1, 1, seg131);
524         AliMUONSegmentationTriggerY *seg132=new AliMUONSegmentationTriggerY;
525         fMUON->SetSegmentationModel(chamber-1, 2, seg132);
526         fMUON->SetResponseModel(chamber-1, responseTrigger0);      
527         fMUON->Chamber(chamber-1).SetChargeCorrel(0); // same charge on cathodes
528         
529         chamber=14;
530         fMUON->SetNsec(chamber-1,2);
531         AliMUONSegmentationTriggerX *seg141=new AliMUONSegmentationTriggerX;
532         fMUON->SetSegmentationModel(chamber-1, 1, seg141);
533         AliMUONSegmentationTriggerY *seg142=new AliMUONSegmentationTriggerY;
534         fMUON->SetSegmentationModel(chamber-1, 2, seg142);
535         
536         fMUON->SetResponseModel(chamber-1, responseTrigger0); 
537         fMUON->Chamber(chamber-1).SetChargeCorrel(0); // same charge on cathodes
538 }       
539
540 //__________________________________________________________________________
541 void AliMUONFactory::Build(AliMUON* where, const char* what) 
542 {
543 //
544 // Construct MUON from chambers, segmentation and responses
545 //
546
547     fMUON = where;
548     char tmp[20];
549     strcpy(tmp, what);
550
551     if (strcmp(tmp, "default")==0) {
552       // Set default parameters
553       fMUON->SetIshunt(0);
554       fMUON->SetMaxStepGas(0.1);
555       fMUON->SetMaxStepAlu(0.1);
556
557       // Build all stations
558       BuildCommon();
559       BuildStation1();
560       BuildStation2();
561       BuildStation3();
562       BuildStation4();
563       BuildStation5();
564       BuildStation6();
565     } 
566     else
567           AliDebug(0,"Non default version of MUON selected. You have to construct yourself the MUON elements !!");
568 }
569
570 //__________________________________________________________________________
571 void AliMUONFactory::BuildStation(AliMUON* where, Int_t stationNumber) 
572 {
573 //
574 // Construct MUON from chambers, segmentation and responses
575 //
576 // Version 0
577 //
578 // First define the number of planes that are segmented (1 or 2) by a call
579 // to SetNsec.
580 // Then chose for each chamber (chamber plane) the segmentation
581 // and response model.
582 // They should be equal for the two chambers of each station. In a future
583 // version this will be enforced.
584 //
585
586     fMUON = where;
587     if (!fResponse0) BuildCommon(); 
588     
589     switch (stationNumber) {    
590       case 1:  BuildStation1(); break;
591       case 2:  BuildStation2(); break;
592       case 3:  BuildStation3(); break;
593       case 4:  BuildStation4(); break;
594       case 5:  BuildStation5(); break;
595       case 6:  BuildStation6(); break;
596     
597       default: AliFatal("Wrong station number");
598     }  
599 }