StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StPicoBTofHit.cxx
1 //
2 // StPicoBTofHit holds information about BTOF hits
3 //
4 
5 // PicoDst headers
6 #include "StPicoMessMgr.h"
7 #include "StPicoBTofHit.h"
8 
9 ClassImp(StPicoBTofHit)
10 
11 //_________________
12 StPicoBTofHit::StPicoBTofHit() : TObject(), mId(-1) {
13  /* empty */
14 }
15 
16 //_________________
17 StPicoBTofHit::StPicoBTofHit(Int_t id) : TObject() {
18  if (id < 0) return;
19  mId = (id > std::numeric_limits<short>::max()) ? std::numeric_limits<short>::max() : (Short_t)id;
20 }
21 
22 //_________________
24  mId = hit.mId;
25 }
26 
27 //_________________
29  /* empty */
30 }
31 
32 //_________________
33 void StPicoBTofHit::setId(Int_t tray, Int_t module, Int_t cell) {
34  Int_t id = (tray - 1) * 192 + (module - 1) * 6 + (cell - 1);
35  if (id<0) {
36  return;
37  }
38  else {
39  mId = (id > std::numeric_limits<short>::max()) ? std::numeric_limits<short>::max() : (Short_t)id;
40  }
41 }
42 
43 //_________________
44 void StPicoBTofHit::Print(const Char_t* option __attribute__((unused)) ) const {
45  LOG_INFO << " Id = " << id() << endm;
46 }
Int_t id() const
Return ID of the hit.
Definition: StPicoBTofHit.h:37
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.