2 #ifndef ALIHLTMUONDECISION_H
3 #define ALIHLTMUONDECISION_H
4 /* This file is property of and copyright by the ALICE HLT Project *
5 * ALICE Experiment at CERN, All rights reserved. *
6 * See cxx source for full Copyright notice */
11 /// @file AliHLTMUONDecision.h
12 /// @author Artur Szostak <artursz@iafrica.com>
14 /// @brief Declaration of a dHLT decision object in ROOT object format.
18 #include "TClonesArray.h"
20 class AliHLTMUONTrack;
21 class AliHLTMUONMansoTrack;
24 * AliHLTMUONDecision stores converted dHLT raw trigger decision data as a ROOT object.
25 * Both AliHLTMUONSinglesDecisionBlockStruct and AliHLTMUONPairsDecisionBlockStruct
26 * data blocks are converted into this class by the AliHLTMUONRootifierComponent.
27 * This class is mainly for testing or as a helper object for dHLT specific analysis,
28 * since it is sometimes easier to store and handle ROOT objects.
30 class AliHLTMUONDecision : public TObject
33 * Stream operator for usage with std::ostream classes.
34 * Allows usage such as:
35 * AliHLTMUONDecision t; std::cout << t;
37 friend std::ostream& operator << (
39 const AliHLTMUONDecision& decision
45 * The AliTrackDecision class stores per track trigger information.
47 class AliTrackDecision : public TObject
50 * Stream operator for usage with std::ostream classes.
52 friend std::ostream& operator << (std::ostream& stream, const AliTrackDecision& decision);
57 * Constructor for new single track trigger decision object.
58 * \param pt The calculated pT value used for the trigger decision.
59 * \param passedLowCut Flag indicating if the track passed the low pT cut.
60 * \param passedHighCut Flag indicating if the track passed the high pT cut.
61 * \param track Pointer to the associated track object.
65 Bool_t passedLowCut = kFALSE,
66 Bool_t passedHighCut = kFALSE,
67 const TObject* track = NULL
69 TObject(), fTrack(track), fPt(pt),
70 fPassedLowCut(passedLowCut), fPassedHighCut(passedHighCut)
74 * Copy constructor performs shallow copy of object since we
75 * do not take ownership of the track object.
77 AliTrackDecision(const AliTrackDecision& obj) :
78 TObject(obj), fTrack(obj.fTrack), fPt(obj.fPt),
79 fPassedLowCut(obj.fPassedLowCut), fPassedHighCut(obj.fPassedHighCut)
83 * Asignment operators performs shallow copy of object since we
84 * do not take ownership of the track object.
86 AliTrackDecision& operator = (const AliTrackDecision& obj)
88 if (this==&obj) return *this;
89 TObject::operator = (obj);
90 fTrack = obj.fTrack; fPt = obj.fPt;
91 fPassedLowCut = obj.fPassedLowCut; fPassedHighCut = obj.fPassedHighCut;
98 virtual ~AliTrackDecision() {}
101 * Returns the track associated with the trigger decision or NULL if none found.
103 const TObject* Track() const { return fTrack; }
106 * Returns the track associated with the trigger decision as a Manso track object.
107 * NULL is returned if no track is found or the track object is not a Manso track.
109 const AliHLTMUONMansoTrack* MansoTrack() const;
112 * Returns the track associated with the trigger decision as a full track object.
113 * NULL is returned if no track is found or the track object is not a full track.
115 const AliHLTMUONTrack* FullTrack() const;
118 * Returns the calculated pT value used for the trigger decision.
120 Float_t Pt() const { return fPt; }
123 * Returns kTRUE if the track passed the low pT cut, else kFALSE.
125 Bool_t PassedLowPtCut() const { return fPassedLowCut; }
128 * Returns kTRUE if the track passed the high pT cut, else kFALSE.
130 Bool_t PassedHighPtCut() const { return fPassedHighCut; }
132 /// Print method inherited from TObject.
133 virtual void Print(Option_t* option = NULL) const;
135 // Methods inherited from TObject
136 virtual Bool_t IsSortable() const { return kTRUE; }
137 Int_t Compare(const TObject* obj) const;
139 // Implement comparison operators.
140 bool operator == (const AliTrackDecision& d) const
142 return fTrack == d.fTrack and fPt == d.fPt
143 and fPassedLowCut == d.fPassedLowCut
144 and fPassedHighCut == d.fPassedHighCut;
147 bool operator != (const AliTrackDecision& d) const
149 return not this->operator == (d);
154 const TObject* fTrack; ///< Track associated with this decision.
155 Float_t fPt; ///< Calculated pT value used for decision (GeV/c).
156 Bool_t fPassedLowCut; ///< Indicates if the track passed the low pT cut.
157 Bool_t fPassedHighCut; ///< Indicates if the track passed the high pT cut.
159 ClassDef(AliHLTMUONDecision::AliTrackDecision, 4); // A single track dHLT trigger decision object.
163 * The AliPairDecision class stores trigger information about a track pair.
165 class AliPairDecision : public TObject
168 * Stream operator for usage with std::ostream classes.
170 friend std::ostream& operator << (std::ostream& stream, const AliPairDecision& decision);
175 * Constructor for new track pair trigger decision object.
176 * \param mass The invariant mass of the track pair.
177 * \param passedLowCut Indicates if the pair passed the low mass cut.
178 * \param passedHighCut Indicates if the pair passed the high mass cut.
179 * \param unlike Indicates if the tracks have opposite sign.
180 * \param lowPtCount The number of tracks in the pair that passed the low pT cut.
181 * Should be in the range [0..2].
182 * \param highPtCount The number of tracks in the pair that passed the high pT cut.
183 * Should be in the range [0..2].
184 * \param trackA Pointer to the first associated track object.
185 * \param trackB Pointer to the second associated track object.
188 Float_t mass = -1, Bool_t passedLowCut = kFALSE,
189 Bool_t passedHighCut = kFALSE, Bool_t unlike = kFALSE,
190 UChar_t lowPtCount = 0, UChar_t highPtCount = 0,
191 const TObject* trackA = NULL,
192 const TObject* trackB = NULL
194 TObject(), fTrackA(trackA), fTrackB(trackB), fMass(mass),
195 fPassedLowCut(passedLowCut), fPassedHighCut(passedHighCut),
196 fUnlike(unlike), fLowPtCount(lowPtCount), fHighPtCount(highPtCount)
200 * Copy constructor performs shallow copy of object since we
201 * do not take ownership of the track objects.
203 AliPairDecision(const AliPairDecision& obj) :
204 TObject(obj), fTrackA(obj.fTrackA), fTrackB(obj.fTrackB), fMass(obj.fMass),
205 fPassedLowCut(obj.fPassedLowCut), fPassedHighCut(obj.fPassedHighCut),
206 fUnlike(obj.fUnlike), fLowPtCount(obj.fLowPtCount), fHighPtCount(obj.fHighPtCount)
210 * Asignment operators performs shallow copy of object since we
211 * do not take ownership of the track objects.
213 AliPairDecision& operator = (const AliPairDecision& obj)
215 if (this==&obj) return *this;
216 TObject::operator = (obj);
217 fTrackA = obj.fTrackA; fTrackB = obj.fTrackB; fMass = obj.fMass; fPassedLowCut = obj.fPassedLowCut;
218 fPassedHighCut = obj.fPassedHighCut; fUnlike = obj.fUnlike; fLowPtCount = obj.fLowPtCount; fHighPtCount = obj.fHighPtCount;
223 * Default destructor.
225 virtual ~AliPairDecision() {}
228 * Returns the first track associated with the track pair trigger decision
229 * or NULL if none found.
231 const TObject* TrackA() const { return fTrackA; }
234 * Returns the first track associated with the pair decision as a Manso track object.
235 * NULL is returned if no track is found or the track object is not a Manso track.
237 const AliHLTMUONMansoTrack* MansoTrackA() const;
240 * Returns the first track associated with the pair decision as a full track object.
241 * NULL is returned if no track is found or the track object is not a full track.
243 const AliHLTMUONTrack* FullTrackA() const;
246 * Returns the second track associated with the track pair trigger decision
247 * or NULL if none found.
249 const TObject* TrackB() const { return fTrackB; }
252 * Returns the second track associated with the pair decision as a Manso track object.
253 * NULL is returned if no track is found or the track object is not a Manso track.
255 const AliHLTMUONMansoTrack* MansoTrackB() const;
258 * Returns the second track associated with the pair decision as a full track object.
259 * NULL is returned if no track is found or the track object is not a full track.
261 const AliHLTMUONTrack* FullTrackB() const;
264 * Returns the calculated invariant mass value used for the trigger decision.
266 Float_t Mass() const { return fMass; }
269 * Returns kTRUE if the track pair passed the low invariant mass cut, else kFALSE.
271 Bool_t PassedLowMassCut() const { return fPassedLowCut; }
274 * Returns kTRUE if the track pair passed the high invariant mass cut, else kFALSE.
276 Bool_t PassedHighMassCut() const { return fPassedHighCut; }
279 * Returns kTRUE if the track pair has unlike sign, else kFALSE.
281 Bool_t UnlikeSign() const { return fUnlike; }
284 * Returns kTRUE if the track pair has like sign, else kFALSE.
286 Bool_t LikeSign() const { return not fUnlike; }
289 * Returns the number of tracks in the pair that passed the low pT cut.
290 * Can be one of 0, 1 or 2.
292 UChar_t NumberPassedLowPtCut() const { return fLowPtCount; }
295 * Returns the number of tracks in the pair that passed the high pT cut.
296 * Can be one of 0, 1 or 2.
298 UChar_t NumberPassedHighPtCut() const { return fHighPtCount; }
301 * Returns kTRUE if both tracks passed the low pT cut, else kFALSE.
303 Bool_t BothPassedLowPtCut() const { return NumberPassedLowPtCut() == 2; }
306 * Returns kTRUE if both tracks passed the high pT cut, else kFALSE.
308 Bool_t BothPassedHighPtCut() const { return NumberPassedHighPtCut() == 2; }
310 /// Print method inherited from TObject.
311 virtual void Print(Option_t* option = NULL) const;
313 // Methods inherited from TObject
314 virtual Bool_t IsSortable() const { return kTRUE; }
315 Int_t Compare(const TObject* obj) const;
317 // Implement comparison operators.
318 bool operator == (const AliPairDecision& d) const
320 return fTrackA == d.fTrackA and fTrackB == d.fTrackB and fMass == d.fMass
321 and fPassedLowCut == d.fPassedLowCut and fPassedHighCut == d.fPassedHighCut
322 and fUnlike == d.fUnlike and fLowPtCount == d.fLowPtCount and fHighPtCount == d.fHighPtCount;
325 bool operator != (const AliPairDecision& d) const
327 return not this->operator == (d);
332 const TObject* fTrackA; ///< The first track associated with this pair decision.
333 const TObject* fTrackB; ///< The second track associated with this pair decision.
334 Float_t fMass; ///< The invariant mass used for the trigger decision. (GeV/c^2)
335 Bool_t fPassedLowCut; ///< Indicates if the track passed the low mass cut.
336 Bool_t fPassedHighCut; ///< Indicates if the track passed the high mass cut.
337 Bool_t fUnlike; ///< Indicates if the track pair has unlike sign.
338 UChar_t fLowPtCount; ///< The number of tracks in the pair that passed the low pT cut.
339 UChar_t fHighPtCount; ///< The number of tracks in the pair that passed the high pT cut.
341 ClassDef(AliHLTMUONDecision::AliPairDecision, 4); // A track pair dHLT trigger decision object.
345 * Constructor for creating a dHLT decision object.
346 * \param nLowPt Number of tracks above low pT cut.
347 * \param nHiPt Number of tracks above high pT cut.
348 * \param nUnlikeAnyPt Number of track pairs with unlike sign.
349 * \param nUnlikeLowPt Number of unlike sign track pairs with pT > low cut.
350 * \param nUnlikeHighPt Number of unlike sign track pairs with pT > high cut.
351 * \param nLikeAnyPt Number of track pairs with like sign.
352 * \param nLikeLowPt Number of like sign track pairs with pT > low cut.
353 * \param nLikeHighPt Number of like sign track pairs with pT > high cut.
354 * \param nMassAny Number of unlike sign track pairs with invariant mass > low cut.
355 * \param nMassLow Number of unlike sign track pairs with invariant mass > low mass cut and pT > low pT cut.
356 * \param nMassHigh Number of unlike sign track pairs with invariant mass > high mass cut and pT > high pT cut.
359 UInt_t nLowPt = 0, UInt_t nHiPt = 0,
360 UInt_t nUnlikeAnyPt = 0, UInt_t nUnlikeLowPt = 0, UInt_t nUnlikeHighPt = 0,
361 UInt_t nLikeAnyPt = 0, UInt_t nLikeLowPt = 0, UInt_t nLikeHighPt = 0,
362 UInt_t nMassAny = 0, UInt_t nMassLow = 0, UInt_t nMassHigh = 0
366 * Default destructor.
368 virtual ~AliHLTMUONDecision() {}
371 * Returns the number of single low pT triggers.
373 UInt_t NumberOfLowPtTriggers() const { return fNlowPt; }
376 * Returns the number of single high pT triggers.
378 UInt_t NumberOfHighPtTriggers() const { return fNhighPt; }
381 * Returns the number of unlike sign pt triggers.
383 UInt_t NumberOfUnlikePairs() const { return fNunlikeAnyPt; }
386 * Returns the number of unlike sign pT triggers, where both tracks have pT > low cut.
388 UInt_t NumberOfUnlikeLowPtPairs() const { return fNunlikeLowPt; }
391 * Returns the number of unlike sign pT triggers, where both tracks have pT > high cut.
393 UInt_t NumberOfUnlikeHighPtPairs() const { return fNunlikeHighPt; }
396 * Returns the number of like sign pt triggers.
398 UInt_t NumberOfLikePairs() const { return fNlikeAnyPt; }
401 * Returns the number of like sign pT triggers, where both tracks have pT > low cut.
403 UInt_t NumberOfLikeLowPtPairs() const { return fNlikeLowPt; }
406 * Returns the number of like sign pT triggers, where both tracks have pT > high cut.
408 UInt_t NumberOfLikeHighPtPairs() const { return fNlikeHighPt; }
411 * Returns the number of invariant mass triggers.
413 UInt_t NumberOfMassTriggers() const { return fNmassAny; }
416 * Returns the number of invariant mass triggers,
417 * where invariant mass > low cut and both tracks have pT > low cut.
419 UInt_t NumberOfLowMassTriggers() const { return fNmassLow; }
422 * Returns the number of invariant mass triggers,
423 * where invariant mass > high cut and both tracks have pT > high cut.
425 UInt_t NumberOfHighMassTriggers() const { return fNmassHigh; }
428 * Returns the total number of single tracks that formed part of this trigger decision.
430 Int_t NumberOfTracks() const { return fTrackDecisions.GetEntriesFast(); }
433 * Returns the i'th trigger decision for a single track.
434 * \param i Should be in the range [0 .. NumberOfTracks()-1]
436 const AliTrackDecision* SingleTrackDecision(Int_t i) const
438 return static_cast<const AliTrackDecision*>(fTrackDecisions.At(i));
442 * Returns the total number of track pairs that formed part of this trigger decision.
444 Int_t NumberOfPairs() const { return fPairDecisions.GetEntriesFast(); }
447 * Returns the i'th trigger decision for a track pair.
448 * \param i Should be in the range [0 .. NumberOfPairs()-1]
450 const AliPairDecision* TrackPairDecision(Int_t i) const
452 return static_cast<const AliPairDecision*>(fPairDecisions.At(i));
455 /// Add a single track decision to the dHLT trigger.
456 void AddDecision(const AliTrackDecision* decision);
458 /// Add a single track decision to the dHLT trigger.
460 Float_t pt, Bool_t passedLowCut, Bool_t passedHighCut,
464 /// Add a track pair decision to the dHLT trigger.
465 void AddDecision(const AliPairDecision* decision);
467 /// Add a track pair decision to the dHLT trigger.
469 Float_t mass, Bool_t passedLowCut,
470 Bool_t passedHighCut, Bool_t unlike,
471 UChar_t lowPtCount, UChar_t highPtCount,
472 const TObject* trackA, const TObject* trackB
476 * Prints the details of the dHLT decision to screen.
477 * @param option A case sensitive string that can contain one of the
479 * "compact" - Prints just the trigger scalars.
480 * "detail" - Prints also the track decision list in a compact format.
481 * "all" - Prints all decision information and also the track decision details.
482 * If the string contains an empty option or NULL then the default is
483 * to print compactly.
485 virtual void Print(Option_t* option = NULL) const;
487 // Methods inherited from TObject
488 virtual Bool_t IsSortable() const { return kTRUE; }
489 Int_t Compare(const TObject* obj) const;
491 // Implement comparison operators.
492 bool operator == (const AliHLTMUONDecision& track) const;
494 bool operator != (const AliHLTMUONDecision& track) const
496 return not this->operator == (track);
501 // Do not allow copying of this class.
502 AliHLTMUONDecision(const AliHLTMUONDecision& track);
503 AliHLTMUONDecision& operator = (const AliHLTMUONDecision& track);
505 UInt_t fNlowPt; ///< Number of low pt triggers.
506 UInt_t fNhighPt; ///< Number of high pt triggers.
508 /// Number of unlike sign pt triggers for both tracks having any pt.
509 UInt_t fNunlikeAnyPt;
511 /// Number of unlike sign low pt triggers where both tracks have pt > low cut.
512 UInt_t fNunlikeLowPt;
514 /// Number of unlike sign high pt triggers where both tracks have pt > high cut.
515 UInt_t fNunlikeHighPt;
517 /// Number of like sign pt triggers where both tracks have any pt.
520 /// Number of like sign low pt triggers where both tracks have pt > low cut.
523 /// Number of like sign high pt triggers where both tracks have pt > high cut.
526 /// Number of pairs that have invariant mass > low mass cut, any pt and unlike sign.
529 /// Number of pairs that have invariant mass > low mass cut, pt > low pt cut and unlike sign.
532 /// Number of pairs that have invariant mass > high mass cut, pt > high pt cut and unlike sign.
535 TClonesArray fTrackDecisions; ///< Array of single track decision objects.
536 TClonesArray fPairDecisions; ///< Array of track pair decision objects.
538 ClassDef(AliHLTMUONDecision, 4); // Decision object containing data converted from raw internal dHLT data structures.
541 #endif // ALIHLTMUONDECISION_H