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.6 2000/10/09 14:01:12 morsch
18 Double inclusion of AliResponse removed.
20 Revision 1.5 2000/07/03 11:54:57 morsch
21 AliMUONSegmentation and AliMUONHitMap have been replaced by AliSegmentation and AliHitMap in STEER
22 The methods GetPadIxy and GetPadXxy of AliMUONSegmentation have changed name to GetPadI and GetPadC.
24 Revision 1.4 2000/06/29 12:34:09 morsch
25 AliMUONSegmentation class has been made independent of AliMUONChamber. This makes
26 it usable with any other geometry class. The link to the object to which it belongs is
27 established via an index. This assumes that there exists a global geometry manager
28 from which the pointer to the parent object can be obtained (in our case gAlice).
30 Revision 1.3 2000/06/28 15:16:35 morsch
31 (1) Client code adapted to new method signatures in AliMUONSegmentation (see comments there)
32 to allow development of slat-muon chamber simulation and reconstruction code in the MUON
33 framework. The changes should have no side effects (mostly dummy arguments).
34 (2) Hit disintegration uses 3-dim hit coordinates to allow simulation
35 of chambers with overlapping modules (MakePadHits, Disintegration).
37 Revision 1.2 2000/06/15 07:58:48 morsch
38 Code from MUON-dev joined
40 Revision 1.1.2.5 2000/06/09 21:27:01 morsch
41 Most coding rule violations corrected.
43 Revision 1.1.2.4 2000/05/05 11:34:12 morsch
46 Revision 1.1.2.3 2000/05/05 10:09:52 morsch
50 // --- MUON includes ---
51 #include "AliMUONChamber.h"
53 // --- ROOT includes ---
58 ClassImp(AliMUONChamber)
60 AliMUONChamber::AliMUONChamber()
62 // Default constructor
63 fSegmentation = new TObjArray(2);
64 (*fSegmentation)[0] = 0;
65 (*fSegmentation)[1] = 0;
70 // to avoid mistakes if ChargeCorrelInit is not called
75 AliMUONChamber::AliMUONChamber(Int_t id)
77 // Construtor with chamber id
78 fSegmentation = new TObjArray(2);
79 (*fSegmentation)[0] = 0;
80 (*fSegmentation)[1] = 0;
85 // to avoid mistakes if ChargeCorrelInit is not called
90 AliMUONChamber::~AliMUONChamber()
93 if (fSegmentation) delete fSegmentation;
96 AliMUONChamber::AliMUONChamber(const AliMUONChamber& rChamber)
98 // Dummy copy constructor
103 void AliMUONChamber::Init()
107 // ... for chamber segmentation
108 if ((*fSegmentation)[0])
109 ((AliSegmentation *) (*fSegmentation)[0])->Init(fId);
112 if ((*fSegmentation)[1])
113 ((AliSegmentation *) (*fSegmentation)[1])->Init(fId);
117 Int_t AliMUONChamber::SigGenCond(Float_t x, Float_t y, Float_t z)
119 // Ask segmentation if signal should be generated
121 return ((AliSegmentation*) (*fSegmentation)[0])
122 ->SigGenCond(x, y, z) ;
124 return (((AliSegmentation*) (*fSegmentation)[0])
125 ->SigGenCond(x, y, z)) ||
126 (((AliSegmentation*) (*fSegmentation)[1])
127 ->SigGenCond(x, y, z)) ;
132 void AliMUONChamber::SigGenInit(Float_t x, Float_t y, Float_t z)
135 // Initialisation of segmentation for hit
138 ((AliSegmentation*) (*fSegmentation)[0])->SigGenInit(x, y, z) ;
140 ((AliSegmentation*) (*fSegmentation)[0])->SigGenInit(x, y, z) ;
141 ((AliSegmentation*) (*fSegmentation)[1])->SigGenInit(x, y, z) ;
145 void AliMUONChamber::ChargeCorrelationInit() {
146 // Initialisation of charge correlation for current hit
147 // the value is stored, and then used by Disintegration
151 // exponential is here to avoid eventual problems in 0
152 fCurrentCorrel = TMath::Exp(gRandom->Gaus(0,fChargeCorrel/2));
155 void AliMUONChamber::DisIntegration(Float_t eloss, Float_t tof,
156 Float_t xhit, Float_t yhit, Float_t zhit,
157 Int_t& nnew,Float_t newclust[6][500])
160 // Generates pad hits (simulated cluster)
161 // using the segmentation and the response model
164 // Width of the integration area
166 dx=fResponse->SigmaIntegration()*fResponse->ChargeSpreadX();
167 dy=fResponse->SigmaIntegration()*fResponse->ChargeSpreadY();
169 // Get pulse height from energy loss
170 Float_t qtot = fResponse->IntPH(eloss);
174 Float_t qcheck=0, qp;
177 // Cathode plane loop
178 for (Int_t i=1; i<=fnsec; i++) {
180 Float_t qcath = qtot * (i==1? fCurrentCorrel : 1/fCurrentCorrel);
181 AliSegmentation * segmentation=
182 (AliSegmentation *) (*fSegmentation)[i-1];
183 for (segmentation->FirstPad(xhit, yhit, zhit, dx, dy);
184 segmentation->MorePads();
185 segmentation->NextPad())
187 qp=fResponse->IntXY(segmentation);
194 // --- store signal information
195 newclust[0][nnew]=qcath; // total charge
196 newclust[1][nnew]=segmentation->Ix(); // ix-position of pad
197 newclust[2][nnew]=segmentation->Iy(); // iy-position of pad
198 newclust[3][nnew]=qp * qcath; // charge on pad
199 newclust[4][nnew]=segmentation->ISector(); // sector id
200 newclust[5][nnew]=(Float_t) i; // counter
202 // if (i==2) printf("\n i, nnew, q %d %d %f", i, nnew, qp*qcath);
207 } // Cathode plane loop
212 void AliMUONChamber::InitGeo(Float_t zpos)
216 // 3% radiation length of aluminum (X0=8.9 cm)
221 AliMUONChamber & AliMUONChamber::operator =(const AliMUONChamber& rhs)
223 // Dummy assignment operator