StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StEStructTrackCuts.h
1 /**********************************************************************
2  *
3  * $Id: StEStructTrackCuts.h,v 1.7 2012/11/16 21:19:08 prindle Exp $
4  *
5  * Author: Jeff Porter
6  *
7  **********************************************************************
8  *
9  * Description: Cut class for track level quantities
10  *
11  *
12  ***********************************************************************/
13 #ifndef __STESTRUCTTRACKCUTS__H
14 #define __STESTRUCTTRACKCUTS__H
15 
16 
17 #include "StEStructCuts.h"
18 #include "Stiostream.h"
19 
20 
22 
23 public:
24 
25  CutName mflagName;
26  CutName mchargeName;
27  CutName mnfitpointsName;
28  CutName mnfitnmaxName;
29  CutName mglobalDCAName;
30  CutName mchi2Name;
31  CutName mdPtByPtName;
32  CutName mptName;
33  CutName mxtName;
34  CutName mytName;
35  CutName mphiName;
36  CutName metaName;
37  CutName mTOFEMassName;
38  CutName mnsigmaEName;
39  CutName mnsigmaPiName;
40  CutName mnsigmaKName;
41  CutName mnsigmaPName;
42  CutName mhijingFragmentName;
43 
44  int mflag[2];
45  int mcharge[2];
46  int mnfitpoints[2];
47  float mnfitnmax[2];
48  float mglobalDCA[2];
49  float mchi2[2];
50  float mdPtByPt[2];
51  float mpt[2];
52  float myt[2];
53  float mxt[2];
54  float mphi[2];
55  float meta[2];
56  float mTOFEMass[2];
57  float mnsigmaE[2];
58  float mnsigmaPi[2];
59  float mnsigmaK[2];
60  float mnsigmaP[2];
61  float mhijingFragment[2];
62  char mFragmentType[1024];
63  int mFragTypes[10];
64  int mNFragTypes;
65  int mnJets;
66 
67  void init();
68  void initCuts();
69  void initNames();
70 
72  StEStructTrackCuts(const char* cutFileName);
73  virtual ~StEStructTrackCuts();
74 
75  virtual bool loadBaseCuts(const char* name, const char** vals, int nvals);
76  virtual void loadUserCuts(const char* name, const char** vals, int nvals);
77  virtual void printCutStats(ostream& ofs);
78 
79  bool goodFlag(int f);
80  bool goodCharge(int c);
81  bool goodNFitPoints(int n);
82  bool goodNFitNMax(float r);
83  bool goodGlobalDCA(float g);
84  bool goodChi2(float x);
85  bool gooddPtByPt(float x);
86  bool goodPt(float p);
87  bool goodXt(float p);
88  bool goodYt(float p);
89  bool goodPhi(float p);
90  bool goodEta(float e);
91  bool goodTOFEMass(float e);
92  bool goodElectron(float e);
93  bool hasElectronCut();
94  bool goodPion(float p);
95  bool goodKaon(float k);
96  bool goodProton(float p);
97  bool goodFragment(int ifragtype);
98 
99 
100  ClassDef(StEStructTrackCuts,1)
101 
102 };
103 
104 inline void StEStructTrackCuts::loadUserCuts(const char* name, const char** vals, int nvals){ }
105 
106 inline bool StEStructTrackCuts::goodFlag(int f){
107  mvalues[mflagName.idx] =(float)f;
108  return ( (mflag[0]==mflag[1] && mflag[0]==0) ||
109  (f>=mflag[0] && f<=mflag[1]) ) ;
110 
111 }
112 
113 inline bool StEStructTrackCuts::goodCharge(int c){
114  mvalues[mchargeName.idx] =(float)c;
115  return ( (mcharge[0]==mcharge[1] && mcharge[0]==0) ||
116  (c>=mcharge[0] && c<=mcharge[1]) ) ;
117 
118 }
119 
120 inline bool StEStructTrackCuts::goodNFitPoints(int c){
121  mvalues[mnfitpointsName.idx] =(float)c;
122  return ( (mnfitpoints[0]==mnfitpoints[1] && mnfitpoints[0]==0) ||
123  (c>=mnfitpoints[0] && c<=mnfitpoints[1]) ) ;
124 
125 }
126 
127 inline bool StEStructTrackCuts::goodNFitNMax(float c){
128  mvalues[mnfitnmaxName.idx] =c;
129  return ( (mnfitnmax[0]==mnfitnmax[1] && mnfitnmax[0]==0) ||
130  (c>=mnfitnmax[0] && c<=mnfitnmax[1]) ) ;
131 
132 }
133 
134 inline bool StEStructTrackCuts::goodGlobalDCA(float c){
135  mvalues[mglobalDCAName.idx] =c;
136  return ( (mglobalDCA[0]==mglobalDCA[1] && mglobalDCA[0]==0) ||
137  (c>=mglobalDCA[0] && c<=mglobalDCA[1]) ) ;
138 
139 }
140 
141 inline bool StEStructTrackCuts::goodChi2(float c){
142  mvalues[mchi2Name.idx] =c;
143  return ( (mchi2[0]==mchi2[1] && mchi2[0]==0) ||
144  (c>=mchi2[0] && c<=mchi2[1]) ) ;
145 
146 }
147 
148 inline bool StEStructTrackCuts::goodPt(float c){
149  mvalues[mptName.idx] =c;
150  return ( (mpt[0]==mpt[1] && mpt[0]==0) ||
151  (c>=mpt[0] && c<=mpt[1]) ) ;
152 
153 }
154 
155 inline bool StEStructTrackCuts::goodYt(float c){
156  mvalues[mytName.idx] =c;
157  return ( (myt[0]==myt[1] && myt[0]==0) ||
158  (c>=myt[0] && c<=myt[1]) ) ;
159 
160 }
161 
162 inline bool StEStructTrackCuts::goodXt(float c){
163  mvalues[mxtName.idx] =c;
164  return ( (mxt[0]==mxt[1] && mxt[0]==0) ||
165  (c>=mxt[0] && c<=mxt[1]) ) ;
166 
167 }
168 
169 
170 inline bool StEStructTrackCuts::goodPhi(float c){
171  mvalues[mphiName.idx] =c;
172  return ( (mphi[0]==mphi[1] && mphi[0]==0) ||
173  (c>=mphi[0] && c<=mphi[1]) ) ;
174 
175 }
176 
177 inline bool StEStructTrackCuts::goodEta(float c){
178  mvalues[metaName.idx] =c;
179  return ( (meta[0]==meta[1] && meta[0]==0) ||
180  (c>=meta[0] && c<=meta[1]) ) ;
181 
182 }
183 
184 inline bool StEStructTrackCuts::goodTOFEMass(float c){
185  mvalues[mTOFEMassName.idx] =c;
186  return ( (mTOFEMass[0]==mTOFEMass[1] && mTOFEMass[0]==0) ||
187  (c>=mTOFEMass[0] && c<=mTOFEMass[1]) ) ;
188 
189 }
190 /*
191 inline bool StEStructTrackCuts::goodElectron(float c) {
192  mvalues[mnsigmaEName.idx] =c;
193  if (mnsigmaE[0]==mnsigmaE[1] && mnsigmaE[0]==0) {
194  return true;
195  }
196  if (mnsigmaE[0]<=c && c<=mnsigmaE[1]) {
197  return true;
198  }
199  return false;
200 }
201 */
202 inline bool StEStructTrackCuts::goodElectron(float c){
203  mvalues[mnsigmaEName.idx] =c;
204  return ( (mnsigmaE[0]==mnsigmaE[1] && mnsigmaE[0]==0) ||
205  (c>=mnsigmaE[0] && c<=mnsigmaE[1]) ) ;
206 
207 }
208 inline bool StEStructTrackCuts::hasElectronCut() {
209  return ( mnsigmaE[0] != mnsigmaE[1] ) ;
210 }
211 
212 inline bool StEStructTrackCuts::goodPion(float c){
213  mvalues[mnsigmaPiName.idx] =c;
214  return ( (mnsigmaPi[0]==mnsigmaPi[1] && mnsigmaPi[0]==0) ||
215  (c>=mnsigmaPi[0] && c<=mnsigmaPi[1]) ) ;
216 
217 }
218 
219 inline bool StEStructTrackCuts::goodKaon(float c){
220  mvalues[mnsigmaKName.idx] =c;
221  return ( (mnsigmaK[0]==mnsigmaK[1] && mnsigmaK[0]==0) ||
222  (c>=mnsigmaK[0] && c<=mnsigmaK[1]) ) ;
223 
224 }
225 
226 inline bool StEStructTrackCuts::goodProton(float c){
227  mvalues[mnsigmaPName.idx] =c;
228  return ( (mnsigmaP[0]==mnsigmaP[1] && mnsigmaP[0]==0) ||
229  (c>=mnsigmaP[0] && c<=mnsigmaP[1]) ) ;
230 
231 };
232 
233 
234 #endif
235 
236 /***********************************************************************
237  *
238  * $Log: StEStructTrackCuts.h,v $
239  * Revision 1.7 2012/11/16 21:19:08 prindle
240  * Moved EventCuts, TrackCuts to EventReader. Affects most readers.
241  * Added support to write and read EStructEvents.
242  * Cuts: 3D histo support, switch to control filling of histogram for reading EStructEvents
243  * EventCuts: A few new cuts
244  * MuDstReader: Add 2D to some histograms, treat ToFCut, PrimaryCuts, VertexRadius histograms like other cut histograms.
245  * QAHists: Add refMult
246  * TrackCuts: Add some hijing cuts.
247  *
248  * Revision 1.6 2011/08/02 20:31:26 prindle
249  * Change string handling
250  * Added event cuts for VPD, good fraction of global tracks are primary, vertex
251  * found only from tracks on single side of TPC, good fraction of primary tracks have TOF hits..
252  * Added methods to check if cuts imposed
253  * Added 2010 200GeV and 62 GeV, 2011 19 GeV AuAu datasets, 200 GeV pp2pp 2009 dataset.
254  * Added TOF vs. dEdx vs. p_t histograms
255  * Fix participant histograms in QAHists.
256  * Added TOFEMass cut in TrackCuts although I think we want to supersede this.
257  *
258  * Revision 1.5 2008/12/02 23:35:36 prindle
259  * Added code for pileup rejection in EventCuts and MuDstReader.
260  * Modified trigger selections for some data sets in EventCuts.
261  *
262  * Revision 1.4 2006/04/04 22:05:07 porter
263  * a handful of changes:
264  * - changed the StEStructAnalysisMaker to contain 1 reader not a list of readers
265  * - added StEStructQAHists object to contain histograms that did exist in macros or elsewhere
266  * - made centrality event cut taken from StEStructCentrality singleton
267  * - put in ability to get any max,min val from the cut class - one must call setRange in class
268  *
269  * Revision 1.3 2005/09/14 17:08:37 msd
270  * Fixed compiler warnings, a few tweaks and upgrades
271  *
272  * Revision 1.2 2005/09/07 20:18:44 prindle
273  * AnalysisMaker: Keep track of currentAnalysis (for use in doEStruct macro)
274  * EventCuts.h: Added trigger cuts including cucu and year 4.
275  * MuDstReader: Added dE/dx histograms. Re-arranged code to count tracks
276  * before making centrality cut.
277  * TrackCuts: Random changes. Moved some variables from private to public.o
278  *
279  * Revision 1.1 2003/10/15 18:20:32 porter
280  * initial check in of Estruct Analysis maker codes.
281  *
282  *
283  *********************************************************************/
284