1 /**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
7 * Permission to use, copy, modify and distribute this software and its *
8 * documentation strictly for non-commercial purposes is hereby granted *
9 * without fee, provided that the above copyright notice appears in all *
10 * copies and that both the copyright notice and this permission notice *
11 * appear in the supporting documentation. The authors make no claims *
12 * about the suitability of this software for any purpose. It is *
13 * provided "as is" without express or implied warranty. *
14 **************************************************************************/
18 //-----------------------------------------------------------------------------
19 /// \class AliMUONVTrackReconstructor
20 /// Virtual MUON track reconstructor in ALICE (class renamed from AliMUONEventReconstructor)
22 /// This class contains as data a pointer to the array of reconstructed tracks
24 /// It contains as methods, among others:
25 /// * EventReconstruct to build the muon tracks
26 /// * EventReconstructTrigger to build the trigger tracks
27 /// * ValidateTracksWithTrigger to match tracker/trigger tracks
29 /// Several options and adjustable parameters are available for both KALMAN and ORIGINAL
30 /// tracking algorithms. They can be changed through the AliMUONRecoParam object
31 /// set in the reconstruction macro or read from the CDB
32 /// (see methods in AliMUONRecoParam.h file for details)
34 /// Main parameters and options are:
35 /// - *fgkSigmaToCutForTracking* : quality cut used to select new clusters to be
36 /// attached to the track candidate and to select good tracks.
37 /// - *fgkMakeTrackCandidatesFast* : if this flag is set to 'true', the track candidates
38 /// are made assuming linear propagation between stations 4 and 5.
39 /// - *fgkTrackAllTracks* : according to the value of this flag, in case that several
40 /// new clusters pass the quality cut, either we consider all the possibilities
41 /// (duplicating tracks) or we attach only the best cluster.
42 /// - *fgkRecoverTracks* : if this flag is set to 'true', we try to recover the tracks
43 /// lost during the tracking by removing the worst of the 2 clusters attached in the
45 /// - *fgkImproveTracks* : if this flag is set to 'true', we try to improve the quality
46 /// of the tracks at the end of the tracking by removing clusters that do not pass
47 /// new quality cut (the track is removed is it does not contain enough cluster anymore).
48 /// - *fgkComplementTracks* : if this flag is set to 'true', we try to improve the quality
49 /// of the tracks at the end of the tracking by adding potentially missing clusters
50 /// (we may have 2 clusters in the same chamber because of the overlapping of detection
51 /// elements, which is not handle by the tracking algorithm).
52 /// - *fgkSigmaToCutForImprovement* : quality cut used when we try to improve the
53 /// quality of the tracks.
55 /// \author Philippe Pillot
56 //-----------------------------------------------------------------------------
58 #include "AliMUONVTrackReconstructor.h"
60 #include "AliMUONConstants.h"
61 #include "AliMUONObjectPair.h"
62 #include "AliMUONTriggerTrack.h"
63 #include "AliMUONTriggerCircuit.h"
64 #include "AliMUONLocalTrigger.h"
65 #include "AliMUONGlobalTrigger.h"
66 #include "AliMUONTrack.h"
67 #include "AliMUONTrackParam.h"
68 #include "AliMUONTrackExtrap.h"
69 #include "AliMUONTrackHitPattern.h"
70 #include "AliMUONVTrackStore.h"
71 #include "AliMUONVClusterStore.h"
72 #include "AliMUONVCluster.h"
73 #include "AliMUONVClusterServer.h"
74 #include "AliMUONVTriggerStore.h"
75 #include "AliMUONVTriggerTrackStore.h"
76 #include "AliMpDEManager.h"
77 #include "AliMpArea.h"
80 #include "AliCodeTimer.h"
81 #include "AliTracker.h"
83 #include <TClonesArray.h>
88 #include <Riostream.h>
91 ClassImp(AliMUONVTrackReconstructor) // Class implementation in ROOT context
94 //__________________________________________________________________________
95 AliMUONVTrackReconstructor::AliMUONVTrackReconstructor(const AliMUONRecoParam* recoParam,
96 AliMUONVClusterServer* clusterServer)
100 fClusterServer(clusterServer),
101 fRecoParam(recoParam)
103 /// Constructor for class AliMUONVTrackReconstructor
104 /// WARNING: if clusterServer=0x0, no clusterization will be possible at this level
106 // Memory allocation for the TClonesArray of reconstructed tracks
107 fRecTracksPtr = new TClonesArray("AliMUONTrack", 100);
109 // set the magnetic field for track extrapolations
110 const AliMagF* kField = AliTracker::GetFieldMap();
111 if (!kField) AliFatal("No field available");
112 AliMUONTrackExtrap::SetField(kField);
115 //__________________________________________________________________________
116 AliMUONVTrackReconstructor::~AliMUONVTrackReconstructor()
118 /// Destructor for class AliMUONVTrackReconstructor
119 delete fRecTracksPtr;
122 //__________________________________________________________________________
123 void AliMUONVTrackReconstructor::ResetTracks()
125 /// To reset the TClonesArray of reconstructed tracks
126 if (fRecTracksPtr) fRecTracksPtr->Clear("C");
131 //__________________________________________________________________________
132 void AliMUONVTrackReconstructor::EventReconstruct(AliMUONVClusterStore& clusterStore, AliMUONVTrackStore& trackStore)
134 /// To reconstruct one event
136 AliCodeTimerAuto("");
138 // Reset array of tracks
141 // Look for candidates from clusters in stations(1..) 4 and 5
142 MakeTrackCandidates(clusterStore);
144 // Look for extra candidates from clusters in stations(1..) 4 and 5
145 if (GetRecoParam()->MakeMoreTrackCandidates()) MakeMoreTrackCandidates(clusterStore);
147 // Stop tracking if no candidate found
148 if (fRecTracksPtr->GetEntriesFast() == 0) return;
150 // Follow tracks in stations(1..) 3, 2 and 1
151 FollowTracks(clusterStore);
153 // Complement the reconstructed tracks
154 if (GetRecoParam()->ComplementTracks()) ComplementTracks(clusterStore);
156 // Improve the reconstructed tracks
157 if (GetRecoParam()->ImproveTracks()) ImproveTracks();
159 // Remove connected tracks
160 if (GetRecoParam()->RemoveConnectedTracksInSt12()) RemoveConnectedTracks(kFALSE);
161 else RemoveConnectedTracks(kTRUE);
163 // Fill AliMUONTrack data members
166 // Add tracks to MUON data container
167 for (Int_t i=0; i<fNRecTracks; ++i)
169 AliMUONTrack * track = (AliMUONTrack*) fRecTracksPtr->At(i);
170 track->SetUniqueID(i+1);
171 trackStore.Add(*track);
175 //__________________________________________________________________________
176 TClonesArray* AliMUONVTrackReconstructor::MakeSegmentsBetweenChambers(const AliMUONVClusterStore& clusterStore, Int_t ch1, Int_t ch2)
178 /// To make the list of segments from the list of clusters in the 2 given chambers.
179 /// Return a new TClonesArray of segments.
180 /// It is the responsibility of the user to delete it afterward.
181 AliDebug(1,Form("Enter MakeSegmentsBetweenChambers (1..) %d-%d", ch1+1, ch2+1));
183 AliMUONVCluster *cluster1, *cluster2;
184 AliMUONObjectPair *segment;
185 Double_t nonBendingSlope = 0, bendingSlope = 0, impactParam = 0., bendingMomentum = 0.; // to avoid compilation warning
187 // Create iterators to loop over clusters in both chambers
188 TIter nextInCh1(clusterStore.CreateChamberIterator(ch1,ch1));
189 TIter nextInCh2(clusterStore.CreateChamberIterator(ch2,ch2));
192 TClonesArray *segments = new TClonesArray("AliMUONObjectPair", 100);
194 // Loop over clusters in the first chamber of the station
195 while ( ( cluster1 = static_cast<AliMUONVCluster*>(nextInCh1()) ) ) {
197 // reset cluster iterator of chamber 2
200 // Loop over clusters in the second chamber of the station
201 while ( ( cluster2 = static_cast<AliMUONVCluster*>(nextInCh2()) ) ) {
204 nonBendingSlope = (cluster1->GetX() - cluster2->GetX()) / (cluster1->GetZ() - cluster2->GetZ());
206 // check if non bending slope is within tolerances
207 if (TMath::Abs(nonBendingSlope) > GetRecoParam()->GetMaxNonBendingSlope()) continue;
210 bendingSlope = (cluster1->GetY() - cluster2->GetY()) / (cluster1->GetZ() - cluster2->GetZ());
212 // check the bending momentum of the bending slope depending if the field is ON or OFF
213 if (AliMUONTrackExtrap::IsFieldON()) {
216 impactParam = cluster1->GetY() - cluster1->GetZ() * bendingSlope;
218 // absolute value of bending momentum
219 bendingMomentum = TMath::Abs(AliMUONTrackExtrap::GetBendingMomentumFromImpactParam(impactParam));
221 // check if bending momentum is within tolerances
222 if (bendingMomentum < GetRecoParam()->GetMinBendingMomentum() ||
223 bendingMomentum > GetRecoParam()->GetMaxBendingMomentum()) continue;
227 // check if non bending slope is within tolerances
228 if (TMath::Abs(bendingSlope) > GetRecoParam()->GetMaxBendingSlope()) continue;
232 segment = new ((*segments)[segments->GetLast()+1]) AliMUONObjectPair(cluster1, cluster2, kFALSE, kFALSE);
234 // Printout for debug
235 if (AliLog::GetGlobalDebugLevel() > 1) {
236 cout << "segmentIndex(0...): " << segments->GetLast() << endl;
238 cout << "Cluster in first chamber" << endl;
240 cout << "Cluster in second chamber" << endl;
248 // Printout for debug
249 AliDebug(1,Form("chambers%d-%d: NSegments = %d ", ch1+1, ch2+1, segments->GetEntriesFast()));
254 //__________________________________________________________________________
255 void AliMUONVTrackReconstructor::RemoveIdenticalTracks()
257 /// To remove identical tracks:
258 /// Tracks are considered identical if they have all their clusters in common.
259 /// One keeps the track with the larger number of clusters if need be
260 AliMUONTrack *track1, *track2, *trackToRemove;
261 Int_t clustersInCommon, nClusters1, nClusters2;
262 Bool_t removedTrack1;
263 // Loop over first track of the pair
264 track1 = (AliMUONTrack*) fRecTracksPtr->First();
266 removedTrack1 = kFALSE;
267 nClusters1 = track1->GetNClusters();
268 // Loop over second track of the pair
269 track2 = (AliMUONTrack*) fRecTracksPtr->After(track1);
271 nClusters2 = track2->GetNClusters();
272 // number of clusters in common between two tracks
273 clustersInCommon = track1->ClustersInCommon(track2);
274 // check for identical tracks
275 if ((clustersInCommon == nClusters1) || (clustersInCommon == nClusters2)) {
276 // decide which track to remove
277 if (nClusters2 > nClusters1) {
278 // remove track1 and continue the first loop with the track next to track1
279 trackToRemove = track1;
280 track1 = (AliMUONTrack*) fRecTracksPtr->After(track1);
281 fRecTracksPtr->Remove(trackToRemove);
282 fRecTracksPtr->Compress(); // this is essential to retrieve the TClonesArray afterwards
284 removedTrack1 = kTRUE;
287 // remove track2 and continue the second loop with the track next to track2
288 trackToRemove = track2;
289 track2 = (AliMUONTrack*) fRecTracksPtr->After(track2);
290 fRecTracksPtr->Remove(trackToRemove);
291 fRecTracksPtr->Compress(); // this is essential to retrieve the TClonesArray afterwards
294 } else track2 = (AliMUONTrack*) fRecTracksPtr->After(track2);
296 if (removedTrack1) continue;
297 track1 = (AliMUONTrack*) fRecTracksPtr->After(track1);
302 //__________________________________________________________________________
303 void AliMUONVTrackReconstructor::RemoveDoubleTracks()
305 /// To remove double tracks:
306 /// Tracks are considered identical if more than half of the clusters of the track
307 /// which has the smaller number of clusters are in common with the other track.
308 /// Among two identical tracks, one keeps the track with the larger number of clusters
309 /// or, if these numbers are equal, the track with the minimum chi2.
310 AliMUONTrack *track1, *track2, *trackToRemove;
311 Int_t clustersInCommon, nClusters1, nClusters2;
312 Bool_t removedTrack1;
313 // Loop over first track of the pair
314 track1 = (AliMUONTrack*) fRecTracksPtr->First();
316 removedTrack1 = kFALSE;
317 nClusters1 = track1->GetNClusters();
318 // Loop over second track of the pair
319 track2 = (AliMUONTrack*) fRecTracksPtr->After(track1);
321 nClusters2 = track2->GetNClusters();
322 // number of clusters in common between two tracks
323 clustersInCommon = track1->ClustersInCommon(track2);
324 // check for identical tracks
325 if (((nClusters1 < nClusters2) && (2 * clustersInCommon > nClusters1)) || (2 * clustersInCommon > nClusters2)) {
326 // decide which track to remove
327 if ((nClusters1 > nClusters2) || ((nClusters1 == nClusters2) && (track1->GetGlobalChi2() <= track2->GetGlobalChi2()))) {
328 // remove track2 and continue the second loop with the track next to track2
329 trackToRemove = track2;
330 track2 = (AliMUONTrack*) fRecTracksPtr->After(track2);
331 fRecTracksPtr->Remove(trackToRemove);
332 fRecTracksPtr->Compress(); // this is essential to retrieve the TClonesArray afterwards
335 // else remove track1 and continue the first loop with the track next to track1
336 trackToRemove = track1;
337 track1 = (AliMUONTrack*) fRecTracksPtr->After(track1);
338 fRecTracksPtr->Remove(trackToRemove);
339 fRecTracksPtr->Compress(); // this is essential to retrieve the TClonesArray afterwards
341 removedTrack1 = kTRUE;
344 } else track2 = (AliMUONTrack*) fRecTracksPtr->After(track2);
346 if (removedTrack1) continue;
347 track1 = (AliMUONTrack*) fRecTracksPtr->After(track1);
352 //__________________________________________________________________________
353 void AliMUONVTrackReconstructor::RemoveConnectedTracks(Bool_t inSt345)
355 /// To remove double tracks:
356 /// Tracks are considered identical if they share 1 cluster or more.
357 /// If inSt345=kTRUE only stations 3, 4 and 5 are considered.
358 /// Among two identical tracks, one keeps the track with the larger number of clusters
359 /// or, if these numbers are equal, the track with the minimum chi2.
360 AliMUONTrack *track1, *track2, *trackToRemove;
361 Int_t clustersInCommon, nClusters1, nClusters2;
362 Bool_t removedTrack1;
363 // Loop over first track of the pair
364 track1 = (AliMUONTrack*) fRecTracksPtr->First();
366 removedTrack1 = kFALSE;
367 nClusters1 = track1->GetNClusters();
368 // Loop over second track of the pair
369 track2 = (AliMUONTrack*) fRecTracksPtr->After(track1);
371 nClusters2 = track2->GetNClusters();
372 // number of clusters in common between two tracks
373 clustersInCommon = track1->ClustersInCommon(track2, inSt345);
374 // check for identical tracks
375 if (clustersInCommon > 0) {
376 // decide which track to remove
377 if ((nClusters1 > nClusters2) || ((nClusters1 == nClusters2) && (track1->GetGlobalChi2() <= track2->GetGlobalChi2()))) {
378 // remove track2 and continue the second loop with the track next to track2
379 trackToRemove = track2;
380 track2 = (AliMUONTrack*) fRecTracksPtr->After(track2);
381 fRecTracksPtr->Remove(trackToRemove);
382 fRecTracksPtr->Compress(); // this is essential to retrieve the TClonesArray afterwards
385 // else remove track1 and continue the first loop with the track next to track1
386 trackToRemove = track1;
387 track1 = (AliMUONTrack*) fRecTracksPtr->After(track1);
388 fRecTracksPtr->Remove(trackToRemove);
389 fRecTracksPtr->Compress(); // this is essential to retrieve the TClonesArray afterwards
391 removedTrack1 = kTRUE;
394 } else track2 = (AliMUONTrack*) fRecTracksPtr->After(track2);
396 if (removedTrack1) continue;
397 track1 = (AliMUONTrack*) fRecTracksPtr->After(track1);
402 //__________________________________________________________________________
403 void AliMUONVTrackReconstructor::AskForNewClustersInChamber(const AliMUONTrackParam &trackParam,
404 AliMUONVClusterStore& clusterStore, Int_t chamber)
406 /// Ask the clustering to reconstruct new clusters around the track candidate position
408 // check if the current chamber is useable
409 if (!fClusterServer || !GetRecoParam()->UseChamber(chamber)) return;
411 // maximum distance between the center of the chamber and a detection element
412 // (accounting for the inclination of the chamber)
413 static const Double_t kMaxDZ = 15.; // 15 cm
415 // extrapolate track parameters to the chamber
416 AliMUONTrackParam extrapTrackParam(trackParam);
417 AliMUONTrackExtrap::ExtrapToZCov(&extrapTrackParam, AliMUONConstants::DefaultChamberZ(chamber));
419 // build the searching area using the track resolution and the maximum-distance-to-track value
420 const TMatrixD& kParamCov = extrapTrackParam.GetCovariances();
421 Double_t errX2 = kParamCov(0,0) + kMaxDZ * kMaxDZ * kParamCov(1,1) + 2. * kMaxDZ * TMath::Abs(kParamCov(0,1));
422 Double_t errY2 = kParamCov(2,2) + kMaxDZ * kMaxDZ * kParamCov(3,3) + 2. * kMaxDZ * TMath::Abs(kParamCov(2,3));
423 Double_t dX = TMath::Abs(trackParam.GetNonBendingSlope()) * kMaxDZ +
424 GetRecoParam()->GetMaxNonBendingDistanceToTrack() +
425 GetRecoParam()->GetSigmaCutForTracking() * TMath::Sqrt(errX2);
426 Double_t dY = TMath::Abs(trackParam.GetBendingSlope()) * kMaxDZ +
427 GetRecoParam()->GetMaxBendingDistanceToTrack() +
428 GetRecoParam()->GetSigmaCutForTracking() * TMath::Sqrt(errY2);
429 TVector2 dimensions(dX, dY);
430 TVector2 position(extrapTrackParam.GetNonBendingCoor(), extrapTrackParam.GetBendingCoor());
431 AliMpArea area(position, dimensions);
433 // ask to cluterize in the given area of the given chamber
434 fClusterServer->Clusterize(chamber, clusterStore, area, GetRecoParam());
438 //__________________________________________________________________________
439 void AliMUONVTrackReconstructor::AskForNewClustersInStation(const AliMUONTrackParam &trackParam,
440 AliMUONVClusterStore& clusterStore, Int_t station)
442 /// Ask the clustering to reconstruct new clusters around the track candidate position
443 /// in the 2 chambers of the given station
444 AskForNewClustersInChamber(trackParam, clusterStore, 2*station+1);
445 AskForNewClustersInChamber(trackParam, clusterStore, 2*station);
448 //__________________________________________________________________________
449 Double_t AliMUONVTrackReconstructor::TryOneCluster(const AliMUONTrackParam &trackParam, AliMUONVCluster* cluster,
450 AliMUONTrackParam &trackParamAtCluster, Bool_t updatePropagator)
452 /// Test the compatibility between the track and the cluster (using trackParam's covariance matrix):
453 /// return the corresponding Chi2
454 /// return trackParamAtCluster
456 // extrapolate track parameters and covariances at the z position of the tested cluster
457 trackParamAtCluster = trackParam;
458 AliMUONTrackExtrap::ExtrapToZCov(&trackParamAtCluster, cluster->GetZ(), updatePropagator);
460 // set pointer to cluster into trackParamAtCluster
461 trackParamAtCluster.SetClusterPtr(cluster);
463 // Set differences between trackParam and cluster in the bending and non bending directions
464 Double_t dX = cluster->GetX() - trackParamAtCluster.GetNonBendingCoor();
465 Double_t dY = cluster->GetY() - trackParamAtCluster.GetBendingCoor();
467 // Calculate errors and covariances
468 const TMatrixD& kParamCov = trackParamAtCluster.GetCovariances();
469 Double_t sigmaX2 = kParamCov(0,0) + cluster->GetErrX2();
470 Double_t sigmaY2 = kParamCov(2,2) + cluster->GetErrY2();
473 return dX * dX / sigmaX2 + dY * dY / sigmaY2;
477 //__________________________________________________________________________
478 Bool_t AliMUONVTrackReconstructor::TryOneClusterFast(const AliMUONTrackParam &trackParam, AliMUONVCluster* cluster)
480 /// Test the compatibility between the track and the cluster
481 /// given the track resolution + the maximum-distance-to-track value
482 /// and assuming linear propagation of the track:
483 /// return kTRUE if they are compatibles
485 Double_t dZ = cluster->GetZ() - trackParam.GetZ();
486 Double_t dX = cluster->GetX() - (trackParam.GetNonBendingCoor() + trackParam.GetNonBendingSlope() * dZ);
487 Double_t dY = cluster->GetY() - (trackParam.GetBendingCoor() + trackParam.GetBendingSlope() * dZ);
488 const TMatrixD& kParamCov = trackParam.GetCovariances();
489 Double_t errX2 = kParamCov(0,0) + dZ * dZ * kParamCov(1,1) + 2. * dZ * kParamCov(0,1);
490 Double_t errY2 = kParamCov(2,2) + dZ * dZ * kParamCov(3,3) + 2. * dZ * kParamCov(2,3);
492 Double_t dXmax = GetRecoParam()->GetSigmaCutForTracking() * TMath::Sqrt(errX2) +
493 GetRecoParam()->GetMaxNonBendingDistanceToTrack();
494 Double_t dYmax = GetRecoParam()->GetSigmaCutForTracking() * TMath::Sqrt(errY2) +
495 GetRecoParam()->GetMaxBendingDistanceToTrack();
497 if (TMath::Abs(dX) > dXmax || TMath::Abs(dY) > dYmax) return kFALSE;
503 //__________________________________________________________________________
504 Double_t AliMUONVTrackReconstructor::TryTwoClustersFast(const AliMUONTrackParam &trackParamAtCluster1, AliMUONVCluster* cluster2,
505 AliMUONTrackParam &trackParamAtCluster2)
507 /// Test the compatibility between the track and the 2 clusters together (using trackParam's covariance matrix)
508 /// assuming linear propagation between the two clusters:
509 /// return the corresponding Chi2 accounting for covariances between the 2 clusters
510 /// return trackParamAtCluster2
512 // extrapolate linearly track parameters and covariances at the z position of the second cluster
513 trackParamAtCluster2 = trackParamAtCluster1;
514 AliMUONTrackExtrap::LinearExtrapToZ(&trackParamAtCluster2, cluster2->GetZ());
516 // set pointer to cluster2 into trackParamAtCluster2
517 trackParamAtCluster2.SetClusterPtr(cluster2);
519 // Set differences between track and clusters in the bending and non bending directions
520 AliMUONVCluster* cluster1 = trackParamAtCluster1.GetClusterPtr();
521 Double_t dX1 = cluster1->GetX() - trackParamAtCluster1.GetNonBendingCoor();
522 Double_t dX2 = cluster2->GetX() - trackParamAtCluster2.GetNonBendingCoor();
523 Double_t dY1 = cluster1->GetY() - trackParamAtCluster1.GetBendingCoor();
524 Double_t dY2 = cluster2->GetY() - trackParamAtCluster2.GetBendingCoor();
526 // Calculate errors and covariances
527 const TMatrixD& kParamCov1 = trackParamAtCluster1.GetCovariances();
528 const TMatrixD& kParamCov2 = trackParamAtCluster2.GetCovariances();
529 Double_t dZ = trackParamAtCluster2.GetZ() - trackParamAtCluster1.GetZ();
530 Double_t sigma2X1 = kParamCov1(0,0) + cluster1->GetErrX2();
531 Double_t sigma2X2 = kParamCov2(0,0) + cluster2->GetErrX2();
532 Double_t covX1X2 = kParamCov1(0,0) + dZ * kParamCov1(0,1);
533 Double_t sigma2Y1 = kParamCov1(2,2) + cluster1->GetErrY2();
534 Double_t sigma2Y2 = kParamCov2(2,2) + cluster2->GetErrY2();
535 Double_t covY1Y2 = kParamCov1(2,2) + dZ * kParamCov1(2,3);
538 Double_t detX = sigma2X1 * sigma2X2 - covX1X2 * covX1X2;
539 Double_t detY = sigma2Y1 * sigma2Y2 - covY1Y2 * covY1Y2;
540 if (detX == 0. || detY == 0.) return 1.e10;
541 return (dX1 * dX1 * sigma2X2 + dX2 * dX2 * sigma2X1 - 2. * dX1 * dX2 * covX1X2) / detX
542 + (dY1 * dY1 * sigma2Y2 + dY2 * dY2 * sigma2Y1 - 2. * dY1 * dY2 * covY1Y2) / detY;
546 //__________________________________________________________________________
547 Bool_t AliMUONVTrackReconstructor::FollowLinearTrackInChamber(AliMUONTrack &trackCandidate, const AliMUONVClusterStore& clusterStore,
550 /// Follow trackCandidate in chamber(0..) nextChamber assuming linear propagation, and search for compatible cluster(s)
551 /// Keep all possibilities or only the best one(s) according to the flag fgkTrackAllTracks:
552 /// kTRUE: duplicate "trackCandidate" if there are several possibilities and add the new tracks at the end of
553 /// fRecTracksPtr to avoid conficts with other track candidates at this current stage of the tracking procedure.
554 /// Remove the obsolete "trackCandidate" at the end.
555 /// kFALSE: add only the best cluster(s) to the "trackCandidate". Try to add a couple of clusters in priority.
556 /// return kTRUE if new cluster(s) have been found (otherwise return kFALSE)
557 AliDebug(1,Form("Enter FollowLinearTrackInChamber(1..) %d", nextChamber+1));
559 Double_t chi2WithOneCluster = 1.e10;
560 Double_t maxChi2WithOneCluster = 2. * GetRecoParam()->GetSigmaCutForTracking() *
561 GetRecoParam()->GetSigmaCutForTracking(); // 2 because 2 quantities in chi2
562 Double_t bestChi2WithOneCluster = maxChi2WithOneCluster;
563 Bool_t foundOneCluster = kFALSE;
564 AliMUONTrack *newTrack = 0x0;
565 AliMUONVCluster *cluster;
566 AliMUONTrackParam trackParam;
567 AliMUONTrackParam extrapTrackParamAtCluster;
568 AliMUONTrackParam bestTrackParamAtCluster;
570 // Get track parameters according to the propagation direction
571 if (nextChamber > 7) trackParam = *(AliMUONTrackParam*)trackCandidate.GetTrackParamAtCluster()->Last();
572 else trackParam = *(AliMUONTrackParam*)trackCandidate.GetTrackParamAtCluster()->First();
574 // Printout for debuging
575 if ((AliLog::GetDebugLevel("MUON","AliMUONVTrackReconstructor") >= 2) || (AliLog::GetGlobalDebugLevel() >= 2)) {
576 cout<<endl<<"Track parameters and covariances at first cluster:"<<endl;
577 trackParam.GetParameters().Print();
578 trackParam.GetCovariances().Print();
582 AliMUONTrackExtrap::AddMCSEffect(&trackParam,AliMUONConstants::ChamberThicknessInX0(),1.);
584 // Printout for debuging
585 if ((AliLog::GetDebugLevel("MUON","AliMUONVTrackReconstructor") >= 1) || (AliLog::GetGlobalDebugLevel() >= 1)) {
586 cout << "FollowLinearTrackInChamber: look for cluster in chamber(1..): " << nextChamber+1 << endl;
589 // Create iterators to loop over clusters in chamber
590 TIter next(clusterStore.CreateChamberIterator(nextChamber,nextChamber));
592 // look for candidates in chamber
593 while ( ( cluster = static_cast<AliMUONVCluster*>(next()) ) ) {
595 // try to add the current cluster fast
596 if (!TryOneClusterFast(trackParam, cluster)) continue;
598 // try to add the current cluster accuratly
599 extrapTrackParamAtCluster = trackParam;
600 AliMUONTrackExtrap::LinearExtrapToZ(&extrapTrackParamAtCluster, cluster->GetZ());
601 chi2WithOneCluster = TryOneCluster(extrapTrackParamAtCluster, cluster, extrapTrackParamAtCluster);
603 // if good chi2 then consider to add cluster
604 if (chi2WithOneCluster < maxChi2WithOneCluster) {
605 foundOneCluster = kTRUE;
607 // Printout for debuging
608 if ((AliLog::GetDebugLevel("MUON","AliMUONVTrackReconstructor") >= 1) || (AliLog::GetGlobalDebugLevel() >= 1)) {
609 cout << "FollowLinearTrackInChamber: found one cluster in chamber(1..): " << nextChamber+1
610 << " (Chi2 = " << chi2WithOneCluster << ")" << endl;
614 if (GetRecoParam()->TrackAllTracks()) {
615 // copy trackCandidate into a new track put at the end of fRecTracksPtr and add the new cluster
616 newTrack = new ((*fRecTracksPtr)[fRecTracksPtr->GetLast()+1]) AliMUONTrack(trackCandidate);
617 if (GetRecoParam()->RequestStation(nextChamber/2))
618 extrapTrackParamAtCluster.SetRemovable(kFALSE);
619 else extrapTrackParamAtCluster.SetRemovable(kTRUE);
620 newTrack->AddTrackParamAtCluster(extrapTrackParamAtCluster,*cluster);
623 // Printout for debuging
624 if ((AliLog::GetDebugLevel("MUON","AliMUONVTrackReconstructor") >= 1) || (AliLog::GetGlobalDebugLevel() >= 1)) {
625 cout << "FollowLinearTrackInChamber: added one cluster in chamber(1..): " << nextChamber+1 << endl;
626 if (AliLog::GetGlobalDebugLevel() >= 3) newTrack->RecursiveDump();
629 } else if (chi2WithOneCluster < bestChi2WithOneCluster) {
630 // keep track of the best cluster
631 bestChi2WithOneCluster = chi2WithOneCluster;
632 bestTrackParamAtCluster = extrapTrackParamAtCluster;
639 // fill out the best track if required else clean up the fRecTracksPtr array
640 if (!GetRecoParam()->TrackAllTracks()) {
641 if (foundOneCluster) {
642 if (GetRecoParam()->RequestStation(nextChamber/2))
643 bestTrackParamAtCluster.SetRemovable(kFALSE);
644 else bestTrackParamAtCluster.SetRemovable(kTRUE);
645 trackCandidate.AddTrackParamAtCluster(bestTrackParamAtCluster,*(bestTrackParamAtCluster.GetClusterPtr()));
647 // Printout for debuging
648 if ((AliLog::GetDebugLevel("MUON","AliMUONVTrackReconstructor") >= 1) || (AliLog::GetGlobalDebugLevel() >= 1)) {
649 cout << "FollowLinearTrackInChamber: added the best cluster in chamber(1..): " << bestTrackParamAtCluster.GetClusterPtr()->GetChamberId()+1 << endl;
650 if (AliLog::GetGlobalDebugLevel() >= 3) newTrack->RecursiveDump();
653 } else return kFALSE;
655 } else if (foundOneCluster) {
657 // remove obsolete track
658 fRecTracksPtr->Remove(&trackCandidate);
661 } else return kFALSE;
667 //__________________________________________________________________________
668 Bool_t AliMUONVTrackReconstructor::FollowLinearTrackInStation(AliMUONTrack &trackCandidate, const AliMUONVClusterStore& clusterStore,
671 /// Follow trackCandidate in station(0..) nextStation assuming linear propagation, and search for compatible cluster(s)
672 /// Keep all possibilities or only the best one(s) according to the flag fgkTrackAllTracks:
673 /// kTRUE: duplicate "trackCandidate" if there are several possibilities and add the new tracks at the end of
674 /// fRecTracksPtr to avoid conficts with other track candidates at this current stage of the tracking procedure.
675 /// Remove the obsolete "trackCandidate" at the end.
676 /// kFALSE: add only the best cluster(s) to the "trackCandidate". Try to add a couple of clusters in priority.
677 /// return kTRUE if new cluster(s) have been found (otherwise return kFALSE)
678 AliDebug(1,Form("Enter FollowLinearTrackInStation(1..) %d", nextStation+1));
680 // Order the chamber according to the propagation direction (tracking starts with chamber 2):
681 // - nextStation == station(1...) 5 => forward propagation
682 // - nextStation < station(1...) 5 => backward propagation
684 if (nextStation==4) {
685 ch1 = 2*nextStation+1;
689 ch2 = 2*nextStation+1;
692 Double_t chi2WithOneCluster = 1.e10;
693 Double_t chi2WithTwoClusters = 1.e10;
694 Double_t maxChi2WithOneCluster = 2. * GetRecoParam()->GetSigmaCutForTracking() *
695 GetRecoParam()->GetSigmaCutForTracking(); // 2 because 2 quantities in chi2
696 Double_t maxChi2WithTwoClusters = 4. * GetRecoParam()->GetSigmaCutForTracking() *
697 GetRecoParam()->GetSigmaCutForTracking(); // 4 because 4 quantities in chi2
698 Double_t bestChi2WithOneCluster = maxChi2WithOneCluster;
699 Double_t bestChi2WithTwoClusters = maxChi2WithTwoClusters;
700 Bool_t foundOneCluster = kFALSE;
701 Bool_t foundTwoClusters = kFALSE;
702 AliMUONTrack *newTrack = 0x0;
703 AliMUONVCluster *clusterCh1, *clusterCh2;
704 AliMUONTrackParam trackParam;
705 AliMUONTrackParam extrapTrackParamAtCluster1;
706 AliMUONTrackParam extrapTrackParamAtCluster2;
707 AliMUONTrackParam bestTrackParamAtCluster1;
708 AliMUONTrackParam bestTrackParamAtCluster2;
710 Int_t nClusters = clusterStore.GetSize();
711 Bool_t *clusterCh1Used = new Bool_t[nClusters];
712 for (Int_t i = 0; i < nClusters; i++) clusterCh1Used[i] = kFALSE;
715 // Get track parameters according to the propagation direction
716 if (nextStation==4) trackParam = *(AliMUONTrackParam*)trackCandidate.GetTrackParamAtCluster()->Last();
717 else trackParam = *(AliMUONTrackParam*)trackCandidate.GetTrackParamAtCluster()->First();
719 // Printout for debuging
720 if ((AliLog::GetDebugLevel("MUON","AliMUONVTrackReconstructor") >= 2) || (AliLog::GetGlobalDebugLevel() >= 2)) {
721 cout<<endl<<"Track parameters and covariances at first cluster:"<<endl;
722 trackParam.GetParameters().Print();
723 trackParam.GetCovariances().Print();
727 AliMUONTrackExtrap::AddMCSEffect(&trackParam,AliMUONConstants::ChamberThicknessInX0(),1.);
729 // Printout for debuging
730 if ((AliLog::GetDebugLevel("MUON","AliMUONVTrackReconstructor") >= 1) || (AliLog::GetGlobalDebugLevel() >= 1)) {
731 cout << "FollowLinearTrackInStation: look for clusters in chamber(1..): " << ch2+1 << endl;
734 // Create iterators to loop over clusters in both chambers
735 TIter nextInCh1(clusterStore.CreateChamberIterator(ch1,ch1));
736 TIter nextInCh2(clusterStore.CreateChamberIterator(ch2,ch2));
738 // look for candidates in chamber 2
739 while ( ( clusterCh2 = static_cast<AliMUONVCluster*>(nextInCh2()) ) ) {
741 // try to add the current cluster fast
742 if (!TryOneClusterFast(trackParam, clusterCh2)) continue;
744 // try to add the current cluster accuratly
745 extrapTrackParamAtCluster2 = trackParam;
746 AliMUONTrackExtrap::LinearExtrapToZ(&extrapTrackParamAtCluster2, clusterCh2->GetZ());
747 chi2WithOneCluster = TryOneCluster(extrapTrackParamAtCluster2, clusterCh2, extrapTrackParamAtCluster2);
749 // if good chi2 then try to attach a cluster in the other chamber too
750 if (chi2WithOneCluster < maxChi2WithOneCluster) {
751 Bool_t foundSecondCluster = kFALSE;
753 // Printout for debuging
754 if ((AliLog::GetDebugLevel("MUON","AliMUONVTrackReconstructor") >= 1) || (AliLog::GetGlobalDebugLevel() >= 1)) {
755 cout << "FollowLinearTrackInStation: found one cluster in chamber(1..): " << ch2+1
756 << " (Chi2 = " << chi2WithOneCluster << ")" << endl;
758 cout << " look for second clusters in chamber(1..): " << ch1+1 << " ..." << endl;
762 AliMUONTrackExtrap::AddMCSEffect(&extrapTrackParamAtCluster2,AliMUONConstants::ChamberThicknessInX0(),1.);
764 // reset cluster iterator of chamber 1
768 // look for second candidates in chamber 1
769 while ( ( clusterCh1 = static_cast<AliMUONVCluster*>(nextInCh1()) ) ) {
772 // try to add the current cluster fast
773 if (!TryOneClusterFast(extrapTrackParamAtCluster2, clusterCh1)) continue;
775 // try to add the current cluster in addition to the one found in the previous chamber
776 chi2WithTwoClusters = TryTwoClustersFast(extrapTrackParamAtCluster2, clusterCh1, extrapTrackParamAtCluster1);
778 // if good chi2 then consider to add the 2 clusters to the "trackCandidate"
779 if (chi2WithTwoClusters < maxChi2WithTwoClusters) {
780 foundSecondCluster = kTRUE;
781 foundTwoClusters = kTRUE;
783 // Printout for debuging
784 if ((AliLog::GetDebugLevel("MUON","AliMUONVTrackReconstructor") >= 1) || (AliLog::GetGlobalDebugLevel() >= 1)) {
785 cout << "FollowLinearTrackInStation: found one cluster in chamber(1..): " << ch1+1
786 << " (Chi2 = " << chi2WithTwoClusters << ")" << endl;
790 if (GetRecoParam()->TrackAllTracks()) {
791 // copy trackCandidate into a new track put at the end of fRecTracksPtr and add the new clusters
792 newTrack = new ((*fRecTracksPtr)[fRecTracksPtr->GetLast()+1]) AliMUONTrack(trackCandidate);
793 extrapTrackParamAtCluster1.SetRemovable(kTRUE);
794 newTrack->AddTrackParamAtCluster(extrapTrackParamAtCluster1,*clusterCh1);
795 extrapTrackParamAtCluster2.SetRemovable(kTRUE);
796 newTrack->AddTrackParamAtCluster(extrapTrackParamAtCluster2,*clusterCh2);
799 // Tag clusterCh1 as used
800 clusterCh1Used[iCluster1] = kTRUE;
802 // Printout for debuging
803 if ((AliLog::GetDebugLevel("MUON","AliMUONVTrackReconstructor") >= 1) || (AliLog::GetGlobalDebugLevel() >= 1)) {
804 cout << "FollowLinearTrackInStation: added two clusters in station(1..): " << nextStation+1 << endl;
805 if (AliLog::GetGlobalDebugLevel() >= 3) newTrack->RecursiveDump();
808 } else if (chi2WithTwoClusters < bestChi2WithTwoClusters) {
809 // keep track of the best couple of clusters
810 bestChi2WithTwoClusters = chi2WithTwoClusters;
811 bestTrackParamAtCluster1 = extrapTrackParamAtCluster1;
812 bestTrackParamAtCluster2 = extrapTrackParamAtCluster2;
819 // if no cluster found in chamber1 then consider to add clusterCh2 only
820 if (!foundSecondCluster) {
821 foundOneCluster = kTRUE;
823 if (GetRecoParam()->TrackAllTracks()) {
824 // copy trackCandidate into a new track put at the end of fRecTracksPtr and add the new cluster
825 newTrack = new ((*fRecTracksPtr)[fRecTracksPtr->GetLast()+1]) AliMUONTrack(trackCandidate);
826 if (GetRecoParam()->RequestStation(nextStation))
827 extrapTrackParamAtCluster2.SetRemovable(kFALSE);
828 else extrapTrackParamAtCluster2.SetRemovable(kTRUE);
829 newTrack->AddTrackParamAtCluster(extrapTrackParamAtCluster2,*clusterCh2);
832 // Printout for debuging
833 if ((AliLog::GetDebugLevel("MUON","AliMUONVTrackReconstructor") >= 1) || (AliLog::GetGlobalDebugLevel() >= 1)) {
834 cout << "FollowLinearTrackInStation: added one cluster in chamber(1..): " << ch2+1 << endl;
835 if (AliLog::GetGlobalDebugLevel() >= 3) newTrack->RecursiveDump();
838 } else if (!foundTwoClusters && chi2WithOneCluster < bestChi2WithOneCluster) {
839 // keep track of the best cluster except if a couple of clusters has already been found
840 bestChi2WithOneCluster = chi2WithOneCluster;
841 bestTrackParamAtCluster1 = extrapTrackParamAtCluster2;
850 // look for candidates in chamber 1 not already attached to a track
851 // if we want to keep all possible tracks or if no good couple of clusters has been found
852 if (GetRecoParam()->TrackAllTracks() || !foundTwoClusters) {
854 // Printout for debuging
855 if ((AliLog::GetDebugLevel("MUON","AliMUONVTrackReconstructor") >= 1) || (AliLog::GetGlobalDebugLevel() >= 1)) {
856 cout << "FollowLinearTrackInStation: look for single cluster in chamber(1..): " << ch1+1 << endl;
859 //Extrapolate trackCandidate to chamber "ch2"
860 AliMUONTrackExtrap::LinearExtrapToZ(&trackParam, AliMUONConstants::DefaultChamberZ(ch2));
862 // add MCS effect for next step
863 AliMUONTrackExtrap::AddMCSEffect(&trackParam,AliMUONConstants::ChamberThicknessInX0(),1.);
865 // reset cluster iterator of chamber 1
869 // look for second candidates in chamber 1
870 while ( ( clusterCh1 = static_cast<AliMUONVCluster*>(nextInCh1()) ) ) {
873 if (clusterCh1Used[iCluster1]) continue; // Skip clusters already used
875 // try to add the current cluster fast
876 if (!TryOneClusterFast(trackParam, clusterCh1)) continue;
878 // try to add the current cluster accuratly
879 extrapTrackParamAtCluster1 = trackParam;
880 AliMUONTrackExtrap::LinearExtrapToZ(&extrapTrackParamAtCluster1, clusterCh1->GetZ());
881 chi2WithOneCluster = TryOneCluster(extrapTrackParamAtCluster1, clusterCh1, extrapTrackParamAtCluster1);
883 // if good chi2 then consider to add clusterCh1
884 // We do not try to attach a cluster in the other chamber too since it has already been done above
885 if (chi2WithOneCluster < maxChi2WithOneCluster) {
886 foundOneCluster = kTRUE;
888 // Printout for debuging
889 if ((AliLog::GetDebugLevel("MUON","AliMUONVTrackReconstructor") >= 1) || (AliLog::GetGlobalDebugLevel() >= 1)) {
890 cout << "FollowLinearTrackInStation: found one cluster in chamber(1..): " << ch1+1
891 << " (Chi2 = " << chi2WithOneCluster << ")" << endl;
895 if (GetRecoParam()->TrackAllTracks()) {
896 // copy trackCandidate into a new track put at the end of fRecTracksPtr and add the new cluster
897 newTrack = new ((*fRecTracksPtr)[fRecTracksPtr->GetLast()+1]) AliMUONTrack(trackCandidate);
898 if (GetRecoParam()->RequestStation(nextStation))
899 extrapTrackParamAtCluster1.SetRemovable(kFALSE);
900 else extrapTrackParamAtCluster1.SetRemovable(kTRUE);
901 newTrack->AddTrackParamAtCluster(extrapTrackParamAtCluster1,*clusterCh1);
904 // Printout for debuging
905 if ((AliLog::GetDebugLevel("MUON","AliMUONVTrackReconstructor") >= 1) || (AliLog::GetGlobalDebugLevel() >= 1)) {
906 cout << "FollowLinearTrackInStation: added one cluster in chamber(1..): " << ch1+1 << endl;
907 if (AliLog::GetGlobalDebugLevel() >= 3) newTrack->RecursiveDump();
910 } else if (chi2WithOneCluster < bestChi2WithOneCluster) {
911 // keep track of the best cluster except if a couple of clusters has already been found
912 bestChi2WithOneCluster = chi2WithOneCluster;
913 bestTrackParamAtCluster1 = extrapTrackParamAtCluster1;
922 // fill out the best track if required else clean up the fRecTracksPtr array
923 if (!GetRecoParam()->TrackAllTracks()) {
924 if (foundTwoClusters) {
925 bestTrackParamAtCluster1.SetRemovable(kTRUE);
926 trackCandidate.AddTrackParamAtCluster(bestTrackParamAtCluster1,*(bestTrackParamAtCluster1.GetClusterPtr()));
927 bestTrackParamAtCluster2.SetRemovable(kTRUE);
928 trackCandidate.AddTrackParamAtCluster(bestTrackParamAtCluster2,*(bestTrackParamAtCluster2.GetClusterPtr()));
930 // Printout for debuging
931 if ((AliLog::GetDebugLevel("MUON","AliMUONVTrackReconstructor") >= 1) || (AliLog::GetGlobalDebugLevel() >= 1)) {
932 cout << "FollowLinearTrackInStation: added the two best clusters in station(1..): " << nextStation+1 << endl;
933 if (AliLog::GetGlobalDebugLevel() >= 3) newTrack->RecursiveDump();
936 } else if (foundOneCluster) {
937 if (GetRecoParam()->RequestStation(nextStation))
938 bestTrackParamAtCluster1.SetRemovable(kFALSE);
939 else bestTrackParamAtCluster1.SetRemovable(kTRUE);
940 trackCandidate.AddTrackParamAtCluster(bestTrackParamAtCluster1,*(bestTrackParamAtCluster1.GetClusterPtr()));
942 // Printout for debuging
943 if ((AliLog::GetDebugLevel("MUON","AliMUONVTrackReconstructor") >= 1) || (AliLog::GetGlobalDebugLevel() >= 1)) {
944 cout << "FollowLinearTrackInStation: added the best cluster in chamber(1..): " << bestTrackParamAtCluster1.GetClusterPtr()->GetChamberId()+1 << endl;
945 if (AliLog::GetGlobalDebugLevel() >= 3) newTrack->RecursiveDump();
949 delete [] clusterCh1Used;
953 } else if (foundOneCluster || foundTwoClusters) {
955 // remove obsolete track
956 fRecTracksPtr->Remove(&trackCandidate);
960 delete [] clusterCh1Used;
964 delete [] clusterCh1Used;
969 //__________________________________________________________________________
970 void AliMUONVTrackReconstructor::ImproveTracks()
972 /// Improve tracks by removing clusters with local chi2 highter than the defined cut
973 /// Recompute track parameters and covariances at the remaining clusters
974 AliDebug(1,"Enter ImproveTracks");
976 AliMUONTrack *track, *nextTrack;
978 track = (AliMUONTrack*) fRecTracksPtr->First();
981 // prepare next track in case the actual track is suppressed
982 nextTrack = (AliMUONTrack*) fRecTracksPtr->After(track);
984 ImproveTrack(*track);
986 // remove track if improvement failed
987 if (!track->IsImproved()) {
988 fRecTracksPtr->Remove(track);
995 // compress the array in case of some tracks have been removed
996 fRecTracksPtr->Compress();
1000 //__________________________________________________________________________
1001 void AliMUONVTrackReconstructor::Finalize()
1003 /// Recompute track parameters and covariances at each attached cluster from those at the first one
1005 AliMUONTrack *track;
1007 track = (AliMUONTrack*) fRecTracksPtr->First();
1010 FinalizeTrack(*track);
1012 track = (AliMUONTrack*) fRecTracksPtr->After(track);
1018 //__________________________________________________________________________
1019 void AliMUONVTrackReconstructor::ValidateTracksWithTrigger(AliMUONVTrackStore& trackStore,
1020 const AliMUONVTriggerTrackStore& triggerTrackStore,
1021 const AliMUONVTriggerStore& triggerStore,
1022 const AliMUONTrackHitPattern& trackHitPattern)
1024 /// Try to match track from tracking system with trigger track
1025 AliCodeTimerAuto("");
1027 trackHitPattern.ExecuteValidation(trackStore, triggerTrackStore, triggerStore);
1030 //__________________________________________________________________________
1031 void AliMUONVTrackReconstructor::EventReconstructTrigger(const AliMUONTriggerCircuit& circuit,
1032 const AliMUONVTriggerStore& triggerStore,
1033 AliMUONVTriggerTrackStore& triggerTrackStore)
1035 /// To make the trigger tracks from Local Trigger
1037 AliCodeTimerAuto("");
1039 AliMUONGlobalTrigger* globalTrigger = triggerStore.Global();
1041 UChar_t gloTrigPat = 0;
1045 gloTrigPat = globalTrigger->GetGlobalResponse();
1048 TIter next(triggerStore.CreateIterator());
1049 AliMUONLocalTrigger* locTrg(0x0);
1051 Float_t z11 = AliMUONConstants::DefaultChamberZ(10);
1052 Float_t z21 = AliMUONConstants::DefaultChamberZ(12);
1054 AliMUONTriggerTrack triggerTrack;
1056 while ( ( locTrg = static_cast<AliMUONLocalTrigger*>(next()) ) )
1058 Bool_t xTrig=locTrg->IsTrigX();
1059 Bool_t yTrig=locTrg->IsTrigY();
1061 Int_t localBoardId = locTrg->LoCircuit();
1064 { // make Trigger Track if trigger in X and Y
1066 Float_t y11 = circuit.GetY11Pos(localBoardId, locTrg->LoStripX());
1067 // need first to convert deviation to [0-30]
1068 // (see AliMUONLocalTriggerBoard::LocalTrigger)
1069 Int_t deviation = locTrg->GetDeviation();
1070 Int_t stripX21 = locTrg->LoStripX()+deviation+1;
1071 Float_t y21 = circuit.GetY21Pos(localBoardId, stripX21);
1072 Float_t x11 = circuit.GetX11Pos(localBoardId, locTrg->LoStripY());
1074 AliDebug(1, Form(" MakeTriggerTrack %d %d %d %d %f %f %f \n",locTrg->LoCircuit(),
1075 locTrg->LoStripX(),locTrg->LoStripX()+locTrg->LoDev()+1,locTrg->LoStripY(),y11, y21, x11));
1077 Float_t thetax = TMath::ATan2( x11 , z11 );
1078 Float_t thetay = TMath::ATan2( (y21-y11) , (z21-z11) );
1080 triggerTrack.SetX11(x11);
1081 triggerTrack.SetY11(y11);
1082 triggerTrack.SetThetax(thetax);
1083 triggerTrack.SetThetay(thetay);
1084 triggerTrack.SetGTPattern(gloTrigPat);
1085 triggerTrack.SetLoTrgNum(localBoardId);
1087 triggerTrackStore.Add(triggerTrack);
1089 } // end of loop on Local Trigger