]>
Commit | Line | Data |
---|---|---|
a9e2aefa | 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 | **************************************************************************/ | |
2682e810 | 15 | |
88cb7938 | 16 | /* $Id$ */ |
a9e2aefa | 17 | |
30178c30 | 18 | // --- ROOT includes --- |
19 | #include <TRandom.h> | |
20 | #include <TMath.h> | |
21 | ||
681d067b | 22 | // --- MUON includes --- |
a9e2aefa | 23 | #include "AliMUONChamber.h" |
d1cd2474 | 24 | #include "AliMUONChamberGeometry.h" |
a9e2aefa | 25 | |
a9e2aefa | 26 | ClassImp(AliMUONChamber) |
27 | ||
30178c30 | 28 | AliMUONChamber::AliMUONChamber() |
29 | : TObject(), | |
30 | fId(0), | |
31 | fdGas(0.), | |
32 | fdAlu(0.), | |
33 | fZ(0.), | |
34 | fnsec(1), | |
35 | frMin(0.), | |
36 | frMax(0.), | |
37 | fCurrentCorrel(1), // to avoid mistakes if ChargeCorrelInit is not called | |
38 | fSegmentation(0), | |
39 | fReconstruction(0), | |
40 | fResponse(0), | |
41 | fGeometry(0) | |
d81db581 | 42 | { |
43 | // Default constructor | |
d81db581 | 44 | } |
45 | ||
30178c30 | 46 | AliMUONChamber::AliMUONChamber(Int_t id) |
47 | : TObject(), | |
48 | fId(id), | |
49 | fdGas(0.), | |
50 | fdAlu(0.), | |
51 | fZ(0.), | |
52 | fnsec(1), | |
53 | frMin(0.), | |
54 | frMax(0.), | |
55 | fCurrentCorrel(1), // to avoid mistakes if ChargeCorrelInit is not called | |
56 | fSegmentation(0), | |
57 | fReconstruction(0), | |
58 | fResponse(0), | |
59 | fGeometry(0) | |
a9e2aefa | 60 | { |
d81db581 | 61 | // Construtor with chamber id |
a9e2aefa | 62 | fSegmentation = new TObjArray(2); |
cd4df77b | 63 | fSegmentation->AddAt(0,0); |
64 | fSegmentation->AddAt(0,1); | |
30178c30 | 65 | |
c6df4ef2 | 66 | fGeometry = new AliMUONChamberGeometry(fId); |
30178c30 | 67 | } |
68 | ||
69 | AliMUONChamber::AliMUONChamber(const AliMUONChamber& rChamber) | |
70 | : TObject(rChamber) | |
71 | { | |
72 | // Protected copy constructor | |
73 | ||
74 | Fatal("AliMUONMergerModule", "Not implemented."); | |
75 | // Dummy copy constructor | |
a9e2aefa | 76 | } |
77 | ||
78 | AliMUONChamber::~AliMUONChamber() | |
79 | { | |
d81db581 | 80 | // Destructor |
c2c0190f | 81 | if (fSegmentation) { |
82 | fSegmentation->Delete(); | |
83 | delete fSegmentation; | |
84 | } | |
c6df4ef2 | 85 | delete fGeometry; |
a9e2aefa | 86 | } |
87 | ||
30178c30 | 88 | AliMUONChamber & AliMUONChamber::operator =(const AliMUONChamber& rhs) |
390151b8 | 89 | { |
30178c30 | 90 | // Protected assignement operator |
a9e2aefa | 91 | |
30178c30 | 92 | if (this == &rhs) return *this; |
93 | ||
94 | Fatal("operator=", "Not implemented."); | |
95 | ||
96 | return *this; | |
97 | } | |
a9e2aefa | 98 | |
d1cd2474 | 99 | Bool_t AliMUONChamber::IsSensId(Int_t volId) const |
100 | { | |
101 | // Returns true if the volume specified by volId is in the list | |
102 | // of sesitive volumes for this chamber | |
103 | ||
104 | return fGeometry->IsSensitiveVolume(volId); | |
105 | } | |
106 | ||
a9e2aefa | 107 | void AliMUONChamber::Init() |
108 | { | |
109 | // Initalisation .. | |
110 | // | |
111 | // ... for chamber segmentation | |
2682e810 | 112 | //PH if ((*fSegmentation)[0]) |
113 | //PH ((AliSegmentation *) (*fSegmentation)[0])->Init(fId); | |
114 | if (fSegmentation->At(0)) | |
115 | ((AliSegmentation *) fSegmentation->At(0))->Init(fId); | |
a9e2aefa | 116 | |
117 | if (fnsec==2) { | |
2682e810 | 118 | //PH if ((*fSegmentation)[1]) |
119 | //PH ((AliSegmentation *) (*fSegmentation)[1])->Init(fId); | |
120 | if (fSegmentation->At(1)) | |
121 | ((AliSegmentation *) fSegmentation->At(1))->Init(fId); | |
a9e2aefa | 122 | } |
123 | } | |
124 | ||
125 | Int_t AliMUONChamber::SigGenCond(Float_t x, Float_t y, Float_t z) | |
126 | { | |
127 | // Ask segmentation if signal should be generated | |
128 | if (fnsec==1) { | |
2682e810 | 129 | //PH return ((AliSegmentation*) (*fSegmentation)[0]) |
130 | return ((AliSegmentation*) fSegmentation->At(0)) | |
a9e2aefa | 131 | ->SigGenCond(x, y, z) ; |
132 | } else { | |
2682e810 | 133 | //PH return (((AliSegmentation*) (*fSegmentation)[0]) |
134 | return (((AliSegmentation*) fSegmentation->At(0)) | |
a9e2aefa | 135 | ->SigGenCond(x, y, z)) || |
2682e810 | 136 | //PH (((AliSegmentation*) (*fSegmentation)[1]) |
137 | (((AliSegmentation*) fSegmentation->At(1)) | |
a9e2aefa | 138 | ->SigGenCond(x, y, z)) ; |
139 | } | |
140 | } | |
141 | ||
142 | ||
143 | void AliMUONChamber::SigGenInit(Float_t x, Float_t y, Float_t z) | |
144 | { | |
145 | // | |
146 | // Initialisation of segmentation for hit | |
147 | // | |
148 | if (fnsec==1) { | |
2682e810 | 149 | //PH ((AliSegmentation*) (*fSegmentation)[0])->SigGenInit(x, y, z) ; |
150 | ((AliSegmentation*) fSegmentation->At(0))->SigGenInit(x, y, z) ; | |
a9e2aefa | 151 | } else { |
2682e810 | 152 | //PH ((AliSegmentation*) (*fSegmentation)[0])->SigGenInit(x, y, z) ; |
153 | //PH ((AliSegmentation*) (*fSegmentation)[1])->SigGenInit(x, y, z) ; | |
154 | ((AliSegmentation*) fSegmentation->At(0))->SigGenInit(x, y, z) ; | |
155 | ((AliSegmentation*) fSegmentation->At(1))->SigGenInit(x, y, z) ; | |
a9e2aefa | 156 | } |
157 | } | |
158 | ||
681d067b | 159 | void AliMUONChamber::ChargeCorrelationInit() { |
160 | // Initialisation of charge correlation for current hit | |
161 | // the value is stored, and then used by Disintegration | |
162 | if (fnsec==1) | |
163 | fCurrentCorrel =1; | |
164 | else | |
165 | // exponential is here to avoid eventual problems in 0 | |
16d57990 | 166 | // factor 2 because chargecorrel is q1/q2 and not q1/qtrue |
167 | fCurrentCorrel = TMath::Exp(gRandom->Gaus(0,fResponse->ChargeCorrel()/2)); | |
681d067b | 168 | } |
169 | ||
24fe6002 | 170 | void AliMUONChamber::DisIntegration(Float_t eloss, Float_t /*tof*/, |
802a864d | 171 | Float_t xhit, Float_t yhit, Float_t zhit, |
a9e2aefa | 172 | Int_t& nnew,Float_t newclust[6][500]) |
173 | { | |
174 | // | |
175 | // Generates pad hits (simulated cluster) | |
176 | // using the segmentation and the response model | |
177 | Float_t dx, dy; | |
178 | // | |
179 | // Width of the integration area | |
180 | // | |
181 | dx=fResponse->SigmaIntegration()*fResponse->ChargeSpreadX(); | |
182 | dy=fResponse->SigmaIntegration()*fResponse->ChargeSpreadY(); | |
183 | // | |
184 | // Get pulse height from energy loss | |
185 | Float_t qtot = fResponse->IntPH(eloss); | |
186 | // | |
187 | // Loop Over Pads | |
188 | ||
3194a39e | 189 | Float_t qp; |
a9e2aefa | 190 | nnew=0; |
ef495f13 | 191 | |
681d067b | 192 | // Cathode plane loop |
a9e2aefa | 193 | for (Int_t i=1; i<=fnsec; i++) { |
681d067b | 194 | Float_t qcath = qtot * (i==1? fCurrentCorrel : 1/fCurrentCorrel); |
a30a000f | 195 | AliSegmentation * segmentation= |
2682e810 | 196 | //PH (AliSegmentation *) (*fSegmentation)[i-1]; |
197 | (AliSegmentation *) fSegmentation->At(i-1); | |
802a864d | 198 | for (segmentation->FirstPad(xhit, yhit, zhit, dx, dy); |
a9e2aefa | 199 | segmentation->MorePads(); |
200 | segmentation->NextPad()) | |
201 | { | |
202 | qp=fResponse->IntXY(segmentation); | |
203 | qp=TMath::Abs(qp); | |
a9e2aefa | 204 | // |
205 | // | |
3194a39e | 206 | if (qp > 1.e-4) |
207 | { | |
208 | if (nnew >= 500) // Perform a bounds check on nnew since it is assumed | |
209 | // newclust only contains 500 elements. | |
210 | { | |
211 | Error("DisIntegration", "Limit of 500 pad responses reached."); | |
212 | return; | |
213 | }; | |
214 | // | |
215 | // --- store signal information | |
681d067b | 216 | newclust[0][nnew]=qcath; // total charge |
a9e2aefa | 217 | newclust[1][nnew]=segmentation->Ix(); // ix-position of pad |
218 | newclust[2][nnew]=segmentation->Iy(); // iy-position of pad | |
681d067b | 219 | newclust[3][nnew]=qp * qcath; // charge on pad |
a9e2aefa | 220 | newclust[4][nnew]=segmentation->ISector(); // sector id |
221 | newclust[5][nnew]=(Float_t) i; // counter | |
222 | nnew++; | |
ef495f13 | 223 | |
a9e2aefa | 224 | } |
225 | } // Pad loop | |
ef495f13 | 226 | |
a9e2aefa | 227 | } // Cathode plane loop |
228 | } | |
229 | ||
230 | ||
231 | ||
24fe6002 | 232 | void AliMUONChamber::InitGeo(Float_t /*zpos*/) |
a9e2aefa | 233 | { |
234 | // sensitive gas gap | |
235 | fdGas= 0.5; | |
236 | // 3% radiation length of aluminum (X0=8.9 cm) | |
237 | fdAlu= 3.0/100*8.9; | |
238 | } | |
239 | ||
240 |