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