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