StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StEEmcHit.h
1 
15 #ifndef _ST_EEMC_HIT_H_
16 #define _ST_EEMC_HIT_H_
17 
18 #include <iostream>
19 #include <TArrayS.h>
20 #include <TArrayF.h>
21 
22 #include "StSimpleHit.h"
23 
25 class StEEmcHit_t;
26 
28 typedef std::vector< StEEmcHit_t > StEEmcHitVec_t;
29 typedef std::vector< StEEmcHit_t* > StEEmcHitPtrVec_t;
30 
31 //#define ClassDefVec( CLASS );
32 
33 // force RootCint.pl to make vector dictionary
34 //ClassDefVec( StEEmcHit_t );
35 
37 class StEEmcHit_t : public StSimpleHit_t {
38  public:
39  // constructor
40  StEEmcHit_t( Short_t ID_in = -1 ) : StSimpleHit_t( ID_in ), mSector(-1), mClusIDu(-1), mClusIDv(-1), mTowerIdx(-1), mEnergyU(-1), mEnergyV(-1),
41  mTtest2(1e100), mWeightU(1), mWeightV(1), mIsValid(1) { /* */ };
42  ~StEEmcHit_t(){ /* */ };
43 
44  // enum
45  // enum PidType_t { PHOTON = 0, LEPTON = 1, HADRON = 2 };
46 
47  // accessors
48  Short_t getSector() const { return mSector; };
49  Short_t getClusIDu() const { return mClusIDu; };
50  Short_t getClusIDv() const { return mClusIDv; };
51  Int_t getTowerIdx() const { return mTowerIdx; };
52  Float_t getEnergyU() const { return mEnergyU; };
53  Float_t getEnergyV() const { return mEnergyV; };
54  Float_t getTtest2() const { return mTtest2; }; // this is really the energy asymmetry squared
55  Float_t getWeightU() const { return mWeightU; };
56  Float_t getWeightV() const { return mWeightV; };
57  Bool_t isValid() const { return mIsValid; };
58  Int_t getNumUsedTowers() const { return mUsedTowerIndices.GetSize(); };
59  //PidType_t getPid() const { return mPid; };
60 
61  // not yet programmed, but allow interface
62  Short_t getSectorU() const { return mSector; };
63  Short_t getSectorV() const { return mSector; };
64 
65  // note: TArray::At does bounds checking
66  Short_t getUseTowerIndex( Int_t localIndex ) const { return mUsedTowerIndices.At( localIndex ); };
67  Float_t getUseTowerWeight( Int_t localIndex ) const { return mUsedTowerWeights.At( localIndex ); };
68 
69  // modifiers
70  void setSector( Short_t sec ){ mSector = sec; };
71  void setClusIDu( Short_t idx ){ mClusIDu = idx; };
72  void setClusIDv( Short_t idx ){ mClusIDv = idx; };
73  void setTowerIdx( Int_t idx ){ mTowerIdx = idx; };
74  void setEnergyU( Float_t E ) { mEnergyU = E; };
75  void setEnergyV( Float_t E ) { mEnergyV = E; };
76  void setWeightU( Float_t E ) { mWeightU = E; };
77  void setWeightV( Float_t E ) { mWeightV = E; };
78  void setIsValid( Bool_t isValid ){ mIsValid = isValid; };
79  void setNumUsedTowers( UInt_t n );
80  void addUsedTower( Int_t localIndex, Short_t towIndex, Float_t weight );
81  void setUsedTowers( std::vector< Short_t >& usedIndices, std::vector< Float_t >& weights );
82  //void setPid( PidType_t pid ){ mPid = pid; };
83 
84  // compute t-test
85  void computeTtest2() {
86  mTtest2 = ( mEnergyU - mEnergyV ) / ( mEnergyU + mEnergyV );
87  mTtest2 *= mTtest2;
88  };
89 
90  // to fill a EEmcHit_t from an StEEmcHit_t
91  friend class StEEmcTreeMaker_t;
92 
93  protected:
94  Short_t mSector;
95  Short_t mClusIDu, mClusIDv;
96  Int_t mTowerIdx; // the main tower it is under
97  Float_t mEnergyU, mEnergyV, mTtest2, mWeightU, mWeightV;
98  Bool_t mIsValid;
99  //PidType_t mPid;
100 
101  TArrayS mUsedTowerIndices; // The indices of the towers used to compute the energy
102  TArrayF mUsedTowerWeights; // The weights for the towers used to compute the energy
103 
104  private:
106  ClassDef(StEEmcHit_t,1); // Class to store EEmc Hits
107 
108 };
109 
110 std::ostream &operator<<( std::ostream &out, const StEEmcHit_t &hit );
111 
112 #endif
113 
114 /*
115  * $Id: StEEmcHit.h,v 1.2 2013/02/21 22:00:44 sgliske Exp $
116  * $Log: StEEmcHit.h,v $
117  * Revision 1.2 2013/02/21 22:00:44 sgliske
118  * general update
119  *
120  * Revision 1.1 2012/11/26 19:05:54 sgliske
121  * moved from offline/users/sgliske/StRoot/StEEmcPool/StEEmcHitMaker to StRoot/StEEmcPool/StEEmcHitMaker
122  *
123  *
124  */
The class.
Definition: StSimpleHit.h:34
The class.
Definition: StEEmcHit.h:37
TArrayS mUsedTowerIndices
just a flag whether to keep in vector
Definition: StEEmcHit.h:101