StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StGammaCandidate.h
1 // //
3 // StGammaCandidate //
4 // //
5 // Jason Webb (Valpo) //
6 // //
7 // Cosmetic update by Michael Betancourt //
8 // //
9 // Detector objects may be added to the candidate //
10 // as follows, //
11 // //
12 // StGammaTower tower = candidate.AddTower(); //
13 // tower.id = <tower id>; //
14 // tower.ET = <tower ET>; //
15 // tower.eta = <tower eta>; //
16 // tower.phi = <tower phi>; //
17 // tower.status = <tower status>; //
18 // tower.fail = <tower fail>; //
19 // //
21 
22 #ifndef STAR_StGammaCandidate
23 #define STAR_StGammaCandidate
24 
25 #include "TObject.h"
26 #include "TVector3.h"
27 #include "TRefArray.h"
28 
29 #include <vector>
30 
31 #include "StGammaTower.h"
32 #include "StGammaStrip.h"
33 #include "StGammaTrack.h"
34 #include "StGammaFitterResult.h"
35 
36 class StEEmcCluster;
37 class StEEmcSmdCluster;
38 class StEmcCluster;
39 
40 class StGammaCandidate: public TObject
41 {
42 
43  public:
44 
45  enum CalorimeterId { kEEmc = 0, kBEmc, kUnknown = 255};
46  enum thresholdCut { kMagnitude, kTransverse };
47 
50 
51  virtual const char* GetCVS() const
52  {static const char cvs[] = "Tag $Name: $ $Id: StGammaCandidate.h,v 1.16 2014/08/06 11:43:17 jeromel Exp $ built " __DATE__ " " __TIME__; return cvs; }
53 
55  // Accessors //
57 
58  Float_t sumPt( Float_t radius, Float_t threshold = 0.0, thresholdCut cut = kTransverse );
59  Float_t sumTrackPt( Float_t radius, Float_t threshold = 0.0, thresholdCut cut = kTransverse );
60  Float_t sumTowerPt( Float_t radius, Float_t threshold = 0.0, thresholdCut cut = kTransverse );
61  Float_t sumPreshower1( Float_t radius, Float_t threshold = 0.0 );
62  Float_t sumPreshower2( Float_t radius, Float_t threshold = 0.0 );
63  Float_t sumPostshower( Float_t radius, Float_t threshold = 0.0 );
64 
65  Int_t numberOfTracks( Float_t radius, Float_t threshold = 0.0, thresholdCut cut = kTransverse );
66  Int_t numberOfTowers( Float_t radius, Float_t threshold = 0.0, thresholdCut cut = kTransverse );
67  Int_t numberOfPreshower1( Float_t radius, Float_t threshold = 0.0 );
68  Int_t numberOfPreshower2( Float_t radius, Float_t threshold = 0.0 );
69  Int_t numberOfPostshower( Float_t radius, Float_t threshold = 0.0 );
70 
71  Int_t detectorId() { return mDetector; }
72  Int_t id() { return mGammaId; }
73 
74  Float_t energy() const { return mEnergy; }
75  Float_t seedEnergy() const { return mSeedEnergy; }
76  Float_t pre1Energy(Float_t threshold = 0.0);
77  Float_t pre2Energy(Float_t threshold = 0.0);
78  Float_t postEnergy(Float_t threshold = 0.0);
79  Float_t smduEnergy(Float_t threshold = 0.0);
80  Float_t smdvEnergy(Float_t threshold = 0.0);
81  Float_t smdEtaEnergy(Float_t threshold = 0.0) { return smduEnergy(threshold); }
82  Float_t smdPhiEnergy(Float_t threshold = 0.0) { return smdvEnergy(threshold); }
83 
84  TVector3 position() const { return mPosition; }
85  TVector3 momentum() const { return mMomentum; }
86 
87  TVector3 momentum1x1();
88  TVector3 momentum1x1c();
89  TVector3 momentum2x1();
90 
91  Int_t numberOfTracks(){ return mTracks.GetLast()+1; }
92  Int_t numberOfTowers(){ return mTowers.GetLast()+1; }
93  Int_t numberOfPreshower1(){ return mPreshower1.GetLast()+1; }
94  Int_t numberOfPreshower2(){ return mPreshower2.GetLast()+1; }
95  Int_t numberOfPostshower(){ return mPostshower.GetLast()+1; }
96  Int_t numberOfSmdu(){ return mSmdu.GetLast()+1; }
97  Int_t numberOfSmdv(){ return mSmdv.GetLast()+1; }
98  Int_t numberOfSmdEta(){ return mSmdu.GetLast()+1; }
99  Int_t numberOfSmdPhi(){ return mSmdv.GetLast()+1; }
100 
101  StGammaTrack *track( Int_t i ){ return (StGammaTrack*)mTracks.At(i); }
102  StGammaTower *tower( Int_t i ){ return (StGammaTower*)mTowers.At(i); }
103  StGammaTower *preshower1( Int_t i ){ return (StGammaTower*)mPreshower1.At(i); }
104  StGammaTower *preshower2( Int_t i ){ return (StGammaTower*)mPreshower2.At(i); }
105  StGammaTower *postshower( Int_t i ){ return (StGammaTower*)mPostshower.At(i); }
106  StGammaStrip *smdu( Int_t i ){ return (StGammaStrip *)mSmdu.At(i); }
107  StGammaStrip *smdv( Int_t i ){ return (StGammaStrip *)mSmdv.At(i); }
108  StGammaStrip *smdEta( Int_t i ){ return (StGammaStrip *)mSmdu.At(i); }
109  StGammaStrip *smdPhi( Int_t i ){ return (StGammaStrip *)mSmdv.At(i); }
110 
111  StGammaTrack *mytrack( Int_t i ){ return (StGammaTrack*)mMyTracks.At(i); }
112  StGammaTower *mytower( Int_t i ){ return (StGammaTower*)mMyTowers.At(i); }
113  StGammaTower *mypreshower1( Int_t i ){ return (StGammaTower*)mMyPreshower1.At(i); }
114  StGammaTower *mypreshower2( Int_t i ){ return (StGammaTower*)mMyPreshower2.At(i); }
115  StGammaTower *mypostshower( Int_t i ){ return (StGammaTower*)mMyPostshower.At(i); }
116 
117  Int_t numberOfMyTracks(){ return mMyTracks.GetLast()+1; }
118  Int_t numberOfMyTowers(){ return mMyTowers.GetLast()+1; }
119  Int_t numberOfMyPreshower1(){ return mMyPreshower1.GetLast()+1; }
120  Int_t numberOfMyPreshower2(){ return mMyPreshower2.GetLast()+1; }
121  Int_t numberOfMyPostshower(){ return mMyPostshower.GetLast()+1; }
122 
123  StGammaFitterResult& smdFit(Int_t plane=0) { return mSmdFit[plane]; }
124 
126  // Mutators //
128 
129  void recluster(TVector3 vertex, Float_t threshold, thresholdCut cut = kTransverse);
130 
131  void SetId(Int_t id) { if( id == kEEmc || id == kBEmc ) mGammaId = id; else mGammaId = kUnknown; }
132  void SetTowerId( Int_t id ) { mTowerId = id; }
133  void SetTowerClusterId( Int_t id ) { mTowerClusterId = id; }
134  void SetSmduClusterId( Int_t id ) { mSmduClusterId = id; }
135  void SetSmdvClusterId( Int_t id ) { mSmdvClusterId = id; }
136 
137  void SetSmdEtaClusterId( Int_t id ) { mSmduClusterId = id; }
138  void SetSmdPhiClusterId( Int_t id ) { mSmdvClusterId = id; }
139 
140  void SetDetectorId( Int_t id ) { mDetector = id; }
141 
142  void SetMomentum( TVector3 p ){ mMomentum=p; }
143  void SetPosition( TVector3 p ){ mPosition=p; }
144  void SetEnergy( Float_t e ){ mEnergy=e; }
145  void SetSeedEnergy( Float_t e ){ mSeedEnergy=e; }
146  void SetPre1Energy( Float_t e ){ mPre1Energy=e; }
147  void SetBPrsEnergy( Float_t e ){ mPre1Energy=e; }
148  void SetPre2Energy( Float_t e ){ mPre2Energy=e; }
149  void SetPostEnergy( Float_t e ){ mPostEnergy=e; }
150  void SetSmduEnergy( Float_t e ){ mSmduEnergy=e; }
151  void SetSmdvEnergy( Float_t e ){ mSmdvEnergy=e; }
152  void SetSmdEtaEnergy( Float_t e ){ mSmduEnergy=e; }
153  void SetSmdPhiEnergy( Float_t e ){ mSmdvEnergy=e; }
154 
155  // Add event objects
156  void addTrack ( StGammaTrack *track ){ mTracks.Add( track ); }
157  void addTower ( StGammaTower *tower ){ mTowers.Add( tower ); }
158  void addPreshower1( StGammaTower *pre1 ){ mPreshower1.Add( pre1 ); }
159  void addPreshower2( StGammaTower *pre2 ){ mPreshower2.Add( pre2 ); }
160  void addPostshower( StGammaTower *post ){ mPostshower.Add( post ); }
161  void addSmdu( StGammaStrip *strip ){ mSmdu.Add(strip); }
162  void addSmdv( StGammaStrip *strip ){ mSmdv.Add(strip); }
163  void addSmdEta( StGammaStrip *strip ){ mSmdu.Add(strip); }
164  void addSmdPhi( StGammaStrip *strip ){ mSmdv.Add(strip); }
165 
166  // Add cluster objects
167  void addMyTrack ( StGammaTrack *track ){ mMyTracks.Add( track ); }
168  void addMyTower ( StGammaTower *tower ){ mMyTowers.Add( tower ); }
169  void addMyPreshower1( StGammaTower *pre1 ){ mMyPreshower1.Add( pre1 ); }
170  void addMyPreshower2( StGammaTower *pre2 ){ mMyPreshower2.Add( pre2 ); }
171  void addMyPostshower( StGammaTower *post ){ mMyPostshower.Add( post ); }
172 
173  void SetSmdFit(const StGammaFitterResult& fit, Int_t plane=0) { mSmdFit[plane] = fit; }
174 
175  protected:
176 
177  Int_t mGammaId;
178  Int_t mTowerId;
182 
183  UChar_t mDetector;
184 
185  TVector3 mMomentum;
186  TVector3 mPosition;
187 
188  Float_t mEnergy;
189 
190  Float_t mSeedEnergy;
191  Float_t mPre1Energy;
192  Float_t mPre2Energy;
193  Float_t mPostEnergy;
194  Float_t mSmduEnergy;
195  Float_t mSmdvEnergy;
196 
198 
199 
200  private:
201 
202  TRefArray mTracks; // all tracks w/in radius
203  TRefArray mTowers; // all towers w/in radius
204  TRefArray mPreshower1; // ditto
205  TRefArray mPreshower2; // ditto
206  TRefArray mPostshower; // ditto
207  TRefArray mSmdu; // all smdu (eta) strips w/in some window
208  TRefArray mSmdv; // all smdv (phi) strips w/in some window
209 
210  TRefArray mMyTracks; // tracks which project to the gamma candidate
211  TRefArray mMyTowers; // towers which belong to the gamma candidate
212  TRefArray mMyPreshower1;
213  TRefArray mMyPreshower2;
214  TRefArray mMyPostshower;
215 
216 
217  ClassDef(StGammaCandidate, 1);
218 
219 };
220 
221 typedef std::vector<StGammaCandidate> StGammaCandidateVec_t;
222 
223 #endif
Float_t mPostEnergy
Energy deposited in epre2 (possibly tof?)
Float_t mSeedEnergy
Energy of the gamma candidate.
StGammaFitterResult mSmdFit[2]
Energy deposited in emsdv (or bsmd phi)
Int_t mTowerClusterId
Seed tower ID (Eemc=index, Bemc=softid)
Float_t mPre1Energy
Energy of the seed tower.
Int_t mSmduClusterId
Unique ID of tower cluster.
TVector3 mPosition
Momentum of the gamma candidate.
Float_t mSmduEnergy
Energy deposited in epost.
Float_t mSmdvEnergy
Energy deposited in esmdu (or bsmd eta)
Float_t mEnergy
Position of the gamma at z (r) = SMD.
UChar_t mDetector
Unique ID of ESMD V (BSMD Phi) cluster.
Int_t mSmdvClusterId
Unique ID of ESMD U (BSMD Eta) cluster.
A base class for representing clusters of EEMC smd strips.
Int_t mTowerId
Unique ID assigned to gamma candidate in event.
TVector3 mMomentum
0=EEMC 1=BEMC
A base class for describing clusters of EEMC towers.
Definition: StEEmcCluster.h:50
Float_t mPre2Energy
Energy deposited in epre1 (or bprs)