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