New virtual class for TrackReconstructor (Philippe Pillot)
[u/mrichter/AliRoot.git] / MUON / AliMUONVTrackReconstructor.cxx
CommitLineData
8d0843c6 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 **************************************************************************/
15
16/* $Id$ */
17
18////////////////////////////////////
19//
20// Virtual MUON track reconstructor in ALICE (class renamed from AliMUONEventReconstructor)
21//
22// This class contains as data:
23// * a pointer to the array of hits to be reconstructed (the event)
24// * a pointer to the array of segments made with these hits inside each station
25// * a pointer to the array of reconstructed tracks
26//
27// It contains as methods, among others:
28// * EventReconstruct to build the muon tracks
29// * EventReconstructTrigger to build the trigger tracks
30//
31////////////////////////////////////
32
33#include <stdlib.h>
34#include <Riostream.h>
35#include <TTree.h>
36
37#include "AliMUONVTrackReconstructor.h"
38#include "AliMUONData.h"
39#include "AliMUONConstants.h"
40#include "AliMUONHitForRec.h"
41#include "AliMUONTriggerTrack.h"
42#include "AliMUONTriggerCircuitNew.h"
43#include "AliMUONLocalTrigger.h"
44#include "AliMUONGlobalTrigger.h"
45#include "AliMUONSegment.h"
46#include "AliMUONTrack.h"
47#include "AliMagF.h"
48#include "AliLog.h"
49#include "AliTracker.h"
50
51ClassImp(AliMUONVTrackReconstructor) // Class implementation in ROOT context
52
53//************* Defaults parameters for reconstruction
54const Double_t AliMUONVTrackReconstructor::fgkDefaultMinBendingMomentum = 3.0;
55const Double_t AliMUONVTrackReconstructor::fgkDefaultMaxBendingMomentum = 3000.0;
56const Double_t AliMUONVTrackReconstructor::fgkDefaultBendingResolution = 0.01;
57const Double_t AliMUONVTrackReconstructor::fgkDefaultNonBendingResolution = 0.144;
58const Double_t AliMUONVTrackReconstructor::fgkDefaultMaxSigma2Distance = 16.0;
59// Simple magnetic field:
60// Value taken from macro MUONtracking.C: 0.7 T, hence 7 kG
61// Length and Position from reco_muon.F, with opposite sign:
62// Length = ZMAGEND-ZCOIL
63// Position = (ZMAGEND+ZCOIL)/2
64// to be ajusted differently from real magnetic field ????
65const Double_t AliMUONVTrackReconstructor::fgkDefaultSimpleBValue = 7.0;
66const Double_t AliMUONVTrackReconstructor::fgkDefaultSimpleBLength = 428.0;
67const Double_t AliMUONVTrackReconstructor::fgkDefaultSimpleBPosition = 1019.0;
68
69//__________________________________________________________________________
70AliMUONVTrackReconstructor::AliMUONVTrackReconstructor(AliMUONData* data)
71 : TObject(),
72 fMinBendingMomentum(fgkDefaultMinBendingMomentum),
73 fMaxBendingMomentum(fgkDefaultMaxBendingMomentum),
74 fBendingResolution(fgkDefaultBendingResolution),
75 fNonBendingResolution(fgkDefaultNonBendingResolution),
76 fMaxSigma2Distance(fgkDefaultMaxSigma2Distance),
77 fChamberThicknessInX0(AliMUONConstants::DefaultChamberThicknessInX0()),
78 fSimpleBValue(fgkDefaultSimpleBValue),
79 fSimpleBLength(fgkDefaultSimpleBLength),
80 fSimpleBPosition(fgkDefaultSimpleBPosition),
81 fSegmentMaxDistBending(0x0),
82 fSegmentMaxDistNonBending(0x0),
83 fHitsForRecPtr(0x0),
84 fNHitsForRec(0),
85 fNHitsForRecPerChamber(0x0),
86 fIndexOfFirstHitForRecPerChamber(0x0),
87 fSegmentsPtr(0x0),
88 fNSegments(0x0),
89 fRecTracksPtr(0x0),
90 fNRecTracks(0),
91 fMUONData(data),
92 fTriggerTrack(new AliMUONTriggerTrack()),
93 fTriggerCircuit(0x0)
94{
95 /// Constructor for class AliMUONVTrackReconstructor
96 fSegmentMaxDistBending = new Double_t[AliMUONConstants::NTrackingSt()];
97 fSegmentMaxDistNonBending = new Double_t[AliMUONConstants::NTrackingSt()];
98 fNHitsForRecPerChamber = new Int_t[AliMUONConstants::NTrackingCh()];
99 fIndexOfFirstHitForRecPerChamber = new Int_t[AliMUONConstants::NTrackingCh()];
100
101 SetReconstructionParametersToDefaults();
102
103 // Memory allocation for the TClonesArray of hits for reconstruction
104 // Is 10000 the right size ????
105 fHitsForRecPtr = new TClonesArray("AliMUONHitForRec", 10000);
106
107 // Memory allocation for the TClonesArray's of segments in stations
108 // Is 2000 the right size ????
109 fSegmentsPtr = new TClonesArray*[AliMUONConstants::NTrackingSt()];
110 fNSegments = new Int_t[AliMUONConstants::NTrackingSt()];
111 for (Int_t st = 0; st < AliMUONConstants::NTrackingSt(); st++) {
112 fSegmentsPtr[st] = new TClonesArray("AliMUONSegment", 2000);
113 fNSegments[st] = 0; // really needed or GetEntriesFast sufficient ????
114 }
115
116 const AliMagF* kField = AliTracker::GetFieldMap();
117 if (!kField) AliFatal("No field available");
118 // Sign of fSimpleBValue according to sign of Bx value at (50,50,-950).
119 Float_t b[3], x[3];
120 x[0] = 50.; x[1] = 50.; x[2] = -950.;
121 kField->Field(x,b);
122
123 fSimpleBValue = TMath::Sign(fSimpleBValue,(Double_t) b[0]);
124 fSimpleBPosition = TMath::Sign(fSimpleBPosition,(Double_t) x[2]);
125 // See how to get fSimple(BValue, BLength, BPosition)
126 // automatically calculated from the actual magnetic field ????
127}
128
129 //__________________________________________________________________________
130AliMUONVTrackReconstructor::~AliMUONVTrackReconstructor(void)
131{
132 /// Destructor for class AliMUONVTrackReconstructor
133 delete [] fSegmentMaxDistBending;
134 delete [] fSegmentMaxDistNonBending;
135 delete [] fNHitsForRecPerChamber;
136 delete [] fIndexOfFirstHitForRecPerChamber;
137 delete fTriggerTrack;
138 delete fHitsForRecPtr;
139 // Correct destruction of everything ????
140 for (Int_t st = 0; st < AliMUONConstants::NTrackingSt(); st++) delete fSegmentsPtr[st];
141 delete [] fSegmentsPtr;
142 delete [] fNSegments;
143}
144
145 //__________________________________________________________________________
146void AliMUONVTrackReconstructor::SetReconstructionParametersToDefaults(void)
147{
148 /// Set reconstruction parameters for making segments to default values
149 // Would be much more convenient with a structure (or class) ????
150
151 // ******** Parameters for making segments
152 // should be parametrized ????
153 // according to interval between chambers in a station ????
154 // Maximum distance in non bending plane
155 // 5 * 0.22 just to remember the way it was made in TRACKF_STAT
156 // SIGCUT*DYMAX(IZ)
157 for (Int_t st = 0; st < AliMUONConstants::NTrackingCh()/2; st++)
158 fSegmentMaxDistNonBending[st] = 5. * 0.22;
159 // Maximum distance in bending plane:
160 // values from TRACKF_STAT, corresponding to (J psi 20cm),
161 // scaled to the real distance between chambers in a station
162 fSegmentMaxDistBending[0] = TMath::Abs( 1.5 *
163 (AliMUONConstants::DefaultChamberZ(1) - AliMUONConstants::DefaultChamberZ(0)) / 20.0);
164 fSegmentMaxDistBending[1] = TMath::Abs( 1.5 *
165 (AliMUONConstants::DefaultChamberZ(3) - AliMUONConstants::DefaultChamberZ(2)) / 20.0);
166 fSegmentMaxDistBending[2] = TMath::Abs( 3.0 *
167 (AliMUONConstants::DefaultChamberZ(5) - AliMUONConstants::DefaultChamberZ(4)) / 20.0);
168 fSegmentMaxDistBending[3] = TMath::Abs( 6.0 *
169 (AliMUONConstants::DefaultChamberZ(7) - AliMUONConstants::DefaultChamberZ(6)) / 20.0);
170 fSegmentMaxDistBending[4] = TMath::Abs( 6.0 *
171 (AliMUONConstants::DefaultChamberZ(9) - AliMUONConstants::DefaultChamberZ(8)) / 20.0);
172
173 return;
174}
175
176 //__________________________________________________________________________
177void AliMUONVTrackReconstructor::EventReconstruct(void)
178{
179 // To reconstruct one event
180 AliDebug(1,"Enter EventReconstruct");
181 ResetTracks(); //AZ
182 ResetSegments(); //AZ
183 ResetHitsForRec(); //AZ
184 AddHitsForRecFromRawClusters();
185 MakeSegments();
186 MakeTracks();
187 if (fMUONData->IsTriggerTrackBranchesInTree())
188 ValidateTracksWithTrigger();
189
190 // Add tracks to MUON data container
191 for(Int_t i=0; i<fNRecTracks; i++) {
192 AliMUONTrack * track = (AliMUONTrack*) fRecTracksPtr->At(i);
193 fMUONData->AddRecTrack(*track);
194 }
195}
196
197 //__________________________________________________________________________
198void AliMUONVTrackReconstructor::ResetTracks(void)
199{
200 /// To reset the TClonesArray of reconstructed tracks
201 if (fRecTracksPtr) fRecTracksPtr->Delete();
202 // Delete in order that the Track destructors are called,
203 // hence the space for the TClonesArray of pointers to TrackHit's is freed
204 fNRecTracks = 0;
205 return;
206}
207
208 //__________________________________________________________________________
209void AliMUONVTrackReconstructor::ResetSegments(void)
210{
211 /// To reset the TClonesArray of segments and the number of Segments for all stations
212 for (Int_t st = 0; st < AliMUONConstants::NTrackingCh()/2; st++) {
213 if (fSegmentsPtr[st]) fSegmentsPtr[st]->Clear();
214 fNSegments[st] = 0;
215 }
216 return;
217}
218
219 //__________________________________________________________________________
220void AliMUONVTrackReconstructor::ResetHitsForRec(void)
221{
222 /// To reset the array and the number of HitsForRec,
223 /// and also the number of HitsForRec
224 /// and the index of the first HitForRec per chamber
225 if (fHitsForRecPtr) fHitsForRecPtr->Delete();
226 fNHitsForRec = 0;
227 for (Int_t ch = 0; ch < AliMUONConstants::NTrackingCh(); ch++)
228 fNHitsForRecPerChamber[ch] = fIndexOfFirstHitForRecPerChamber[ch] = 0;
229 return;
230}
231
232 //__________________________________________________________________________
233void AliMUONVTrackReconstructor::SortHitsForRecWithIncreasingChamber()
234{
235 /// Sort HitsForRec's in increasing order with respect to chamber number.
236 /// Uses the function "Compare".
237 /// Update the information for HitsForRec per chamber too.
238 Int_t ch, nhits, prevch;
239 fHitsForRecPtr->Sort();
240 for (ch = 0; ch < AliMUONConstants::NTrackingCh(); ch++) {
241 fNHitsForRecPerChamber[ch] = 0;
242 fIndexOfFirstHitForRecPerChamber[ch] = 0;
243 }
244 prevch = 0; // previous chamber
245 nhits = 0; // number of hits in current chamber
246 // Loop over HitsForRec
247 for (Int_t hit = 0; hit < fNHitsForRec; hit++) {
248 // chamber number (0...)
249 ch = ((AliMUONHitForRec*) ((*fHitsForRecPtr)[hit]))->GetChamberNumber();
250 // increment number of hits in current chamber
251 (fNHitsForRecPerChamber[ch])++;
252 // update index of first HitForRec in current chamber
253 // if chamber number different from previous one
254 if (ch != prevch) {
255 fIndexOfFirstHitForRecPerChamber[ch] = hit;
256 prevch = ch;
257 }
258 }
259 return;
260}
261
262 //__________________________________________________________________________
263void AliMUONVTrackReconstructor::MakeSegmentsPerStation(Int_t Station)
264{
265 /// To make the list of segments in station number "Station" (0...)
266 /// from the list of hits to be reconstructed.
267 /// Updates "fNSegments"[Station].
268 /// Segments in stations 4 and 5 are sorted
269 /// according to increasing absolute value of "impact parameter"
270 AliMUONHitForRec *hit1Ptr, *hit2Ptr;
271 AliMUONSegment *segment;
272 Bool_t last2st;
273 Double_t bendingSlope, distBend, distNonBend, extBendCoor, extNonBendCoor,
274 impactParam = 0., maxImpactParam = 0., minImpactParam = 0.; // =0 to avoid compilation warnings.
275 AliDebug(1,Form("Enter MakeSegmentsPerStation (0...) %d",Station));
276 // first and second chambers (0...) in the station
277 Int_t ch1 = 2 * Station;
278 Int_t ch2 = ch1 + 1;
279 // variable true for stations downstream of the dipole:
280 // Station(0..4) equal to 3 or 4
281 if ((Station == 3) || (Station == 4)) {
282 last2st = kTRUE;
283 // maximum impact parameter (cm) according to fMinBendingMomentum...
284 maxImpactParam =
285 TMath::Abs(GetImpactParamFromBendingMomentum(fMinBendingMomentum));
286 // minimum impact parameter (cm) according to fMaxBendingMomentum...
287 minImpactParam =
288 TMath::Abs(GetImpactParamFromBendingMomentum(fMaxBendingMomentum));
289 }
290 else last2st = kFALSE;
291 // extrapolation factor from Z of first chamber to Z of second chamber
292 // dZ to be changed to take into account fine structure of chambers ????
293 Double_t extrapFact;
294 // index for current segment
295 Int_t segmentIndex = 0;
296 // Loop over HitsForRec in the first chamber of the station
297 for (Int_t hit1 = fIndexOfFirstHitForRecPerChamber[ch1];
298 hit1 < fIndexOfFirstHitForRecPerChamber[ch1] + fNHitsForRecPerChamber[ch1];
299 hit1++) {
300 // pointer to the HitForRec
301 hit1Ptr = (AliMUONHitForRec*) ((*fHitsForRecPtr)[hit1]);
302 // extrapolation,
303 // on the straight line joining the HitForRec to the vertex (0,0,0),
304 // to the Z of the second chamber of the station
305 // Loop over HitsForRec in the second chamber of the station
306 for (Int_t hit2 = fIndexOfFirstHitForRecPerChamber[ch2];
307 hit2 < fIndexOfFirstHitForRecPerChamber[ch2] + fNHitsForRecPerChamber[ch2];
308 hit2++) {
309 // pointer to the HitForRec
310 hit2Ptr = (AliMUONHitForRec*) ((*fHitsForRecPtr)[hit2]);
311 // absolute values of distances, in bending and non bending planes,
312 // between the HitForRec in the second chamber
313 // and the previous extrapolation
314 extrapFact = hit2Ptr->GetZ()/ hit1Ptr->GetZ();
315 extBendCoor = extrapFact * hit1Ptr->GetBendingCoor();
316 extNonBendCoor = extrapFact * hit1Ptr->GetNonBendingCoor();
317 distBend = TMath::Abs(hit2Ptr->GetBendingCoor() - extBendCoor);
318 distNonBend = TMath::Abs(hit2Ptr->GetNonBendingCoor() - extNonBendCoor);
319 if (last2st) {
320 // bending slope
321 if ( hit1Ptr->GetZ() - hit2Ptr->GetZ() != 0.0 ) {
322 bendingSlope = (hit1Ptr->GetBendingCoor() - hit2Ptr->GetBendingCoor()) /
323 (hit1Ptr->GetZ() - hit2Ptr->GetZ());
324 // absolute value of impact parameter
325 impactParam =
326 TMath::Abs(hit1Ptr->GetBendingCoor() - hit1Ptr->GetZ() * bendingSlope);
327 }
328 else {
329 AliWarning("hit1Ptr->GetZ() = hit2Ptr->GetZ(): impactParam set to maxImpactParam");
330 impactParam = maxImpactParam;
331 }
332 }
333 // check for distances not too large,
334 // and impact parameter not too big if stations downstream of the dipole.
335 // Conditions "distBend" and "impactParam" correlated for these stations ????
336 if ((distBend < fSegmentMaxDistBending[Station]) &&
337 (distNonBend < fSegmentMaxDistNonBending[Station]) &&
338 (!last2st || (impactParam < maxImpactParam)) &&
339 (!last2st || (impactParam > minImpactParam))) {
340 // make new segment
341 segment = new ((*fSegmentsPtr[Station])[segmentIndex])
342 AliMUONSegment(hit1Ptr, hit2Ptr);
343 // update "link" to this segment from the hit in the first chamber
344 if (hit1Ptr->GetNSegments() == 0)
345 hit1Ptr->SetIndexOfFirstSegment(segmentIndex);
346 hit1Ptr->SetNSegments(hit1Ptr->GetNSegments() + 1);
347 if (AliLog::GetGlobalDebugLevel() > 1) {
348 cout << "segmentIndex(0...): " << segmentIndex
349 << " distBend: " << distBend
350 << " distNonBend: " << distNonBend
351 << endl;
352 segment->Dump();
353 cout << "HitForRec in first chamber" << endl;
354 hit1Ptr->Dump();
355 cout << "HitForRec in second chamber" << endl;
356 hit2Ptr->Dump();
357 };
358 // increment index for current segment
359 segmentIndex++;
360 }
361 } //for (Int_t hit2
362 } // for (Int_t hit1...
363 fNSegments[Station] = segmentIndex;
364 // Sorting according to "impact parameter" if station(1..5) 4 or 5,
365 // i.e. Station(0..4) 3 or 4, using the function "Compare".
366 // After this sorting, it is impossible to use
367 // the "fNSegments" and "fIndexOfFirstSegment"
368 // of the HitForRec in the first chamber to explore all segments formed with it.
369 // Is this sorting really needed ????
370 if ((Station == 3) || (Station == 4)) (fSegmentsPtr[Station])->Sort();
371 AliDebug(1,Form("Station: %d NSegments: %d ", Station, fNSegments[Station]));
372 return;
373}
374
375 //__________________________________________________________________________
376Double_t AliMUONVTrackReconstructor::GetImpactParamFromBendingMomentum(Double_t BendingMomentum) const
377{
378 /// Returns impact parameter at vertex in bending plane (cm),
379 /// from the signed bending momentum "BendingMomentum" in bending plane (GeV/c),
380 /// using simple values for dipole magnetic field.
381 /// The sign of "BendingMomentum" is the sign of the charge.
382 return (-0.0003 * fSimpleBValue * fSimpleBLength * fSimpleBPosition /
383 BendingMomentum);
384}
385
386 //__________________________________________________________________________
387Double_t AliMUONVTrackReconstructor::GetBendingMomentumFromImpactParam(Double_t ImpactParam) const
388{
389 /// Returns signed bending momentum in bending plane (GeV/c),
390 /// the sign being the sign of the charge for particles moving forward in Z,
391 /// from the impact parameter "ImpactParam" at vertex in bending plane (cm),
392 /// using simple values for dipole magnetic field.
393 return (-0.0003 * fSimpleBValue * fSimpleBLength * fSimpleBPosition /
394 ImpactParam);
395}
396
397 //__________________________________________________________________________
398void AliMUONVTrackReconstructor::ValidateTracksWithTrigger(void)
399{
400 /// Try to match track from tracking system with trigger track
401 AliMUONTrack *track;
402 AliMUONTrackParam trackParam;
403 AliMUONTriggerTrack *triggerTrack;
404
405 fMUONData->SetTreeAddress("RL");
406 fMUONData->GetRecTriggerTracks();
407 TClonesArray *recTriggerTracks = fMUONData->RecTriggerTracks();
408
409 Bool_t matchTrigger;
410 Double_t distSigma[3]={1,1,0.02}; // sigma of distributions (trigger-track) X,Y,slopeY
411 Double_t distTriggerTrack[3];
412 Double_t chi2MatchTrigger, xTrack, yTrack, ySlopeTrack, dTrigTrackMin2, dTrigTrack2 = 0.;
413
414 track = (AliMUONTrack*) fRecTracksPtr->First();
415 while (track) {
416 matchTrigger = kFALSE;
417 chi2MatchTrigger = 0.;
418
419 trackParam = *((AliMUONTrackParam*) (track->GetTrackParamAtHit()->Last()));
420 trackParam.ExtrapToZ(AliMUONConstants::DefaultChamberZ(10)); // extrap to 1st trigger chamber
421
422 xTrack = trackParam.GetNonBendingCoor();
423 yTrack = trackParam.GetBendingCoor();
424 ySlopeTrack = trackParam.GetBendingSlope();
425 dTrigTrackMin2 = 999.;
426
427 triggerTrack = (AliMUONTriggerTrack*) recTriggerTracks->First();
428 while(triggerTrack){
429 distTriggerTrack[0] = (triggerTrack->GetX11()-xTrack)/distSigma[0];
430 distTriggerTrack[1] = (triggerTrack->GetY11()-yTrack)/distSigma[1];
431 distTriggerTrack[2] = (TMath::Tan(triggerTrack->GetThetay())-ySlopeTrack)/distSigma[2];
432 dTrigTrack2 = 0.;
433 for (Int_t iVar = 0; iVar < 3; iVar++) dTrigTrack2 += distTriggerTrack[iVar]*distTriggerTrack[iVar];
434 if (dTrigTrack2 < dTrigTrackMin2 && dTrigTrack2 < fMaxSigma2Distance) {
435 dTrigTrackMin2 = dTrigTrack2;
436 matchTrigger = kTRUE;
437 chi2MatchTrigger = dTrigTrack2/3.; // Normalized Chi2, 3 variables (X,Y,slopeY)
438 }
439 triggerTrack = (AliMUONTriggerTrack*) recTriggerTracks->After(triggerTrack);
440 }
441
442 track->SetMatchTrigger(matchTrigger);
443 track->SetChi2MatchTrigger(chi2MatchTrigger);
444
445 track = (AliMUONTrack*) fRecTracksPtr->After(track);
446 }
447
448 return;
449}
450
451//__________________________________________________________________________
452void AliMUONVTrackReconstructor::EventReconstructTrigger(void)
453{
454 /// To reconstruct trigger for one event
455 AliDebug(1,"Enter EventReconstructTrigger");
456 MakeTriggerTracks();
457 return;
458}
459
460 //__________________________________________________________________________
461Bool_t AliMUONVTrackReconstructor::MakeTriggerTracks(void)
462{
463 // To make the trigger tracks from Local Trigger
464 AliDebug(1, "Enter MakeTriggerTracks");
465
466 Int_t nTRentries;
467 UChar_t gloTrigPat;
468 TClonesArray *localTrigger;
469 TClonesArray *globalTrigger;
470 AliMUONLocalTrigger *locTrg;
471 AliMUONGlobalTrigger *gloTrg;
472
473 TTree* treeR = fMUONData->TreeR();
474
475 nTRentries = Int_t(treeR->GetEntries());
476
477 treeR->GetEvent(0); // only one entry
478
479 if (!(fMUONData->IsTriggerBranchesInTree())) {
480 AliWarning(Form("Trigger information is not avalaible, nTRentries = %d not equal to 1",nTRentries));
481 return kFALSE;
482 }
483
484 fMUONData->SetTreeAddress("TC");
485 fMUONData->GetTrigger();
486
487 // global trigger for trigger pattern
488 gloTrigPat = 0;
489 globalTrigger = fMUONData->GlobalTrigger();
490 gloTrg = (AliMUONGlobalTrigger*)globalTrigger->UncheckedAt(0);
491
492 if (gloTrg)
493 gloTrigPat = gloTrg->GetGlobalResponse();
494
495
496 // local trigger for tracking
497 localTrigger = fMUONData->LocalTrigger();
498 Int_t nlocals = (Int_t) (localTrigger->GetEntries());
499
500 Float_t z11 = AliMUONConstants::DefaultChamberZ(10);
501 Float_t z21 = AliMUONConstants::DefaultChamberZ(12);
502
503 Float_t y11 = 0.;
504 Int_t stripX21 = 0;
505 Float_t y21 = 0.;
506 Float_t x11 = 0.;
507
508 for (Int_t i=0; i<nlocals; i++) { // loop on Local Trigger
509 locTrg = (AliMUONLocalTrigger*)localTrigger->UncheckedAt(i);
510
511 AliDebug(1, "AliMUONTrackReconstructor::MakeTriggerTrack using NEW trigger \n");
512 AliMUONTriggerCircuitNew* circuit =
513 (AliMUONTriggerCircuitNew*)fTriggerCircuit->At(locTrg->LoCircuit()-1); // -1 !!!
514
515 y11 = circuit->GetY11Pos(locTrg->LoStripX());
516 stripX21 = locTrg->LoStripX()+locTrg->LoDev()+1;
517 y21 = circuit->GetY21Pos(stripX21);
518 x11 = circuit->GetX11Pos(locTrg->LoStripY());
519
520 AliDebug(1, Form(" MakeTriggerTrack %d %d %d %d %d %f %f %f \n",i,locTrg->LoCircuit(),
521 locTrg->LoStripX(),locTrg->LoStripX()+locTrg->LoDev()+1,locTrg->LoStripY(),y11, y21, x11));
522
523 Float_t thetax = TMath::ATan2( x11 , z11 );
524 Float_t thetay = TMath::ATan2( (y21-y11) , (z21-z11) );
525
526 fTriggerTrack->SetX11(x11);
527 fTriggerTrack->SetY11(y11);
528 fTriggerTrack->SetThetax(thetax);
529 fTriggerTrack->SetThetay(thetay);
530 fTriggerTrack->SetGTPattern(gloTrigPat);
531
532 fMUONData->AddRecTriggerTrack(*fTriggerTrack);
533 } // end of loop on Local Trigger
534 return kTRUE;
535}
536
537//__________________________________________________________________________
538void AliMUONVTrackReconstructor::EventDumpTrigger(void)
539{
540 /// Dump reconstructed trigger event
541 /// and the particle parameters
542 AliMUONTriggerTrack *triggertrack ;
543 Int_t nTriggerTracks = fMUONData->RecTriggerTracks()->GetEntriesFast();
544
545 AliDebug(1, "****** enter EventDumpTrigger ******");
546 AliDebug(1, Form("Number of Reconstructed tracks : %d ", nTriggerTracks));
547
548 // Loop over reconstructed tracks
549 for (Int_t trackIndex = 0; trackIndex < nTriggerTracks; trackIndex++) {
550 triggertrack = (AliMUONTriggerTrack*)fMUONData->RecTriggerTracks()->At(trackIndex);
551 printf(" trigger track number %i x11=%f y11=%f thetax=%f thetay=%f \n",
552 trackIndex,
553 triggertrack->GetX11(),triggertrack->GetY11(),
554 triggertrack->GetThetax(),triggertrack->GetThetay());
555 }
556}
557