StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StPicoEmcTrigger.h
1 
8 #ifndef StPicoEmcTrigger_h
9 #define StPicoEmcTrigger_h
10 
11 // C++ headers
12 #include <vector>
13 
14 // ROOT headers
15 #include "TObject.h"
16 
17 //_________________
18 class StPicoEmcTrigger : public TObject {
19 
20  public:
24  StPicoEmcTrigger(Int_t flag, Int_t id, Int_t adc);
26  StPicoEmcTrigger(Int_t flag, Int_t id, Int_t adc, std::vector<unsigned short> smdE,
27  std::vector<unsigned short> smdP);
29  StPicoEmcTrigger(const StPicoEmcTrigger &trigger);
31  virtual ~StPicoEmcTrigger();
33  virtual void Print(const Char_t* option = "") const;
34 
35  //
36  // Getters
37  //
38 
41  UInt_t flag() const { return (UInt_t)mFlag; }
43  Int_t id() const { return (Int_t)mId; }
45  Int_t adc() const { return (Int_t)mAdc; }
47  Int_t numberOfSmdEHits() const { return (Int_t)mSmdE.size(); }
49  Int_t numberOfSmdPHits() const { return (Int_t)mSmdP.size(); }
51  Int_t smdEIndex(Int_t i) const;
53  Int_t smdPIndex(Int_t i) const;
54 
56  bool isHT0() const { return mFlag & 0x1; }
58  bool isHT1() const { return mFlag & 0x2; }
60  bool isHT2() const { return mFlag & 0x4; }
62  bool isHT3() const { return mFlag & 0x8; }
63 
65  bool isJP0() const { return mFlag & 0x10; }
67  bool isJP1() const { return mFlag & 0x20; }
69  bool isJP2() const { return mFlag & 0x40; }
70 
71  //
72  // Setters
73  //
74 
76  void setFlag(Int_t flag);
78  void setId(Int_t id);
80  void setAdc(Int_t adc);
81 
82 
83  protected:
86  UChar_t mFlag;
88  UShort_t mId;
90  UShort_t mAdc;
92  std::vector<unsigned short> mSmdE;
94  std::vector<unsigned short> mSmdP;
95 
96  ClassDef(StPicoEmcTrigger, 2)
97 };
98 
99 #endif
void setAdc(Int_t adc)
Set ADC.
UShort_t mId
SoftId. bjp: 1-18, ht: 1-4800.
void setFlag(Int_t flag)
Set trigger flag.
void setId(Int_t id)
Set ID.
Int_t id() const
Return ID: bjp: 1-18, ht: 1-4800.
Int_t smdPIndex(Int_t i) const
Return i-th BEmc SMDP hit index. -1 = no entries, -2 = out of range.
UShort_t mAdc
ADC.
std::vector< unsigned short > mSmdP
Vector of associated BEmc SMD Phi hit indices.
StPicoEmcTrigger()
Default constructor.
Holds EMC trigger information.
Int_t numberOfSmdPHits() const
Return number of associated BEmc SMD Phi hits.
bool isJP2() const
Check if the trigger is JP2.
UInt_t flag() const
std::vector< unsigned short > mSmdE
Vector of associated BEmc SMD Eta hit indices.
bool isHT1() const
Check if the trigger is HT1.
bool isHT2() const
Check if the trigger is HT2.
bool isHT3() const
Check if the trigger is HT3.
Int_t adc() const
Return ADC.
bool isJP1() const
Check if the trigger is JP1.
bool isJP0() const
Check if the trigger is JP0.
virtual ~StPicoEmcTrigger()
Destructor.
Int_t smdEIndex(Int_t i) const
Return i-th BEmc SMDE hit index. -1 = no entries, -2 = out of range.
Int_t numberOfSmdEHits() const
Return number of associated BEmc SMD Eta hits.
bool isHT0() const
Check if the trigger is HT0.
virtual void Print(const Char_t *option="") const
Print EMC trigger information.