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