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.9 2001/01/26 21:35:54 morsch
18 All pointers set to 0 in default constructor.
20 Revision 1.8 2001/01/17 20:53:40 hristov
21 Destructors corrected to avoid memory leaks
23 Revision 1.7 2000/12/20 13:00:22 egangler
25 Added charge correlation between cathods.
27 MUON->Chamber(chamber-1).SetChargeCorrel(0.11); to set the RMS of
28 q1/q2 to 11 % (number from Alberto)
29 This is stored in AliMUONChamber fChargeCorrel member.
30 At generation time, when a tracks enters the volume,
31 AliMUONv1::StepManager calls
32 AliMUONChamber::ChargeCorrelationInit() to set the current value of
33 fCurrentCorrel which is then used at Disintegration level to scale
34 appropriately the PadHit charges.
36 Revision 1.6 2000/10/09 14:01:12 morsch
37 Double inclusion of AliResponse removed.
39 Revision 1.5 2000/07/03 11:54:57 morsch
40 AliMUONSegmentation and AliMUONHitMap have been replaced by AliSegmentation and AliHitMap in STEER
41 The methods GetPadIxy and GetPadXxy of AliMUONSegmentation have changed name to GetPadI and GetPadC.
43 Revision 1.4 2000/06/29 12:34:09 morsch
44 AliMUONSegmentation class has been made independent of AliMUONChamber. This makes
45 it usable with any other geometry class. The link to the object to which it belongs is
46 established via an index. This assumes that there exists a global geometry manager
47 from which the pointer to the parent object can be obtained (in our case gAlice).
49 Revision 1.3 2000/06/28 15:16:35 morsch
50 (1) Client code adapted to new method signatures in AliMUONSegmentation (see comments there)
51 to allow development of slat-muon chamber simulation and reconstruction code in the MUON
52 framework. The changes should have no side effects (mostly dummy arguments).
53 (2) Hit disintegration uses 3-dim hit coordinates to allow simulation
54 of chambers with overlapping modules (MakePadHits, Disintegration).
56 Revision 1.2 2000/06/15 07:58:48 morsch
57 Code from MUON-dev joined
59 Revision 1.1.2.5 2000/06/09 21:27:01 morsch
60 Most coding rule violations corrected.
62 Revision 1.1.2.4 2000/05/05 11:34:12 morsch
65 Revision 1.1.2.3 2000/05/05 10:09:52 morsch
69 // --- MUON includes ---
70 #include "AliMUONChamber.h"
72 // --- ROOT includes ---
77 ClassImp(AliMUONChamber)
79 AliMUONChamber::AliMUONChamber()
81 // Default constructor
87 // to avoid mistakes if ChargeCorrelInit is not called
91 AliMUONChamber::AliMUONChamber(Int_t id)
93 // Construtor with chamber id
94 fSegmentation = new TObjArray(2);
95 (*fSegmentation)[0] = 0;
96 (*fSegmentation)[1] = 0;
101 // to avoid mistakes if ChargeCorrelInit is not called
105 AliMUONChamber::~AliMUONChamber()
109 fSegmentation->Delete();
110 delete fSegmentation;
114 AliMUONChamber::AliMUONChamber(const AliMUONChamber& rChamber)
116 // Dummy copy constructor
121 void AliMUONChamber::Init()
125 // ... for chamber segmentation
126 if ((*fSegmentation)[0])
127 ((AliSegmentation *) (*fSegmentation)[0])->Init(fId);
130 if ((*fSegmentation)[1])
131 ((AliSegmentation *) (*fSegmentation)[1])->Init(fId);
135 Int_t AliMUONChamber::SigGenCond(Float_t x, Float_t y, Float_t z)
137 // Ask segmentation if signal should be generated
139 return ((AliSegmentation*) (*fSegmentation)[0])
140 ->SigGenCond(x, y, z) ;
142 return (((AliSegmentation*) (*fSegmentation)[0])
143 ->SigGenCond(x, y, z)) ||
144 (((AliSegmentation*) (*fSegmentation)[1])
145 ->SigGenCond(x, y, z)) ;
150 void AliMUONChamber::SigGenInit(Float_t x, Float_t y, Float_t z)
153 // Initialisation of segmentation for hit
156 ((AliSegmentation*) (*fSegmentation)[0])->SigGenInit(x, y, z) ;
158 ((AliSegmentation*) (*fSegmentation)[0])->SigGenInit(x, y, z) ;
159 ((AliSegmentation*) (*fSegmentation)[1])->SigGenInit(x, y, z) ;
163 void AliMUONChamber::ChargeCorrelationInit() {
164 // Initialisation of charge correlation for current hit
165 // the value is stored, and then used by Disintegration
169 // exponential is here to avoid eventual problems in 0
170 // factor 2 because chargecorrel is q1/q2 and not q1/qtrue
171 fCurrentCorrel = TMath::Exp(gRandom->Gaus(0,fResponse->ChargeCorrel()/2));
174 void AliMUONChamber::DisIntegration(Float_t eloss, Float_t tof,
175 Float_t xhit, Float_t yhit, Float_t zhit,
176 Int_t& nnew,Float_t newclust[6][500])
179 // Generates pad hits (simulated cluster)
180 // using the segmentation and the response model
183 // Width of the integration area
185 dx=fResponse->SigmaIntegration()*fResponse->ChargeSpreadX();
186 dy=fResponse->SigmaIntegration()*fResponse->ChargeSpreadY();
188 // Get pulse height from energy loss
189 Float_t qtot = fResponse->IntPH(eloss);
193 Float_t qcheck=0, qp;
196 // Cathode plane loop
197 for (Int_t i=1; i<=fnsec; i++) {
199 Float_t qcath = qtot * (i==1? fCurrentCorrel : 1/fCurrentCorrel);
200 AliSegmentation * segmentation=
201 (AliSegmentation *) (*fSegmentation)[i-1];
202 for (segmentation->FirstPad(xhit, yhit, zhit, dx, dy);
203 segmentation->MorePads();
204 segmentation->NextPad())
206 qp=fResponse->IntXY(segmentation);
213 // --- store signal information
214 newclust[0][nnew]=qcath; // total charge
215 newclust[1][nnew]=segmentation->Ix(); // ix-position of pad
216 newclust[2][nnew]=segmentation->Iy(); // iy-position of pad
217 newclust[3][nnew]=qp * qcath; // charge on pad
218 newclust[4][nnew]=segmentation->ISector(); // sector id
219 newclust[5][nnew]=(Float_t) i; // counter
221 // if (i==2) printf("\n i, nnew, q %d %d %f", i, nnew, qp*qcath);
226 } // Cathode plane loop
231 void AliMUONChamber::InitGeo(Float_t zpos)
235 // 3% radiation length of aluminum (X0=8.9 cm)
240 AliMUONChamber & AliMUONChamber::operator =(const AliMUONChamber& rhs)
242 // Dummy assignment operator