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