1 #ifndef ALIHLTMUONDECISION_H
2 #define ALIHLTMUONDECISION_H
3 /* This file is property of and copyright by the ALICE HLT Project *
4 * ALICE Experiment at CERN, All rights reserved. *
5 * See cxx source for full Copyright notice */
10 /// @file AliHLTMUONDecision.h
11 /// @author Artur Szostak <artursz@iafrica.com>
13 /// @brief Declaration of a dHLT decision object in ROOT object format.
17 #include "TClonesArray.h"
19 class AliHLTMUONMansoTrack;
22 * AliHLTMUONDecision stores converted dHLT raw trigger decision data as a ROOT object.
23 * Both AliHLTMUONSinglesDecisionBlockStruct and AliHLTMUONPairsDecisionBlockStruct
24 * data blocks are converted into this class by the AliHLTMUONRootifierComponent.
25 * This class is mainly for testing or as a helper object for dHLT specific analysis,
26 * since it is sometimes easier to store and handle ROOT objects.
28 class AliHLTMUONDecision : public TObject
31 * Stream operator for usage with std::ostream classes.
32 * Allows usage such as:
33 * AliHLTMUONDecision t; std::cout << t;
35 friend std::ostream& operator << (
37 const AliHLTMUONDecision& decision
43 * The AliTrackDecision class stores per track trigger information.
45 class AliTrackDecision : public TObject
48 * Stream operator for usage with std::ostream classes.
50 friend std::ostream& operator << (std::ostream& stream, const AliTrackDecision& decision);
55 * Constructor for new single track trigger decision object.
56 * \param pt The calculated pT value used for the trigger decision.
57 * \param passedLowCut Flag indicating if the track passed the low pT cut.
58 * \param passedHighCut Flag indicating if the track passed the high pT cut.
59 * \param track Pointer to the associated track object.
63 Bool_t passedLowCut = kFALSE,
64 Bool_t passedHighCut = kFALSE,
65 const AliHLTMUONMansoTrack* track = NULL
67 TObject(), fTrack(track), fPt(pt),
68 fPassedLowCut(passedLowCut), fPassedHighCut(passedHighCut)
72 * Copy constructor performs shallow copy of object since we
73 * do not take ownership of the track object.
75 AliTrackDecision(const AliTrackDecision& obj) :
76 TObject(obj), fTrack(obj.fTrack), fPt(obj.fPt),
77 fPassedLowCut(obj.fPassedLowCut), fPassedHighCut(obj.fPassedHighCut)
81 * Asignment operators performs shallow copy of object since we
82 * do not take ownership of the track object.
84 const AliTrackDecision& operator = (const AliTrackDecision& obj)
86 TObject::operator = (obj);
87 fTrack = obj.fTrack; fPt = obj.fPt;
88 fPassedLowCut = obj.fPassedLowCut; fPassedHighCut = obj.fPassedHighCut;
95 virtual ~AliTrackDecision() {}
98 * Returns the track associated with the trigger decision or NULL if none found.
100 const AliHLTMUONMansoTrack* Track() const { return fTrack; }
103 * Returns the calculated pT value used for the trigger decision.
105 Float_t Pt() const { return fPt; }
108 * Returns kTRUE if the track passed the low pT cut, else kFALSE.
110 Bool_t PassedLowPtCut() const { return fPassedLowCut; }
113 * Returns kTRUE if the track passed the high pT cut, else kFALSE.
115 Bool_t PassedHighPtCut() const { return fPassedHighCut; }
117 /// Print method inherited from TObject.
118 virtual void Print(Option_t* option = NULL) const;
120 // Methods inherited from TObject
121 virtual Bool_t IsSortable() const { return kTRUE; }
122 Int_t Compare(const TObject* obj) const;
124 // Implement comparison operators.
125 bool operator == (const AliTrackDecision& d) const
127 return fTrack == d.fTrack and fPt == d.fPt
128 and fPassedLowCut == d.fPassedLowCut
129 and fPassedHighCut == d.fPassedHighCut;
132 bool operator != (const AliTrackDecision& d) const
134 return not this->operator == (d);
139 const AliHLTMUONMansoTrack* fTrack; ///< Track associated with this decision.
140 Float_t fPt; ///< Calculated pT value used for decision (GeV/c).
141 Bool_t fPassedLowCut; ///< Indicates if the track passed the low pT cut.
142 Bool_t fPassedHighCut; ///< Indicates if the track passed the high pT cut.
144 ClassDef(AliHLTMUONDecision::AliTrackDecision, 3); // A single track dHLT trigger decision object.
148 * The AliPairDecision class stores trigger information about a track pair.
150 class AliPairDecision : public TObject
153 * Stream operator for usage with std::ostream classes.
155 friend std::ostream& operator << (std::ostream& stream, const AliPairDecision& decision);
160 * Constructor for new track pair trigger decision object.
161 * \param mass The invariant mass of the track pair.
162 * \param passedLowCut Indicates if the pair passed the low mass cut.
163 * \param passedHighCut Indicates if the pair passed the high mass cut.
164 * \param unlike Indicates if the tracks have opposite sign.
165 * \param lowPtCount The number of tracks in the pair that passed the low pT cut.
166 * Should be in the range [0..2].
167 * \param highPtCount The number of tracks in the pair that passed the high pT cut.
168 * Should be in the range [0..2].
169 * \param trackA Pointer to the first associated track object.
170 * \param trackB Pointer to the second associated track object.
173 Float_t mass = -1, Bool_t passedLowCut = kFALSE,
174 Bool_t passedHighCut = kFALSE, Bool_t unlike = kFALSE,
175 UChar_t lowPtCount = 0, UChar_t highPtCount = 0,
176 const AliHLTMUONMansoTrack* trackA = NULL,
177 const AliHLTMUONMansoTrack* trackB = NULL
179 TObject(), fTrackA(trackA), fTrackB(trackB), fMass(mass),
180 fPassedLowCut(passedLowCut), fPassedHighCut(passedHighCut),
181 fUnlike(unlike), fLowPtCount(lowPtCount), fHighPtCount(highPtCount)
185 * Copy constructor performs shallow copy of object since we
186 * do not take ownership of the track objects.
188 AliPairDecision(const AliPairDecision& obj) :
189 TObject(obj), fTrackA(obj.fTrackA), fTrackB(obj.fTrackB), fMass(obj.fMass),
190 fPassedLowCut(obj.fPassedLowCut), fPassedHighCut(obj.fPassedHighCut),
191 fUnlike(obj.fUnlike), fLowPtCount(obj.fLowPtCount), fHighPtCount(obj.fHighPtCount)
195 * Asignment operators performs shallow copy of object since we
196 * do not take ownership of the track objects.
198 const AliPairDecision& operator = (const AliPairDecision& obj)
200 TObject::operator = (obj);
201 fTrackA = obj.fTrackA; fTrackB = obj.fTrackB; fMass = obj.fMass; fPassedLowCut = obj.fPassedLowCut;
202 fPassedHighCut = obj.fPassedHighCut; fUnlike = obj.fUnlike; fLowPtCount = obj.fLowPtCount; fHighPtCount = obj.fHighPtCount;
207 * Default destructor.
209 virtual ~AliPairDecision() {}
212 * Returns the first track associated with the track pair trigger decision
213 * or NULL if none found.
215 const AliHLTMUONMansoTrack* TrackA() const { return fTrackA; }
218 * Returns the second track associated with the track pair trigger decision
219 * or NULL if none found.
221 const AliHLTMUONMansoTrack* TrackB() const { return fTrackB; }
224 * Returns the calculated invariant mass value used for the trigger decision.
226 Float_t Mass() const { return fMass; }
229 * Returns kTRUE if the track pair passed the low invariant mass cut, else kFALSE.
231 Bool_t PassedLowMassCut() const { return fPassedLowCut; }
234 * Returns kTRUE if the track pair passed the high invariant mass cut, else kFALSE.
236 Bool_t PassedHighMassCut() const { return fPassedHighCut; }
239 * Returns kTRUE if the track pair has unlike sign, else kFALSE.
241 Bool_t UnlikeSign() const { return fUnlike; }
244 * Returns kTRUE if the track pair has like sign, else kFALSE.
246 Bool_t LikeSign() const { return not fUnlike; }
249 * Returns the number of tracks in the pair that passed the low pT cut.
250 * Can be one of 0, 1 or 2.
252 UChar_t NumberPassedLowPtCut() const { return fLowPtCount; }
255 * Returns the number of tracks in the pair that passed the high pT cut.
256 * Can be one of 0, 1 or 2.
258 UChar_t NumberPassedHighPtCut() const { return fHighPtCount; }
261 * Returns kTRUE if both tracks passed the low pT cut, else kFALSE.
263 Bool_t BothPassedLowPtCut() const { return NumberPassedLowPtCut() == 2; }
266 * Returns kTRUE if both tracks passed the high pT cut, else kFALSE.
268 Bool_t BothPassedHighPtCut() const { return NumberPassedHighPtCut() == 2; }
270 /// Print method inherited from TObject.
271 virtual void Print(Option_t* option = NULL) const;
273 // Methods inherited from TObject
274 virtual Bool_t IsSortable() const { return kTRUE; }
275 Int_t Compare(const TObject* obj) const;
277 // Implement comparison operators.
278 bool operator == (const AliPairDecision& d) const
280 return fTrackA == d.fTrackA and fTrackB == d.fTrackB and fMass == d.fMass
281 and fPassedLowCut == d.fPassedLowCut and fPassedHighCut == d.fPassedHighCut
282 and fUnlike == d.fUnlike and fLowPtCount == d.fLowPtCount and fHighPtCount == d.fHighPtCount;
285 bool operator != (const AliPairDecision& d) const
287 return not this->operator == (d);
292 const AliHLTMUONMansoTrack* fTrackA; ///< The first track associated with this pair decision.
293 const AliHLTMUONMansoTrack* fTrackB; ///< The second track associated with this pair decision.
294 Float_t fMass; ///< The invariant mass used for the trigger decision. (GeV/c^2)
295 Bool_t fPassedLowCut; ///< Indicates if the track passed the low mass cut.
296 Bool_t fPassedHighCut; ///< Indicates if the track passed the high mass cut.
297 Bool_t fUnlike; ///< Indicates if the track pair has unlike sign.
298 UChar_t fLowPtCount; ///< The number of tracks in the pair that passed the low pT cut.
299 UChar_t fHighPtCount; ///< The number of tracks in the pair that passed the high pT cut.
301 ClassDef(AliHLTMUONDecision::AliPairDecision, 3); // A track pair dHLT trigger decision object.
305 * Constructor for creating a dHLT decision object.
306 * \param nLowPt Number of tracks above low pT cut.
307 * \param nHiPt Number of tracks above high pT cut.
308 * \param nUnlikeAnyPt Number of track pairs with unlike sign.
309 * \param nUnlikeLowPt Number of unlike sign track pairs with pT > low cut.
310 * \param nUnlikeHighPt Number of unlike sign track pairs with pT > high cut.
311 * \param nLikeAnyPt Number of track pairs with like sign.
312 * \param nLikeLowPt Number of like sign track pairs with pT > low cut.
313 * \param nLikeHighPt Number of like sign track pairs with pT > high cut.
314 * \param nMassAny Number of unlike sign track pairs with invariant mass > low cut.
315 * \param nMassLow Number of unlike sign track pairs with invariant mass > low mass cut and pT > low pT cut.
316 * \param nMassHigh Number of unlike sign track pairs with invariant mass > high mass cut and pT > high pT cut.
319 UInt_t nLowPt = 0, UInt_t nHiPt = 0,
320 UInt_t nUnlikeAnyPt = 0, UInt_t nUnlikeLowPt = 0, UInt_t nUnlikeHighPt = 0,
321 UInt_t nLikeAnyPt = 0, UInt_t nLikeLowPt = 0, UInt_t nLikeHighPt = 0,
322 UInt_t nMassAny = 0, UInt_t nMassLow = 0, UInt_t nMassHigh = 0
326 * Default destructor.
328 virtual ~AliHLTMUONDecision() {}
331 * Returns the number of single low pT triggers.
333 UInt_t NumberOfLowPtTriggers() const { return fNlowPt; }
336 * Returns the number of single high pT triggers.
338 UInt_t NumberOfHighPtTriggers() const { return fNhighPt; }
341 * Returns the number of unlike sign pt triggers.
343 UInt_t NumberOfUnlikePairs() const { return fNunlikeAnyPt; }
346 * Returns the number of unlike sign pT triggers, where both tracks have pT > low cut.
348 UInt_t NumberOfUnlikeLowPtPairs() const { return fNunlikeLowPt; }
351 * Returns the number of unlike sign pT triggers, where both tracks have pT > high cut.
353 UInt_t NumberOfUnlikeHighPtPairs() const { return fNunlikeHighPt; }
356 * Returns the number of like sign pt triggers.
358 UInt_t NumberOfLikePairs() const { return fNlikeAnyPt; }
361 * Returns the number of like sign pT triggers, where both tracks have pT > low cut.
363 UInt_t NumberOfLikeLowPtPairs() const { return fNlikeLowPt; }
366 * Returns the number of like sign pT triggers, where both tracks have pT > high cut.
368 UInt_t NumberOfLikeHighPtPairs() const { return fNlikeHighPt; }
371 * Returns the number of invariant mass triggers.
373 UInt_t NumberOfMassTriggers() const { return fNmassAny; }
376 * Returns the number of invariant mass triggers,
377 * where invariant mass > low cut and both tracks have pT > low cut.
379 UInt_t NumberOfLowMassTriggers() const { return fNmassLow; }
382 * Returns the number of invariant mass triggers,
383 * where invariant mass > high cut and both tracks have pT > high cut.
385 UInt_t NumberOfHighMassTriggers() const { return fNmassHigh; }
388 * Returns the total number of single tracks that formed part of this trigger decision.
390 Int_t NumberOfTracks() const { return fTrackDecisions.GetEntriesFast(); }
393 * Returns the i'th trigger decision for a single track.
394 * \param i Should be in the range [0 .. NumberOfTracks()-1]
396 const AliTrackDecision* SingleTrackDecision(Int_t i) const
398 return static_cast<const AliTrackDecision*>(fTrackDecisions.At(i));
402 * Returns the total number of track pairs that formed part of this trigger decision.
404 Int_t NumberOfPairs() const { return fPairDecisions.GetEntriesFast(); }
407 * Returns the i'th trigger decision for a track pair.
408 * \param i Should be in the range [0 .. NumberOfPairs()-1]
410 const AliPairDecision* TrackPairDecision(Int_t i) const
412 return static_cast<const AliPairDecision*>(fPairDecisions.At(i));
415 /// Add a single track decision to the dHLT trigger.
416 void AddDecision(const AliTrackDecision* decision);
418 /// Add a single track decision to the dHLT trigger.
420 Float_t pt, Bool_t passedLowCut, Bool_t passedHighCut,
421 const AliHLTMUONMansoTrack* track
424 /// Add a track pair decision to the dHLT trigger.
425 void AddDecision(const AliPairDecision* decision);
427 /// Add a track pair decision to the dHLT trigger.
429 Float_t mass, Bool_t passedLowCut,
430 Bool_t passedHighCut, Bool_t unlike,
431 UChar_t lowPtCount, UChar_t highPtCount,
432 const AliHLTMUONMansoTrack* trackA,
433 const AliHLTMUONMansoTrack* trackB
437 * Prints the details of the dHLT decision to screen.
438 * @param option A case sensitive string that can contain one of the
440 * "compact" - Prints just the trigger scalars.
441 * "detail" - Prints also the track decision list in a compact format.
442 * "all" - Prints all decision information and also the track decision details.
443 * If the string contains an empty option or NULL then the default is
444 * to print compactly.
446 virtual void Print(Option_t* option = NULL) const;
448 // Methods inherited from TObject
449 virtual Bool_t IsSortable() const { return kTRUE; }
450 Int_t Compare(const TObject* obj) const;
452 // Implement comparison operators.
453 bool operator == (const AliHLTMUONDecision& track) const;
455 bool operator != (const AliHLTMUONDecision& track) const
457 return not this->operator == (track);
462 // Do not allow copying of this class.
463 AliHLTMUONDecision(const AliHLTMUONDecision& track);
464 AliHLTMUONDecision& operator = (const AliHLTMUONDecision& track);
466 UInt_t fNlowPt; ///< Number of low pt triggers.
467 UInt_t fNhighPt; ///< Number of high pt triggers.
469 /// Number of unlike sign pt triggers for both tracks having any pt.
470 UInt_t fNunlikeAnyPt;
472 /// Number of unlike sign low pt triggers where both tracks have pt > low cut.
473 UInt_t fNunlikeLowPt;
475 /// Number of unlike sign high pt triggers where both tracks have pt > high cut.
476 UInt_t fNunlikeHighPt;
478 /// Number of like sign pt triggers where both tracks have any pt.
481 /// Number of like sign low pt triggers where both tracks have pt > low cut.
484 /// Number of like sign high pt triggers where both tracks have pt > high cut.
487 /// Number of pairs that have invariant mass > low mass cut, any pt and unlike sign.
490 /// Number of pairs that have invariant mass > low mass cut, pt > low pt cut and unlike sign.
493 /// Number of pairs that have invariant mass > high mass cut, pt > high pt cut and unlike sign.
496 TClonesArray fTrackDecisions; ///< Array of single track decision objects.
497 TClonesArray fPairDecisions; ///< Array of track pair decision objects.
499 ClassDef(AliHLTMUONDecision, 3); // Decision object containing data converted from raw internal dHLT data structures.
502 #endif // ALIHLTMUONDECISION_H