]>
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" | |
aa43efee | 52 | #include "AliESD.h" |
53 | #include "AliESDMuonTrack.h" | |
3fa6cfdd | 54 | #include "AliMUONLoader.h" |
fe4da5cc | 55 | #include "AliMUON.h" |
aa43efee | 56 | #include "AliMUONTriggerTrack.h" |
57 | #include "AliMUONEventReconstructor.h" | |
58 | #include "AliMUONTrack.h" | |
59 | #include "AliMUONTrackParam.h" | |
88cb7938 | 60 | #include "AliMUONChamberTrigger.h" |
61 | #include "AliMUONClusterFinderVS.h" | |
62 | #include "AliMUONClusterInput.h" | |
63 | #include "AliMUONConstants.h" | |
64 | #include "AliMUONDigit.h" | |
65 | #include "AliMUONGlobalTrigger.h" | |
a9e2aefa | 66 | #include "AliMUONHit.h" |
88cb7938 | 67 | #include "AliMUONHitMapA1.h" |
68 | #include "AliMUONLocalTrigger.h" | |
69 | #include "AliMUONMerger.h" | |
a9e2aefa | 70 | #include "AliMUONPadHit.h" |
a9e2aefa | 71 | #include "AliMUONRawCluster.h" |
88cb7938 | 72 | #include "AliMUONTransientDigit.h" |
ecfa008b | 73 | #include "AliMUONTriggerCircuit.h" |
a9e2aefa | 74 | #include "AliMUONTriggerDecision.h" |
d1cd2474 | 75 | #include "AliMUONVGeometryBuilder.h" |
88cb7938 | 76 | #include "AliRun.h" |
85a5290f | 77 | #include "AliMUONDigitizerv1.h" |
88cb7938 | 78 | |
a9e2aefa | 79 | |
80 | // Defaults parameters for Z positions of chambers | |
81 | // taken from values for "stations" in AliMUON::AliMUON | |
82 | // const Float_t zch[7]={528, 690., 975., 1249., 1449., 1610, 1710.}; | |
83 | // and from array "dstation" in AliMUONv1::CreateGeometry | |
84 | // Float_t dstation[5]={20., 20., 20, 20., 20.}; | |
85 | // for tracking chambers, | |
86 | // according to (Z1 = zch - dstation) and (Z2 = zch + dstation) | |
87 | // for the first and second chambers in the station, respectively, | |
88 | // and from "DTPLANES" in AliMUONv1::CreateGeometry | |
89 | // const Float_t DTPLANES = 15.; | |
90 | // for trigger chambers, | |
91 | // according to (Z1 = zch) and (Z2 = zch + DTPLANES) | |
92 | // for the first and second chambers in the station, respectively | |
fe4da5cc | 93 | |
fe4da5cc | 94 | ClassImp(AliMUON) |
ce3f5e87 | 95 | //__________________________________________________________________ |
fe4da5cc | 96 | AliMUON::AliMUON() |
97 | { | |
de05461e | 98 | // Default Constructor |
99 | // | |
1bd28025 | 100 | fNCh = 0; |
101 | fNTrackingCh = 0; | |
1bd26093 | 102 | fIshunt = 0; |
1bd28025 | 103 | fChambers = 0; |
d1cd2474 | 104 | fGeometryBuilders = 0; |
ce3f5e87 | 105 | fTriggerCircuits = 0; |
1bd26093 | 106 | fAccMin = 0.; |
107 | fAccMax = 0.; | |
108 | fAccCut = kFALSE; | |
1cae9436 | 109 | fMerger = 0; |
edf34242 | 110 | fFileName = 0; |
aecb8bcd | 111 | fMUONData = 0; |
d652f85c | 112 | fSplitLevel = 0; |
fe4da5cc | 113 | } |
ce3f5e87 | 114 | //__________________________________________________________________ |
fe4da5cc | 115 | AliMUON::AliMUON(const char *name, const char *title) |
ce3f5e87 | 116 | : AliDetector(name,title) |
fe4da5cc | 117 | { |
118 | //Begin_Html | |
119 | /* | |
a897a37a | 120 | <img src="gif/alimuon.gif"> |
fe4da5cc | 121 | */ |
122 | //End_Html | |
ce3f5e87 | 123 | fMUONData = 0x0; |
d652f85c | 124 | fSplitLevel= 0; |
ce3f5e87 | 125 | fIshunt = 0; |
f665c1ea | 126 | |
ce3f5e87 | 127 | fNCh = AliMUONConstants::NCh(); |
128 | fNTrackingCh = AliMUONConstants::NTrackingCh(); | |
a897a37a | 129 | |
ce3f5e87 | 130 | SetMarkerColor(kRed);// |
a9e2aefa | 131 | // |
ce3f5e87 | 132 | // Creating List of Chambers |
a9e2aefa | 133 | Int_t ch; |
f665c1ea | 134 | fChambers = new TObjArray(AliMUONConstants::NCh()); |
d1cd2474 | 135 | fGeometryBuilders = new TObjArray(AliMUONConstants::NCh()); |
136 | ||
a9e2aefa | 137 | // Loop over stations |
f665c1ea | 138 | for (Int_t st = 0; st < AliMUONConstants::NCh() / 2; st++) { |
a9e2aefa | 139 | // Loop over 2 chambers in the station |
ce3f5e87 | 140 | for (Int_t stCH = 0; stCH < 2; stCH++) { |
141 | // | |
142 | // | |
143 | // Default Parameters for Muon Tracking Stations | |
144 | ch = 2 * st + stCH; | |
145 | if (ch < AliMUONConstants::NTrackingCh()) { | |
146 | fChambers->AddAt(new AliMUONChamber(ch),ch); | |
147 | } else { | |
148 | fChambers->AddAt(new AliMUONChamberTrigger(ch),ch); | |
149 | } | |
150 | AliMUONChamber* chamber = (AliMUONChamber*) fChambers->At(ch); | |
d1cd2474 | 151 | //chamber->SetGid(0); |
ce3f5e87 | 152 | // Default values for Z of chambers |
153 | chamber->SetZ(AliMUONConstants::DefaultChamberZ(ch)); | |
154 | // | |
155 | chamber->InitGeo(AliMUONConstants::DefaultChamberZ(ch)); | |
156 | // Set chamber inner and outer radius to default | |
157 | chamber->SetRInner(AliMUONConstants::Dmin(st)/2); | |
158 | chamber->SetROuter(AliMUONConstants::Dmax(st)/2); | |
159 | // | |
160 | } // Chamber stCH (0, 1) in | |
a9e2aefa | 161 | } // Station st (0...) |
ce3f5e87 | 162 | |
1391e633 | 163 | // Negatives values are ignored by geant3 CONS200 in the calculation of the tracking parameters |
164 | fMaxStepGas=0.1; | |
165 | fMaxStepAlu=0.1; | |
a9e2aefa | 166 | fMaxDestepGas=-1; |
167 | fMaxDestepAlu=-1; | |
ce3f5e87 | 168 | |
169 | fMaxIterPad = 0; | |
170 | fCurIterPad = 0; | |
171 | ||
172 | fAccMin = 0.; | |
173 | fAccMax = 0.; | |
174 | fAccCut = kFALSE; | |
175 | ||
176 | // cp new design of AliMUONTriggerDecision | |
177 | fTriggerCircuits = new TObjArray(AliMUONConstants::NTriggerCircuit()); | |
178 | for (Int_t circ=0; circ<AliMUONConstants::NTriggerCircuit(); circ++) { | |
179 | fTriggerCircuits->AddAt(new AliMUONTriggerCircuit(),circ); | |
180 | } | |
181 | fMerger = 0; | |
fe4da5cc | 182 | } |
ce3f5e87 | 183 | //____________________________________________________________________ |
50e97f19 | 184 | AliMUON::AliMUON(const AliMUON& rMUON):AliDetector(rMUON) |
a9e2aefa | 185 | { |
186 | // Dummy copy constructor | |
187 | ; | |
188 | ||
189 | } | |
ce3f5e87 | 190 | //____________________________________________________________________ |
fe4da5cc | 191 | AliMUON::~AliMUON() |
192 | { | |
de05461e | 193 | // Destructor |
ce3f5e87 | 194 | if(fDebug) printf("%s: Calling AliMUON destructor !!!\n",ClassName()); |
195 | fIshunt = 0; | |
196 | if (fMerger) delete fMerger; | |
d1cd2474 | 197 | |
198 | if (fGeometryBuilders){ | |
199 | fGeometryBuilders->Delete(); | |
200 | delete fGeometryBuilders; | |
c6df4ef2 | 201 | } |
202 | if (fChambers){ | |
203 | fChambers->Delete(); | |
204 | delete fChambers; | |
205 | } | |
206 | if (fTriggerCircuits){ | |
207 | fTriggerCircuits->Delete(); | |
208 | delete fTriggerCircuits; | |
209 | } | |
210 | delete fMUONData; | |
d1cd2474 | 211 | } |
212 | //_____________________________________________________________________________ | |
213 | void AliMUON::AddGeometryBuilder(AliMUONVGeometryBuilder* geomBuilder) | |
214 | { | |
215 | // Adds the geometry builder to the list | |
216 | // --- | |
217 | ||
218 | fGeometryBuilders->Add(geomBuilder); | |
a897a37a | 219 | } |
ce3f5e87 | 220 | //____________________________________________________________________ |
fe4da5cc | 221 | void AliMUON::BuildGeometry() |
222 | { | |
de05461e | 223 | // Geometry for event display |
5fd73042 | 224 | for (Int_t i=0; i<7; i++) { |
225 | for (Int_t j=0; j<2; j++) { | |
226 | Int_t id=2*i+j+1; | |
227 | this->Chamber(id-1).SegmentationModel(1)->Draw("eventdisplay"); | |
a897a37a | 228 | } |
5fd73042 | 229 | } |
fe4da5cc | 230 | } |
ce3f5e87 | 231 | //___________________________________________________________________ |
fe4da5cc | 232 | Int_t AliMUON::DistancetoPrimitive(Int_t , Int_t ) |
233 | { | |
ce3f5e87 | 234 | return 9999; |
fe4da5cc | 235 | } |
ce3f5e87 | 236 | //__________________________________________________________________ |
237 | void AliMUON::SetTreeAddress() | |
a897a37a | 238 | { |
ce3f5e87 | 239 | GetMUONData()->SetLoader(fLoader); |
240 | GetMUONData()->SetTreeAddress("H,D,RC"); | |
d652f85c | 241 | fHits = GetMUONData()->Hits(); // Added by Ivana to use the methods FisrtHit, NextHit of AliDetector |
a9e2aefa | 242 | } |
243 | ||
ce3f5e87 | 244 | //____________________________________________________________________ |
a9e2aefa | 245 | void AliMUON::SetPadSize(Int_t id, Int_t isec, Float_t p1, Float_t p2) |
246 | { | |
de05461e | 247 | // Set the pad size for chamber id and cathode isec |
a9e2aefa | 248 | Int_t i=2*(id-1); |
2682e810 | 249 | ((AliMUONChamber*) fChambers->At(i)) ->SetPadSize(isec,p1,p2); |
250 | ((AliMUONChamber*) fChambers->At(i+1))->SetPadSize(isec,p1,p2); | |
a897a37a | 251 | } |
252 | ||
fe4da5cc | 253 | //___________________________________________ |
a9e2aefa | 254 | void AliMUON::SetChambersZ(const Float_t *Z) |
255 | { | |
256 | // Set Z values for all chambers (tracking and trigger) | |
257 | // from the array pointed to by "Z" | |
f665c1ea | 258 | for (Int_t ch = 0; ch < AliMUONConstants::NCh(); ch++) |
2682e810 | 259 | ((AliMUONChamber*) fChambers->At(ch))->SetZ(Z[ch]); |
f665c1ea | 260 | return; |
a9e2aefa | 261 | } |
ce3f5e87 | 262 | //_________________________________________________________________ |
a9e2aefa | 263 | void AliMUON::SetChambersZToDefault() |
fe4da5cc | 264 | { |
a9e2aefa | 265 | // Set Z values for all chambers (tracking and trigger) |
266 | // to default values | |
f665c1ea | 267 | SetChambersZ(AliMUONConstants::DefaultChamberZ()); |
a9e2aefa | 268 | return; |
fe4da5cc | 269 | } |
ce3f5e87 | 270 | //_________________________________________________________________ |
a897a37a | 271 | void AliMUON::SetChargeSlope(Int_t id, Float_t p1) |
fe4da5cc | 272 | { |
de05461e | 273 | // Set the inverse charge slope for chamber id |
ce3f5e87 | 274 | Int_t i=2*(id-1); //PH ((AliMUONChamber*) (*fChambers)[i])->SetSigmaIntegration(p1); |
275 | //PH ((AliMUONChamber*) (*fChambers)[i+1])->SetSigmaIntegration(p1); | |
2682e810 | 276 | ((AliMUONChamber*) fChambers->At(i))->SetChargeSlope(p1); |
277 | ((AliMUONChamber*) fChambers->At(i+1))->SetChargeSlope(p1); | |
fe4da5cc | 278 | } |
ce3f5e87 | 279 | //__________________________________________________________________ |
a897a37a | 280 | void AliMUON::SetChargeSpread(Int_t id, Float_t p1, Float_t p2) |
fe4da5cc | 281 | { |
de05461e | 282 | // Set sigma of charge spread for chamber id |
fe4da5cc | 283 | Int_t i=2*(id-1); |
2682e810 | 284 | ((AliMUONChamber*) fChambers->At(i))->SetChargeSpread(p1,p2); |
285 | ((AliMUONChamber*) fChambers->At(i+1))->SetChargeSpread(p1,p2); | |
fe4da5cc | 286 | } |
ce3f5e87 | 287 | //___________________________________________________________________ |
a897a37a | 288 | void AliMUON::SetSigmaIntegration(Int_t id, Float_t p1) |
fe4da5cc | 289 | { |
de05461e | 290 | // Set integration limits for charge spread |
fe4da5cc | 291 | Int_t i=2*(id-1); |
2682e810 | 292 | ((AliMUONChamber*) fChambers->At(i))->SetSigmaIntegration(p1); |
293 | ((AliMUONChamber*) fChambers->At(i+1))->SetSigmaIntegration(p1); | |
fe4da5cc | 294 | } |
295 | ||
ce3f5e87 | 296 | //__________________________________________________________________ |
d09fafb0 | 297 | void AliMUON::SetMaxAdc(Int_t id, Int_t p1) |
fe4da5cc | 298 | { |
de05461e | 299 | // Set maximum number for ADCcounts (saturation) |
fe4da5cc | 300 | Int_t i=2*(id-1); |
2682e810 | 301 | ((AliMUONChamber*) fChambers->At(i))->SetMaxAdc(p1); |
302 | ((AliMUONChamber*) fChambers->At(i+1))->SetMaxAdc(p1); | |
fe4da5cc | 303 | } |
ce3f5e87 | 304 | //__________________________________________________________________ |
a897a37a | 305 | void AliMUON::SetMaxStepGas(Float_t p1) |
fe4da5cc | 306 | { |
de05461e | 307 | // Set stepsize in gas |
ce3f5e87 | 308 | fMaxStepGas=p1; |
fe4da5cc | 309 | } |
ce3f5e87 | 310 | //__________________________________________________________________ |
a897a37a | 311 | void AliMUON::SetMaxStepAlu(Float_t p1) |
fe4da5cc | 312 | { |
de05461e | 313 | // Set step size in Alu |
fe4da5cc | 314 | fMaxStepAlu=p1; |
315 | } | |
ce3f5e87 | 316 | //__________________________________________________________________ |
a897a37a | 317 | void AliMUON::SetMaxDestepGas(Float_t p1) |
fe4da5cc | 318 | { |
de05461e | 319 | // Set maximum step size in Gas |
fe4da5cc | 320 | fMaxDestepGas=p1; |
321 | } | |
ce3f5e87 | 322 | //__________________________________________________________________ |
a897a37a | 323 | void AliMUON::SetMaxDestepAlu(Float_t p1) |
fe4da5cc | 324 | { |
de05461e | 325 | // Set maximum step size in Alu |
ce3f5e87 | 326 | fMaxDestepAlu=p1; |
fe4da5cc | 327 | } |
ce3f5e87 | 328 | //___________________________________________________________________ |
5c1f55c5 | 329 | void AliMUON::SetAcceptance(Bool_t acc, Float_t angmin, Float_t angmax) |
fe4da5cc | 330 | { |
de05461e | 331 | // Set acceptance cuts |
ce3f5e87 | 332 | fAccCut=acc; |
333 | fAccMin=angmin*TMath::Pi()/180; | |
334 | fAccMax=angmax*TMath::Pi()/180; | |
335 | Int_t ch; | |
336 | if (acc) { | |
337 | for (Int_t st = 0; st < AliMUONConstants::NCh() / 2; st++) { | |
338 | // Loop over 2 chambers in the station | |
339 | for (Int_t stCH = 0; stCH < 2; stCH++) { | |
340 | ch = 2 * st + stCH; | |
341 | // Set chamber inner and outer radius according to acceptance cuts | |
b13a15bc | 342 | Chamber(ch).SetRInner(TMath::Abs(AliMUONConstants::DefaultChamberZ(ch)*TMath::Tan(fAccMin))); |
343 | Chamber(ch).SetROuter(TMath::Abs(AliMUONConstants::DefaultChamberZ(ch)*TMath::Tan(fAccMax))); | |
ce3f5e87 | 344 | } // chamber loop |
345 | } // station loop | |
346 | } | |
fe4da5cc | 347 | } |
d1cd2474 | 348 | |
349 | //____________________________________________________________________ | |
350 | Float_t AliMUON::GetMaxStepGas() const | |
351 | { | |
352 | // Return stepsize in gas | |
353 | ||
354 | return fMaxStepGas; | |
355 | } | |
356 | ||
357 | //____________________________________________________________________ | |
358 | Float_t AliMUON::GetMaxStepAlu() const | |
359 | { | |
360 | // Return step size in Alu | |
361 | ||
362 | return fMaxStepAlu; | |
363 | } | |
364 | ||
365 | //____________________________________________________________________ | |
366 | Float_t AliMUON::GetMaxDestepGas() const | |
367 | { | |
368 | // Return maximum step size in Gas | |
369 | ||
370 | return fMaxDestepGas; | |
371 | } | |
372 | ||
373 | //____________________________________________________________________ | |
374 | Float_t AliMUON::GetMaxDestepAlu() const | |
375 | { | |
376 | // Return maximum step size in Gas | |
377 | ||
378 | return fMaxDestepAlu; | |
379 | } | |
380 | ||
ce3f5e87 | 381 | //____________________________________________________________________ |
a30a000f | 382 | void AliMUON::SetSegmentationModel(Int_t id, Int_t isec, AliSegmentation *segmentation) |
fe4da5cc | 383 | { |
de05461e | 384 | // Set the segmentation for chamber id cathode isec |
2682e810 | 385 | ((AliMUONChamber*) fChambers->At(id))->SetSegmentationModel(isec, segmentation); |
fe4da5cc | 386 | |
387 | } | |
ce3f5e87 | 388 | //____________________________________________________________________ |
a9e2aefa | 389 | void AliMUON::SetResponseModel(Int_t id, AliMUONResponse *response) |
fe4da5cc | 390 | { |
de05461e | 391 | // Set the response for chamber id |
2682e810 | 392 | ((AliMUONChamber*) fChambers->At(id))->SetResponseModel(response); |
fe4da5cc | 393 | } |
ce3f5e87 | 394 | //____________________________________________________________________ |
30aaba74 | 395 | void AliMUON::SetReconstructionModel(Int_t id, AliMUONClusterFinderVS *reconst) |
a897a37a | 396 | { |
de05461e | 397 | // Set ClusterFinder for chamber id |
2682e810 | 398 | ((AliMUONChamber*) fChambers->At(id))->SetReconstructionModel(reconst); |
a897a37a | 399 | } |
ce3f5e87 | 400 | //____________________________________________________________________ |
fe4da5cc | 401 | void AliMUON::SetNsec(Int_t id, Int_t nsec) |
402 | { | |
de05461e | 403 | // Set number of segmented cathods for chamber id |
2682e810 | 404 | ((AliMUONChamber*) fChambers->At(id))->SetNsec(nsec); |
fe4da5cc | 405 | } |
85a5290f | 406 | //____________________________________________________________________ |
c92eb8ad | 407 | AliDigitizer* AliMUON::CreateDigitizer(AliRunDigitizer* manager) const |
85a5290f | 408 | { |
409 | return new AliMUONDigitizerv1(manager); | |
410 | } | |
ce3f5e87 | 411 | //_____________________________________________________________________ |
2ab0c725 | 412 | void AliMUON::SDigits2Digits() |
413 | { | |
d963c261 | 414 | |
415 | // write TreeD here | |
416 | ||
417 | if (!fMerger) { | |
418 | if (gAlice->GetDebug()>0) { | |
419 | cerr<<"AliMUON::SDigits2Digits: create default AliMUONMerger "<<endl; | |
420 | cerr<<" no merging, just digitization of 1 event will be done"<<endl; | |
421 | } | |
422 | fMerger = new AliMUONMerger(); | |
2ab0c725 | 423 | } |
d963c261 | 424 | fMerger->Init(); |
425 | fMerger->Digitise(); | |
426 | char hname[30]; | |
88cb7938 | 427 | // sprintf(hname,"TreeD%d",fLoader->GetHeader()->GetEvent()); |
428 | fLoader->TreeD()->Write(hname,TObject::kOverwrite); | |
429 | fLoader->TreeD()->Reset(); | |
2ab0c725 | 430 | } |
a9e2aefa | 431 | |
ce3f5e87 | 432 | //_______________________________________________________________________ |
3fa6cfdd | 433 | AliLoader* AliMUON::MakeLoader(const char* topfoldername) |
434 | { | |
435 | //builds standard getter (AliLoader type) | |
436 | //if detector wants to use castomized getter, it must overload this method | |
437 | ||
438 | if (GetDebug()) | |
439 | Info("MakeLoader", | |
440 | "Creating standard getter for detector %s. Top folder is %s.", | |
441 | GetName(),topfoldername); | |
442 | ||
128843d9 | 443 | fLoader = new AliLoader(GetName(),topfoldername); |
ce3f5e87 | 444 | fMUONData = new AliMUONData(fLoader,GetName(),GetName()); |
d652f85c | 445 | fMUONData->SetSplitLevel(fSplitLevel); |
3fa6cfdd | 446 | return fLoader; |
447 | } | |
a897a37a | 448 | |
ce3f5e87 | 449 | //_______________________________________________________________________ |
a9e2aefa | 450 | void AliMUON::Trigger(Int_t nev){ |
451 | // call the Trigger Algorithm and fill TreeR | |
452 | ||
453 | Int_t singlePlus[3] = {0,0,0}; | |
454 | Int_t singleMinus[3] = {0,0,0}; | |
455 | Int_t singleUndef[3] = {0,0,0}; | |
456 | Int_t pairUnlike[3] = {0,0,0}; | |
457 | Int_t pairLike[3] = {0,0,0}; | |
ce3f5e87 | 458 | |
a9e2aefa | 459 | ResetTrigger(); |
a9e2aefa | 460 | AliMUONTriggerDecision* decision= new AliMUONTriggerDecision(1); |
461 | decision->Trigger(); | |
462 | decision->GetGlobalTrigger(singlePlus, singleMinus, singleUndef, | |
463 | pairUnlike, pairLike); | |
ce3f5e87 | 464 | |
465 | // add a local trigger in the list | |
466 | GetMUONData()->AddGlobalTrigger(singlePlus, singleMinus, singleUndef, pairUnlike, pairLike); | |
9ae15266 | 467 | Int_t i; |
a9e2aefa | 468 | |
f665c1ea | 469 | for (Int_t icirc=0; icirc<AliMUONConstants::NTriggerCircuit(); icirc++) { |
ce3f5e87 | 470 | if(decision->GetITrigger(icirc)==1) { |
471 | Int_t localtr[7]={0,0,0,0,0,0,0}; | |
472 | Int_t loLpt[2]={0,0}; Int_t loHpt[2]={0,0}; Int_t loApt[2]={0,0}; | |
473 | decision->GetLutOutput(icirc, loLpt, loHpt, loApt); | |
474 | localtr[0] = icirc; | |
475 | localtr[1] = decision->GetStripX11(icirc); | |
476 | localtr[2] = decision->GetDev(icirc); | |
477 | localtr[3] = decision->GetStripY11(icirc); | |
478 | for (i=0; i<2; i++) { // convert the Lut output in 1 digit | |
479 | localtr[4] = localtr[4]+Int_t(loLpt[i]*TMath::Power(2,i)); | |
480 | localtr[5] = localtr[5]+Int_t(loHpt[i]*TMath::Power(2,i)); | |
481 | localtr[6] = localtr[6]+Int_t(loApt[i]*TMath::Power(2,i)); | |
a897a37a | 482 | } |
ce3f5e87 | 483 | GetMUONData()->AddLocalTrigger(localtr); // add a local trigger in the list |
484 | } | |
a9e2aefa | 485 | } |
ce3f5e87 | 486 | |
a9e2aefa | 487 | delete decision; |
bf17dbfd | 488 | |
ba9436c6 | 489 | // fLoader->TreeR()->Fill(); |
1a1cdff8 | 490 | GetMUONData()->Fill("GLT"); //Filling Global and Local Trigger GLT |
ce3f5e87 | 491 | // char hname[30]; |
492 | // sprintf(hname,"TreeR%d",nev); | |
493 | // fLoader->TreeR()->Write(hname,TObject::kOverwrite); | |
bf17dbfd | 494 | // fLoader->TreeR()->Reset(); |
88cb7938 | 495 | fLoader->WriteRecPoints("OVERWRITE"); |
88cb7938 | 496 | |
19dd5b2f | 497 | // printf("\n End of trigger for event %d\n", nev); |
a897a37a | 498 | } |
a897a37a | 499 | |
ce3f5e87 | 500 | //____________________________________________________________________ |
fe311ef1 | 501 | void AliMUON::Digits2Reco() |
502 | { | |
503 | FindClusters(); | |
e365e1ee | 504 | Int_t nev = gAlice->GetHeader()->GetEvent(); |
1a1cdff8 | 505 | GetMUONData()->Fill("RC"); //Filling Reconstructed Cluster |
88cb7938 | 506 | fLoader->WriteRecPoints("OVERWRITE"); |
ce3f5e87 | 507 | GetMUONData()->ResetRawClusters(); |
1a1cdff8 | 508 | Info("Digits2Reco","End of cluster finding for event %d", nev); |
fe311ef1 | 509 | } |
ce3f5e87 | 510 | //____________________________________________________________________ |
fe311ef1 | 511 | void AliMUON::FindClusters() |
a9e2aefa | 512 | { |
de05461e | 513 | // |
514 | // Perform cluster finding | |
515 | // | |
a9e2aefa | 516 | TClonesArray *dig1, *dig2; |
517 | Int_t ndig, k; | |
518 | dig1 = new TClonesArray("AliMUONDigit",1000); | |
519 | dig2 = new TClonesArray("AliMUONDigit",1000); | |
520 | AliMUONDigit *digit; | |
a9e2aefa | 521 | // Loop on chambers and on cathode planes |
a897a37a | 522 | // |
fe311ef1 | 523 | ResetRawClusters(); |
88cb7938 | 524 | TClonesArray * muonDigits; |
525 | ||
1bd28025 | 526 | for (Int_t ich = 0; ich < 10; ich++) { |
2682e810 | 527 | //PH AliMUONChamber* iChamber = (AliMUONChamber*) (*fChambers)[ich]; |
528 | AliMUONChamber* iChamber = (AliMUONChamber*) fChambers->At(ich); | |
fe311ef1 | 529 | AliMUONClusterFinderVS* rec = iChamber->ReconstructionModel(); |
530 | ||
88cb7938 | 531 | ResetDigits(); |
1a1cdff8 | 532 | GetMUONData()->GetCathode(0); |
88cb7938 | 533 | //TClonesArray * |
1a1cdff8 | 534 | muonDigits = GetMUONData()->Digits(ich); |
a9e2aefa | 535 | ndig=muonDigits->GetEntriesFast(); |
19dd5b2f | 536 | if(fDebug) |
88cb7938 | 537 | printf("\n 1 Found %d digits in %p chamber %d", ndig, muonDigits,ich); |
a9e2aefa | 538 | TClonesArray &lhits1 = *dig1; |
1bd28025 | 539 | Int_t n = 0; |
540 | for (k = 0; k < ndig; k++) { | |
541 | digit = (AliMUONDigit*) muonDigits->UncheckedAt(k); | |
542 | if (rec->TestTrack(digit->Track(0))) | |
a9e2aefa | 543 | new(lhits1[n++]) AliMUONDigit(*digit); |
544 | } | |
1a1cdff8 | 545 | GetMUONData()->ResetDigits(); |
546 | GetMUONData()->GetCathode(1); | |
547 | muonDigits = GetMUONData()->Digits(ich); | |
a9e2aefa | 548 | ndig=muonDigits->GetEntriesFast(); |
19dd5b2f | 549 | if(fDebug) |
a9e2aefa | 550 | printf("\n 2 Found %d digits in %p %d", ndig, muonDigits, ich); |
551 | TClonesArray &lhits2 = *dig2; | |
552 | n=0; | |
553 | ||
554 | for (k=0; k<ndig; k++) { | |
555 | digit= (AliMUONDigit*) muonDigits->UncheckedAt(k); | |
1bd28025 | 556 | if (rec->TestTrack(digit->Track(0))) |
a9e2aefa | 557 | new(lhits2[n++]) AliMUONDigit(*digit); |
a897a37a | 558 | } |
a897a37a | 559 | |
9825400f | 560 | if (rec) { |
561 | AliMUONClusterInput::Instance()->SetDigits(ich, dig1, dig2); | |
a9e2aefa | 562 | rec->FindRawClusters(); |
563 | } | |
564 | dig1->Delete(); | |
565 | dig2->Delete(); | |
566 | } // for ich | |
a9e2aefa | 567 | delete dig1; |
568 | delete dig2; | |
a897a37a | 569 | } |
ce3f5e87 | 570 | //______________________________________________________________________ |
2ab0c725 | 571 | #ifdef never |
ce3f5e87 | 572 | void AliMUON::Streamer(TBuffer &R__b)_ |
fe4da5cc | 573 | { |
574 | // Stream an object of class AliMUON. | |
a30a000f | 575 | AliMUONChamber *iChamber; |
a9e2aefa | 576 | AliMUONTriggerCircuit *iTriggerCircuit; |
a30a000f | 577 | AliSegmentation *segmentation; |
578 | AliMUONResponse *response; | |
579 | TClonesArray *digitsaddress; | |
580 | TClonesArray *rawcladdress; | |
9ae15266 | 581 | Int_t i; |
9ae15266 | 582 | if (R__b.IsReading()) { |
583 | Version_t R__v = R__b.ReadVersion(); if (R__v) { } | |
584 | AliDetector::Streamer(R__b); | |
585 | R__b >> fNPadHits; | |
586 | R__b >> fPadHits; // diff | |
587 | R__b >> fNLocalTrigger; | |
588 | R__b >> fLocalTrigger; | |
589 | R__b >> fNGlobalTrigger; | |
590 | R__b >> fGlobalTrigger; | |
591 | R__b >> fDchambers; | |
592 | R__b >> fRawClusters; | |
593 | R__b.ReadArray(fNdch); | |
594 | R__b.ReadArray(fNrawch); | |
595 | R__b >> fAccCut; | |
596 | R__b >> fAccMin; | |
597 | R__b >> fAccMax; | |
598 | R__b >> fChambers; | |
599 | R__b >> fTriggerCircuits; | |
f665c1ea | 600 | for (i =0; i<AliMUONConstants::NTriggerCircuit(); i++) { |
9ae15266 | 601 | iTriggerCircuit=(AliMUONTriggerCircuit*) (*fTriggerCircuits)[i]; |
602 | iTriggerCircuit->Streamer(R__b); | |
fe4da5cc | 603 | } |
9ae15266 | 604 | // Stream chamber related information |
f665c1ea | 605 | for (i =0; i<AliMUONConstants::NCh(); i++) { |
9ae15266 | 606 | iChamber=(AliMUONChamber*) (*fChambers)[i]; |
607 | iChamber->Streamer(R__b); | |
608 | if (iChamber->Nsec()==1) { | |
609 | segmentation=iChamber->SegmentationModel(1); | |
610 | if (segmentation) | |
611 | segmentation->Streamer(R__b); | |
612 | } else { | |
613 | segmentation=iChamber->SegmentationModel(1); | |
614 | if (segmentation) | |
615 | segmentation->Streamer(R__b); | |
616 | if (segmentation) | |
617 | segmentation=iChamber->SegmentationModel(2); | |
618 | segmentation->Streamer(R__b); | |
619 | } | |
620 | response=iChamber->ResponseModel(); | |
621 | if (response) | |
622 | response->Streamer(R__b); | |
623 | digitsaddress=(TClonesArray*) (*fDchambers)[i]; | |
624 | digitsaddress->Streamer(R__b); | |
f665c1ea | 625 | if (i < AliMUONConstants::NTrackingCh()) { |
9ae15266 | 626 | rawcladdress=(TClonesArray*) (*fRawClusters)[i]; |
627 | rawcladdress->Streamer(R__b); | |
628 | } | |
a9e2aefa | 629 | } |
9ae15266 | 630 | |
631 | } else { | |
632 | R__b.WriteVersion(AliMUON::IsA()); | |
633 | AliDetector::Streamer(R__b); | |
634 | R__b << fNPadHits; | |
635 | R__b << fPadHits; // diff | |
636 | R__b << fNLocalTrigger; | |
637 | R__b << fLocalTrigger; | |
638 | R__b << fNGlobalTrigger; | |
639 | R__b << fGlobalTrigger; | |
640 | R__b << fDchambers; | |
641 | R__b << fRawClusters; | |
f665c1ea | 642 | R__b.WriteArray(fNdch, AliMUONConstants::NCh()); |
643 | R__b.WriteArray(fNrawch, AliMUONConstants::NTrackingCh()); | |
9ae15266 | 644 | |
645 | R__b << fAccCut; | |
646 | R__b << fAccMin; | |
647 | R__b << fAccMax; | |
648 | ||
649 | R__b << fChambers; | |
650 | R__b << fTriggerCircuits; | |
f665c1ea | 651 | for (i =0; i<AliMUONConstants::NTriggerCircuit(); i++) { |
9ae15266 | 652 | iTriggerCircuit=(AliMUONTriggerCircuit*) (*fTriggerCircuits)[i]; |
653 | iTriggerCircuit->Streamer(R__b); | |
fe4da5cc | 654 | } |
f665c1ea | 655 | for (i =0; i<AliMUONConstants::NCh(); i++) { |
9ae15266 | 656 | iChamber=(AliMUONChamber*) (*fChambers)[i]; |
657 | iChamber->Streamer(R__b); | |
658 | if (iChamber->Nsec()==1) { | |
659 | segmentation=iChamber->SegmentationModel(1); | |
660 | if (segmentation) | |
661 | segmentation->Streamer(R__b); | |
662 | } else { | |
663 | segmentation=iChamber->SegmentationModel(1); | |
664 | if (segmentation) | |
665 | segmentation->Streamer(R__b); | |
666 | segmentation=iChamber->SegmentationModel(2); | |
667 | if (segmentation) | |
668 | segmentation->Streamer(R__b); | |
669 | } | |
670 | response=iChamber->ResponseModel(); | |
671 | if (response) | |
672 | response->Streamer(R__b); | |
673 | digitsaddress=(TClonesArray*) (*fDchambers)[i]; | |
674 | digitsaddress->Streamer(R__b); | |
f665c1ea | 675 | if (i < AliMUONConstants::NTrackingCh()) { |
9ae15266 | 676 | rawcladdress=(TClonesArray*) (*fRawClusters)[i]; |
677 | rawcladdress->Streamer(R__b); | |
678 | } | |
a9e2aefa | 679 | } |
fe4da5cc | 680 | } |
fe4da5cc | 681 | } |
2ab0c725 | 682 | #endif |
ce3f5e87 | 683 | //_______________________________________________________________________ |
a9e2aefa | 684 | AliMUONPadHit* AliMUON::FirstPad(AliMUONHit* hit, TClonesArray *clusters) |
fe4da5cc | 685 | { |
5a35ac13 | 686 | // to be removed |
fe4da5cc | 687 | // Initialise the pad iterator |
688 | // Return the address of the first padhit for hit | |
a897a37a | 689 | TClonesArray *theClusters = clusters; |
fe4da5cc | 690 | Int_t nclust = theClusters->GetEntriesFast(); |
1bd28025 | 691 | if (nclust && hit->PHlast() > 0) { |
692 | AliMUON::fMaxIterPad=hit->PHlast(); | |
693 | AliMUON::fCurIterPad=hit->PHfirst(); | |
a9e2aefa | 694 | return (AliMUONPadHit*) clusters->UncheckedAt(AliMUON::fCurIterPad-1); |
fe4da5cc | 695 | } else { |
696 | return 0; | |
697 | } | |
698 | } | |
ce3f5e87 | 699 | //_______________________________________________________________________ |
a9e2aefa | 700 | AliMUONPadHit* AliMUON::NextPad(TClonesArray *clusters) |
fe4da5cc | 701 | { |
5a35ac13 | 702 | // To be removed |
de05461e | 703 | // Get next pad (in iterator) |
704 | // | |
a9e2aefa | 705 | AliMUON::fCurIterPad++; |
706 | if (AliMUON::fCurIterPad <= AliMUON::fMaxIterPad) { | |
707 | return (AliMUONPadHit*) clusters->UncheckedAt(AliMUON::fCurIterPad-1); | |
fe4da5cc | 708 | } else { |
709 | return 0; | |
710 | } | |
711 | } | |
ce3f5e87 | 712 | //_______________________________________________________________________ |
a897a37a | 713 | |
714 | AliMUONRawCluster *AliMUON::RawCluster(Int_t ichamber, Int_t icathod, Int_t icluster) | |
715 | { | |
de05461e | 716 | // |
717 | // Return rawcluster (icluster) for chamber ichamber and cathode icathod | |
718 | // Obsolete ?? | |
ce3f5e87 | 719 | TClonesArray *muonRawCluster = GetMUONData()->RawClusters(ichamber); |
a897a37a | 720 | ResetRawClusters(); |
88cb7938 | 721 | TTree *treeR = fLoader->TreeR(); |
a9e2aefa | 722 | Int_t nent=(Int_t)treeR->GetEntries(); |
723 | treeR->GetEvent(nent-2+icathod-1); | |
724 | //treeR->GetEvent(icathod); | |
725 | //Int_t nrawcl = (Int_t)muonRawCluster->GetEntriesFast(); | |
a897a37a | 726 | |
a9e2aefa | 727 | AliMUONRawCluster * mRaw = (AliMUONRawCluster*)muonRawCluster->UncheckedAt(icluster); |
a897a37a | 728 | //printf("RawCluster _ nent nrawcl icluster mRaw %d %d %d%p\n",nent,nrawcl,icluster,mRaw); |
729 | ||
730 | return mRaw; | |
731 | } | |
ce3f5e87 | 732 | //________________________________________________________________________ |
1cae9436 | 733 | void AliMUON::SetMerger(AliMUONMerger* merger) |
734 | { | |
735 | // Set pointer to merger | |
736 | fMerger = merger; | |
737 | } | |
ce3f5e87 | 738 | //________________________________________________________________________ |
1cae9436 | 739 | AliMUONMerger* AliMUON::Merger() |
740 | { | |
741 | // Return pointer to merger | |
742 | return fMerger; | |
743 | } | |
ce3f5e87 | 744 | //________________________________________________________________________ |
50e97f19 | 745 | AliMUON& AliMUON::operator = (const AliMUON& /*rhs*/) |
a897a37a | 746 | { |
a9e2aefa | 747 | // copy operator |
748 | // dummy version | |
749 | return *this; | |
a897a37a | 750 | } |
aa43efee | 751 | //________________________________________________________________________ |
752 | void AliMUON::Reconstruct() const | |
753 | { | |
754 | // reconstruct clusters | |
755 | ||
9a22765d | 756 | // AliLoader* loader = GetLoader(); |
757 | AliRunLoader* runLoader = fLoader->GetRunLoader(); | |
aa43efee | 758 | Int_t nEvents = runLoader->GetNumberOfEvents(); |
759 | ||
760 | for (Int_t i = 0; i < 10; i++) { | |
761 | AliMUONClusterFinderVS *RecModel = new AliMUONClusterFinderVS(); | |
762 | RecModel->SetGhostChi2Cut(10); | |
763 | const_cast<AliMUON*>(this)->SetReconstructionModel(i,RecModel); | |
764 | } | |
765 | ||
766 | AliMUONEventReconstructor* reco = new AliMUONEventReconstructor(); | |
767 | ||
9a22765d | 768 | fLoader->LoadRecPoints("RECREATE"); |
769 | fLoader->LoadTracks("RECREATE"); | |
770 | fLoader->LoadDigits("READ"); | |
aa43efee | 771 | |
772 | ||
773 | // Loop over events | |
774 | for(Int_t ievent = 0; ievent < nEvents; ievent++) { | |
19dd5b2f | 775 | printf("Event %d\n",ievent); |
aa43efee | 776 | runLoader->GetEvent(ievent); |
777 | ||
778 | //---------------------------- digit2Reco & Trigger --------------------- | |
9a22765d | 779 | if (!fLoader->TreeR()) fLoader->MakeRecPointsContainer(); |
aa43efee | 780 | |
781 | // tracking branch | |
782 | fMUONData->MakeBranch("RC"); | |
783 | fMUONData->SetTreeAddress("D,RC"); | |
784 | const_cast<AliMUON*>(this)->Digits2Reco(); | |
785 | ||
786 | // trigger branch | |
787 | fMUONData->MakeBranch("GLT"); | |
788 | fMUONData->SetTreeAddress("D,GLT"); | |
789 | const_cast<AliMUON*>(this)->Trigger(ievent); | |
790 | ||
791 | //---------------------------- Track & TriggerTrack --------------------- | |
9a22765d | 792 | if (!fLoader->TreeT()) fLoader->MakeTracksContainer(); |
aa43efee | 793 | |
794 | fMUONData->MakeBranch("RT"); //track | |
795 | fMUONData->SetTreeAddress("RT"); | |
796 | reco->EventReconstruct(); | |
797 | for(Int_t i=0; i<reco->GetNRecTracks(); i++) { | |
798 | AliMUONTrack * track = (AliMUONTrack*) reco->GetRecTracksPtr()->At(i); | |
799 | fMUONData->AddRecTrack(*track); | |
800 | } | |
801 | fMUONData->Fill("RT"); | |
802 | ||
803 | fMUONData->MakeBranch("RL"); //trigger track | |
804 | fMUONData->SetTreeAddress("RL"); | |
805 | reco->EventReconstructTrigger(); | |
806 | for(Int_t i=0; i<reco->GetNRecTriggerTracks(); i++) { | |
807 | AliMUONTriggerTrack * triggertrack = (AliMUONTriggerTrack*) reco->GetRecTriggerTracksPtr()->At(i); | |
808 | fMUONData->AddRecTriggerTrack(*triggertrack); | |
809 | } | |
810 | fMUONData->Fill("RL"); | |
811 | ||
9a22765d | 812 | fLoader->WriteTracks("OVERWRITE"); |
aa43efee | 813 | |
814 | //--------------------------- Resetting branches ----------------------- | |
815 | fMUONData->ResetDigits(); | |
816 | fMUONData->ResetRawClusters(); | |
817 | fMUONData->ResetTrigger(); | |
818 | fMUONData->ResetRecTracks(); | |
819 | fMUONData->ResetRecTriggerTracks(); | |
820 | } | |
9a22765d | 821 | fLoader->UnloadDigits(); |
822 | fLoader->UnloadRecPoints(); | |
823 | fLoader->UnloadTracks(); | |
824 | //delete reco; | |
aa43efee | 825 | } |
826 | //________________________________________________________________________ | |
827 | void AliMUON::FillESD(AliESD* event) const | |
828 | { | |
829 | ||
830 | TClonesArray * recTracksArray; | |
831 | ||
bdfa9e49 | 832 | //YS AliLoader* loader = GetLoader(); |
833 | AliRunLoader* runLoader = fLoader->GetRunLoader(); //YS loader->GetRunLoader(); | |
834 | fLoader->LoadTracks("READ"); //YS | |
aa43efee | 835 | |
836 | ||
837 | // declaration | |
838 | Int_t ievent; | |
839 | Int_t ntrackhits; | |
840 | Double_t fitfmin; | |
841 | Int_t nrectracks; | |
842 | ||
843 | Double_t bendingSlope, nonBendingSlope, fInverseBendingMomentum; | |
844 | Double_t fXRec, fYRec, fZRec; | |
845 | ||
846 | Float_t x11, y11, thetaX,thetaY ; | |
847 | ||
bdfa9e49 | 848 | //YS Int_t nEvents = runLoader->GetNumberOfEvents(); |
aa43efee | 849 | |
850 | // setting pointer for tracks, triggertracks& trackparam at vertex | |
851 | AliMUONTrack * rectrack; | |
852 | AliMUONTriggerTrack * rectriggertrack; | |
853 | AliMUONTrackParam *trackParam; | |
bdfa9e49 | 854 | |
855 | ievent = runLoader->GetEventNumber() ; //YS | |
856 | //YS for (ievent = 0; ievent < nEvents; ievent++) { | |
aa43efee | 857 | runLoader->GetEvent(ievent); |
858 | ||
859 | // setting ESD MUON class | |
860 | AliESDMuonTrack* ESDTrack = new AliESDMuonTrack() ; | |
861 | ||
862 | // -------------------- tracks------------- | |
863 | fMUONData->SetTreeAddress("RT"); | |
864 | fMUONData->GetRecTracks(); | |
865 | recTracksArray = fMUONData->RecTracks(); | |
866 | ||
867 | nrectracks = (Int_t) recTracksArray->GetEntriesFast(); // | |
868 | ||
869 | // printf(">>> Event %d Number of Recconstructed tracks %d \n",ievent, nrectracks); | |
870 | ||
871 | // read track infos | |
872 | for (Int_t irectracks = 0; irectracks < nrectracks; irectracks++) { | |
873 | ||
874 | rectrack = (AliMUONTrack*) recTracksArray->At(irectracks); | |
875 | ||
876 | trackParam = rectrack->GetTrackParamAtVertex(); | |
877 | ||
878 | bendingSlope = trackParam->GetBendingSlope(); | |
879 | nonBendingSlope = trackParam->GetNonBendingSlope(); | |
880 | fInverseBendingMomentum = trackParam->GetInverseBendingMomentum(); | |
881 | fXRec = trackParam->GetNonBendingCoor(); | |
882 | fYRec = trackParam->GetBendingCoor(); | |
883 | fZRec = trackParam->GetZ(); | |
884 | ||
885 | ntrackhits = rectrack->GetNTrackHits(); | |
886 | fitfmin = rectrack->GetFitFMin(); | |
887 | ||
888 | // setting data member of ESD MUON | |
889 | ESDTrack->SetInverseBendingMomentum(fInverseBendingMomentum); | |
890 | ESDTrack->SetThetaX(TMath::ATan(nonBendingSlope)); | |
891 | ESDTrack->SetThetaY(TMath::ATan(bendingSlope)); | |
892 | ESDTrack->SetZ(fZRec); | |
893 | ESDTrack->SetBendingCoor(fYRec); | |
894 | ESDTrack->SetNonBendingCoor(fXRec); | |
895 | ESDTrack->SetChi2(fitfmin); | |
896 | ESDTrack->SetNHit(ntrackhits); | |
897 | } | |
898 | ||
899 | // // -------------------- trigger tracks------------- | |
900 | fMUONData->SetTreeAddress("RL"); | |
901 | fMUONData->GetRecTriggerTracks(); | |
902 | recTracksArray = fMUONData->RecTriggerTracks(); | |
903 | ||
bdfa9e49 | 904 | Int_t ntrectracks = (Int_t) recTracksArray->GetEntriesFast(); //YS |
aa43efee | 905 | |
906 | // printf(">>> Event %d Number of Recconstructed tracks %d \n",ievent, nrectracks); | |
907 | ||
908 | // read trigger track infos | |
bdfa9e49 | 909 | for (Int_t irectracks = 0; irectracks < ntrectracks; irectracks++) { |
aa43efee | 910 | |
911 | rectriggertrack = (AliMUONTriggerTrack*) recTracksArray->At(irectracks); | |
912 | ||
913 | x11 = rectriggertrack->GetY11(); | |
914 | y11 = rectriggertrack->GetY11(); | |
915 | thetaX = rectriggertrack->GetThetax(); | |
916 | thetaY = rectriggertrack->GetThetay(); | |
917 | ||
918 | // setting data member of ESD MUON trigger | |
919 | ESDTrack->SetThetaX11(thetaX); | |
920 | ESDTrack->SetThetaY11(thetaY); | |
921 | ESDTrack->SetX11(x11); | |
922 | ESDTrack->SetY11(y11); | |
923 | } | |
924 | ||
925 | // storing ESD MUON Track into ESD Event & reset muondata | |
bdfa9e49 | 926 | if (ntrectracks+ntrectracks != 0) //YS |
927 | event->AddMuonTrack(ESDTrack); | |
aa43efee | 928 | fMUONData->ResetRecTracks(); |
929 | fMUONData->ResetRecTriggerTracks(); | |
930 | ||
bdfa9e49 | 931 | //YS } // end loop on event |
932 | fLoader->UnloadTracks(); //YS | |
aa43efee | 933 | } |
a897a37a | 934 |