StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StJet.h
1 // -*- mode:c++ -*-
3 //
4 // $Id: StJet.h,v 1.3 2009/09/05 22:15:16 pibero Exp $
5 // $Log: StJet.h,v $
6 // Revision 1.3 2009/09/05 22:15:16 pibero
7 // Add tracks and towers references to jet
8 //
9 // Revision 1.2 2009/09/05 18:18:05 pibero
10 // Add utility functions for trigger patches
11 //
12 // Revision 1.1 2008/06/01 03:41:45 tai
13 // moved StJet, StJets, and TrackToJetIndex to StSpinPool/StJets
14 //
15 // Revision 1.4 2008/03/27 02:25:03 tai
16 // moved the definitions of the construcors from .h to .cxx
17 // set jetEt and 3 other variables in a constructor
18 //
19 // Revision 1.3 2007/06/05 21:56:11 kocolosk
20 // added data members for zVertex and geometric trigger associations, plus methods for detEta (barrel only)
21 //
22 // Revision 1.2 2005/01/27 18:39:03 mmiller
23 // Added some extra accessors to StJet object to keep track of Et from TPC, BTOW, ETOW, etc.
24 //
25 // Revision 1.1 2004/07/08 15:41:03 mmiller
26 // First release of StJetMaker. Mike's commit of full clean of StJetFinder, StJetMaker, and StSpinMaker. builds and runs in dev.
27 //
28 // Revision 1.7 2003/09/23 19:37:02 thenry
29 // Fixed et and ez (again) correctly this time.
30 //
31 // Revision 1.6 2003/09/22 22:09:28 thenry
32 // Fixed formula for Et and Ez.
33 //
34 // Revision 1.5 2003/09/02 17:59:01 perev
35 // gcc 3.2 updates + WarnOff
36 //
37 // Revision 1.4 2003/07/17 23:47:11 akio
38 // bug fix. Thanks Dylan
39 //
40 // Revision 1.3 2002/12/04 20:28:07 thenry
41 // StppuDstMaker was modified to allow multiple jet analysis modules to be
42 // run simultaneosly with various parameters while the Maker loads the events
43 // and analyses them. Four different jet analyzers exist:
44 //
45 // Konstanin's Analyzers:
46 // Kt type: StppKonstKtJetAnalyzer
47 // Cone type: StppKonstConeJetAnalyzer
48 //
49 // Mike's Analyzers:
50 // Kt type: StppMikeKtJetAnalyzer
51 // Cone type: StppMikeConeJetAnalyzer
52 //
53 // These modules all require the StJetFinder modules.
54 //
55 // Revision 1.2 2002/06/24 13:22:59 akio
56 // numerous bug fix & updates
57 //
58 // Revision 1.1 2002/02/11 20:30:48 akio
59 // Many updates, including very first version of jet finder.
60 //
61 //
62 // Revision 1.0 2002/01/25 Akio Ogawa
63 // First Version of StJet
64 //
66 //
67 // StJet
68 //
69 // Event class for a Jet
70 //
72 #ifndef StJet_h
73 #define StJet_h
74 
75 class TrackToJetIndex;
76 class TowerToJetIndex;
77 
78 #include <cmath>
79 #include <vector>
80 
81 #include "TLorentzVector.h"
82 #include "TRefArray.h"
83 
91 class StJet : public TLorentzVector {
92 
93  public:
94  StJet();
95  StJet(double lE, double lpx, double lpy, double lpz, Int_t size, int c);
96 
98  Int_t nCell;
99 
101  int charge;
102 
104  int nTracks;
105 
107  int nBtowers;
108 
110  int nEtowers;
111 
113  float tpcEtSum;
114 
116  float btowEtSum;
117 
119  float etowEtSum;
120 
122  float jetEt;
123 
125  float jetPt;
126 
128  float jetEta;
129 
131  float jetPhi;
132 
134  float zVertex;
135 
136  Float_t et() const {return E()*sqrt(1.0-tanh(Eta())*tanh(Eta()));}
137  Float_t ez() const {return E()*fabs(tanh(Eta()));}
138 
139  float neutralFraction() const { return (btowEtSum+etowEtSum)/(btowEtSum+etowEtSum+tpcEtSum); }
140  float chargedFraction() const { return 1-neutralFraction(); }
141  float rt() const { return neutralFraction(); }
142  TrackToJetIndex* leadingChargedParticle() const;
143 
144  //default radius is in between BSMD radii
145  Float_t detEta(float vz, float radius = 231.72) const;
146  Float_t detEta() const;
147 
148  //methods to record jet pointing at trigger tower/patch
149  void addGeomTrigger(int trigId);
150  bool geomTrigger(int trigId) const;
151  std::vector<int>& geomTriggers() { return mGeomTriggers; }
152 
153  // Distance in eta-phi plane between this jet and the argument
154  double deltaPhi(const StJet* jet) const { return Vect().DeltaPhi(jet->Vect()); }
155  double deltaR(const StJet* jet) const { return Vect().DeltaR(jet->Vect()); }
156 
157  // Utility functions to get jet patch eta and phi from jet patch id and vice-versa
158  static bool getJetPatchEtaPhi(int id, float& eta, float& phi);
159  static bool getJetPatchId(float eta, float phi, int& id);
160 
161  // Tracks and towers associated with this jet
162  int numberOfTracks() const { return mTracks.GetEntriesFast(); }
163  int numberOfTowers() const { return mTowers.GetEntriesFast(); }
164 
165  TrackToJetIndex* track(int i) const { return (TrackToJetIndex*)mTracks.At(i); }
166  TowerToJetIndex* tower(int i) const { return (TowerToJetIndex*)mTowers.At(i); }
167 
168  TRefArray& tracks() { return mTracks; }
169  TRefArray& towers() { return mTowers; }
170 
171  void addTrack(const TrackToJetIndex* track) { mTracks.Add((TObject*)track); }
172  void addTower(const TowerToJetIndex* tower) { mTowers.Add((TObject*)tower); }
173 
174  private:
175  std::vector<int> mGeomTriggers;
176 
177  TRefArray mTracks;
178  TRefArray mTowers;
179 
180  ClassDef(StJet,8);
181 };
182 
183 #endif
float jetEt
Et (stored for convenience when drawing TTree)
Definition: StJet.h:122
int nTracks
The number of tracks in this jet.
Definition: StJet.h:104
Int_t nCell
The number of 4-vectors contributing to this jet.
Definition: StJet.h:98
float jetPt
Pt (stored for convenience when drawing TTree)
Definition: StJet.h:125
float zVertex
position of vertex used to reconstruct jet
Definition: StJet.h:134
int nBtowers
The number of Barrel towers in this jet.
Definition: StJet.h:107
float jetEta
Eta (stored for convenience when drawing TTree)
Definition: StJet.h:128
float etowEtSum
The summed Et from Endcap towers.
Definition: StJet.h:119
float jetPhi
Phi (stored for convenience when drawing TTree)
Definition: StJet.h:131
int nEtowers
The number of Endcap towers in this jet.
Definition: StJet.h:110
float tpcEtSum
The summed Et from tracks.
Definition: StJet.h:113
float btowEtSum
The summed Et from Barrel towers.
Definition: StJet.h:116
int charge
The summed coulomb charge of the tracks in this jet.
Definition: StJet.h:101
Definition: StJet.h:91