StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
St2009WMaker.h
1 // $Id: St2009WMaker.h,v 1.17 2014/08/06 11:43:41 jeromel Exp $
2 
3 #ifndef STAR_St2009WMaker
4 #define STAR_St2009WMaker
5 
18 #ifndef StMaker_H
19 #include "StMaker.h"
20 #endif
21 #include <TRandom3.h>
22 
23 #include "Wevent2009.h"
24 #include "WtpcFilter.h"
25 
26 class TObjArray;
27 class TH1I;
28 class TH2I;
29 class StMuDstMaker;
30 class StEmcGeom;
31 class StEmcDecoder;
32 class StBemcTables;
33 class StEEmcDb;
34 class EEmcGeomSimple;
35 class WeventDisplay;
36 class St2009pubWanaMaker;
37 class St2009pubJSMaker;
38 class St2009pubSpinMaker;
39 class St2009pubMcMaker;
40 class St2009WjjMaker;
41 class StMcJetCalibMaker;
42 
43 class StJetReader;
44 class StJets;
45 class StJet;
46 class TClonesArray;
47 class TRandom3;
48 
49 
50 class St2009WMaker : public StMaker {
51  friend class WeventDisplay;
52  friend class St2009pubWanaMaker;
53  friend class St2009pubJSMaker;
54  friend class St2009pubSpinMaker;
55  friend class St2009pubMcMaker;
56  friend class St2009WlumiMaker;
57  friend class St2009ZMaker;
58  friend class St2009WjjMaker;
59  friend class StMcJetCalibMaker;
60 
61  private:
62  StMuDstMaker* mMuDstMaker;
63  StJetReader* mJetReaderMaker;
64  int nJets;
65  TString mJetTreeBranch,mJetTreeBranch_noEEMC;
66  TClonesArray* mJets;
67  Wevent2009 wEve;
68  WeventDisplay *wDisaply;
69  WtpcFilter mTpcFilter[mxTpcSec]; // allows sector dependent track filtering
70  int nInpEve,nTrigEve, nAccEve; // event counters
71  int mRunNo;
72  int isMC; //0 for real data
73 
74  //... internal params
75  int par_l0emulAdcThresh;
76  float par_l2emulSeedThresh, par_l2emulClusterThresh;
77 
78  int par_bht3TrgID, par_l2wTrgID;
79  float par_vertexZ;
80  int par_minPileupVert;
81 
82  int par_nFitPts;
83  float par_nHitFrac, par_trackRin, par_trackRout, par_trackPt;
84 
85  int par_kSigPed, par_AdcThres;
86  float par_maxADC, par_clustET, par_clustFrac24, par_nearTotEtFrac;
87  float par_nearDeltaR, par_awayDeltaPhi, par_smallNearDeltaR;
88  float par_delR3D, par_highET, par_ptBalance;
89  float par_leptonEta; //
90  int par_inpRunNo; // to control run dependent cuts, ugly solution JB
91 
92  float par_countTrPt,par_countTowEt;
93  int par_useEtow;
94  float par_etowScale;
95  float par_btowScale;
96 
97  float par_mcJetNeutScale;
98  float par_mcJetChrgScale;
99 
100  char* gains_file;
101  int use_gains_file;
102  float gains_BTOW[4801];
103 
104  TH1F* hReweight; char* nameReweight;
105 
106  public: // to overwrite default params from .C macro
107  void useEtow(int x){ par_useEtow=x; }
108  void setVertexCuts(float zm, int npv) {
109  par_vertexZ=zm; par_minPileupVert=npv; }
110  void setEleTrackCuts(int nfp, int hfr, float rin, float rout, float mpt) {
111  par_nFitPts=nfp; par_nHitFrac=hfr;
112  par_trackRin=rin; par_trackRout=rout; par_trackPt=mpt;}
113  void setWbosonCuts(float a, float fr2, float bal) {
114  par_highET=a; par_nearTotEtFrac=fr2; par_ptBalance=bal;}
115  void setEmcCuts(int ksp , float madc, float clet, float fr1, float dr){
116  par_kSigPed=ksp; par_maxADC=madc; par_clustET=clet;
117  par_clustFrac24=fr1;}
118  void setEtowScale(float x){ par_etowScale=x; }
119  void setBtowScale(float x){ par_btowScale=x; }
120  void setL0AdcThresh(int x){ par_l0emulAdcThresh=x; }
121  void setL2ClusterThresh(float x){ par_l2emulClusterThresh=x; }
122  void setL2SeedThresh(float x){ par_l2emulSeedThresh=x; }
123  void setJetTreeBranch(TString jetTreeBranch, TString jetTreeBranch_noEEMC){ mJetTreeBranch = jetTreeBranch; mJetTreeBranch_noEEMC = jetTreeBranch_noEEMC; }
124  void setJetNeutScaleMC(float x){ par_mcJetNeutScale=x; }
125  void setJetChrgScaleMC(float x){ par_mcJetChrgScale=x; }
126 
127  void setGainsFile(char* x) {gains_file=x; use_gains_file=1;}
128  void setNameReweight(char* x) {nameReweight=x;}
129 
130  private:
131 
132  //.... not used in the algo
133  int par_DsmThres;
134  int par_maxDisplEve;
135 
136  StBemcTables* mBarrelTables; // used to acBcess EMC status and pedestal info
137  StEmcGeom *mBtowGeom, * mBSmdGeom[mxBSmd];
138  int mapBtowIJ2ID[mxBTetaBin*mxBTphiBin];// vs. (iEta, iPhi)
139  TVector3 positionBtow[mxBtow]; // vs. tower ID
140  TVector3 positionBsmd[mxBSmd][mxBStrips]; // vs. strip ID
141 
142  StEEmcDb *mDbE; // access to EEMC database
143  EEmcGeomSimple *geomE;// access to EEMC geometry
144  TVector3 positionEtow[mxEtowSec*mxEtowSub][mxEtowEta];
145 
146  int accessTrig();
147  int accessVertex();
148  int accessTracks();
149  int accessBTOW();
150  void accessBSMD();
151  int accessETOW();
152 
153  bool passes_L0();
154  bool passes_L2();
155  void find_W_boson();
156  void tag_Z_boson();
157  int extendTrack2Barrel();
158  int matchTrack2Cluster();
159  void findNearJet();
160  void findAwayJet();
161  void findPtBalance();
162  void hadronicRecoil();
163 
164  // jets
165  StJet* getJet(int i){return (StJet*)mJets->At(i);}
166  TClonesArray* getJets(TString branchName);
167 
168  TRandom3 *mRand;
169 
170  // tools
171  float sumTpcCone( int vertID, TVector3 refAxis, int flag, int &nTrCnt);
172  float sumBtowCone( float zVert, TVector3 refAxis, int flag,int &nTow);
173  WeveCluster maxBtow2x2(int iEta, int iPhi, float zVert);
174  WeveCluster sumBtowPatch(int iEta, int iPhi, int Leta,int Lphi,float zVert);
175  float sumEtowCone(float zVert, TVector3 refAxis,int flag,int &nTow);
176  void patchToEtaPhi(int patch, int*eta, int*phi);
177 
178  // histograms
179  TObjArray *HList;
180  enum {mxHA=350}; TH1 * hA[mxHA];
181 
182  void initHistos();
183  void initGeom();
184  int L2algoEtaPhi2IJ(float etaF,float phiF,int &kEta, int &kPhi);
185 
186  public:
187  St2009WMaker(const char *name="2009WalgoB5.2");
188  virtual ~St2009WMaker(){};
189  virtual Int_t Init();
190  virtual Int_t Make();
191 
192  virtual Int_t InitRun (int runumber);
193  virtual void Clear(const Option_t* = "");
194  virtual Int_t FinishRun(int runumber);
195 
196  void setTrigID(int bht3, int l2w, int runNo) { par_bht3TrgID=bht3; par_l2wTrgID=l2w; par_inpRunNo=runNo;}
197  void setHList(TObjArray * x){HList=x;}
198  void setMC(int x){isMC=x;}
199  void setMaxDisplayEve(int n) { par_maxDisplEve=n;}
200 
202  virtual const char *GetCVS() const {
203  static const char cvs[]="Tag $Name: $ $Id: St2009WMaker.h,v 1.17 2014/08/06 11:43:41 jeromel Exp $ built " __DATE__ " " __TIME__ ;
204  return cvs;
205  }
206 
207  ClassDef(St2009WMaker,0) //StAF chain virtual base class for Makers
208 };
209 
210 #endif
211 
212 
213 // $Log: St2009WMaker.h,v $
214 // Revision 1.17 2014/08/06 11:43:41 jeromel
215 // Suffix on literals need to be space (later gcc compiler makes it an error) - first wave of fixes
216 //
217 // Revision 1.16 2011/09/14 14:23:20 stevens4
218 // update used for cross section PRD paper
219 //
220 // Revision 1.15 2010/12/02 18:31:43 rcorliss
221 // updated lumi code to match the starnote version
222 //
223 // Revision 1.14 2010/05/01 01:31:44 balewski
224 // added W->JJ code & JES calibration
225 //
226 // Revision 1.13 2010/04/27 16:53:45 stevens4
227 // add code to remove events tagged as Zs from W candidates
228 //
229 // Revision 1.12 2010/04/16 14:35:32 balewski
230 // fix borken header
231 //
232 // Revision 1.11 2010/03/23 15:33:55 seelej
233 // Edit to files to allow the use of a text file for the gains instead of using the DB.
234 //
235 // Revision 1.10 2010/03/14 22:50:31 balewski
236 // *** empty log message ***
237 //
238 // Revision 1.9 2010/02/18 22:34:50 stevens4
239 // add tpc effic study and allow energy scaling for data and MC
240 //
241 // Revision 1.8 2010/01/27 22:12:24 balewski
242 // spin code matched to x-section code
243 //
244 // Revision 1.7 2010/01/23 02:35:38 stevens4
245 // add ability to scale jet et and use real btow peds for rcf mc
246 //
247 // Revision 1.6 2010/01/21 00:15:25 balewski
248 // added sector & run dependent TPC cuts on Rin, Rout
249 //
250 // Revision 1.5 2010/01/18 03:26:15 balewski
251 // expanded TPC track filtering, not finished
252 //
253 // Revision 1.4 2010/01/09 00:07:16 stevens4
254 // add jet finder
255 //
256 // Revision 1.3 2010/01/06 19:16:47 stevens4
257 // track cuts now on primary component, cleanup
258 //
259 // Revision 1.2 2009/12/07 20:37:56 rcorliss
260 // Start
261 //
262 // Revision 1.1 2009/11/23 23:00:18 balewski
263 // code moved spin-pool
264 //
265 // Revision 1.1 2009/11/23 21:11:18 balewski
266 // start
267 //
maker to retrieve info from geant.root files for comparison with reco quantities from MC ...
virtual const char * GetCVS() const
Displayed on session exit, leave it as-is please ...
Definition: St2009WMaker.h:202
my own maker to do analysis outside of W selection
muDst based extraction of W-signal from pp500 data from 2009
Definition: St2009WMaker.h:50
virtual void Clear(Option_t *option="")
User defined functions.
Definition: StMaker.cxx:634
uses tree from W-algo to find Zs
Definition: St2009ZMaker.h:26
virtual Int_t Make()
Definition: StJets.h:24
gathers all results from W-analysis, Jan&#39;s analysis
spin sorting of W&#39;s
EEMC simple geometry.
spin sorting of W&#39;s
Definition: StJet.h:91
spin sorting of W&#39;s