]> git.uio.no Git - u/mrichter/AliRoot.git/blob - MUON/AliMUONResponseFactory.cxx
- Class description on 5 lines (Coding conventions)
[u/mrichter/AliRoot.git] / MUON / AliMUONResponseFactory.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 // Class AliMUONResponseFactory
18 // -----------------------------
19 // Factory for muon response
20 // Class separated from AliMUONFactoryV4
21
22 /* $Id$ */
23
24 #include "AliMUONResponseFactory.h"
25 #include "AliRun.h"
26 #include "AliLog.h"
27
28 #include "AliMpPlaneType.h"
29
30 #include "AliMUON.h"
31 #include "AliMUONConstants.h"
32 #include "AliMUONTriggerConstants.h"
33 #include "AliMUONChamber.h"
34 #include "AliMUONResponseV0.h"
35 #include "AliMUONResponseTrigger.h"
36
37 ClassImp(AliMUONResponseFactory)
38
39 //__________________________________________________________________________
40   AliMUONResponseFactory::AliMUONResponseFactory(const char* name)
41     : TNamed(name, ""),
42       fMUON(0),
43       fResponse0(0)
44 {
45 /// Standard constructor
46   
47   AliDebug(1,Form("ctor this=%p",this));
48 }
49
50 //__________________________________________________________________________
51   AliMUONResponseFactory::AliMUONResponseFactory()
52     : TNamed(),
53       fMUON(0),
54       fResponse0(0)
55 {
56 /// Default constructor
57
58   AliDebug(1,Form("default (empty) ctor this=%p",this));
59 }
60
61 //__________________________________________________________________________
62 AliMUONResponseFactory::AliMUONResponseFactory(const AliMUONResponseFactory& rhs)
63  : TNamed(rhs)
64 {
65 /// Protected copy constructor
66
67   AliFatal("Not implemented.");
68 }
69
70 //__________________________________________________________________________
71
72 AliMUONResponseFactory::~AliMUONResponseFactory()
73 {
74 /// Destructor
75         AliDebug(1,Form("dtor this=%p",this));
76 }
77
78 //__________________________________________________________________________
79 AliMUONResponseFactory&  AliMUONResponseFactory::operator=(const AliMUONResponseFactory& rhs)
80 {
81 /// Protected assignement operator
82
83   if (this == &rhs) return *this;
84
85   AliFatal("Not implemented.");
86     
87   return *this;  
88 }    
89           
90 //__________________________________________________________________________
91 void AliMUONResponseFactory::BuildCommon() 
92 {
93 /// Construct the default response.
94
95   // Default response: 5 mm of gas
96   fResponse0 = new AliMUONResponseV0;
97   fResponse0->SetSqrtKx3AndDeriveKx2Kx4(0.7131); // sqrt(0.5085)
98   fResponse0->SetSqrtKy3AndDeriveKy2Ky4(0.7642); // sqrt(0.5840)
99   fResponse0->SetPitch(AliMUONConstants::Pitch()); // anode-cathode distance
100   fResponse0->SetSigmaIntegration(10.);
101   fResponse0->SetChargeSlope(10);
102   fResponse0->SetChargeSpread(0.18, 0.18);
103   fResponse0->SetMaxAdc(4096);
104   fResponse0->SetSaturation(3000);
105   fResponse0->SetZeroSuppression(6);
106 }       
107         
108 //__________________________________________________________________________
109 void AliMUONResponseFactory::BuildStation1() 
110 {
111 /// Configuration for Chamber TC1/2  (Station 1) ----------           
112
113   // Response for 4 mm of gas (station 1)
114   // automatic consistency with width of sensitive medium in CreateGeometry ????
115   AliMUONResponseV0* responseSt1 = new AliMUONResponseV0;
116   // Mathieson parameters from L.Kharmandarian's thesis, page 190
117   responseSt1->SetSqrtKx3AndDeriveKx2Kx4(0.7000); // sqrt(0.4900)
118   responseSt1->SetSqrtKy3AndDeriveKy2Ky4(0.7550); // sqrt(0.5700)
119   responseSt1->SetPitch(AliMUONConstants::PitchSt1()); // anode-cathode distance
120   responseSt1->SetSigmaIntegration(10.);
121   // ChargeSlope larger to compensate for the smaller anode-cathode distance
122   // and keep the same most probable ADC channel for mip's
123   responseSt1->SetChargeSlope(62.5); 
124   // assumed proportionality to anode-cathode distance for ChargeSpread
125   responseSt1->SetChargeSpread(0.144, 0.144);
126   responseSt1->SetMaxAdc(4096);
127   responseSt1->SetSaturation(3000);
128   responseSt1->SetZeroSuppression(6);
129
130    for (Int_t chamber = 0; chamber < 2; chamber++) {
131     fMUON->SetResponseModel(chamber, responseSt1); // special response      
132     fMUON->Chamber(chamber).SetChargeCorrel(0.11); // 11% charge spread
133   }
134 }
135
136 //__________________________________________________________________________
137 void AliMUONResponseFactory::BuildStation2() 
138 {
139 /// Configuration for Chamber TC3/4 (Station 2) -----------
140
141   for (Int_t chamber = 2; chamber < 4; chamber++) {
142     fMUON->SetResponseModel(chamber, fResponse0); // normal response        
143     fMUON->Chamber(chamber).SetChargeCorrel(0.11); // 11% charge spread
144   }
145 }       
146         
147 //__________________________________________________________________________
148 void AliMUONResponseFactory::BuildStation3() 
149 {
150 /// Configuration for Chamber TC5/6  (Station 3) ----------          
151
152   for (Int_t chamber = 4; chamber < 6; chamber++) {
153     fMUON->SetResponseModel(chamber, fResponse0); // normal response        
154     fMUON->Chamber(chamber).SetChargeCorrel(0.11); // 11% charge spread
155   }
156 }       
157         
158 //__________________________________________________________________________
159 void AliMUONResponseFactory::BuildStation4() 
160 {
161 /// Configuration for Chamber TC7/8  (Station 4) ----------          
162
163   for (Int_t chamber = 6; chamber < 8; chamber++) {
164     fMUON->SetResponseModel(chamber, fResponse0); // normal response        
165     fMUON->Chamber(chamber).SetChargeCorrel(0.11); // 11% charge spread
166   }
167 }       
168         
169 //__________________________________________________________________________
170 void AliMUONResponseFactory::BuildStation5() 
171 {
172 /// Configuration for Chamber TC9/10  (Station 5) ---------           
173
174   for (Int_t chamber = 8; chamber < 10; chamber++) {
175     fMUON->SetResponseModel(chamber, fResponse0); // normal response        
176     fMUON->Chamber(chamber).SetChargeCorrel(0.11); // 11% charge spread
177   }
178 }       
179         
180 //__________________________________________________________________________
181 void AliMUONResponseFactory::BuildStation6() 
182 {
183 /// Configuration for Trigger Chambers   (Station 6,7) ---------           
184
185   for (Int_t chamber = 10; chamber < 14; chamber++) {
186    
187     fMUON->SetResponseModel(chamber, new AliMUONResponseTrigger);
188     fMUON->Chamber(chamber).SetChargeCorrel(0); // same charge on both cathodes
189   }
190 }       
191
192 //__________________________________________________________________________
193 void AliMUONResponseFactory::Build(AliMUON* where) 
194 {
195 /// Construct MUON responses
196
197   fMUON = where;
198
199   // Set default parameters
200   fMUON->SetIshunt(0);
201   fMUON->SetMaxStepGas(0.1);
202   fMUON->SetMaxStepAlu(0.1);
203
204   // Build stations
205   BuildCommon();
206   BuildStation1();
207   BuildStation2();
208   BuildStation3();
209   BuildStation4();
210   BuildStation5();
211   BuildStation6();
212 }
213
214 //__________________________________________________________________________
215 void AliMUONResponseFactory::BuildStation(AliMUON* where, Int_t stationNumber) 
216 {
217 /// Construct MUON responses for given station
218
219   fMUON = where;
220   if (!fResponse0) BuildCommon(); 
221     
222   switch (stationNumber) {    
223     case 1:  BuildStation1(); break;
224     case 2:  BuildStation2(); break;
225     case 3:  BuildStation3(); break;
226     case 4:  BuildStation4(); break;
227     case 5:  BuildStation5(); break;
228     case 6:  BuildStation6(); break;
229     
230     default: AliFatal("Wrong station number");
231   }  
232 }