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 AliHLTMUONTrack;
20 class AliHLTMUONMansoTrack;
23 * AliHLTMUONDecision stores converted dHLT raw trigger decision data as a ROOT object.
24 * Both AliHLTMUONSinglesDecisionBlockStruct and AliHLTMUONPairsDecisionBlockStruct
25 * data blocks are converted into this class by the AliHLTMUONRootifierComponent.
26 * This class is mainly for testing or as a helper object for dHLT specific analysis,
27 * since it is sometimes easier to store and handle ROOT objects.
29 class AliHLTMUONDecision : public TObject
32 * Stream operator for usage with std::ostream classes.
33 * Allows usage such as:
34 * AliHLTMUONDecision t; std::cout << t;
36 friend std::ostream& operator << (
38 const AliHLTMUONDecision& decision
44 * The AliTrackDecision class stores per track trigger information.
46 class AliTrackDecision : public TObject
49 * Stream operator for usage with std::ostream classes.
51 friend std::ostream& operator << (std::ostream& stream, const AliTrackDecision& decision);
56 * Constructor for new single track trigger decision object.
57 * \param pt The calculated pT value used for the trigger decision.
58 * \param passedLowCut Flag indicating if the track passed the low pT cut.
59 * \param passedHighCut Flag indicating if the track passed the high pT cut.
60 * \param track Pointer to the associated track object.
64 Bool_t passedLowCut = kFALSE,
65 Bool_t passedHighCut = kFALSE,
66 const TObject* track = NULL
68 TObject(), fTrack(track), fPt(pt),
69 fPassedLowCut(passedLowCut), fPassedHighCut(passedHighCut)
73 * Copy constructor performs shallow copy of object since we
74 * do not take ownership of the track object.
76 AliTrackDecision(const AliTrackDecision& obj) :
77 TObject(obj), fTrack(obj.fTrack), fPt(obj.fPt),
78 fPassedLowCut(obj.fPassedLowCut), fPassedHighCut(obj.fPassedHighCut)
82 * Asignment operators performs shallow copy of object since we
83 * do not take ownership of the track object.
85 const AliTrackDecision& operator = (const AliTrackDecision& obj)
87 TObject::operator = (obj);
88 fTrack = obj.fTrack; fPt = obj.fPt;
89 fPassedLowCut = obj.fPassedLowCut; fPassedHighCut = obj.fPassedHighCut;
96 virtual ~AliTrackDecision() {}
99 * Returns the track associated with the trigger decision or NULL if none found.
101 const TObject* Track() const { return fTrack; }
104 * Returns the track associated with the trigger decision as a Manso track object.
105 * NULL is returned if no track is found or the track object is not a Manso track.
107 const AliHLTMUONMansoTrack* MansoTrack() const;
110 * Returns the track associated with the trigger decision as a full track object.
111 * NULL is returned if no track is found or the track object is not a full track.
113 const AliHLTMUONTrack* FullTrack() const;
116 * Returns the calculated pT value used for the trigger decision.
118 Float_t Pt() const { return fPt; }
121 * Returns kTRUE if the track passed the low pT cut, else kFALSE.
123 Bool_t PassedLowPtCut() const { return fPassedLowCut; }
126 * Returns kTRUE if the track passed the high pT cut, else kFALSE.
128 Bool_t PassedHighPtCut() const { return fPassedHighCut; }
130 /// Print method inherited from TObject.
131 virtual void Print(Option_t* option = NULL) const;
133 // Methods inherited from TObject
134 virtual Bool_t IsSortable() const { return kTRUE; }
135 Int_t Compare(const TObject* obj) const;
137 // Implement comparison operators.
138 bool operator == (const AliTrackDecision& d) const
140 return fTrack == d.fTrack and fPt == d.fPt
141 and fPassedLowCut == d.fPassedLowCut
142 and fPassedHighCut == d.fPassedHighCut;
145 bool operator != (const AliTrackDecision& d) const
147 return not this->operator == (d);
152 const TObject* fTrack; ///< Track associated with this decision.
153 Float_t fPt; ///< Calculated pT value used for decision (GeV/c).
154 Bool_t fPassedLowCut; ///< Indicates if the track passed the low pT cut.
155 Bool_t fPassedHighCut; ///< Indicates if the track passed the high pT cut.
157 ClassDef(AliHLTMUONDecision::AliTrackDecision, 4); // A single track dHLT trigger decision object.
161 * The AliPairDecision class stores trigger information about a track pair.
163 class AliPairDecision : public TObject
166 * Stream operator for usage with std::ostream classes.
168 friend std::ostream& operator << (std::ostream& stream, const AliPairDecision& decision);
173 * Constructor for new track pair trigger decision object.
174 * \param mass The invariant mass of the track pair.
175 * \param passedLowCut Indicates if the pair passed the low mass cut.
176 * \param passedHighCut Indicates if the pair passed the high mass cut.
177 * \param unlike Indicates if the tracks have opposite sign.
178 * \param lowPtCount The number of tracks in the pair that passed the low pT cut.
179 * Should be in the range [0..2].
180 * \param highPtCount The number of tracks in the pair that passed the high pT cut.
181 * Should be in the range [0..2].
182 * \param trackA Pointer to the first associated track object.
183 * \param trackB Pointer to the second associated track object.
186 Float_t mass = -1, Bool_t passedLowCut = kFALSE,
187 Bool_t passedHighCut = kFALSE, Bool_t unlike = kFALSE,
188 UChar_t lowPtCount = 0, UChar_t highPtCount = 0,
189 const TObject* trackA = NULL,
190 const TObject* trackB = NULL
192 TObject(), fTrackA(trackA), fTrackB(trackB), fMass(mass),
193 fPassedLowCut(passedLowCut), fPassedHighCut(passedHighCut),
194 fUnlike(unlike), fLowPtCount(lowPtCount), fHighPtCount(highPtCount)
198 * Copy constructor performs shallow copy of object since we
199 * do not take ownership of the track objects.
201 AliPairDecision(const AliPairDecision& obj) :
202 TObject(obj), fTrackA(obj.fTrackA), fTrackB(obj.fTrackB), fMass(obj.fMass),
203 fPassedLowCut(obj.fPassedLowCut), fPassedHighCut(obj.fPassedHighCut),
204 fUnlike(obj.fUnlike), fLowPtCount(obj.fLowPtCount), fHighPtCount(obj.fHighPtCount)
208 * Asignment operators performs shallow copy of object since we
209 * do not take ownership of the track objects.
211 const AliPairDecision& operator = (const AliPairDecision& obj)
213 TObject::operator = (obj);
214 fTrackA = obj.fTrackA; fTrackB = obj.fTrackB; fMass = obj.fMass; fPassedLowCut = obj.fPassedLowCut;
215 fPassedHighCut = obj.fPassedHighCut; fUnlike = obj.fUnlike; fLowPtCount = obj.fLowPtCount; fHighPtCount = obj.fHighPtCount;
220 * Default destructor.
222 virtual ~AliPairDecision() {}
225 * Returns the first track associated with the track pair trigger decision
226 * or NULL if none found.
228 const TObject* TrackA() const { return fTrackA; }
231 * Returns the first track associated with the pair decision as a Manso track object.
232 * NULL is returned if no track is found or the track object is not a Manso track.
234 const AliHLTMUONMansoTrack* MansoTrackA() const;
237 * Returns the first track associated with the pair decision as a full track object.
238 * NULL is returned if no track is found or the track object is not a full track.
240 const AliHLTMUONTrack* FullTrackA() const;
243 * Returns the second track associated with the track pair trigger decision
244 * or NULL if none found.
246 const TObject* TrackB() const { return fTrackB; }
249 * Returns the second track associated with the pair decision as a Manso track object.
250 * NULL is returned if no track is found or the track object is not a Manso track.
252 const AliHLTMUONMansoTrack* MansoTrackB() const;
255 * Returns the second track associated with the pair decision as a full track object.
256 * NULL is returned if no track is found or the track object is not a full track.
258 const AliHLTMUONTrack* FullTrackB() const;
261 * Returns the calculated invariant mass value used for the trigger decision.
263 Float_t Mass() const { return fMass; }
266 * Returns kTRUE if the track pair passed the low invariant mass cut, else kFALSE.
268 Bool_t PassedLowMassCut() const { return fPassedLowCut; }
271 * Returns kTRUE if the track pair passed the high invariant mass cut, else kFALSE.
273 Bool_t PassedHighMassCut() const { return fPassedHighCut; }
276 * Returns kTRUE if the track pair has unlike sign, else kFALSE.
278 Bool_t UnlikeSign() const { return fUnlike; }
281 * Returns kTRUE if the track pair has like sign, else kFALSE.
283 Bool_t LikeSign() const { return not fUnlike; }
286 * Returns the number of tracks in the pair that passed the low pT cut.
287 * Can be one of 0, 1 or 2.
289 UChar_t NumberPassedLowPtCut() const { return fLowPtCount; }
292 * Returns the number of tracks in the pair that passed the high pT cut.
293 * Can be one of 0, 1 or 2.
295 UChar_t NumberPassedHighPtCut() const { return fHighPtCount; }
298 * Returns kTRUE if both tracks passed the low pT cut, else kFALSE.
300 Bool_t BothPassedLowPtCut() const { return NumberPassedLowPtCut() == 2; }
303 * Returns kTRUE if both tracks passed the high pT cut, else kFALSE.
305 Bool_t BothPassedHighPtCut() const { return NumberPassedHighPtCut() == 2; }
307 /// Print method inherited from TObject.
308 virtual void Print(Option_t* option = NULL) const;
310 // Methods inherited from TObject
311 virtual Bool_t IsSortable() const { return kTRUE; }
312 Int_t Compare(const TObject* obj) const;
314 // Implement comparison operators.
315 bool operator == (const AliPairDecision& d) const
317 return fTrackA == d.fTrackA and fTrackB == d.fTrackB and fMass == d.fMass
318 and fPassedLowCut == d.fPassedLowCut and fPassedHighCut == d.fPassedHighCut
319 and fUnlike == d.fUnlike and fLowPtCount == d.fLowPtCount and fHighPtCount == d.fHighPtCount;
322 bool operator != (const AliPairDecision& d) const
324 return not this->operator == (d);
329 const TObject* fTrackA; ///< The first track associated with this pair decision.
330 const TObject* fTrackB; ///< The second track associated with this pair decision.
331 Float_t fMass; ///< The invariant mass used for the trigger decision. (GeV/c^2)
332 Bool_t fPassedLowCut; ///< Indicates if the track passed the low mass cut.
333 Bool_t fPassedHighCut; ///< Indicates if the track passed the high mass cut.
334 Bool_t fUnlike; ///< Indicates if the track pair has unlike sign.
335 UChar_t fLowPtCount; ///< The number of tracks in the pair that passed the low pT cut.
336 UChar_t fHighPtCount; ///< The number of tracks in the pair that passed the high pT cut.
338 ClassDef(AliHLTMUONDecision::AliPairDecision, 4); // A track pair dHLT trigger decision object.
342 * Constructor for creating a dHLT decision object.
343 * \param nLowPt Number of tracks above low pT cut.
344 * \param nHiPt Number of tracks above high pT cut.
345 * \param nUnlikeAnyPt Number of track pairs with unlike sign.
346 * \param nUnlikeLowPt Number of unlike sign track pairs with pT > low cut.
347 * \param nUnlikeHighPt Number of unlike sign track pairs with pT > high cut.
348 * \param nLikeAnyPt Number of track pairs with like sign.
349 * \param nLikeLowPt Number of like sign track pairs with pT > low cut.
350 * \param nLikeHighPt Number of like sign track pairs with pT > high cut.
351 * \param nMassAny Number of unlike sign track pairs with invariant mass > low cut.
352 * \param nMassLow Number of unlike sign track pairs with invariant mass > low mass cut and pT > low pT cut.
353 * \param nMassHigh Number of unlike sign track pairs with invariant mass > high mass cut and pT > high pT cut.
356 UInt_t nLowPt = 0, UInt_t nHiPt = 0,
357 UInt_t nUnlikeAnyPt = 0, UInt_t nUnlikeLowPt = 0, UInt_t nUnlikeHighPt = 0,
358 UInt_t nLikeAnyPt = 0, UInt_t nLikeLowPt = 0, UInt_t nLikeHighPt = 0,
359 UInt_t nMassAny = 0, UInt_t nMassLow = 0, UInt_t nMassHigh = 0
363 * Default destructor.
365 virtual ~AliHLTMUONDecision() {}
368 * Returns the number of single low pT triggers.
370 UInt_t NumberOfLowPtTriggers() const { return fNlowPt; }
373 * Returns the number of single high pT triggers.
375 UInt_t NumberOfHighPtTriggers() const { return fNhighPt; }
378 * Returns the number of unlike sign pt triggers.
380 UInt_t NumberOfUnlikePairs() const { return fNunlikeAnyPt; }
383 * Returns the number of unlike sign pT triggers, where both tracks have pT > low cut.
385 UInt_t NumberOfUnlikeLowPtPairs() const { return fNunlikeLowPt; }
388 * Returns the number of unlike sign pT triggers, where both tracks have pT > high cut.
390 UInt_t NumberOfUnlikeHighPtPairs() const { return fNunlikeHighPt; }
393 * Returns the number of like sign pt triggers.
395 UInt_t NumberOfLikePairs() const { return fNlikeAnyPt; }
398 * Returns the number of like sign pT triggers, where both tracks have pT > low cut.
400 UInt_t NumberOfLikeLowPtPairs() const { return fNlikeLowPt; }
403 * Returns the number of like sign pT triggers, where both tracks have pT > high cut.
405 UInt_t NumberOfLikeHighPtPairs() const { return fNlikeHighPt; }
408 * Returns the number of invariant mass triggers.
410 UInt_t NumberOfMassTriggers() const { return fNmassAny; }
413 * Returns the number of invariant mass triggers,
414 * where invariant mass > low cut and both tracks have pT > low cut.
416 UInt_t NumberOfLowMassTriggers() const { return fNmassLow; }
419 * Returns the number of invariant mass triggers,
420 * where invariant mass > high cut and both tracks have pT > high cut.
422 UInt_t NumberOfHighMassTriggers() const { return fNmassHigh; }
425 * Returns the total number of single tracks that formed part of this trigger decision.
427 Int_t NumberOfTracks() const { return fTrackDecisions.GetEntriesFast(); }
430 * Returns the i'th trigger decision for a single track.
431 * \param i Should be in the range [0 .. NumberOfTracks()-1]
433 const AliTrackDecision* SingleTrackDecision(Int_t i) const
435 return static_cast<const AliTrackDecision*>(fTrackDecisions.At(i));
439 * Returns the total number of track pairs that formed part of this trigger decision.
441 Int_t NumberOfPairs() const { return fPairDecisions.GetEntriesFast(); }
444 * Returns the i'th trigger decision for a track pair.
445 * \param i Should be in the range [0 .. NumberOfPairs()-1]
447 const AliPairDecision* TrackPairDecision(Int_t i) const
449 return static_cast<const AliPairDecision*>(fPairDecisions.At(i));
452 /// Add a single track decision to the dHLT trigger.
453 void AddDecision(const AliTrackDecision* decision);
455 /// Add a single track decision to the dHLT trigger.
457 Float_t pt, Bool_t passedLowCut, Bool_t passedHighCut,
461 /// Add a track pair decision to the dHLT trigger.
462 void AddDecision(const AliPairDecision* decision);
464 /// Add a track pair decision to the dHLT trigger.
466 Float_t mass, Bool_t passedLowCut,
467 Bool_t passedHighCut, Bool_t unlike,
468 UChar_t lowPtCount, UChar_t highPtCount,
469 const TObject* trackA, const TObject* trackB
473 * Prints the details of the dHLT decision to screen.
474 * @param option A case sensitive string that can contain one of the
476 * "compact" - Prints just the trigger scalars.
477 * "detail" - Prints also the track decision list in a compact format.
478 * "all" - Prints all decision information and also the track decision details.
479 * If the string contains an empty option or NULL then the default is
480 * to print compactly.
482 virtual void Print(Option_t* option = NULL) const;
484 // Methods inherited from TObject
485 virtual Bool_t IsSortable() const { return kTRUE; }
486 Int_t Compare(const TObject* obj) const;
488 // Implement comparison operators.
489 bool operator == (const AliHLTMUONDecision& track) const;
491 bool operator != (const AliHLTMUONDecision& track) const
493 return not this->operator == (track);
498 // Do not allow copying of this class.
499 AliHLTMUONDecision(const AliHLTMUONDecision& track);
500 AliHLTMUONDecision& operator = (const AliHLTMUONDecision& track);
502 UInt_t fNlowPt; ///< Number of low pt triggers.
503 UInt_t fNhighPt; ///< Number of high pt triggers.
505 /// Number of unlike sign pt triggers for both tracks having any pt.
506 UInt_t fNunlikeAnyPt;
508 /// Number of unlike sign low pt triggers where both tracks have pt > low cut.
509 UInt_t fNunlikeLowPt;
511 /// Number of unlike sign high pt triggers where both tracks have pt > high cut.
512 UInt_t fNunlikeHighPt;
514 /// Number of like sign pt triggers where both tracks have any pt.
517 /// Number of like sign low pt triggers where both tracks have pt > low cut.
520 /// Number of like sign high pt triggers where both tracks have pt > high cut.
523 /// Number of pairs that have invariant mass > low mass cut, any pt and unlike sign.
526 /// Number of pairs that have invariant mass > low mass cut, pt > low pt cut and unlike sign.
529 /// Number of pairs that have invariant mass > high mass cut, pt > high pt cut and unlike sign.
532 TClonesArray fTrackDecisions; ///< Array of single track decision objects.
533 TClonesArray fPairDecisions; ///< Array of track pair decision objects.
535 ClassDef(AliHLTMUONDecision, 4); // Decision object containing data converted from raw internal dHLT data structures.
538 #endif // ALIHLTMUONDECISION_H