StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StPicoMtdHit.cxx
1 //
2 // StPicoMtdHit holds information about MTD hit
3 //
4 
5 // C++ headers
6 #include <limits>
7 
8 // PicoDst headers
9 #include "StPicoMessMgr.h"
10 #include "StPicoMtdHit.h"
11 
12 ClassImp(StPicoMtdHit)
13 
14 //_________________
15 StPicoMtdHit::StPicoMtdHit(): TObject(), mgChannel(-1), mTriggerFlag(0),
16  mLeadingEdgeTime{ -999., -999.}, mTrailingEdgeTime{ -999., -999} {
17  /* empty */
18 }
19 
20 //_________________
22  mgChannel = hit.mgChannel;
26 }
27 
28 //_________________
30  /* emtpy */
31 }
32 
33 //_________________
34 void StPicoMtdHit::Print(const Char_t* option __attribute__((unused)) ) const {
35  LOG_INFO << " Backleg = " << backleg()
36  << " Module = " << module()
37  << " Cell = " << cell() << endm;
38 }
39 
40 //_________________
41 void StPicoMtdHit::setHitChannel(Int_t backleg, Int_t module, Int_t cell) {
42 
43  Int_t gchan = (backleg - 1) * 60 + (module - 1) * 12 + cell;
44 
45  // Check the range of the hit value
46  if( gchan < std::numeric_limits<short>::max() ) {
47  mgChannel = (Short_t)gchan;
48  }
49  else {
50  mgChannel = -1;
51  LOG_INFO << "Weird cell: backleg = " << backleg
52  << ", module = " << module
53  << ", cell = " << cell
54  << endm;
55  }
56 }
57 
58 //_________________
59 void StPicoMtdHit::setLeadingEdgeTime(std::pair<Float_t, Float_t> leadingEdgeTime) {
61 }
62 
63 //_________________
64 void StPicoMtdHit::setTrailingEdgeTime(std::pair<Float_t, Float_t> trailingEdgeTime) {
66 }
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
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
Int_t module() const
Return module number (1-5) of the MTD hit.
Definition: StPicoMtdHit.h:41
virtual ~StPicoMtdHit()
Destructor.
Holds information about the hit from MTD.
Definition: StPicoMtdHit.h:18
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.