StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StFcsHit.h
1 /***************************************************************************
2  *
3  * $Id: StFcsHit.h,v 2.1 2021/01/11 20:25:37 ullrich Exp $
4  *
5  * Author: Akio Ogawaa, Aug 2018
6  ***************************************************************************
7  *
8  * Description: StFcsHit is data for individual cell
9  *
10  ***************************************************************************
11  *
12  * $Log: StFcsHit.h,v $
13  * Revision 2.1 2021/01/11 20:25:37 ullrich
14  * Initial Revision
15  *
16  **************************************************************************/
17 #ifndef StFcsHit_hh
18 #define StFcsHit_hh
19 
20 #include "Stiostream.h"
21 #include "StObject.h"
22 #include "TArrayS.h"
23 class StFcsCluster;
24 
25 class StFcsHit : public StObject {
26 public:
27  StFcsHit();
28  StFcsHit(unsigned short zs, unsigned short det, unsigned short id,
29  unsigned short ns, unsigned short ehp, unsigned short dep, unsigned short ch,
30  int ntimebin, unsigned short* data);
31  StFcsHit(unsigned short zs, unsigned short det, unsigned short id,
32  unsigned short ns, unsigned short ehp, unsigned short dep, unsigned short ch,
33  float e);
34  ~StFcsHit();
35 
36  unsigned short zs() const;
37  unsigned short detectorId() const;
38  unsigned short id() const;
39  unsigned short ns() const; //from DEP
40  unsigned short ehp() const; //from DEP
41  unsigned short dep() const; //from DEP
42  unsigned short channel() const; //from DEP
43  unsigned int nTimeBin() const;
44  unsigned short timebin(int i) const;
45  unsigned short data(int i) const;
46  unsigned short adc(int i) const;
47  unsigned short flag(int i) const;
48  int adcSum() const;
49  float fitPeak() const;
50  float fitSigma() const;
51  float fitChi2() const;
52  int nPeak() const;
53  float energy() const;
54 
55  void setDepCh(unsigned short ns, unsigned short ehp, unsigned short dep, unsigned short ch);
56  void setNS(unsigned short val);
57  void setEHP(unsigned short val);
58  void setDep(unsigned short val);
59  void setChannel(unsigned short val);
60 
61  void setDetId(unsigned short zs, unsigned short det, unsigned short id);
62  void setZS(unsigned short val);
63  void setDetId(unsigned short val);
64  void setDetectorId(unsigned short val);
65  void setId(unsigned short val);
66 
67  void setData(int n, const unsigned short* d);
68  void setDataAt(int tb, unsigned short val);
69  void setAdcFlag(int tb, unsigned short adc, unsigned short flag);
70  void setAdc(int tb, unsigned short val);
71  void setFlag(int tb, unsigned short val);
72 
73  void setAdcSum(int v);
74  void setFitPeak(float v);
75  void setFitSigma(float v);
76  void setFitChi2(float v);
77  void setNPeak(int v);
78  void setEnergy(float v);
79 
80  void setFcsHit(unsigned short zs, unsigned short det, unsigned short id,
81  unsigned short ns, unsigned short ehp, unsigned short dep, unsigned short ch,
82  int ntimebin, unsigned short* data);
83  void setFcsHit(unsigned short zs, unsigned short det, unsigned short id,
84  unsigned short ns, unsigned short ehp, unsigned short dep, unsigned short ch,
85  float e);
86 
87  void setCluster(StFcsCluster* clu) {mCluster = clu;}
88  StFcsCluster *cluster() {return mCluster;}
89 
90  const vector<pair<unsigned int, float>>& getGeantTracks() const {return mGeantTracks;}
91  void addGeantTrack(unsigned int id, float e);
92 
93  void print(Option_t *option="") const;
94 
95 protected:
96  UShort_t mDetId=0; // 1 bit ZS, 3 bits DetectorId, 12 bits id
97  UShort_t mDepCh=0; // 1 bit for NS, 2 bits for EHP, 5 bits for DEP, 8 bits for channal
98  UInt_t mAdcSum=0; // ADC sum
99  Float_t mFitPeak=0.0; // fit peak position
100  Float_t mFitSigma=0.0; // fit sigma
101  Float_t mFitChi2=0.0; // fit chi2
102  UInt_t mNPeak=0; // number of peaks found
103  Float_t mEnergy=0.0; // corrected energy
104  StFcsCluster* mCluster=0; // pointer to cluster this hit belongs
105  TArrayS* mData=0; // 12bit ADC values + flag at highest 4 bits, array of timebin
106 
107  vector<pair<unsigned int, float>> mGeantTracks; // parent G2T track id and dE
108 
109  ClassDef(StFcsHit,6)
110 };
111 
112 #endif