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 **************************************************************************/
17 Revision 1.11 2001/07/20 10:03:14 morsch
18 Changes needed to work with Root 3.01 (substitute lhs [] operator). (Jiri Chudoba)
20 Revision 1.10 2001/03/20 13:17:30 egangler
21 fChargeCorrel moved from AliMUONChamber to AliMUONResponse as decided by
23 Setters and Getters are modified accordingly.
24 This modification is transparent to the user code
26 Revision 1.9 2001/01/26 21:35:54 morsch
27 All pointers set to 0 in default constructor.
29 Revision 1.8 2001/01/17 20:53:40 hristov
30 Destructors corrected to avoid memory leaks
32 Revision 1.7 2000/12/20 13:00:22 egangler
34 Added charge correlation between cathods.
36 MUON->Chamber(chamber-1).SetChargeCorrel(0.11); to set the RMS of
37 q1/q2 to 11 % (number from Alberto)
38 This is stored in AliMUONChamber fChargeCorrel member.
39 At generation time, when a tracks enters the volume,
40 AliMUONv1::StepManager calls
41 AliMUONChamber::ChargeCorrelationInit() to set the current value of
42 fCurrentCorrel which is then used at Disintegration level to scale
43 appropriately the PadHit charges.
45 Revision 1.6 2000/10/09 14:01:12 morsch
46 Double inclusion of AliResponse removed.
48 Revision 1.5 2000/07/03 11:54:57 morsch
49 AliMUONSegmentation and AliMUONHitMap have been replaced by AliSegmentation and AliHitMap in STEER
50 The methods GetPadIxy and GetPadXxy of AliMUONSegmentation have changed name to GetPadI and GetPadC.
52 Revision 1.4 2000/06/29 12:34:09 morsch
53 AliMUONSegmentation class has been made independent of AliMUONChamber. This makes
54 it usable with any other geometry class. The link to the object to which it belongs is
55 established via an index. This assumes that there exists a global geometry manager
56 from which the pointer to the parent object can be obtained (in our case gAlice).
58 Revision 1.3 2000/06/28 15:16:35 morsch
59 (1) Client code adapted to new method signatures in AliMUONSegmentation (see comments there)
60 to allow development of slat-muon chamber simulation and reconstruction code in the MUON
61 framework. The changes should have no side effects (mostly dummy arguments).
62 (2) Hit disintegration uses 3-dim hit coordinates to allow simulation
63 of chambers with overlapping modules (MakePadHits, Disintegration).
65 Revision 1.2 2000/06/15 07:58:48 morsch
66 Code from MUON-dev joined
68 Revision 1.1.2.5 2000/06/09 21:27:01 morsch
69 Most coding rule violations corrected.
71 Revision 1.1.2.4 2000/05/05 11:34:12 morsch
74 Revision 1.1.2.3 2000/05/05 10:09:52 morsch
78 // --- MUON includes ---
79 #include "AliMUONChamber.h"
81 // --- ROOT includes ---
86 ClassImp(AliMUONChamber)
88 AliMUONChamber::AliMUONChamber()
90 // Default constructor
96 // to avoid mistakes if ChargeCorrelInit is not called
100 AliMUONChamber::AliMUONChamber(Int_t id)
102 // Construtor with chamber id
103 fSegmentation = new TObjArray(2);
104 fSegmentation->AddAt(0,0);
105 fSegmentation->AddAt(0,1);
110 // to avoid mistakes if ChargeCorrelInit is not called
114 AliMUONChamber::~AliMUONChamber()
118 fSegmentation->Delete();
119 delete fSegmentation;
123 AliMUONChamber::AliMUONChamber(const AliMUONChamber& rChamber)
125 // Dummy copy constructor
130 void AliMUONChamber::Init()
134 // ... for chamber segmentation
135 //PH if ((*fSegmentation)[0])
136 //PH ((AliSegmentation *) (*fSegmentation)[0])->Init(fId);
137 if (fSegmentation->At(0))
138 ((AliSegmentation *) fSegmentation->At(0))->Init(fId);
141 //PH if ((*fSegmentation)[1])
142 //PH ((AliSegmentation *) (*fSegmentation)[1])->Init(fId);
143 if (fSegmentation->At(1))
144 ((AliSegmentation *) fSegmentation->At(1))->Init(fId);
148 Int_t AliMUONChamber::SigGenCond(Float_t x, Float_t y, Float_t z)
150 // Ask segmentation if signal should be generated
152 //PH return ((AliSegmentation*) (*fSegmentation)[0])
153 return ((AliSegmentation*) fSegmentation->At(0))
154 ->SigGenCond(x, y, z) ;
156 //PH return (((AliSegmentation*) (*fSegmentation)[0])
157 return (((AliSegmentation*) fSegmentation->At(0))
158 ->SigGenCond(x, y, z)) ||
159 //PH (((AliSegmentation*) (*fSegmentation)[1])
160 (((AliSegmentation*) fSegmentation->At(1))
161 ->SigGenCond(x, y, z)) ;
166 void AliMUONChamber::SigGenInit(Float_t x, Float_t y, Float_t z)
169 // Initialisation of segmentation for hit
172 //PH ((AliSegmentation*) (*fSegmentation)[0])->SigGenInit(x, y, z) ;
173 ((AliSegmentation*) fSegmentation->At(0))->SigGenInit(x, y, z) ;
175 //PH ((AliSegmentation*) (*fSegmentation)[0])->SigGenInit(x, y, z) ;
176 //PH ((AliSegmentation*) (*fSegmentation)[1])->SigGenInit(x, y, z) ;
177 ((AliSegmentation*) fSegmentation->At(0))->SigGenInit(x, y, z) ;
178 ((AliSegmentation*) fSegmentation->At(1))->SigGenInit(x, y, z) ;
182 void AliMUONChamber::ChargeCorrelationInit() {
183 // Initialisation of charge correlation for current hit
184 // the value is stored, and then used by Disintegration
188 // exponential is here to avoid eventual problems in 0
189 // factor 2 because chargecorrel is q1/q2 and not q1/qtrue
190 fCurrentCorrel = TMath::Exp(gRandom->Gaus(0,fResponse->ChargeCorrel()/2));
193 void AliMUONChamber::DisIntegration(Float_t eloss, Float_t tof,
194 Float_t xhit, Float_t yhit, Float_t zhit,
195 Int_t& nnew,Float_t newclust[6][500])
198 // Generates pad hits (simulated cluster)
199 // using the segmentation and the response model
202 // Width of the integration area
204 dx=fResponse->SigmaIntegration()*fResponse->ChargeSpreadX();
205 dy=fResponse->SigmaIntegration()*fResponse->ChargeSpreadY();
207 // Get pulse height from energy loss
208 Float_t qtot = fResponse->IntPH(eloss);
212 Float_t qcheck=0, qp;
215 // Cathode plane loop
216 for (Int_t i=1; i<=fnsec; i++) {
218 Float_t qcath = qtot * (i==1? fCurrentCorrel : 1/fCurrentCorrel);
219 AliSegmentation * segmentation=
220 //PH (AliSegmentation *) (*fSegmentation)[i-1];
221 (AliSegmentation *) fSegmentation->At(i-1);
222 for (segmentation->FirstPad(xhit, yhit, zhit, dx, dy);
223 segmentation->MorePads();
224 segmentation->NextPad())
226 qp=fResponse->IntXY(segmentation);
233 // --- store signal information
234 newclust[0][nnew]=qcath; // total charge
235 newclust[1][nnew]=segmentation->Ix(); // ix-position of pad
236 newclust[2][nnew]=segmentation->Iy(); // iy-position of pad
237 newclust[3][nnew]=qp * qcath; // charge on pad
238 newclust[4][nnew]=segmentation->ISector(); // sector id
239 newclust[5][nnew]=(Float_t) i; // counter
241 // if (i==2) printf("\n i, nnew, q %d %d %f", i, nnew, qp*qcath);
246 } // Cathode plane loop
251 void AliMUONChamber::InitGeo(Float_t zpos)
255 // 3% radiation length of aluminum (X0=8.9 cm)
260 AliMUONChamber & AliMUONChamber::operator =(const AliMUONChamber& rhs)
262 // Dummy assignment operator