StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StPicoBTofHit.h
1 
8 #ifndef StPicoBTofHit_h
9 #define StPicoBTofHit_h
10 
11 // C++ headers
12 #include <limits>
13 
14 // ROOT headers
15 #include "TObject.h"
16 
17 //_________________
18 class StPicoBTofHit : public TObject {
19 
20  public:
22  StPicoBTofHit();
24  StPicoBTofHit(Int_t id);
28  virtual ~StPicoBTofHit();
30  virtual void Print(const Char_t* option = "") const;
31 
32  //
33  // Getters
34  //
35 
37  Int_t id() const { return mId; }
39  Int_t tray() const { return mId / 192 + 1; }
41  Int_t module() const { return (mId % 192) / 6 + 1; }
43  Int_t cell() const { return mId / 6 + 1; }
44 
45  //
46  // Setters
47  //
48 
50  void setId(Int_t id)
51  { if (id<0) { mId = -1; }
52  else { mId = (id > std::numeric_limits<short>::max()) ? std::numeric_limits<short>::max() : (Short_t)id; } }
54  void setId(Int_t tray, Int_t module, Int_t cell);
55 
56  private:
57 
59  Short_t mId;
60 
61  ClassDef(StPicoBTofHit, 2)
62 };
63 
64 #endif
Int_t module() const
Return module number.
Definition: StPicoBTofHit.h:41
Int_t tray() const
Return tray number.
Definition: StPicoBTofHit.h:39
Int_t id() const
Return ID of the hit.
Definition: StPicoBTofHit.h:37
Int_t cell() const
Return cell number.
Definition: StPicoBTofHit.h:43
Stores BTOF hit information.
Definition: StPicoBTofHit.h:18
virtual void Print(const Char_t *option="") const
Print hit information.
void setId(Int_t id)
Set ID of the hit.
Definition: StPicoBTofHit.h:50
virtual ~StPicoBTofHit()
Destructor.
StPicoBTofHit()
Default consturctor.