StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StPicoMtdHit.h
1 
8 #ifndef StPicoMtdHit_h
9 #define StPicoMtdHit_h
10 
11 // C++ headers
12 #include <utility>
13 
14 // ROOT headers
15 #include "TObject.h"
16 
17 //_________________
18 class StPicoMtdHit : public TObject {
19 
20  public:
21 
23  StPicoMtdHit();
27  virtual ~StPicoMtdHit();
29  virtual void Print(const Char_t* option = "") const;
30 
31  //
32  // Getters
33  //
34 
37  Int_t gChannel() const { return (Int_t)mgChannel; }
39  Int_t backleg() const { return (Int_t)mgChannel / 60 + 1; }
41  Int_t module() const { return ((Int_t)mgChannel % 60) / 12 + 1; }
43  Int_t cell() const { return (Int_t)mgChannel % 12; }
47  Int_t triggerFlag() const { return (Int_t) mTriggerFlag; }
49  std::pair<Float_t, Float_t> leadingEdgeTime() const { return mLeadingEdgeTime; }
51  std::pair<Float_t, Float_t> trailingEdgeTime() const { return mTrailingEdgeTime; }
53  std::pair<Float_t, Float_t> tot() const
54  { return std::pair<Float_t, Float_t>(mTrailingEdgeTime.first - mLeadingEdgeTime.first,
55  mTrailingEdgeTime.second - mLeadingEdgeTime.second); }
56  std::pair<Float_t, Float_t> timeOverThreshold() const { return tot(); }
57 
58  //
59  // Setters
60  //
61 
65  void setTriggerFlag(Int_t const flag) { mTriggerFlag = (UChar_t)flag; }
66 
68  void setLeadingEdgeTime(std::pair<Float_t, Float_t> leadingEdgeTime);
69 
71  void setTrailingEdgeTime(std::pair<Float_t, Float_t> trailingEdgeTime);
72 
74  void setHitChannel(Int_t backleg, Int_t module, Int_t cell);
75 
76  protected:
77 
79  Short_t mgChannel;
81  UChar_t mTriggerFlag;
83  std::pair<Float_t, Float_t> mLeadingEdgeTime;
85  std::pair<Float_t, Float_t> mTrailingEdgeTime;
86 
87  ClassDef(StPicoMtdHit, 1)
88 };
89 
90 #endif
std::pair< Float_t, Float_t > leadingEdgeTime() const
Return leading edge time.
Definition: StPicoMtdHit.h:49
std::pair< Float_t, Float_t > mTrailingEdgeTime
Trailing-edge time for the hit.
Definition: StPicoMtdHit.h:85
std::pair< Float_t, Float_t > trailingEdgeTime() const
Return trailing edge time.
Definition: StPicoMtdHit.h:51
Short_t mgChannel
Encoding: mgChannel = (backleg-1) * 60 + (module-1) * 12 + cell.
Definition: StPicoMtdHit.h:79
void setHitChannel(Int_t backleg, Int_t module, Int_t cell)
Encode global channel number as: (backleg-1) * 60 + (module-1) * 12 + cell.
UChar_t mTriggerFlag
Number of hits in the corresponding trigger unit that fired the trigger.
Definition: StPicoMtdHit.h:81
Int_t gChannel() const
Definition: StPicoMtdHit.h:37
std::pair< Float_t, Float_t > mLeadingEdgeTime
Leading-edge time for the hit.
Definition: StPicoMtdHit.h:83
void setLeadingEdgeTime(std::pair< Float_t, Float_t > leadingEdgeTime)
Set leading edge time.
void setTrailingEdgeTime(std::pair< Float_t, Float_t > trailingEdgeTime)
Set trailing edge time.
Int_t backleg() const
Return backleg number (1-30) of the MTD hit.
Definition: StPicoMtdHit.h:39
void setTriggerFlag(Int_t const flag)
Definition: StPicoMtdHit.h:65
Int_t module() const
Return module number (1-5) of the MTD hit.
Definition: StPicoMtdHit.h:41
virtual ~StPicoMtdHit()
Destructor.
std::pair< Float_t, Float_t > tot() const
Return time-over-threshold of the MTD hit.
Definition: StPicoMtdHit.h:53
Holds information about the hit from MTD.
Definition: StPicoMtdHit.h:18
Int_t triggerFlag() const
Definition: StPicoMtdHit.h:47
virtual void Print(const Char_t *option="") const
Print the stored information.
Int_t cell() const
Return cell number (0-11) of the MTD hit.
Definition: StPicoMtdHit.h:43
StPicoMtdHit()
Default constructor.