StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StFgtStrip.h
1 /***************************************************************************
2  *
3  * $Id: StFgtStrip.h,v 2.1 2012/04/16 20:20:49 ullrich Exp $
4  * Author: S. Gliske, Oct 2011
5  *
6  ***************************************************************************
7  *
8  * Description: data for individual strip of the FGT.
9  *
10  ***************************************************************************
11  *
12  * $Log: StFgtStrip.h,v $
13  * Revision 2.1 2012/04/16 20:20:49 ullrich
14  * Initial Revision
15  *
16  *
17  **************************************************************************/
18 
19 #ifndef _ST_FGT_STRIP_H_
20 #define _ST_FGT_STRIP_H_
21 
22 #include "StObject.h"
23 #include "StEnumerations.h"
24 
25 class StFgtStrip : public StObject {
26 public:
27  // constructors
28  StFgtStrip();
29  StFgtStrip(const StFgtStrip&);
30  StFgtStrip& operator=( const StFgtStrip& );
31 
32  // deconstructor
33  ~StFgtStrip();
34 
35  // accessors
36  int getGeoId() const;
37  short getAdc( int tb = -1 ) const;
38  short getMaxAdc() const;
39  short getClusterSeedType() const;
40  float getCharge() const;
41  float getChargeUncert() const;
42  void getElecCoords( int& rdo, int& arm, int& apv, int& chan );
43  float getPed() const;
44  float getPedErr() const;
45  bool chargeValid() const;
46 
47  // modifiers
48  void setGeoId ( int geoId );
49  void setAdc ( short adc, int tb = -1 );
50  void setMaxAdc(short adc);
51  void setClusterSeedType( short seedType );
52  void setCharge ( float charge );
53  void setChargeUncert( float chargeUncert);
54  void setElecCoords( int rdo, int arm, int apv, int chan );
55  void setPed(float ped);
56  void setPedErr(float pedErr);
57  void invalidateCharge();
58 
59  // query default time bin
60  static void setDefaultTimeBin( int tb );
61  static int getDefaultTimeBin();
62 
63 protected:
64  // data members
65  Int_t mGeoId; // indexing: 6 disk * 4 quad * 2 planes * 720 strips
66  Short_t mAdc[kFgtNumTimeBins]; // note "StRoot/RTS/src/DAQ_FGT/daq_fgt.h" uses UShort_t
67  Short_t mMaxAdc; // max over the time bins
68  Short_t mClusterSeedType; // See types in StFgtConsts.h
69  Float_t mCharge; // before GEM, units (C), relation: ADC = ped + charge*gain(r,phi,disc)
70  Float_t mChargeUncert;
71  Int_t mRdo, mArm, mApv, mChan; // elec coords, straight out of the DAQ file
72  Float_t mPed;
73  Float_t mPedErr;
74 
75  static Int_t mDefaultTimeBin;
76 
77  // to signify an invalid value of the charge
78  enum { kInvalidChargeValue = -10000 };
79 
80 private:
81  ClassDef(StFgtStrip,1);
82 };
83 
84 // Functor for sorting the strips in the strip weight map.
86  bool operator() (const StFgtStrip* strip1, const StFgtStrip* strip2) const;
87 };
88 
89 // inline functions
90 
91 // accessors
92 
93 inline int StFgtStrip::getGeoId() const { return mGeoId; };
94 inline short StFgtStrip::getMaxAdc() const { return mMaxAdc; };
95 inline short StFgtStrip::getClusterSeedType() const { return mClusterSeedType; };
96 inline float StFgtStrip::getCharge() const { return mCharge; };
97 inline float StFgtStrip::getChargeUncert() const { return mChargeUncert; };
98 
99 inline void StFgtStrip::getElecCoords( int& rdo, int& arm, int& apv, int& chan ){ rdo = mRdo; arm = mArm; apv = mApv; chan = mChan; };
100 
101 inline float StFgtStrip::getPed() const { return mPed; };
102 inline float StFgtStrip::getPedErr() const { return mPedErr; };
103 inline bool StFgtStrip::chargeValid() const { return mCharge != 0 && mCharge != kInvalidChargeValue; };
104 
105 inline short StFgtStrip::getAdc( int tb ) const {
106  return mAdc[ (tb < 0 || tb >= kFgtNumTimeBins) ? mDefaultTimeBin : tb ];
107 };
108 
109 // modifiers
110 
111 inline void StFgtStrip::setGeoId( int geoId ) { mGeoId = geoId; };
112 inline void StFgtStrip::setMaxAdc( short adc ) { mMaxAdc=adc; };
113 inline void StFgtStrip::setClusterSeedType( short seedType) { mClusterSeedType=seedType; };
114 inline void StFgtStrip::setCharge ( float charge ) { mCharge = charge; };
115 inline void StFgtStrip::setChargeUncert ( float chargeUncert ){ mChargeUncert = chargeUncert; };
116 
117 inline void StFgtStrip::setElecCoords( int rdo, int arm, int apv, int chan ){ mRdo = rdo; mArm = arm; mApv = apv; mChan = chan; };
118 
119 inline void StFgtStrip::setPed(float ped) { mPed=ped; }
120 inline void StFgtStrip::setPedErr(float pedErr) { mPedErr=pedErr; }
121 inline void StFgtStrip::invalidateCharge() { mCharge = kInvalidChargeValue; };
122 
123 inline void StFgtStrip::setAdc( short adc, int tb ) {
124  mAdc[ (tb < 0 || tb >= kFgtNumTimeBins) ? mDefaultTimeBin : tb ] = adc;
125  if( adc > mMaxAdc )
126  mMaxAdc=adc;
127 };
128 
129 // static default time bin
130 
131 inline int StFgtStrip::getDefaultTimeBin() { return mDefaultTimeBin; };
132 inline void StFgtStrip::setDefaultTimeBin( int tb ) { mDefaultTimeBin = tb; };
133 
134 #endif