1 /**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
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 **************************************************************************/
16 ////////////////////////////////////////////////////////////
17 // Factory for muon response //
18 ////////////////////////////////////////////////////////////
22 #include "AliMUONResponseFactory.h"
26 #include "AliMpPlaneType.h"
29 #include "AliMUONConstants.h"
30 #include "AliMUONTriggerConstants.h"
31 #include "AliMUONChamber.h"
32 #include "AliMUONResponseV0.h"
33 #include "AliMUONResponseTrigger.h"
35 ClassImp(AliMUONResponseFactory)
37 //__________________________________________________________________________
38 AliMUONResponseFactory::AliMUONResponseFactory(const char* name)
43 AliDebug(1,Form("ctor this=%p",this));
46 //__________________________________________________________________________
47 AliMUONResponseFactory::AliMUONResponseFactory()
52 AliDebug(1,Form("default (empty) ctor this=%p",this));
53 // Default constructor
56 //__________________________________________________________________________
57 AliMUONResponseFactory::AliMUONResponseFactory(const AliMUONResponseFactory& rhs)
60 // Protected copy constructor
62 AliFatal("Not implemented.");
65 //__________________________________________________________________________
67 AliMUONResponseFactory::~AliMUONResponseFactory()
70 AliDebug(1,Form("dtor this=%p",this));
73 //__________________________________________________________________________
74 AliMUONResponseFactory& AliMUONResponseFactory::operator=(const AliMUONResponseFactory& rhs)
76 // Protected assignement operator
78 if (this == &rhs) return *this;
80 AliFatal("Not implemented.");
85 //__________________________________________________________________________
86 void AliMUONResponseFactory::BuildCommon()
89 // Construct the default response.
92 // Default response: 5 mm of gas
93 fResponse0 = new AliMUONResponseV0;
94 fResponse0->SetSqrtKx3AndDeriveKx2Kx4(0.7131); // sqrt(0.5085)
95 fResponse0->SetSqrtKy3AndDeriveKy2Ky4(0.7642); // sqrt(0.5840)
96 fResponse0->SetPitch(AliMUONConstants::Pitch()); // anode-cathode distance
97 fResponse0->SetSigmaIntegration(10.);
98 fResponse0->SetChargeSlope(10);
99 fResponse0->SetChargeSpread(0.18, 0.18);
100 fResponse0->SetMaxAdc(4096);
101 fResponse0->SetSaturation(3000);
102 fResponse0->SetZeroSuppression(6);
105 //__________________________________________________________________________
106 void AliMUONResponseFactory::BuildStation1()
108 /// Configuration for Chamber TC1/2 (Station 1) ----------
110 // Response for 4 mm of gas (station 1)
111 // automatic consistency with width of sensitive medium in CreateGeometry ????
112 AliMUONResponseV0* responseSt1 = new AliMUONResponseV0;
113 // Mathieson parameters from L.Kharmandarian's thesis, page 190
114 responseSt1->SetSqrtKx3AndDeriveKx2Kx4(0.7000); // sqrt(0.4900)
115 responseSt1->SetSqrtKy3AndDeriveKy2Ky4(0.7550); // sqrt(0.5700)
116 responseSt1->SetPitch(AliMUONConstants::PitchSt1()); // anode-cathode distance
117 responseSt1->SetSigmaIntegration(10.);
118 // ChargeSlope larger to compensate for the smaller anode-cathode distance
119 // and keep the same most probable ADC channel for mip's
120 responseSt1->SetChargeSlope(62.5);
121 // assumed proportionality to anode-cathode distance for ChargeSpread
122 responseSt1->SetChargeSpread(0.144, 0.144);
123 responseSt1->SetMaxAdc(4096);
124 responseSt1->SetSaturation(3000);
125 responseSt1->SetZeroSuppression(6);
127 for (Int_t chamber = 0; chamber < 2; chamber++) {
128 fMUON->SetResponseModel(chamber, responseSt1); // special response
129 fMUON->Chamber(chamber).SetChargeCorrel(0.11); // 11% charge spread
133 //__________________________________________________________________________
134 void AliMUONResponseFactory::BuildStation2()
136 /// Configuration for Chamber TC3/4 (Station 2) -----------
138 for (Int_t chamber = 2; chamber < 4; chamber++) {
139 fMUON->SetResponseModel(chamber, fResponse0); // normal response
140 fMUON->Chamber(chamber).SetChargeCorrel(0.11); // 11% charge spread
144 //__________________________________________________________________________
145 void AliMUONResponseFactory::BuildStation3()
147 /// Configuration for Chamber TC5/6 (Station 3) ----------
149 for (Int_t chamber = 4; chamber < 6; chamber++) {
150 fMUON->SetResponseModel(chamber, fResponse0); // normal response
151 fMUON->Chamber(chamber).SetChargeCorrel(0.11); // 11% charge spread
155 //__________________________________________________________________________
156 void AliMUONResponseFactory::BuildStation4()
158 /// Configuration for Chamber TC7/8 (Station 4) ----------
160 for (Int_t chamber = 6; chamber < 8; chamber++) {
161 fMUON->SetResponseModel(chamber, fResponse0); // normal response
162 fMUON->Chamber(chamber).SetChargeCorrel(0.11); // 11% charge spread
166 //__________________________________________________________________________
167 void AliMUONResponseFactory::BuildStation5()
169 /// Configuration for Chamber TC9/10 (Station 5) ---------
171 for (Int_t chamber = 8; chamber < 10; chamber++) {
172 fMUON->SetResponseModel(chamber, fResponse0); // normal response
173 fMUON->Chamber(chamber).SetChargeCorrel(0.11); // 11% charge spread
177 //__________________________________________________________________________
178 void AliMUONResponseFactory::BuildStation6()
180 /// Configuration for Trigger Chambers (Station 6,7) ---------
182 for (Int_t chamber = 10; chamber < 14; chamber++) {
184 fMUON->SetResponseModel(chamber, new AliMUONResponseTrigger);
185 fMUON->Chamber(chamber).SetChargeCorrel(0); // same charge on both cathodes
189 //__________________________________________________________________________
190 void AliMUONResponseFactory::Build(AliMUON* where)
192 // Construct MUON responses
196 // Set default parameters
198 fMUON->SetMaxStepGas(0.1);
199 fMUON->SetMaxStepAlu(0.1);
211 //__________________________________________________________________________
212 void AliMUONResponseFactory::BuildStation(AliMUON* where, Int_t stationNumber)
214 // Construct MUON responses
217 if (!fResponse0) BuildCommon();
219 switch (stationNumber) {
220 case 1: BuildStation1(); break;
221 case 2: BuildStation2(); break;
222 case 3: BuildStation3(); break;
223 case 4: BuildStation4(); break;
224 case 5: BuildStation5(); break;
225 case 6: BuildStation6(); break;
227 default: AliFatal("Wrong station number");