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(), 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 memcpy(this, &obj, sizeof(AliTrackDecision));
93 virtual ~AliTrackDecision() {}
96 * Returns the track associated with the trigger decision or NULL if none found.
98 const AliHLTMUONMansoTrack* Track() const { return fTrack; }
101 * Returns the calculated pT value used for the trigger decision.
103 Float_t Pt() const { return fPt; }
106 * Returns kTRUE if the track passed the low pT cut, else kFALSE.
108 Bool_t PassedLowPtCut() const { return fPassedLowCut; }
111 * Returns kTRUE if the track passed the high pT cut, else kFALSE.
113 Bool_t PassedHighPtCut() const { return fPassedHighCut; }
115 /// Print method inherited from TObject.
116 virtual void Print(Option_t* option = NULL) const;
118 // Methods inherited from TObject
119 virtual Bool_t IsSortable() const { return kTRUE; }
120 Int_t Compare(const TObject* obj) const;
122 // Implement comparison operators.
123 bool operator == (const AliTrackDecision& d) const
125 return fTrack == d.fTrack and fPt == d.fPt
126 and fPassedLowCut == d.fPassedLowCut
127 and fPassedHighCut == d.fPassedHighCut;
130 bool operator != (const AliTrackDecision& d) const
132 return not this->operator == (d);
137 const AliHLTMUONMansoTrack* fTrack; ///< Track associated with this decision.
138 Float_t fPt; ///< Calculated pT value used for decision (GeV/c).
139 Bool_t fPassedLowCut; ///< Indicates if the track passed the low pT cut.
140 Bool_t fPassedHighCut; ///< Indicates if the track passed the high pT cut.
142 ClassDef(AliHLTMUONDecision::AliTrackDecision, 2); // A single track dHLT trigger decision object.
146 * The AliPairDecision class stores trigger information about a track pair.
148 class AliPairDecision : public TObject
151 * Stream operator for usage with std::ostream classes.
153 friend std::ostream& operator << (std::ostream& stream, const AliPairDecision& decision);
158 * Constructor for new track pair trigger decision object.
159 * \param mass The invariant mass of the track pair.
160 * \param passedLowCut Indicates if the pair passed the low mass cut.
161 * \param passedHighCut Indicates if the pair passed the high mass cut.
162 * \param unlike Indicates if the tracks have opposite sign.
163 * \param lowPtCount The number of tracks in the pair that passed the low pT cut.
164 * Should be in the range [0..2].
165 * \param highPtCount The number of tracks in the pair that passed the high pT cut.
166 * Should be in the range [0..2].
167 * \param trackA Pointer to the first associated track object.
168 * \param trackB Pointer to the second associated track object.
171 Float_t mass = -1, Bool_t passedLowCut = kFALSE,
172 Bool_t passedHighCut = kFALSE, Bool_t unlike = kFALSE,
173 UChar_t lowPtCount = 0, UChar_t highPtCount = 0,
174 const AliHLTMUONMansoTrack* trackA = NULL,
175 const AliHLTMUONMansoTrack* trackB = NULL
177 TObject(), fTrackA(trackA), fTrackB(trackB), fMass(mass),
178 fPassedLowCut(passedLowCut), fPassedHighCut(passedHighCut),
179 fUnlike(unlike), fLowPtCount(lowPtCount), fHighPtCount(highPtCount)
183 * Copy constructor performs shallow copy of object since we
184 * do not take ownership of the track objects.
186 AliPairDecision(const AliPairDecision& obj) :
187 TObject(), fTrackA(obj.fTrackA), fTrackB(obj.fTrackB), fMass(obj.fMass),
188 fPassedLowCut(obj.fPassedLowCut), fPassedHighCut(obj.fPassedHighCut),
189 fUnlike(obj.fUnlike), fLowPtCount(obj.fLowPtCount), fHighPtCount(obj.fHighPtCount)
193 * Asignment operators performs shallow copy of object since we
194 * do not take ownership of the track objects.
196 const AliPairDecision& operator = (const AliPairDecision& obj)
198 memcpy(this, &obj, sizeof(AliPairDecision));
203 * Default destructor.
205 virtual ~AliPairDecision() {}
208 * Returns the first track associated with the track pair trigger decision
209 * or NULL if none found.
211 const AliHLTMUONMansoTrack* TrackA() const { return fTrackA; }
214 * Returns the second track associated with the track pair trigger decision
215 * or NULL if none found.
217 const AliHLTMUONMansoTrack* TrackB() const { return fTrackB; }
220 * Returns the calculated invariant mass value used for the trigger decision.
222 Float_t Mass() const { return fMass; }
225 * Returns kTRUE if the track pair passed the low invariant mass cut, else kFALSE.
227 Bool_t PassedLowMassCut() const { return fPassedLowCut; }
230 * Returns kTRUE if the track pair passed the high invariant mass cut, else kFALSE.
232 Bool_t PassedHighMassCut() const { return fPassedHighCut; }
235 * Returns kTRUE if the track pair has unlike sign, else kFALSE.
237 Bool_t UnlikeSign() const { return fUnlike; }
240 * Returns kTRUE if the track pair has like sign, else kFALSE.
242 Bool_t LikeSign() const { return not fUnlike; }
245 * Returns the number of tracks in the pair that passed the low pT cut.
246 * Can be one of 0, 1 or 2.
248 UChar_t NumberPassedLowPtCut() const { return fLowPtCount; }
251 * Returns the number of tracks in the pair that passed the high pT cut.
252 * Can be one of 0, 1 or 2.
254 UChar_t NumberPassedHighPtCut() const { return fHighPtCount; }
257 * Returns kTRUE if both tracks passed the low pT cut, else kFALSE.
259 Bool_t BothPassedLowPtCut() const { return NumberPassedLowPtCut() == 2; }
262 * Returns kTRUE if both tracks passed the high pT cut, else kFALSE.
264 Bool_t BothPassedHighPtCut() const { return NumberPassedHighPtCut() == 2; }
266 /// Print method inherited from TObject.
267 virtual void Print(Option_t* option = NULL) const;
269 // Methods inherited from TObject
270 virtual Bool_t IsSortable() const { return kTRUE; }
271 Int_t Compare(const TObject* obj) const;
273 // Implement comparison operators.
274 bool operator == (const AliPairDecision& d) const
276 return fTrackA == d.fTrackA and fTrackB == d.fTrackB and fMass == d.fMass
277 and fPassedLowCut == d.fPassedLowCut and fPassedHighCut == d.fPassedHighCut
278 and fUnlike == d.fUnlike and fLowPtCount == d.fLowPtCount and fHighPtCount == d.fHighPtCount;
281 bool operator != (const AliPairDecision& d) const
283 return not this->operator == (d);
288 const AliHLTMUONMansoTrack* fTrackA; ///< The first track associated with this pair decision.
289 const AliHLTMUONMansoTrack* fTrackB; ///< The second track associated with this pair decision.
290 Float_t fMass; ///< The invariant mass used for the trigger decision. (GeV/c^2)
291 Bool_t fPassedLowCut; ///< Indicates if the track passed the low mass cut.
292 Bool_t fPassedHighCut; ///< Indicates if the track passed the high mass cut.
293 Bool_t fUnlike; ///< Indicates if the track pair has unlike sign.
294 UChar_t fLowPtCount; ///< The number of tracks in the pair that passed the low pT cut.
295 UChar_t fHighPtCount; ///< The number of tracks in the pair that passed the high pT cut.
297 ClassDef(AliHLTMUONDecision::AliPairDecision, 2); // A track pair dHLT trigger decision object.
301 * Constructor for creating a dHLT decision object.
302 * \param nLowPt Number of tracks above low pT cut.
303 * \param nHiPt Number of tracks above high pT cut.
304 * \param nUnlikeAnyPt Number of track pairs with unlike sign.
305 * \param nUnlikeLowPt Number of unlike sign track pairs with pT > low cut.
306 * \param nUnlikeHighPt Number of unlike sign track pairs with pT > high cut.
307 * \param nLikeAnyPt Number of track pairs with like sign.
308 * \param nLikeLowPt Number of like sign track pairs with pT > low cut.
309 * \param nLikeHighPt Number of like sign track pairs with pT > high cut.
310 * \param nMassAny Number of unlike sign track pairs with invariant mass > low cut.
311 * \param nMassLow Number of unlike sign track pairs with invariant mass > low mass cut and pT > low pT cut.
312 * \param nMassHigh Number of unlike sign track pairs with invariant mass > high mass cut and pT > high pT cut.
315 UInt_t nLowPt = 0, UInt_t nHiPt = 0,
316 UInt_t nUnlikeAnyPt = 0, UInt_t nUnlikeLowPt = 0, UInt_t nUnlikeHighPt = 0,
317 UInt_t nLikeAnyPt = 0, UInt_t nLikeLowPt = 0, UInt_t nLikeHighPt = 0,
318 UInt_t nMassAny = 0, UInt_t nMassLow = 0, UInt_t nMassHigh = 0
322 * Default destructor.
324 virtual ~AliHLTMUONDecision() {}
327 * Returns the number of single low pT triggers.
329 UInt_t NumberOfLowPtTriggers() const { return fNlowPt; }
332 * Returns the number of single high pT triggers.
334 UInt_t NumberOfHighPtTriggers() const { return fNhighPt; }
337 * Returns the number of unlike sign pt triggers.
339 UInt_t NumberOfUnlikePairs() const { return fNunlikeAnyPt; }
342 * Returns the number of unlike sign pT triggers, where both tracks have pT > low cut.
344 UInt_t NumberOfUnlikeLowPtPairs() const { return fNunlikeLowPt; }
347 * Returns the number of unlike sign pT triggers, where both tracks have pT > high cut.
349 UInt_t NumberOfUnlikeHighPtPairs() const { return fNunlikeHighPt; }
352 * Returns the number of like sign pt triggers.
354 UInt_t NumberOfLikePairs() const { return fNlikeAnyPt; }
357 * Returns the number of like sign pT triggers, where both tracks have pT > low cut.
359 UInt_t NumberOfLikeLowPtPairs() const { return fNlikeLowPt; }
362 * Returns the number of like sign pT triggers, where both tracks have pT > high cut.
364 UInt_t NumberOfLikeHighPtPairs() const { return fNlikeHighPt; }
367 * Returns the number of invariant mass triggers.
369 UInt_t NumberOfMassTriggers() const { return fNmassAny; }
372 * Returns the number of invariant mass triggers,
373 * where invariant mass > low cut and both tracks have pT > low cut.
375 UInt_t NumberOfLowMassTriggers() const { return fNmassLow; }
378 * Returns the number of invariant mass triggers,
379 * where invariant mass > high cut and both tracks have pT > high cut.
381 UInt_t NumberOfHighMassTriggers() const { return fNmassHigh; }
384 * Returns the total number of single tracks that formed part of this trigger decision.
386 Int_t NumberOfTracks() const { return fTrackDecisions.GetEntriesFast(); }
389 * Returns the i'th trigger decision for a single track.
390 * \param i Should be in the range [0 .. NumberOfTracks()-1]
392 const AliTrackDecision* SingleTrackDecision(Int_t i) const
394 return static_cast<const AliTrackDecision*>(fTrackDecisions.At(i));
398 * Returns the total number of track pairs that formed part of this trigger decision.
400 Int_t NumberOfPairs() const { return fPairDecisions.GetEntriesFast(); }
403 * Returns the i'th trigger decision for a track pair.
404 * \param i Should be in the range [0 .. NumberOfPairs()-1]
406 const AliPairDecision* TrackPairDecision(Int_t i) const
408 return static_cast<const AliPairDecision*>(fPairDecisions.At(i));
411 /// Add a single track decision to the dHLT trigger.
412 void AddDecision(const AliTrackDecision* decision);
414 /// Add a single track decision to the dHLT trigger.
416 Float_t pt, Bool_t passedLowCut, Bool_t passedHighCut,
417 const AliHLTMUONMansoTrack* track
420 /// Add a track pair decision to the dHLT trigger.
421 void AddDecision(const AliPairDecision* decision);
423 /// Add a track pair decision to the dHLT trigger.
425 Float_t mass, Bool_t passedLowCut,
426 Bool_t passedHighCut, Bool_t unlike,
427 UChar_t lowPtCount, UChar_t highPtCount,
428 const AliHLTMUONMansoTrack* trackA,
429 const AliHLTMUONMansoTrack* trackB
433 * Prints the details of the dHLT decision to screen.
434 * @param option A case sensitive string that can contain one of the
436 * "compact" - Prints just the trigger scalars.
437 * "detail" - Prints also the track decision list in a compact format.
438 * "all" - Prints all decision information and also the track decision details.
439 * If the string contains an empty option or NULL then the default is
440 * to print compactly.
442 virtual void Print(Option_t* option = NULL) const;
444 // Methods inherited from TObject
445 virtual Bool_t IsSortable() const { return kTRUE; }
446 Int_t Compare(const TObject* obj) const;
448 // Implement comparison operators.
449 bool operator == (const AliHLTMUONDecision& track) const;
451 bool operator != (const AliHLTMUONDecision& track) const
453 return not this->operator == (track);
458 // Do not allow copying of this class.
459 AliHLTMUONDecision(const AliHLTMUONDecision& track);
460 AliHLTMUONDecision& operator = (const AliHLTMUONDecision& track);
462 UInt_t fNlowPt; ///< Number of low pt triggers.
463 UInt_t fNhighPt; ///< Number of high pt triggers.
465 /// Number of unlike sign pt triggers for both tracks having any pt.
466 UInt_t fNunlikeAnyPt;
468 /// Number of unlike sign low pt triggers where both tracks have pt > low cut.
469 UInt_t fNunlikeLowPt;
471 /// Number of unlike sign high pt triggers where both tracks have pt > high cut.
472 UInt_t fNunlikeHighPt;
474 /// Number of like sign pt triggers where both tracks have any pt.
477 /// Number of like sign low pt triggers where both tracks have pt > low cut.
480 /// Number of like sign high pt triggers where both tracks have pt > high cut.
483 /// Number of pairs that have invariant mass > low mass cut, any pt and unlike sign.
486 /// Number of pairs that have invariant mass > low mass cut, pt > low pt cut and unlike sign.
489 /// Number of pairs that have invariant mass > high mass cut, pt > high pt cut and unlike sign.
492 TClonesArray fTrackDecisions; ///< Array of single track decision objects.
493 TClonesArray fPairDecisions; ///< Array of track pair decision objects.
495 ClassDef(AliHLTMUONDecision, 2); // Decision object containing data converted from raw internal dHLT data structures.
498 #endif // ALIHLTMUONDECISION_H