StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StGammaEvent.h
1 // //
3 // StGammaEvent //
4 // //
5 // Original concept and implementation by Jason //
6 // Webb (Valpo) //
7 // //
9 
10 #ifndef STAR_StGammaEvent
11 #define STAR_StGammaEvent
12 
13 #include <set>
14 
15 #include "TObject.h"
16 #include "TVector3.h"
17 
18 #include "StGammaCandidate.h"
19 #include "StGammaCandidateMaker.h"
20 
21 #include "StGammaTrack.h"
22 #include "StGammaTower.h"
23 #include "StGammaStrip.h"
24 
25 #include "TClonesArray.h"
26 #include "TObjString.h"
27 
28 class StMuTrack;
29 class StGammaPythiaEvent;
30 
31 #define TPC_VERTEX 0x0001
32 
33 class StGammaEvent: public TObject
34 {
35 
36  public:
37 
38  enum Spin4State { kBlueUpYellUp=5, kBlueUpYellDn=6, kBlueDnYellUp=9, kBlueDnYellDn=10, kUnknownSpin4=42 };
39  enum PolarizationType { kUnpolarized=0, kLongLong, kTransTrans, kRadRad, kUnknownPol=42 };
40  // see http://www.star.bnl.gov/protected/spin/balewski/2005-spinDB/definitions/
41 
42  StGammaEvent();
43  ~StGammaEvent();
44 
45  virtual const char* GetCVS() const
46  {static const char cvs[] = "Tag $Name: $ $Id: StGammaEvent.h,v 1.16 2014/08/06 11:43:18 jeromel Exp $ built " __DATE__ " " __TIME__; return cvs; }
47 
48  void Clear(Option_t *opts= "");
49 
50  UShort_t mFlags;
51  UShort_t flags() const { return mFlags; }
52 
54  // Accessors //
56 
57  Int_t numberOfTracks() const { return mTracks->GetEntriesFast(); }
58  Int_t numberOfTowers() const { return mTowers->GetEntriesFast(); }
59  Int_t numberOfPreshower1() const { return mPreshower1->GetEntriesFast(); }
60  Int_t numberOfPreshower2() const { return mPreshower2->GetEntriesFast(); }
61  Int_t numberOfPostshower() const { return mPostshower->GetEntriesFast(); }
62  Int_t numberOfStrips() const { return mStrips->GetEntriesFast(); }
63  Int_t numberOfCandidates() const { return mCandidates->GetEntriesFast(); }
64 
65  StGammaTrack *track( Int_t i ) const { return (StGammaTrack*)mTracks->At(i); }
66  StGammaTower *tower( Int_t i ) const { return (StGammaTower*)mTowers->At(i); }
67  StGammaTower *preshower1( Int_t i ) const { return (StGammaTower*)mPreshower1->At(i); }
68  StGammaTower *preshower2( Int_t i ) const { return (StGammaTower*)mPreshower2->At(i); }
69  StGammaTower *postshower( Int_t i ) const { return (StGammaTower*)mPostshower->At(i); }
70  StGammaStrip *strip( Int_t i ) const { return (StGammaStrip*)mStrips->At(i); }
71  StGammaCandidate *candidate( Int_t i ) const { return (StGammaCandidate*)mCandidates->At(i); }
72 
73  Int_t runNumber() const { return mRunNumber; }
74  Int_t eventNumber() const { return mEventNumber; }
75  set<int>& triggerIds() { return mTriggerIds; }
76  bool isTrigger(int id) const { return mTriggerIds.find(id) != mTriggerIds.end(); }
77  bool isSimuTrigger(int id) const { return mSimuTriggerIds.find(id) != mSimuTriggerIds.end(); }
78  TObjString muDstFileName() const { return mMudstFileName; }
79  TVector3& vertex(){ return mVertex; }
80  Float_t vertexRank() { return mVertexRank; }
81  Float_t magneticField() const { return mMagneticField; }
83 
84  Bool_t validSpinDb() { return mSpinDbValid; }
85  UShort_t spin4() { return mSpin4; }
86  UShort_t bunchCrossing7bit() { return mBunchCrossing7bit; }
87  UShort_t bunchCrossing48bit() { return mBunchCrossing48bit; }
88  UShort_t bunchCrossingStar() { return mBunchCrossingStar; }
89  UShort_t polarizationType() { return mPolarizationType; }
90 
91  Float_t sumPt( Float_t eta_min = -2.5, Float_t eta_max = +2.5 ) const;
92  Float_t sumTrackPt(Float_t eta_min = -2.5, Float_t eta_max = +2.5 ) const;
93  Float_t sumTowerPt(Float_t eta_min = -2.5, Float_t eta_max = +2.5 ) const;
94 
96  // Mutators //
98 
99  StGammaTrack *newTrack( StMuTrack *mutr=0 );
106 
107  void SetRunNumber( Int_t run ){ mRunNumber=run; }
108  void SetEventNumber( Int_t event ){ mEventNumber=event; }
109  void SetTriggerIds(const vector<unsigned int>& triggerIds) { copy(triggerIds.begin(), triggerIds.end(), inserter(mTriggerIds, mTriggerIds.begin())); }
110  void SetSimuTriggerIds(const vector<unsigned int>& triggerIds) { copy(triggerIds.begin(), triggerIds.end(), inserter(mSimuTriggerIds, mSimuTriggerIds.begin())); }
111  void SetMudstFileName(const TObjString &i) { mMudstFileName = i; }
112  void SetVertex(const TVector3& vertex ){ mVertex=vertex; }
113  void SetVertexRank(Float_t rank) { mVertexRank = rank; }
114  void SetMagneticField( Float_t magneticField) { mMagneticField = magneticField; }
115  void SetPythia(StGammaPythiaEvent* pythia) { mPythia = pythia; }
116 
117  void SetValidDb( Bool_t v ){ mSpinDbValid=v; }
118  void SetSpin4( UShort_t s ){ mSpin4=s; }
119  void SetBunchCrossing7bit( UShort_t b ){ mBunchCrossing7bit=b; }
120  void SetBunchCrossing48bit( UShort_t b ){ mBunchCrossing48bit=b; }
121  void SetBunchCrossingStar( UShort_t b ){ mBunchCrossingStar=b; }
122  void SetPolarizationType( UShort_t t ){ mPolarizationType=t; }
123  void SetDsmVertex( UShort_t v ){ mDsmVertex=v; }
124 
125  protected:
126 
127  Int_t mRunNumber;
128  Int_t mEventNumber;
129  set<int> mTriggerIds;
130  set<int> mSimuTriggerIds;
131  TObjString mMudstFileName;
132  TVector3 mVertex;
133  Float_t mVertexRank;
134  Float_t mMagneticField;
136 
137  Bool_t mSpinDbValid;
138  UShort_t mSpin4;
139  UShort_t mBunchCrossing7bit;
140  UShort_t mBunchCrossing48bit;
141  UShort_t mBunchCrossingStar;
142  UShort_t mPolarizationType;
143 
144  UShort_t mDsmVertex;
145 
146  private:
147 
148  Int_t InitArrays();
149 
150  TClonesArray *mTracks; //-> array of all tracks
151  TClonesArray *mTowers; //-> array of all towers
152  TClonesArray *mPreshower1; //-> array of all preshower1
153  TClonesArray *mPreshower2; //-> array of all preshower2
154  TClonesArray *mPostshower; //-> array of all postshower
155  TClonesArray *mStrips; //-> array of all strips
156  TClonesArray *mCandidates; //-> array of all candidates
157 
158  friend Int_t StGammaCandidateMaker::Compress();
159 
160  ClassDef(StGammaEvent, 1);
161 
162 };
163 
164 #endif
Float_t sumTrackPt(Float_t eta_min=-2.5, Float_t eta_max=+2.5) const
Returns track+tower pT in eta range.
StGammaPythiaEvent * mPythia
Magnetic field (kG)
Definition: StGammaEvent.h:135
Int_t runNumber() const
Return ith candidate.
Definition: StGammaEvent.h:73
Float_t sumTowerPt(Float_t eta_min=-2.5, Float_t eta_max=+2.5) const
Returns track pT in eta range.
StGammaTower * newPostshower()
Add a new preshower2 element.
StGammaTower * tower(Int_t i) const
Return ith track.
Definition: StGammaEvent.h:66
StGammaTower * preshower1(Int_t i) const
Return ith tower.
Definition: StGammaEvent.h:67
Int_t numberOfPostshower() const
Return number of pre2.
Definition: StGammaEvent.h:61
Int_t numberOfPreshower1() const
Return number of towers.
Definition: StGammaEvent.h:59
Float_t mMagneticField
Primary vertex rank.
Definition: StGammaEvent.h:134
Int_t numberOfCandidates() const
Return number of strips.
Definition: StGammaEvent.h:63
StGammaTower * newPreshower1()
Add a new tower.
StGammaTower * newTower()
Add a new track.
StGammaStrip * strip(Int_t i) const
Return ith post.
Definition: StGammaEvent.h:70
Bool_t validSpinDb()
Pythia event.
Definition: StGammaEvent.h:84
StGammaTower * newPreshower2()
Add a new preshower1 (bprs) element.
TVector3 & vertex()
Returns muDst file from which event originated.
Definition: StGammaEvent.h:79
StGammaTrack * newTrack(StMuTrack *mutr=0)
Returns tower pT in eta range.
StGammaCandidate * newCandidate()
Add a new SMD strip.
StGammaStrip * newStrip()
Add a new postshower element.
set< int > mSimuTriggerIds
Trigger ID&#39;s.
Definition: StGammaEvent.h:130
Float_t magneticField() const
Returns rank of primary vertex.
Definition: StGammaEvent.h:81
Float_t mVertexRank
Event primary vertex (TPC)
Definition: StGammaEvent.h:133
set< int > mTriggerIds
Event number.
Definition: StGammaEvent.h:129
StGammaTrack * track(Int_t i) const
Return number of candidates.
Definition: StGammaEvent.h:65
TObjString mMudstFileName
Simulated Trigger ID&#39;s.
Definition: StGammaEvent.h:131
void SetRunNumber(Int_t run)
Add a new gamma candidate.
Definition: StGammaEvent.h:107
Int_t eventNumber() const
Returns run number.
Definition: StGammaEvent.h:74
UShort_t flags() const
Event flags (see above)
Definition: StGammaEvent.h:51
Int_t numberOfPreshower2() const
Return number of pre1.
Definition: StGammaEvent.h:60
TVector3 mVertex
File from which StGammaEvent originatedt.
Definition: StGammaEvent.h:132
StGammaPythiaEvent * pythia()
Magnetic field (kG)
Definition: StGammaEvent.h:82
StGammaTower * preshower2(Int_t i) const
Return ith pre1.
Definition: StGammaEvent.h:68
Float_t vertexRank()
Returns the primary vertex.
Definition: StGammaEvent.h:80
StGammaTower * postshower(Int_t i) const
Return ith pre2.
Definition: StGammaEvent.h:69
Int_t mEventNumber
Run number.
Definition: StGammaEvent.h:128
Int_t numberOfTowers() const
Return number of tracks.
Definition: StGammaEvent.h:58
StGammaCandidate * candidate(Int_t i) const
Return ith strip.
Definition: StGammaEvent.h:71
set< int > & triggerIds()
Returns event number.
Definition: StGammaEvent.h:75
Int_t numberOfStrips() const
Return number of post.
Definition: StGammaEvent.h:62