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