StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StIstRawHit.h
1 // $Id: StIstRawHit.h,v 1.15 2016/01/11 21:16:02 smirnovd Exp $
2 
3 #ifndef StIstRawHit_hh
4 #define StIstRawHit_hh
5 
6 #include "StObject.h"
8 #include "StIstConsts.h"
9 
10 
17 class StIstRawHit : public StObject
18 {
19 public:
20  //constructors
21  StIstRawHit();
22 
23  template<typename Container>
24  StIstRawHit(int channelId, int geoId,
25  const Container &charges, const Container &chargeErrs = Container{},
26  UChar_t maxTimeBin = 3, UShort_t idTruth = 0);
27 
28  //accessors
29  int getChannelId() const;
30  int getGeoId() const;
31  unsigned char getLadder() const;
32  unsigned char getSensor() const;
33  unsigned char getRow() const;
34  unsigned char getColumn() const;
35  float getCharge(int tb = 0) const;
36  float getChargeErr(int tb = 0) const;
37  unsigned char getMaxTimeBin() const;
38  unsigned char getRdo() const;
39  unsigned char getArm() const;
40  unsigned char getApv() const;
41  unsigned char getChannel() const;
42  static unsigned char getDefaultTimeBin();
43  unsigned short getIdTruth() const;
44 
45  //modifiers
46  void setChannelId(int rChannelId);
47  void setGeoId(int rChannelId);
48  void setCharge(float charge, int tb = -1);
49 
52  template<typename Container>
53  void setCharges(const Container& charges) {
54  std::copy( std::begin(charges), std::end(charges), mCharge);
55  }
56 
57  void setChargeErr(float chargeErr, int tb = -1);
58  void setMaxTimeBin(int tb) ;
59  static void setDefaultTimeBin( int tb );
60  void setIdTruth(unsigned short idTruth);
61 
62  using StObject::Print;
63  void Print(int nTimeBins) const;
64 
65 private:
66 
67  Int_t mChannelId;
68  Int_t mGeoId;
69  Float_t mCharge[kIstNumTimeBins];
70  Float_t mChargeErr[kIstNumTimeBins];
72  UChar_t mMaxTimeBin;
73  UShort_t mIdTruth;
74 
75  static UChar_t mDefaultTimeBin;
76 
77  ClassDef(StIstRawHit, 1)
78 };
79 
80 
82 struct rawHitPtrLessThan {
83  bool operator() (const StIstRawHit *rawHit1, const StIstRawHit *rawHit2) const;
84 };
85 
86 #endif
unsigned char getLadder() const
1-24
Definition: StIstRawHit.cxx:46
unsigned char getArm() const
0-5
Definition: StIstRawHit.cxx:73
unsigned char getColumn() const
1-12
Definition: StIstRawHit.cxx:62
unsigned char getRow() const
1-64
Definition: StIstRawHit.cxx:56
int getGeoId() const
1-110592
Definition: StIstRawHit.cxx:41
unsigned char getApv() const
0-23
Definition: StIstRawHit.cxx:78
int getChannelId() const
0-110591
Definition: StIstRawHit.cxx:40
unsigned short getIdTruth() const
for embedding, 0 as background
Definition: StIstRawHit.cxx:44
void setCharges(const Container &charges)
Definition: StIstRawHit.h:53
unsigned char getRdo() const
1-6
Definition: StIstRawHit.cxx:68
unsigned char getChannel() const
0-127
Definition: StIstRawHit.cxx:83
unsigned char getSensor() const
1-6
Definition: StIstRawHit.cxx:51