StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StMtdRawHit.h
1 
4 /***************************************************************************
5  *
6  * $Id: StMtdRawHit.h,v 2.1 2011/04/25 21:24:02 ullrich Exp $
7  *
8  * Author: Frank Geurts, April 25, 2011
9 ***************************************************************************
10  *
11  * Description: MTD raw hits from daq
12  *
13  ***************************************************************************
14  *
15  * $Log: StMtdRawHit.h,v $
16  * Revision 2.1 2011/04/25 21:24:02 ullrich
17  * Initial Revision.
18  *
19  **************************************************************************/
20 #ifndef StMtdRawHit_hh
21 #define StMtdRawHit_hh
22 
23 #include <Stiostream.h>
24 #include "StObject.h"
25 #include <cstdlib>
26 
27 class StMtdRawHit : public StObject {
28 public:
29  StMtdRawHit();
30 
31  StMtdRawHit(char, unsigned char, unsigned char, unsigned int);
32  ~StMtdRawHit();
33 
34  int operator==(const StMtdRawHit&) const;
35  int operator!=(const StMtdRawHit&) const;
36 
37  bool leadingEdge() const;
38  bool trailingEdge() const;
39  int fiberId() const;
40  int flag() const;
41  int backleg() const;
42  int channel() const;
43  unsigned int tdc() const;
44 
45  void setFlag(char);
46  void setBackleg(unsigned char);
47  void setChannel(unsigned char);
48  void setTdc(unsigned int);
49 
50 protected:
51  Char_t mFlag;
52  UChar_t mBackLeg;
53  UChar_t mChannel;
54  UInt_t mTdc;
55 
56  ClassDef(StMtdRawHit,1)
57 };
58 
59 ostream& operator<<(ostream&, const StMtdRawHit&); // Printing operator
60 inline void StMtdRawHit::setFlag(char iflag) { mFlag = iflag;}
61 inline void StMtdRawHit::setBackleg(unsigned char ibackleg) { mBackLeg = ibackleg;}
62 inline void StMtdRawHit::setChannel(unsigned char ichannel){ mChannel = ichannel;}
63 inline void StMtdRawHit::setTdc(unsigned int rawTdc){ mTdc = rawTdc;}
64 inline bool StMtdRawHit::leadingEdge() const { return (mFlag>0);}
65 inline bool StMtdRawHit::trailingEdge() const{ return (mFlag<0);}
66 inline int StMtdRawHit::fiberId() const { return abs(static_cast<int>(mFlag)) - 1;}
67 inline int StMtdRawHit::flag() const {return mFlag;}
68 inline int StMtdRawHit::backleg() const {return mBackLeg;}
69 inline int StMtdRawHit::channel() const{return mChannel;}
70 inline unsigned int StMtdRawHit::tdc() const { return mTdc;}
71 
72 #endif