]>
Commit | Line | Data |
---|---|---|
4c039060 | 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 | **************************************************************************/ | |
4c039060 | 15 | |
88cb7938 | 16 | /* $Id$ */ |
17 | ||
a9e2aefa | 18 | |
19 | /////////////////////////////////////////////// | |
fe4da5cc | 20 | // Manager and hits classes for set:MUON // |
21 | //////////////////////////////////////////////// | |
22 | ||
88cb7938 | 23 | #include "Riostream.h" |
24 | ||
25 | #include <AliPDG.h> | |
a897a37a | 26 | #include <TBRIK.h> |
88cb7938 | 27 | #include <TCanvas.h> |
28 | #include <TDirectory.h> | |
29 | #include <TFile.h> | |
94de3818 | 30 | #include <TGeometry.h> |
88cb7938 | 31 | #include <TMinuit.h> |
fe4da5cc | 32 | #include <TNode.h> |
88cb7938 | 33 | #include <TNtuple.h> |
fe4da5cc | 34 | #include <TObjArray.h> |
88cb7938 | 35 | #include <TObject.h> |
36 | #include <TObjectTable.h> | |
37 | #include <TPad.h> | |
a897a37a | 38 | #include <TParticle.h> |
39 | #include <TROOT.h> | |
88cb7938 | 40 | #include <TRandom.h> |
41 | #include <TRotMatrix.h> | |
42 | #include <TTUBE.h> | |
a9e2aefa | 43 | #include <TTUBE.h> |
88cb7938 | 44 | #include <TTree.h> |
45 | #include <TVector.h> | |
46 | #include <TVirtualMC.h> | |
fe4da5cc | 47 | |
88cb7938 | 48 | #include "AliConst.h" |
49 | #include "AliHeader.h" | |
50 | #include "AliHitMap.h" | |
51 | #include "AliLoader.h" | |
dbb4e169 | 52 | #include "AliRunDigitizer.h" |
307d9d04 | 53 | #include "AliMC.h" |
fac3a970 | 54 | #include "AliRun.h" |
3fa6cfdd | 55 | #include "AliMUONLoader.h" |
fe4da5cc | 56 | #include "AliMUON.h" |
88cb7938 | 57 | #include "AliMUONChamberTrigger.h" |
88cb7938 | 58 | #include "AliMUONConstants.h" |
59 | #include "AliMUONDigit.h" | |
a9e2aefa | 60 | #include "AliMUONHit.h" |
88cb7938 | 61 | #include "AliMUONHitMapA1.h" |
88cb7938 | 62 | #include "AliMUONMerger.h" |
a9e2aefa | 63 | #include "AliMUONPadHit.h" |
a9e2aefa | 64 | #include "AliMUONRawCluster.h" |
88cb7938 | 65 | #include "AliMUONTransientDigit.h" |
ecfa008b | 66 | #include "AliMUONTriggerCircuit.h" |
d1cd2474 | 67 | #include "AliMUONVGeometryBuilder.h" |
dbb4e169 | 68 | #include "AliMUONDigitizerv2.h" |
d1775029 | 69 | #include "AliMUONSDigitizerv1.h" |
39e39255 | 70 | #include "AliMUONRawData.h" |
a9e2aefa | 71 | |
72 | // Defaults parameters for Z positions of chambers | |
73 | // taken from values for "stations" in AliMUON::AliMUON | |
74 | // const Float_t zch[7]={528, 690., 975., 1249., 1449., 1610, 1710.}; | |
75 | // and from array "dstation" in AliMUONv1::CreateGeometry | |
76 | // Float_t dstation[5]={20., 20., 20, 20., 20.}; | |
77 | // for tracking chambers, | |
78 | // according to (Z1 = zch - dstation) and (Z2 = zch + dstation) | |
79 | // for the first and second chambers in the station, respectively, | |
80 | // and from "DTPLANES" in AliMUONv1::CreateGeometry | |
81 | // const Float_t DTPLANES = 15.; | |
82 | // for trigger chambers, | |
83 | // according to (Z1 = zch) and (Z2 = zch + DTPLANES) | |
84 | // for the first and second chambers in the station, respectively | |
fe4da5cc | 85 | |
fe4da5cc | 86 | ClassImp(AliMUON) |
30178c30 | 87 | |
ce3f5e87 | 88 | //__________________________________________________________________ |
fe4da5cc | 89 | AliMUON::AliMUON() |
30178c30 | 90 | : AliDetector(), |
91 | fNCh(0), | |
92 | fNTrackingCh(0), | |
93 | fMUONData(0), | |
94 | fSplitLevel(0), | |
95 | fChambers(0), | |
96 | fGeometryBuilders(0), | |
97 | fTriggerCircuits(0), | |
98 | fAccCut(kFALSE), | |
99 | fAccMin(0.), | |
100 | fAccMax(0.), | |
101 | fMaxStepGas(0.), | |
102 | fMaxStepAlu(0.), | |
103 | fMaxDestepGas(0.), | |
104 | fMaxDestepAlu(0.), | |
105 | fMaxIterPad(0), | |
106 | fCurIterPad(0), | |
107 | fMerger(0) | |
fe4da5cc | 108 | { |
de05461e | 109 | // Default Constructor |
110 | // | |
1bd26093 | 111 | fIshunt = 0; |
fe4da5cc | 112 | } |
30178c30 | 113 | |
ce3f5e87 | 114 | //__________________________________________________________________ |
fe4da5cc | 115 | AliMUON::AliMUON(const char *name, const char *title) |
30178c30 | 116 | : AliDetector(name,title), |
117 | fNCh(AliMUONConstants::NCh()), | |
118 | fNTrackingCh(AliMUONConstants::NTrackingCh()), | |
119 | fMUONData(0), | |
120 | fSplitLevel(0), | |
121 | fChambers(0), | |
122 | fGeometryBuilders(0), | |
123 | fTriggerCircuits(0), | |
124 | fAccCut(kFALSE), | |
125 | fAccMin(0.), | |
126 | fAccMax(0.), | |
127 | fMaxStepGas(0.1), | |
128 | fMaxStepAlu(0.1), | |
129 | fMaxDestepGas(-1), // Negatives values are ignored by geant3 CONS200 | |
130 | fMaxDestepAlu(-1), // in the calculation of the tracking parameters | |
131 | fMaxIterPad(0), | |
132 | fCurIterPad(0), | |
133 | fMerger(0) | |
fe4da5cc | 134 | { |
f665c1ea | 135 | |
30178c30 | 136 | fIshunt = 0; |
a897a37a | 137 | |
ce3f5e87 | 138 | SetMarkerColor(kRed);// |
a9e2aefa | 139 | // |
ce3f5e87 | 140 | // Creating List of Chambers |
a9e2aefa | 141 | Int_t ch; |
f665c1ea | 142 | fChambers = new TObjArray(AliMUONConstants::NCh()); |
d1cd2474 | 143 | fGeometryBuilders = new TObjArray(AliMUONConstants::NCh()); |
144 | ||
a9e2aefa | 145 | // Loop over stations |
f665c1ea | 146 | for (Int_t st = 0; st < AliMUONConstants::NCh() / 2; st++) { |
a9e2aefa | 147 | // Loop over 2 chambers in the station |
ce3f5e87 | 148 | for (Int_t stCH = 0; stCH < 2; stCH++) { |
149 | // | |
150 | // | |
151 | // Default Parameters for Muon Tracking Stations | |
152 | ch = 2 * st + stCH; | |
153 | if (ch < AliMUONConstants::NTrackingCh()) { | |
154 | fChambers->AddAt(new AliMUONChamber(ch),ch); | |
155 | } else { | |
156 | fChambers->AddAt(new AliMUONChamberTrigger(ch),ch); | |
157 | } | |
158 | AliMUONChamber* chamber = (AliMUONChamber*) fChambers->At(ch); | |
d1cd2474 | 159 | //chamber->SetGid(0); |
ce3f5e87 | 160 | // Default values for Z of chambers |
161 | chamber->SetZ(AliMUONConstants::DefaultChamberZ(ch)); | |
162 | // | |
163 | chamber->InitGeo(AliMUONConstants::DefaultChamberZ(ch)); | |
164 | // Set chamber inner and outer radius to default | |
165 | chamber->SetRInner(AliMUONConstants::Dmin(st)/2); | |
166 | chamber->SetROuter(AliMUONConstants::Dmax(st)/2); | |
167 | // | |
168 | } // Chamber stCH (0, 1) in | |
a9e2aefa | 169 | } // Station st (0...) |
ce3f5e87 | 170 | |
ce3f5e87 | 171 | // cp new design of AliMUONTriggerDecision |
172 | fTriggerCircuits = new TObjArray(AliMUONConstants::NTriggerCircuit()); | |
173 | for (Int_t circ=0; circ<AliMUONConstants::NTriggerCircuit(); circ++) { | |
174 | fTriggerCircuits->AddAt(new AliMUONTriggerCircuit(),circ); | |
175 | } | |
fe4da5cc | 176 | } |
30178c30 | 177 | |
ce3f5e87 | 178 | //____________________________________________________________________ |
30178c30 | 179 | AliMUON::AliMUON(const AliMUON& rMUON) |
180 | : AliDetector(rMUON) | |
a9e2aefa | 181 | { |
30178c30 | 182 | // Protected copy constructor |
183 | ||
184 | Fatal("AliMUONMergerModule", "Not implemented."); | |
a9e2aefa | 185 | } |
30178c30 | 186 | |
ce3f5e87 | 187 | //____________________________________________________________________ |
fe4da5cc | 188 | AliMUON::~AliMUON() |
189 | { | |
de05461e | 190 | // Destructor |
ce3f5e87 | 191 | if(fDebug) printf("%s: Calling AliMUON destructor !!!\n",ClassName()); |
192 | fIshunt = 0; | |
193 | if (fMerger) delete fMerger; | |
d1cd2474 | 194 | |
195 | if (fGeometryBuilders){ | |
196 | fGeometryBuilders->Delete(); | |
197 | delete fGeometryBuilders; | |
c6df4ef2 | 198 | } |
199 | if (fChambers){ | |
200 | fChambers->Delete(); | |
201 | delete fChambers; | |
202 | } | |
203 | if (fTriggerCircuits){ | |
204 | fTriggerCircuits->Delete(); | |
205 | delete fTriggerCircuits; | |
206 | } | |
207 | delete fMUONData; | |
d1cd2474 | 208 | } |
30178c30 | 209 | |
210 | //________________________________________________________________________ | |
211 | AliMUON& AliMUON::operator = (const AliMUON& rhs) | |
212 | { | |
213 | // Protected assignement operator | |
214 | ||
215 | if (this == &rhs) return *this; | |
216 | ||
217 | Fatal("operator=", "Not implemented."); | |
218 | ||
219 | return *this; | |
220 | } | |
221 | ||
d1cd2474 | 222 | //_____________________________________________________________________________ |
223 | void AliMUON::AddGeometryBuilder(AliMUONVGeometryBuilder* geomBuilder) | |
224 | { | |
225 | // Adds the geometry builder to the list | |
226 | // --- | |
227 | ||
228 | fGeometryBuilders->Add(geomBuilder); | |
a897a37a | 229 | } |
ce3f5e87 | 230 | //____________________________________________________________________ |
fe4da5cc | 231 | void AliMUON::BuildGeometry() |
232 | { | |
de05461e | 233 | // Geometry for event display |
a25133eb | 234 | // for (Int_t i=0; i<7; i++) { |
235 | // for (Int_t j=0; j<2; j++) { | |
236 | // Int_t id=2*i+j+1; | |
237 | // this->Chamber(id-1).SegmentationModel(1)->Draw("eventdisplay"); | |
238 | // } | |
239 | // } | |
fe4da5cc | 240 | } |
ce3f5e87 | 241 | //__________________________________________________________________ |
242 | void AliMUON::SetTreeAddress() | |
a897a37a | 243 | { |
ce3f5e87 | 244 | GetMUONData()->SetLoader(fLoader); |
d1775029 | 245 | // GetMUONData()->MakeBranch("D,S,RC"); |
246 | // GetMUONData()->SetTreeAddress("H,D,S,RC"); | |
52c9bc11 | 247 | GetMUONData()->SetTreeAddress("H"); |
307d9d04 | 248 | if (fHits != GetMUONData()->Hits()) { |
ae31c826 | 249 | if ( gAlice->GetMCApp() ) |
6d2f7cbd | 250 | if ( gAlice->GetMCApp()->GetHitLists() ) { |
251 | fHits = GetMUONData()->Hits(); | |
252 | gAlice->GetMCApp()->AddHitList(fHits); // For purifyKine, only necessary when Hit list is created in AliMUONData | |
253 | } | |
307d9d04 | 254 | } |
6d2f7cbd | 255 | fHits = GetMUONData()->Hits(); // Added by Ivana to use the methods FisrtHit, NextHit of AliDetector |
a9e2aefa | 256 | } |
257 | ||
ce3f5e87 | 258 | //____________________________________________________________________ |
a9e2aefa | 259 | void AliMUON::SetPadSize(Int_t id, Int_t isec, Float_t p1, Float_t p2) |
260 | { | |
de05461e | 261 | // Set the pad size for chamber id and cathode isec |
a9e2aefa | 262 | Int_t i=2*(id-1); |
2682e810 | 263 | ((AliMUONChamber*) fChambers->At(i)) ->SetPadSize(isec,p1,p2); |
264 | ((AliMUONChamber*) fChambers->At(i+1))->SetPadSize(isec,p1,p2); | |
a897a37a | 265 | } |
266 | ||
fe4da5cc | 267 | //___________________________________________ |
a9e2aefa | 268 | void AliMUON::SetChambersZ(const Float_t *Z) |
269 | { | |
270 | // Set Z values for all chambers (tracking and trigger) | |
271 | // from the array pointed to by "Z" | |
f665c1ea | 272 | for (Int_t ch = 0; ch < AliMUONConstants::NCh(); ch++) |
2682e810 | 273 | ((AliMUONChamber*) fChambers->At(ch))->SetZ(Z[ch]); |
f665c1ea | 274 | return; |
a9e2aefa | 275 | } |
ce3f5e87 | 276 | //_________________________________________________________________ |
a9e2aefa | 277 | void AliMUON::SetChambersZToDefault() |
fe4da5cc | 278 | { |
a9e2aefa | 279 | // Set Z values for all chambers (tracking and trigger) |
280 | // to default values | |
f665c1ea | 281 | SetChambersZ(AliMUONConstants::DefaultChamberZ()); |
a9e2aefa | 282 | return; |
fe4da5cc | 283 | } |
ce3f5e87 | 284 | //_________________________________________________________________ |
a897a37a | 285 | void AliMUON::SetChargeSlope(Int_t id, Float_t p1) |
fe4da5cc | 286 | { |
de05461e | 287 | // Set the inverse charge slope for chamber id |
ce3f5e87 | 288 | Int_t i=2*(id-1); //PH ((AliMUONChamber*) (*fChambers)[i])->SetSigmaIntegration(p1); |
289 | //PH ((AliMUONChamber*) (*fChambers)[i+1])->SetSigmaIntegration(p1); | |
2682e810 | 290 | ((AliMUONChamber*) fChambers->At(i))->SetChargeSlope(p1); |
291 | ((AliMUONChamber*) fChambers->At(i+1))->SetChargeSlope(p1); | |
fe4da5cc | 292 | } |
ce3f5e87 | 293 | //__________________________________________________________________ |
a897a37a | 294 | void AliMUON::SetChargeSpread(Int_t id, Float_t p1, Float_t p2) |
fe4da5cc | 295 | { |
de05461e | 296 | // Set sigma of charge spread for chamber id |
fe4da5cc | 297 | Int_t i=2*(id-1); |
2682e810 | 298 | ((AliMUONChamber*) fChambers->At(i))->SetChargeSpread(p1,p2); |
299 | ((AliMUONChamber*) fChambers->At(i+1))->SetChargeSpread(p1,p2); | |
fe4da5cc | 300 | } |
ce3f5e87 | 301 | //___________________________________________________________________ |
a897a37a | 302 | void AliMUON::SetSigmaIntegration(Int_t id, Float_t p1) |
fe4da5cc | 303 | { |
de05461e | 304 | // Set integration limits for charge spread |
fe4da5cc | 305 | Int_t i=2*(id-1); |
2682e810 | 306 | ((AliMUONChamber*) fChambers->At(i))->SetSigmaIntegration(p1); |
307 | ((AliMUONChamber*) fChambers->At(i+1))->SetSigmaIntegration(p1); | |
fe4da5cc | 308 | } |
309 | ||
ce3f5e87 | 310 | //__________________________________________________________________ |
d09fafb0 | 311 | void AliMUON::SetMaxAdc(Int_t id, Int_t p1) |
fe4da5cc | 312 | { |
de05461e | 313 | // Set maximum number for ADCcounts (saturation) |
fe4da5cc | 314 | Int_t i=2*(id-1); |
2682e810 | 315 | ((AliMUONChamber*) fChambers->At(i))->SetMaxAdc(p1); |
316 | ((AliMUONChamber*) fChambers->At(i+1))->SetMaxAdc(p1); | |
fe4da5cc | 317 | } |
ce3f5e87 | 318 | //__________________________________________________________________ |
a897a37a | 319 | void AliMUON::SetMaxStepGas(Float_t p1) |
fe4da5cc | 320 | { |
de05461e | 321 | // Set stepsize in gas |
ce3f5e87 | 322 | fMaxStepGas=p1; |
fe4da5cc | 323 | } |
ce3f5e87 | 324 | //__________________________________________________________________ |
a897a37a | 325 | void AliMUON::SetMaxStepAlu(Float_t p1) |
fe4da5cc | 326 | { |
de05461e | 327 | // Set step size in Alu |
fe4da5cc | 328 | fMaxStepAlu=p1; |
329 | } | |
ce3f5e87 | 330 | //__________________________________________________________________ |
a897a37a | 331 | void AliMUON::SetMaxDestepGas(Float_t p1) |
fe4da5cc | 332 | { |
de05461e | 333 | // Set maximum step size in Gas |
fe4da5cc | 334 | fMaxDestepGas=p1; |
335 | } | |
ce3f5e87 | 336 | //__________________________________________________________________ |
a897a37a | 337 | void AliMUON::SetMaxDestepAlu(Float_t p1) |
fe4da5cc | 338 | { |
de05461e | 339 | // Set maximum step size in Alu |
ce3f5e87 | 340 | fMaxDestepAlu=p1; |
fe4da5cc | 341 | } |
ce3f5e87 | 342 | //___________________________________________________________________ |
5c1f55c5 | 343 | void AliMUON::SetAcceptance(Bool_t acc, Float_t angmin, Float_t angmax) |
fe4da5cc | 344 | { |
de05461e | 345 | // Set acceptance cuts |
ce3f5e87 | 346 | fAccCut=acc; |
347 | fAccMin=angmin*TMath::Pi()/180; | |
348 | fAccMax=angmax*TMath::Pi()/180; | |
349 | Int_t ch; | |
350 | if (acc) { | |
351 | for (Int_t st = 0; st < AliMUONConstants::NCh() / 2; st++) { | |
352 | // Loop over 2 chambers in the station | |
353 | for (Int_t stCH = 0; stCH < 2; stCH++) { | |
354 | ch = 2 * st + stCH; | |
355 | // Set chamber inner and outer radius according to acceptance cuts | |
b13a15bc | 356 | Chamber(ch).SetRInner(TMath::Abs(AliMUONConstants::DefaultChamberZ(ch)*TMath::Tan(fAccMin))); |
357 | Chamber(ch).SetROuter(TMath::Abs(AliMUONConstants::DefaultChamberZ(ch)*TMath::Tan(fAccMax))); | |
ce3f5e87 | 358 | } // chamber loop |
359 | } // station loop | |
360 | } | |
fe4da5cc | 361 | } |
d1cd2474 | 362 | |
363 | //____________________________________________________________________ | |
364 | Float_t AliMUON::GetMaxStepGas() const | |
365 | { | |
366 | // Return stepsize in gas | |
367 | ||
368 | return fMaxStepGas; | |
369 | } | |
370 | ||
371 | //____________________________________________________________________ | |
372 | Float_t AliMUON::GetMaxStepAlu() const | |
373 | { | |
374 | // Return step size in Alu | |
375 | ||
376 | return fMaxStepAlu; | |
377 | } | |
378 | ||
379 | //____________________________________________________________________ | |
380 | Float_t AliMUON::GetMaxDestepGas() const | |
381 | { | |
382 | // Return maximum step size in Gas | |
383 | ||
384 | return fMaxDestepGas; | |
385 | } | |
386 | ||
387 | //____________________________________________________________________ | |
388 | Float_t AliMUON::GetMaxDestepAlu() const | |
389 | { | |
390 | // Return maximum step size in Gas | |
391 | ||
392 | return fMaxDestepAlu; | |
393 | } | |
ce3f5e87 | 394 | //____________________________________________________________________ |
a30a000f | 395 | void AliMUON::SetSegmentationModel(Int_t id, Int_t isec, AliSegmentation *segmentation) |
fe4da5cc | 396 | { |
de05461e | 397 | // Set the segmentation for chamber id cathode isec |
2682e810 | 398 | ((AliMUONChamber*) fChambers->At(id))->SetSegmentationModel(isec, segmentation); |
fe4da5cc | 399 | |
400 | } | |
ce3f5e87 | 401 | //____________________________________________________________________ |
a9e2aefa | 402 | void AliMUON::SetResponseModel(Int_t id, AliMUONResponse *response) |
fe4da5cc | 403 | { |
de05461e | 404 | // Set the response for chamber id |
2682e810 | 405 | ((AliMUONChamber*) fChambers->At(id))->SetResponseModel(response); |
fe4da5cc | 406 | } |
ce3f5e87 | 407 | //____________________________________________________________________ |
fe4da5cc | 408 | void AliMUON::SetNsec(Int_t id, Int_t nsec) |
409 | { | |
de05461e | 410 | // Set number of segmented cathods for chamber id |
2682e810 | 411 | ((AliMUONChamber*) fChambers->At(id))->SetNsec(nsec); |
fe4da5cc | 412 | } |
85a5290f | 413 | //____________________________________________________________________ |
c92eb8ad | 414 | AliDigitizer* AliMUON::CreateDigitizer(AliRunDigitizer* manager) const |
85a5290f | 415 | { |
dbb4e169 | 416 | return new AliMUONDigitizerv2(manager); |
85a5290f | 417 | } |
ce3f5e87 | 418 | //_____________________________________________________________________ |
2ab0c725 | 419 | void AliMUON::SDigits2Digits() |
420 | { | |
d963c261 | 421 | |
422 | // write TreeD here | |
423 | ||
424 | if (!fMerger) { | |
425 | if (gAlice->GetDebug()>0) { | |
426 | cerr<<"AliMUON::SDigits2Digits: create default AliMUONMerger "<<endl; | |
427 | cerr<<" no merging, just digitization of 1 event will be done"<<endl; | |
428 | } | |
429 | fMerger = new AliMUONMerger(); | |
2ab0c725 | 430 | } |
d963c261 | 431 | fMerger->Init(); |
432 | fMerger->Digitise(); | |
433 | char hname[30]; | |
88cb7938 | 434 | // sprintf(hname,"TreeD%d",fLoader->GetHeader()->GetEvent()); |
435 | fLoader->TreeD()->Write(hname,TObject::kOverwrite); | |
436 | fLoader->TreeD()->Reset(); | |
2ab0c725 | 437 | } |
a9e2aefa | 438 | |
d1775029 | 439 | //_____________________________________________________________________ |
440 | void AliMUON::Hits2SDigits() | |
441 | { | |
dbb4e169 | 442 | // Adaption of AliMUONSDigitizerv1 to be excuted by the AliSimulation framework |
443 | AliRunLoader* runLoader = fLoader->GetRunLoader(); | |
444 | AliRunDigitizer * manager = new AliRunDigitizer(1,1); | |
e191bb57 | 445 | manager->SetInputStream(0,runLoader->GetFileName(),AliConfig::GetDefaultEventFolderName()); |
dbb4e169 | 446 | AliMUONDigitizer * dMUON = new AliMUONSDigitizerv1(manager); |
447 | fLoader->LoadHits("READ"); | |
448 | for (Int_t iEvent = 0; iEvent < runLoader->GetNumberOfEvents(); iEvent++) { | |
449 | runLoader->GetEvent(iEvent); | |
450 | dMUON->Exec(""); | |
451 | } | |
452 | fLoader->UnloadHits(); | |
d1775029 | 453 | } |
39e39255 | 454 | //_____________________________________________________________________ |
455 | void AliMUON::Digits2Raw() | |
456 | { | |
457 | // convert digits of the current event to raw data | |
458 | AliMUONRawData* rawData; | |
459 | ||
460 | rawData = new AliMUONRawData(fLoader); | |
461 | if (!rawData->WriteRawData()) Info("MUON","pb writting raw data"); | |
462 | delete rawData; | |
463 | return; | |
464 | } | |
ce3f5e87 | 465 | //_______________________________________________________________________ |
3fa6cfdd | 466 | AliLoader* AliMUON::MakeLoader(const char* topfoldername) |
467 | { | |
468 | //builds standard getter (AliLoader type) | |
469 | //if detector wants to use castomized getter, it must overload this method | |
470 | ||
471 | if (GetDebug()) | |
472 | Info("MakeLoader", | |
473 | "Creating standard getter for detector %s. Top folder is %s.", | |
474 | GetName(),topfoldername); | |
128843d9 | 475 | fLoader = new AliLoader(GetName(),topfoldername); |
ce3f5e87 | 476 | fMUONData = new AliMUONData(fLoader,GetName(),GetName()); |
d652f85c | 477 | fMUONData->SetSplitLevel(fSplitLevel); |
3fa6cfdd | 478 | return fLoader; |
479 | } | |
ce3f5e87 | 480 | //_______________________________________________________________________ |
a9e2aefa | 481 | AliMUONPadHit* AliMUON::FirstPad(AliMUONHit* hit, TClonesArray *clusters) |
fe4da5cc | 482 | { |
5a35ac13 | 483 | // to be removed |
fe4da5cc | 484 | // Initialise the pad iterator |
485 | // Return the address of the first padhit for hit | |
a897a37a | 486 | TClonesArray *theClusters = clusters; |
fe4da5cc | 487 | Int_t nclust = theClusters->GetEntriesFast(); |
1bd28025 | 488 | if (nclust && hit->PHlast() > 0) { |
30178c30 | 489 | fMaxIterPad=hit->PHlast(); |
490 | fCurIterPad=hit->PHfirst(); | |
491 | return (AliMUONPadHit*) clusters->UncheckedAt(fCurIterPad-1); | |
fe4da5cc | 492 | } else { |
493 | return 0; | |
494 | } | |
495 | } | |
ce3f5e87 | 496 | //_______________________________________________________________________ |
a9e2aefa | 497 | AliMUONPadHit* AliMUON::NextPad(TClonesArray *clusters) |
fe4da5cc | 498 | { |
5a35ac13 | 499 | // To be removed |
de05461e | 500 | // Get next pad (in iterator) |
501 | // | |
30178c30 | 502 | fCurIterPad++; |
503 | if (fCurIterPad <= fMaxIterPad) { | |
504 | return (AliMUONPadHit*) clusters->UncheckedAt(fCurIterPad-1); | |
fe4da5cc | 505 | } else { |
506 | return 0; | |
507 | } | |
508 | } | |
ce3f5e87 | 509 | //_______________________________________________________________________ |
a897a37a | 510 | |
511 | AliMUONRawCluster *AliMUON::RawCluster(Int_t ichamber, Int_t icathod, Int_t icluster) | |
512 | { | |
de05461e | 513 | // |
514 | // Return rawcluster (icluster) for chamber ichamber and cathode icathod | |
515 | // Obsolete ?? | |
ce3f5e87 | 516 | TClonesArray *muonRawCluster = GetMUONData()->RawClusters(ichamber); |
a897a37a | 517 | ResetRawClusters(); |
88cb7938 | 518 | TTree *treeR = fLoader->TreeR(); |
a9e2aefa | 519 | Int_t nent=(Int_t)treeR->GetEntries(); |
520 | treeR->GetEvent(nent-2+icathod-1); | |
521 | //treeR->GetEvent(icathod); | |
522 | //Int_t nrawcl = (Int_t)muonRawCluster->GetEntriesFast(); | |
a897a37a | 523 | |
a9e2aefa | 524 | AliMUONRawCluster * mRaw = (AliMUONRawCluster*)muonRawCluster->UncheckedAt(icluster); |
a897a37a | 525 | //printf("RawCluster _ nent nrawcl icluster mRaw %d %d %d%p\n",nent,nrawcl,icluster,mRaw); |
526 | ||
527 | return mRaw; | |
528 | } | |
ce3f5e87 | 529 | //________________________________________________________________________ |
1cae9436 | 530 | void AliMUON::SetMerger(AliMUONMerger* merger) |
531 | { | |
532 | // Set pointer to merger | |
533 | fMerger = merger; | |
534 | } | |
ce3f5e87 | 535 | //________________________________________________________________________ |
1cae9436 | 536 | AliMUONMerger* AliMUON::Merger() |
537 | { | |
538 | // Return pointer to merger | |
539 | return fMerger; | |
540 | } | |
ce3f5e87 | 541 | //________________________________________________________________________ |
48b32e42 | 542 | void AliMUON::RemapTrackHitIDs(Int_t* map) |
543 | { | |
544 | // Remaps the track numbers in the hits arrays, so that they correspond | |
545 | // to the entry indices in the Kine tree. | |
546 | // The correspondance is not direct. To get the real index into the Kine tree | |
547 | // compute the particle index as follows: | |
548 | // | |
549 | // num_primaries = AliStack::GetNprimary(); | |
550 | // num_tracks = AliStack::GetNtracks(); | |
551 | // track = AliMUONHit::Track() | |
552 | // | |
553 | // if (track < num_primaries) | |
554 | // particleindex = track + num_tracks - num_primaries; | |
555 | // else | |
556 | // particleindex = track - num_primaries; | |
557 | ||
558 | // Remap the track numbers based on the specified map. | |
559 | AliMUONData* data = GetMUONData(); | |
560 | TClonesArray* hits = data->Hits(); | |
561 | for (Int_t i = 0; i < hits->GetEntriesFast(); i++) | |
562 | { | |
563 | AliMUONHit* hit = static_cast<AliMUONHit*>( hits->At(i) ); | |
564 | hit->SetTrack( map[hit->Track()] ); | |
565 | }; | |
566 | }; | |
567 |