StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
St2011WMaker.h
1 // $Id: St2011WMaker.h,v 1.17 2016/01/08 02:08:49 jlzhang Exp $
2 
3 #ifndef STAR_St2011WMaker
4 #define STAR_St2011WMaker
5 
18 #ifndef StMaker_H
19 #include "StMaker.h"
20 #endif
21 #include <TChain.h>
22 #include <TRandom3.h>
23 
24 #include "Wevent2011.h"
25 #include "WtpcFilter.h"
26 
27 class TObjArray;
28 class TH1I;
29 class TH2I;
30 class StMuDstMaker;
31 class StEmcGeom;
32 class StEmcDecoder;
33 class StBemcTables;
34 class StEEmcDb;
35 class StSpinDbMaker;
36 class EEmcGeomSimple;
37 class EEmcSmdGeom;
38 class WeventDisplay;
39 class St2011pubWanaMaker;
40 class St2011pubSpinMaker;
41 class St2011pubMcMaker;
42 
43 class TClonesArray;
44 class TTree;
45 
46 //new jet tree format
47 class StJetEvent;
48 
49 class St2011WMaker : public StMaker {
50  friend class WeventDisplay;
51  friend class St2011pubWanaMaker;
52  friend class St2011pubSpinMaker;
53  friend class St2011pubMcMaker;
54  friend class St2011WlumiMaker;
55  friend class St2011ZMaker;
56 
57  private:
58  StMuDstMaker* mMuDstMaker;
59  TString mJetTreeBranch,mJetTreeBranch_noEEMC;
60  Wevent2011 *wEve;
61  TTree *mWtree; TString mTreeName; TFile *mTreeFile;
62  WeventDisplay *wDisaply;
63  WtpcFilter mTpcFilter[mxTpcSec]; //allows sector dependent filter
64  WtpcFilter mTpcFilterE[mxTpcSec]; //allows sector dependent filter for endcap tracks
65  int nInpEve,nTrigEve, nAccEve; // event counters
66  int mRunNo, nRun;
67  int isMC; //0 for real data
68  int Tfirst,Tlast;
69 
70  //... internal params
71  int par_l0emulAdcThresh;
72  float par_l2emulSeedThresh, par_l2emulClusterThresh;
73 
74  int par_l2bwTrgID;
75  int parE_l2ewTrgID;
76  float par_vertexZ;
77  int par_minPileupVert;
78 
79  int par_nFitPts,parE_nFitPts;
80  float par_nHitFrac, par_trackRin, par_trackRout, par_trackPt;
81  float parE_nHitFrac, parE_trackRin, parE_trackRout, parE_trackPt;
82 
83  int par_kSigPed, par_AdcThres;
84  float par_maxADC, par_clustET, parE_clustET;
85  float par_clustFrac24, par_nearTotEtFrac;
86  float parE_clustFrac24,parE_nearTotEtFrac;
87  float par_nearDeltaR, par_awayDeltaPhi;
88  float par_delR3D, parE_delR3D, par_highET, parE_highET, par_ptBalance, parE_ptBalance;
89  float par_awayET, parE_awayET;
90  float par_leptonEtaLow,par_leptonEtaHigh,parE_leptonEtaLow,parE_leptonEtaHigh; //bracket acceptance
91  float parE_trackEtaMin;
92  int parE_nSmdStrip, parE_esmdGL, parE_esmdWL;
93  float parE_smdRatio;
94 
95  float par_QET2PTlow, par_QET2PThigh;
96  float parE_QET2PTlow, parE_QET2PThigh;
97 
98  float par_etowScale;
99  float par_btowScale;
100 
101  TString coreTitle;
102 
103  public: // to overwrite default params from .C macro
104  void setVertexCuts(float zm, int npv) {
105  par_vertexZ=zm; par_minPileupVert=npv; }
106  void setEleTrackCuts(int nfp, int hfr, float rin, float rout, float mpt) {
107  par_nFitPts=nfp; par_nHitFrac=hfr;
108  par_trackRin=rin; par_trackRout=rout; par_trackPt=mpt;}
109  void setWbosonCuts(float a, float fr2, float bal, float etaLow, float etaHigh) {
110  par_highET=a; par_nearTotEtFrac=fr2; par_ptBalance=bal; par_leptonEtaLow=etaLow; par_leptonEtaHigh=etaHigh;}
111  void setE_WbosonCuts(float a, float fr2, float bal, float etaLow, float etaHigh) {
112  parE_highET=a; parE_nearTotEtFrac=fr2; parE_ptBalance=bal; parE_leptonEtaLow=etaLow; parE_leptonEtaHigh=etaHigh;}
113  void setEmcCuts(int ksp , float madc, float clet, float fr1, float dr){
114  par_kSigPed=ksp; par_maxADC=madc; par_clustET=clet;
115  par_clustFrac24=fr1;}
116  void setEtowScale(float x){ par_etowScale=x; }
117  void setBtowScale(float x){ par_btowScale=x; }
118  void setConeRadius(float nearCone, float awayCone) { par_nearDeltaR=nearCone; par_awayDeltaPhi=awayCone; } // Jinlong, easy set cone radius
119  void setL0AdcThresh(int x){ par_l0emulAdcThresh=x; }
120  void setL2ClusterThresh(float x){ par_l2emulClusterThresh=x; }
121  void setL2SeedThresh(float x){ par_l2emulSeedThresh=x; }
122  void setJetTreeBranch(TString jetTreeBranch, TString jetTreeBranch_noEEMC){ mJetTreeBranch = jetTreeBranch; mJetTreeBranch_noEEMC = jetTreeBranch_noEEMC; }
123 
124  void setTreeName(TString x) { mTreeName=x; }
125  private:
126 
127  //.... not used in the algo
128  int par_DsmThres,parE_DsmThres;
129  int par_maxDisplEve;
130 
131  StBemcTables* mBarrelTables; //used to access EMC status and ped info
132  StEmcGeom *mBtowGeom, * mBSmdGeom[mxBSmd];
133  int mapBtowIJ2ID[mxBTetaBin*mxBTphiBin];// vs. (iEta, iPhi)
134  TVector3 positionBtow[mxBtow]; // vs. tower ID
135  TVector3 positionBsmd[mxBSmd][mxBStrips]; // vs. strip ID
136 
137  StEEmcDb *mDbE; // access to EEMC database
138  StSpinDbMaker *spinDb; // access spin information
139  EEmcGeomSimple *geomE;// access to EEMC geometry
140  EEmcSmdGeom *geoSmd;// access to ESMD geometry
141  TVector3 positionEtow[mxEtowSec*mxEtowSub][mxEtowEta];
142 
143  int accessBarrelTrig();
144  int accessEndcapTrig();
145  int accessVertex();
146  int accessTracks();
147  int accessBTOW();
148  void accessBSMD();
149  int accessETOW();
150  void accessEPRS();
151  void accessESMD();
152  void analyzeESMD();
153  void analyzeEPRS();
154 
155  bool passes_L0();
156  bool passes_L2();
157  void find_W_boson();
158  void findEndcap_W_boson();
159  void tag_Z_boson();
160  int extendTrack2Barrel();
161  int matchTrack2BtowCluster();
162  int extendTrack2Endcap();
163  int matchTrack2EtowCluster();
164  void findNearJet();
165  void findAwayJet();
166  void findPtBalance();
167  void esmdAnalysis();
168 
169  // new jet tree format
170  StJetEvent* mJetEvent;
171  StJetEvent* mJetEvent_noEEMC;
172  void getJetEvent();
173 
174  // tools
175  float sumTpcCone( int vertID, TVector3 refAxis, int flag,int pointTowId);
176  float sumBtowCone( float zVert, TVector3 refAxis, int flag);
177  float sumEtowCone(float zVert, TVector3 refAxis,int flag);
178  float sumTpcConeFromTree( int vertID, TVector3 refAxis, int flag,int pointTowId); //uses track vector saved in tree
179  WeveCluster maxBtow2x2(int iEta, int iPhi, float zVert);
180  WeveCluster sumBtowPatch(int iEta, int iPhi, int Leta,int Lphi,float zVert);
181  WeveCluster maxEtow2x1(int iEta, int iPhi, float zVert);
182  WeveCluster maxEtow2x2(int iEta, int iPhi, float zVert);
183  WeveCluster sumEtowPatch(int iEta, int iPhi, int Leta,int Lphi,float zVert);
184  void patchToEtaPhi(int patch, int*eta, int*phi);
185 
186 
187  // histograms
188  TObjArray *HList; TObjArray *HListTpc;
189  enum {mxHA=400}; TH1 * hA[mxHA];
190  enum {mxHE=300}; TH1 * hE[mxHE];
191  TH1 *hbxIdeal;
192 
193  void initHistos(); void initEHistos();
194  void initGeom();
195  int L2algoEtaPhi2IJ(float etaF,float phiF,int &kEta, int &kPhi);
196 
197  public:
198  St2011WMaker(const char *name="2011Walgo");
199  virtual ~St2011WMaker(){};
200  virtual Int_t Init();
201  virtual Int_t Make();
202  virtual Int_t Finish();
203 
204  virtual Int_t InitRun (int runumber);
205  virtual void Clear(const Option_t* = "");
206  virtual Int_t FinishRun(int runumber);
207 
208  void setTrigID( int l2bw, int l2ew) { par_l2bwTrgID=l2bw; parE_l2ewTrgID=l2ew; }
209 
210  void setHList(TObjArray * x){HList=x;}
211  void setHListTpc(TObjArray * x){HListTpc=x;}
212  void setMC(int x){isMC=x;}
213  void setMaxDisplayEve(int n) { par_maxDisplEve=n;}
214  void attachSpinDb(StSpinDbMaker *mk){ spinDb=mk;}
215 
216  //tree analysis
217  void chainFile( const Char_t *name );
218  void chainJetFile( const Char_t *name );
219  Int_t getNumberOfEvents(){ return mTreeChain->GetEntries(); }
220  Int_t getEvent(Int_t event, Int_t eventJet);
221 
222  protected:
223  Int_t index,indexJet;
224  TChain *mTreeChain;
225  TChain *mJetTreeChain;
226 
228  virtual const char *GetCVS() const {
229  static const char cvs[]="Tag $Name: $ $Id: St2011WMaker.h,v 1.17 2016/01/08 02:08:49 jlzhang Exp $ built " __DATE__ " " __TIME__ ;
230  return cvs;
231  }
232 
233  ClassDef(St2011WMaker,0) //StAF chain virtual base class for Makers
234 };
235 
236 #endif
237 
238 
239 // $Log: St2011WMaker.h,v $
240 // Revision 1.17 2016/01/08 02:08:49 jlzhang
241 // added couples histograms and fixed a small bug
242 //
243 // Revision 1.16 2014/08/06 11:43:41 jeromel
244 // Suffix on literals need to be space (later gcc compiler makes it an error) - first wave of fixes
245 //
246 // Revision 1.15 2013/09/13 19:33:13 stevens4
247 // Updates to code for combined 2011+2012 result presented to spin PWG 9.12.13
248 //
249 // Revision 1.14 2012/09/21 16:59:10 balewski
250 // added ESMD peak adjustement - partialy finished
251 //
252 // Revision 1.13 2012/09/18 22:30:18 stevens4
253 // change to new jet tree format with access to all rank>0 vertices
254 //
255 // Revision 1.12 2012/08/28 14:28:27 stevens4
256 // add histos for barrel and endcap algos
257 //
258 // Revision 1.11 2012/08/21 18:29:16 stevens4
259 // Updates to endcap W selection using ESMD strip ratio
260 //
261 // Revision 1.10 2012/08/21 17:40:09 stevens4
262 // Revert to previous version
263 //
264 // Revision 1.8 2012/08/07 21:06:38 stevens4
265 // update to tree analysis to produce independent histos in a TDirectory for each eta-bin
266 //
267 // Revision 1.7 2012/07/13 20:53:16 stevens4
268 // Add filling of empty events in W tree
269 // Minor modifications to histograms
270 //
271 // Revision 1.6 2012/07/13 16:11:44 balewski
272 // minor clenup, prevent crash in Finish if zero input events, now it runs on M-C events as well
273 //
274 // Revision 1.5 2012/07/12 20:49:21 balewski
275 // added spin info(star: bx48, bx7, spin4) and maxHtDSM & BTOW to Wtree
276 // removed dependence of spinSortingMaker from muDst
277 // Now Wtree can be spin-sorted w/o DB
278 // rdMu.C & readWtree.C macros modified
279 // tested so far on real data run 11
280 // lot of misc. code shuffling
281 //
282 // Revision 1.4 2012/06/25 20:53:17 stevens4
283 // algo and histo cleanup
284 //
285 // Revision 1.3 2012/06/18 18:28:00 stevens4
286 // Updates for Run 9+11+12 AL analysis
287 //
288 // Revision 1.2 2011/02/25 06:03:35 stevens4
289 // addes some histos and enabled running on MC
290 //
291 // Revision 1.1 2011/02/10 20:33:22 balewski
292 // start
293 //
gathers all results from W-analysis, Jan&#39;s analysis
virtual Int_t Make()
virtual void Clear(Option_t *option="")
User defined functions.
Definition: StMaker.cxx:634
spin sorting of W&#39;s
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: St2011WMaker.h:228
EEMC simple geometry.
muDst based extraction of W-signal from pp500 data from 2011
Definition: St2011WMaker.h:49
accumulates alternative rel lumi monitors based on jet events
virtual Int_t Finish()
uses tree from W-algo to find Zs
Definition: St2011ZMaker.h:26