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