StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StEStructEventCuts.cxx
1 /**********************************************************************
2  *
3  * $Id: StEStructEventCuts.cxx,v 1.19 2012/11/16 21:19:06 prindle Exp $
4  *
5  * Author: Jeff Porter
6  *
7  **********************************************************************
8  *
9  * Description: Cut class for event level quantities
10  *
11  *
12  ***********************************************************************/
13 #include "StEStructEventCuts.h"
14 #include "Stsstream.h"
15 #include <stdlib.h>
16 #include <string>
17 
18 ClassImp(StEStructEventCuts)
19 
21 StEStructEventCuts::StEStructEventCuts(const char* cutfileName): StEStructCuts(cutfileName) { init(); };
22 
23 StEStructEventCuts::~StEStructEventCuts() {};
24 
25 void StEStructEventCuts::init() {
26  mtrgByRunPeriod=false;
27  strcpy(mcutTypeName,"Event");
28  initCuts();
29  initNames();
30  if (isLoaded()) {
31  loadCuts();
32  }
33  badTrigger = 0;
34 }
35 
36 void StEStructEventCuts::initCuts(){
37 
38  mtWord[0]=mtWord[1]=0;
39  mpVertexZ[0]=mpVertexZ[1]=0;
40  mpVPDVertex[0]=mpVPDVertex[1]=0;
41  mpVertexRadius[0]=mpVertexRadius[1]=0;
42  mcentrality[0]=mcentrality[1]=0;
43  mgoodtoffraction[0]=mgoodtoffraction[1]=0;
44  mgoodprimaryfraction[0]=mgoodprimaryfraction[1]=0;
45  mZVertSep[0]=mZVertSep[1]=0;
46  mZVertMatch[0]=mZVertMatch[1]=0;
47 
48 }
49 
50 void StEStructEventCuts::initNames(){
51 
52  strcpy(mtWordName.name,"triggerWord");
53  strcpy(mpVertexZName.name,"primaryVertexZ");
54  strcpy(mpVPDVertexName.name,"primaryVPDVertex");
55  strcpy(mpVertexRadiusName.name,"primaryVertexRadius");
56  strcpy(mcentralityName.name,"centrality");
57  strcpy(mgoodtoffractionName.name,"goodToFFraction");
58  strcpy(mgoodprimaryfractionName.name,"goodPrimaryFraction");
59  strcpy(mZVertSepName.name,"pileup");
60  strcpy(mZVertMatchName.name,"singleSideVertex");
61 }
62 
63 bool StEStructEventCuts::loadBaseCuts(const char* name, const char** vals, int nvals){
64 
65  if (!strcmp(name,mtWordName.name)) {
66  if (1 == nvals) {
67  sscanf(vals[0],"%s\t",mRunPeriod);
68  // check for valid name and define limits for histograms
69  // For named triggerWord mtWord is used to define histogram ranges.
70  bool validRun = 0;
71  if (!strcmp("AuAu200GeVMinBias2001",mRunPeriod)) {
72  // For use with trgsetupname=ProductionMinBias; productions P02gc,P02gd,P02ge; recommended |Vz|<25
73  mtWord[0] = 4090;
74  mtWord[1] = 4140;
75  validRun = 1;
76  } else if (!strcmp("AuAu200GeVCentral2001",mRunPeriod)) {
77  // For use with trgsetupname=productionCentral; productions P02gc,P02gd,P02ge; recommended |Vz|<25
78  mtWord[0] = 4000;
79  mtWord[1] = 4500;
80  validRun = 1;
81  } else if (!strcmp("AuAu200GeVProductionMinBias2004",mRunPeriod) ||
82  !strcmp("AuAu200GeVProductionMinBiasA2004",mRunPeriod) ||
83  !strcmp("AuAu200GeVProductionMinBiasB2004",mRunPeriod)) {
84  // trgsetupname=productionMinBias; production P05ic;
85  // For period A the trigger page recommends -10 < Vz <30
86  // I think we are better off always using -15 < Vz < 15
87  //mtWord[0] = 15000; mtWord[1] = 15010;
88  mtWord[0] = 15000;
89  mtWord[1] = 15050;
90  validRun = 1;
91  } else if (!strcmp("AuAu200GeVProductionLow2004",mRunPeriod)) {
92  // trgsetupname=productionMinBias; production P05ia; recommended |Vz|<30
93  //mtWord[0] = 15000; mtWord[1] = 15010;
94  mtWord[0] = 15000;
95  mtWord[1] = 15050;
96  validRun = 1;
97  } else if (!strcmp("AuAu200GeVProductionMid2004",mRunPeriod)) {
98  // trgsetupname=productionMinBias; production P05ia; recommended |Vz|<30
99  //mtWord[0] = 15000; mtWord[1] = 15010;
100  mtWord[0] = 15000;
101  mtWord[1] = 15050;
102  validRun = 1;
103  } else if (!strcmp("AuAu200GeVProductionHigh2004",mRunPeriod)) {
104  // trgsetupname=productionMinBias; production P05ia; recommended |Vz|<30
105  //mtWord[0] = 15000; mtWord[1] = 15010;
106  mtWord[0] = 15000;
107  mtWord[1] = 15050;
108  validRun = 1;
109  } else if (!strcmp("AuAu200GeVMinBias2010",mRunPeriod)) {
110  // trgsetupname=AuAu200_production
111  mtWord[0] = 260000;
112  mtWord[1] = 260500;
113  validRun = 1;
114  } else if (!strcmp("AuAu200GeVMinBias2011",mRunPeriod)) {
115  // trgsetupname=AuAu200_production
116  mtWord[0] = 350000;
117  mtWord[1] = 350500;
118  validRun = 1;
119  } else if (!strcmp("2007ProductionMinBias",mRunPeriod)) {
120  // For use with trgsetupname=2007ProductionMinBias; productions P08ic; recommended |Vz|<10 (maybe 5)
121  mtWord[0] = 200000;
122  mtWord[1] = 200050;
123  validRun = 1;
124  } else if (!strcmp("2007Production2",mRunPeriod)) {
125  // For use with trgsetupname=2007Production2; productions P08ic; recommended |Vz|<10 (maybe 5)
126  mtWord[0] = 200000;
127  mtWord[1] = 200050;
128  validRun = 1;
129  } else if (!strcmp("2007LowLuminosity",mRunPeriod)) {
130  // For use with trgsetupname=2007ProductionMinBias; productions P07id; recommended |Vz|<10 (maybe 5)
131  mtWord[0] = 200000;
132  mtWord[1] = 200050;
133  validRun = 1;
134  } else if (!strcmp("AuAu62GeVMinBias2010",mRunPeriod)) {
135  // trgsetupname=AuAu62_production
136  mtWord[0] = 270000;
137  mtWord[1] = 270050;
138  validRun = 1;
139  } else if (!strcmp("AuAu62GeVMinBias2004",mRunPeriod)) {
140  // trgsetupname=production62Gev; productions P04id,P04ie,P05ic; recommended |Vz|<30
141  mtWord[0] = 35000;
142  mtWord[1] = 35050;
143  validRun = 1;
144  } else if (!strcmp("AuAu39GeVMinBias2010",mRunPeriod)) {
145  // trgsetupname=AuAu30_production; productions P10ih; Not sure about recommended V_z cut yet.
146  mtWord[0] = 28000;
147  mtWord[1] = 28050;
148  validRun = 1;
149  } else if (!strcmp("AuAu27GeVMinBias2011",mRunPeriod)) {
150  // trgsetupname=AuAu27_production
151  mtWord[0] = 360000;
152  mtWord[1] = 360050;
153  validRun = 1;
154  } else if (!strcmp("AuAu19GeVMinBias2011",mRunPeriod)) {
155  // trgsetupname=AuAu19_production
156  mtWord[0] = 340000;
157  mtWord[1] = 340050;
158  validRun = 1;
159  } else if (!strcmp("AuAu11GeVMinBias2010",mRunPeriod)) {
160  // trgsetupname=AuAu11_production; productions P10ih; Not sure about recommended V_z cut yet.
161  // Not sure I have the right triggerid.
162  mtWord[0] = 31000;
163  mtWord[1] = 31050;
164  validRun = 1;
165  } else if (!strcmp("AuAu7GeVMinBias2010",mRunPeriod)) {
166  // trgsetupname=AuAu7_production; productions P10ih; Not sure about recommended V_z cut yet.
167  mtWord[0] = 29000;
168  mtWord[1] = 29050;
169  validRun = 1;
170  } else if (!strcmp("CuCu200GeVProductionMinBias2005",mRunPeriod)) {
171  // ...
172  mtWord[0] = 66000; // untested
173  mtWord[1] = 66050;
174  validRun = 1;
175  } else if (!strcmp("CuCu200GeVProductionMinBias2007ic",mRunPeriod)) {
176  // ...
177  mtWord[0] = 76000;
178  mtWord[1] = 76050;
179  validRun = 1;
180  } else if (!strcmp("CuCu62GeVProductionMinBias2005",mRunPeriod)) {
181  // ...
182  mtWord[0] = 76000; // untested
183  mtWord[1] = 76050;
184  validRun = 1;
185  } else if (!strcmp("CuCu62GeVProductionMinBias2007ic",mRunPeriod)) {
186  // ...
187  mtWord[0] = 76002;
188  mtWord[1] = 76011;
189  validRun = 1;
190  } else if (!strcmp("CuCu22GeVProductionMinBiasP05if",mRunPeriod)) {
191  // ...
192  mtWord[0] = 86000; // untested. Believe this includes all triggers except
193  mtWord[1] = 86050; // zero-bias.
194  validRun = 1;
195  } else if (!strcmp("dAu200GeVMinBias2003",mRunPeriod)) {
196  // ...
197  mtWord[0] = 2000; // untested
198  mtWord[1] = 2050;
199  validRun = 1;
200  } else if (!strcmp("ppProductionMinBias2005",mRunPeriod)) {
201  // ...
202  mtWord[0] = 96011; // untested
203  mtWord[1] = 106011;
204  validRun = 1;
205  } else if (!strcmp("pp400MinBias2005",mRunPeriod)) {
206  // ...
207  mtWord[0] = 96011; // untested
208  mtWord[1] = 106011;
209  validRun = 1;
210  } else if (!strcmp("pp2006MinBias2006",mRunPeriod)) {
211  // ...
212  mtWord[0] = 117000; // untested
213  mtWord[1] = 117050;
214  validRun = 1;
215  } else if (!strcmp("pp2pp_VPDMB_2009",mRunPeriod)) {
216  // ...
217  mtWord[0] = 250100; // untested
218  mtWord[1] = 250150;
219  validRun = 1;
220  } else if (!strcmp("ppProductionMB622006",mRunPeriod)) {
221  // ...
222  mtWord[0] = 147000; // untested
223  mtWord[1] = 147050;
224  validRun = 1;
225  } else if (!strcmp("production2009_200GeV_Single",mRunPeriod)) {
226  // ...
227  mtWord[0] = 240000; // untested
228  mtWord[1] = 240050;
229  validRun = 1;
230  }
231  if (validRun) {
232  string hName;
233  hName = mtWordName.name; hName += "NoCut";
234  TH1F *noCutHist = new TH1F(hName.c_str(),hName.c_str(),mtWord[1]-mtWord[0]+3,mtWord[0]-1.5,mtWord[1]+1.5);
235  hName = mtWordName.name; hName += "Cut";
236  TH1F *cutHist = new TH1F(hName.c_str(),hName.c_str(),mtWord[1]-mtWord[0]+3,mtWord[0]-1.5,mtWord[1]+1.5);
237  addCutHists(noCutHist,cutHist,mtWordName.name);
238  hName = mtWordName.name; hName += "NoCut2D";
239  TH2F *noCutHist2D = new TH2F(hName.c_str(),hName.c_str(),mtWord[1]-mtWord[0]+3,mtWord[0]-1.5,mtWord[1]+1.5,mtWord[1]-mtWord[0]+3,mtWord[0]-1.5,mtWord[1]+1.5);
240  hName = mtWordName.name; hName += "Cut2D";
241  TH2F *cutHist2D = new TH2F(hName.c_str(),hName.c_str(),mtWord[1]-mtWord[0]+3,mtWord[0]-1.5,mtWord[1]+1.5,mtWord[1]-mtWord[0]+3,mtWord[0]-1.5,mtWord[1]+1.5);
242  hName = mtWordName.name; hName += "2D";
243  addCutHists(noCutHist2D,cutHist2D,hName.c_str());
244 /*
245  char *hName;
246  hName = new char[strlen(mtWordName.name)+5];
247  sprintf(hName,"%sNoCut",mtWordName.name);
248  TH1F *noCutHist = new TH1F(hName,hName,mtWord[1]-mtWord[0]+3,mtWord[0]-1.5,mtWord[1]+1.5);
249  delete [] hName;
250  hName = new char[strlen(mtWordName.name)+3];
251  sprintf(hName,"%sCut",mtWordName.name);
252  TH1F *cutHist = new TH1F(hName,hName,mtWord[1]-mtWord[0]+3,mtWord[0]-1.5,mtWord[1]+1.5);
253  addCutHists(noCutHist,cutHist,mtWordName.name);
254  delete [] hName;
255  hName = new char[strlen(mtWordName.name)+7];
256  sprintf(hName,"%sNoCut2D",mtWordName.name);
257  TH2F *noCutHist2D = new TH2F(hName,hName,mtWord[1]-mtWord[0]+3,mtWord[0]-1.5,mtWord[1]+1.5,mtWord[1]-mtWord[0]+3,mtWord[0]-1.5,mtWord[1]+1.5);
258  delete [] hName;
259  hName = new char[strlen(mtWordName.name)+5];
260  sprintf(hName,"%sCut2D",mtWordName.name);
261  TH2F *cutHist2D = new TH2F(hName,hName,mtWord[1]-mtWord[0]+3,mtWord[0]-1.5,mtWord[1]+1.5,mtWord[1]-mtWord[0]+3,mtWord[0]-1.5,mtWord[1]+1.5);
262  delete [] hName;
263  hName = new char[strlen(mtWordName.name)+2];
264  sprintf(hName,"%s2D",mtWordName.name);
265  addCutHists(noCutHist2D,cutHist2D,hName);
266  delete [] hName;
267  */
268  mtrgByRunPeriod=true;
269  } else {
270  cout << " Warning: unknown run period " << name << endl;
271  }
272  } else {
273  mtWord[0]=(unsigned int)atoi(vals[0]);
274  mtWord[1]=(unsigned int)atoi(vals[1]);
275  if (mtWord[0]==mtWord[1]) { // histogram needs some help in this case.
276  float arange[2];
277  arange[0]=mtWord[0]-0.05*mtWord[0];
278  arange[1]=mtWord[0]+0.05*mtWord[0];
279  mtWordName.idx=createCutHists(name,arange);
280  } else {
281  mtWordName.idx=createCutHists(name,mtWord);
282  }
283  }
284  setRange(mtWordName.name,mtWord[0],mtWord[1]);
285  return true;
286  }
287 
288  if (!strcmp(name,mpVertexZName.name)) {
289  mpVertexZ[0]=atof(vals[0]);
290  mpVertexZ[1]=atof(vals[1]);
291  mpVertexZName.idx=createCutHists(name,mpVertexZ);
292  setRange(mpVertexZName.name,mpVertexZ[0],mpVertexZ[1]);
293  return true;
294  }
295 
296  if (!strcmp(name,mpVPDVertexName.name)) {
297  mpVPDVertex[0]=atof(vals[0]);
298  mpVPDVertex[1]=atof(vals[1]);
299  mpVPDVertexName.idx=createCutHists(name,mpVPDVertex);
300  setRange(mpVPDVertexName.name,mpVPDVertex[0],mpVPDVertex[1]);
301  return true;
302  }
303 
304  if (!strcmp(name,mpVertexRadiusName.name)) {
305  mpVertexRadius[0]=atof(vals[0]);
306  mpVertexRadius[1]=atof(vals[1]);
307  mpVertexRadiusName.idx=createCutHists(name,mpVertexRadius);
308  setRange(mpVertexRadiusName.name,mpVertexRadius[0],mpVertexRadius[1]);
309  return true;
310  }
311 
312  if (!strcmp(name,mcentralityName.name)) {
313  mcentrality[0]=atoi(vals[0]);
314  mcentrality[1]=atoi(vals[1]);
315  mcentralityName.idx=createCutHists(name,mcentrality);
316  setRange(mcentralityName.name,mcentrality[0],mcentrality[1]);
317  return true;
318  }
319 
320  if (!strcmp(name,mgoodtoffractionName.name)) {
321  mgoodtoffraction[0]=atof(vals[0]);
322  mgoodtoffraction[1]=atof(vals[1]);
323  mgoodtoffractionName.idx=createCutHists(name,mgoodtoffraction);
324  setRange(mgoodtoffractionName.name,mgoodtoffraction[0],mgoodtoffraction[1]);
325  return true;
326  }
327 
328  if (!strcmp(name,mgoodprimaryfractionName.name)) {
329  mgoodprimaryfraction[0]=atof(vals[0]);
330  mgoodprimaryfraction[1]=atof(vals[1]);
331  mgoodprimaryfractionName.idx=createCutHists(name,mgoodprimaryfraction);
332  setRange(mgoodprimaryfractionName.name,mgoodprimaryfraction[0],mgoodprimaryfraction[1]);
333  return true;
334  }
335 
336  if (!strcmp(name,mZVertSepName.name)) {
337  mZVertSep[0]=atoi(vals[0]);
338  mZVertSep[1]=atoi(vals[1]);
339  mZVertSepName.idx=createCutHists(name,mZVertSep);
340  setRange(mZVertSepName.name,mZVertSep[0],mZVertSep[1]);
341  return true;
342  }
343 
344  if (!strcmp(name,mZVertMatchName.name)) {
345  mZVertMatch[0]=atoi(vals[0]);
346  mZVertMatch[1]=atoi(vals[1]);
347  mZVertMatchName.idx=createCutHists(name,mZVertMatch);
348  setRange(mZVertMatchName.name,mZVertMatch[0],mZVertMatch[1]);
349  return true;
350  }
351 
352  return false;
353 
354 };
355 
356 bool StEStructEventCuts::goodTrigger(StMuDst* muDst) {
357 
358  StMuEvent* muEvent = muDst->event();
359  if (mtrgByRunPeriod) {
360 
361  if (!strcmp("CuCu22GeVProductionMinBiasP05if",mRunPeriod)) {
362  // Accept all triggers.
363  return true;
364  } else if (!strcmp("CuCu62GeVProductionMinBias2005",mRunPeriod)) {
365  if (muEvent->triggerIdCollection().nominal().isTrigger(76007) ||
366  muEvent->triggerIdCollection().nominal().isTrigger(76011)) {
367  return true;
368  }
369  } else if (!strcmp("CuCu200GeVProductionMinBias2005",mRunPeriod)) {
370  if (muEvent->triggerIdCollection().nominal().isTrigger(66007)) {
371  return true;
372  }
373  } else if (!strcmp("CuCu62GeVProductionMinBias2007ic",mRunPeriod)) {
374  // Assume vertex characteristics essentially the same
375  // as the 200GeV CuCu data.
376  if (muEvent->runNumber()<6069077) {
377  if (muEvent->triggerIdCollection().nominal().isTrigger(76002) ||
378  muEvent->triggerIdCollection().nominal().isTrigger(76011)) {
379  return goodVertexTopology(muDst);
380  }
381  } else {
382  if (muEvent->triggerIdCollection().nominal().isTrigger(76007) ||
383  muEvent->triggerIdCollection().nominal().isTrigger(76011)) {
384  return goodVertexTopology(muDst);
385  }
386  }
387  } else if (!strcmp("CuCu200GeVProductionMinBias2007ic",mRunPeriod)) {
388  if (muEvent->triggerIdCollection().nominal().isTrigger(66007)) {
389  return goodVertexTopology(muDst);
390  }
391  } else if (!strcmp("2007ProductionMinBias",mRunPeriod)) {
392  // This is 200GeV ProductionMinBias AuAu data from 2007
393  // First triggerId has killer bits on, second killer bits off.
394  // I don't know what killer bits are. Are they important?
395  // Trigger page suggests ID 200001 should be in mbvpd.
396  // Multiplicity distribution of that id is cleary wrong.
397  if (muEvent->triggerIdCollection().nominal().isTrigger(200001) ||
398  muEvent->triggerIdCollection().nominal().isTrigger(200003) ||
399  muEvent->triggerIdCollection().nominal().isTrigger(200020)) {
400  badTrigger++;
401  }
402  if (muEvent->triggerIdCollection().nominal().isTrigger(200013)) {
403  return goodVertexTopology(muDst);
404  }
405  } else if (!strcmp("2007Production2",mRunPeriod)) {
406  // This is 200GeV Production2 AuAu data from 2007
407  // I think this trigger had the same trigger bits as 2007ProductionMinBias but
408  // was active during different runs. May be an issue of pre-scaling or splittin
409  // in express streams.
410  if (muEvent->triggerIdCollection().nominal().isTrigger(200001) ||
411  muEvent->triggerIdCollection().nominal().isTrigger(200003) ||
412  muEvent->triggerIdCollection().nominal().isTrigger(200020)) {
413  badTrigger++;
414  }
415  if (muEvent->triggerIdCollection().nominal().isTrigger(200013)) {
416  return goodVertexTopology(muDst);
417  }
418  } else if (!strcmp("2007LowLuminosity",mRunPeriod)) {
419  // This is 200GeV LowLuminosity AuAu data from 2007
420  if (muEvent->triggerIdCollection().nominal().isTrigger(200001) ||
421  muEvent->triggerIdCollection().nominal().isTrigger(200003) ||
422  muEvent->triggerIdCollection().nominal().isTrigger(200013)) {
423  badTrigger++;
424  }
425  if (muEvent->triggerIdCollection().nominal().isTrigger(200020)) {
426  return goodVertexTopology(muDst);
427  }
428  } else if (!strcmp("AuAu200GeVProductionMinBias2004",mRunPeriod)) {
429  if (muEvent->runNumber() < 5023099) {
430  if (muEvent->triggerIdCollection().nominal().isTrigger(15003)) {
431  return true;
432  }
433  } else if (muEvent->runNumber() > 503098) {
434  if (muEvent->triggerIdCollection().nominal().isTrigger(15007)) {
435  return true;
436  }
437  }
438  } else if (!strcmp("AuAu200GeVProductionMinBiasA2004",mRunPeriod)) {
439  if (muEvent->runNumber() < 5023099) {
440  if (muEvent->triggerIdCollection().nominal().isTrigger(15003)) {
441  return true;
442  }
443  }
444  } else if (!strcmp("AuAu200GeVProductionMinBiasB2004",mRunPeriod)) {
445  if (muEvent->runNumber() > 503098) {
446  if (muEvent->triggerIdCollection().nominal().isTrigger(15007)) {
447  return true;
448  }
449  }
450  } else if (!strcmp("AuAu200GeVProductionLow2004",mRunPeriod)) {
451  if (muEvent->runNumber() > 5042040) {
452  if (muEvent->triggerIdCollection().nominal().isTrigger(15007)) {
453  return true;
454  }
455  }
456  } else if (!strcmp("AuAu200GeVProductionMid2004",mRunPeriod)) {
457  if (muEvent->runNumber() > 5042040) {
458  if (muEvent->triggerIdCollection().nominal().isTrigger(15007)) {
459  return true;
460  }
461  }
462  } else if (!strcmp("AuAu200GeVProductionHigh2004",mRunPeriod)) {
463  if (muEvent->runNumber() > 5042040) {
464  if (muEvent->triggerIdCollection().nominal().isTrigger(15007)) {
465  return true;
466  }
467  }
468  } else if (!strcmp("AuAu200GeVMinBias2010",mRunPeriod)) {
469  // I think all these vpd-mb triggers were for different parts of the run.
470  // I don't know why they have different numbers though.
471  if (muEvent->triggerIdCollection().nominal().isTrigger(260001) ||
472  muEvent->triggerIdCollection().nominal().isTrigger(260011) ||
473  muEvent->triggerIdCollection().nominal().isTrigger(260021) ||
474  muEvent->triggerIdCollection().nominal().isTrigger(260031)) {
475  return true;
476 // return goodVertexTopology(muDst);
477  }
478 if (0) {
479  // The triggers ending in 4 are called vpd-mb-slow
480  // Don't know what 9 is, must be during setup.
481  if (muEvent->triggerIdCollection().nominal().isTrigger(9)) {
482  return true;
483  } else if (muEvent->triggerIdCollection().nominal().isTrigger(260001)) {
484  return true;
485  } else if (muEvent->triggerIdCollection().nominal().isTrigger(260011)) {
486  return true;
487  } else if (muEvent->triggerIdCollection().nominal().isTrigger(260014)) {
488  return true;
489  } else if (muEvent->triggerIdCollection().nominal().isTrigger(260021)) {
490  return true;
491  } else if (muEvent->triggerIdCollection().nominal().isTrigger(260024)) {
492  return true;
493  } else if (muEvent->triggerIdCollection().nominal().isTrigger(260031)) {
494  return true;
495  }
496 }
497  } else if (!strcmp("AuAu200GeVMinBias2011",mRunPeriod)) {
498  // These vpd-mb triggers were for different run numbers, use catalog query if you want specific trigger.
499  // I don't know why they have different numbers though.
500  if (muEvent->triggerIdCollection().nominal().isTrigger(350003) ||
501  muEvent->triggerIdCollection().nominal().isTrigger(350013) ||
502  muEvent->triggerIdCollection().nominal().isTrigger(350023) ||
503  muEvent->triggerIdCollection().nominal().isTrigger(350033) ||
504  muEvent->triggerIdCollection().nominal().isTrigger(350043)) {
505  return true;
506  }
507  } else if (!strcmp("AuAu62GeVMinBias2010",mRunPeriod)) {
508  if (muEvent->triggerIdCollection().nominal().isTrigger(270001) ||
509  muEvent->triggerIdCollection().nominal().isTrigger(270011) ||
510  muEvent->triggerIdCollection().nominal().isTrigger(270021)) {
511  return true;
512  }
513  } else if (!strcmp("AuAu62GeVMinBias2004",mRunPeriod)) {
514  if (((muEvent->triggerIdCollection().nominal().isTrigger(35004) ||
515  muEvent->triggerIdCollection().nominal().isTrigger(35007))
516  ||
517  ((muEvent->triggerIdCollection().nominal().isTrigger(35001) ||
518  muEvent->triggerIdCollection().nominal().isTrigger(35009) )
519  && muEvent->ctbMultiplicity()>15))) {
520  return true;
521  }
522  } else if (!strcmp("AuAu39GeVMinBias2010",mRunPeriod)) {
523  if (muEvent->triggerIdCollection().nominal().isTrigger(280001)) {
524  return true;
525  }
526  } else if (!strcmp("AuAu27GeVMinBias2011",mRunPeriod)) {
527  if (muEvent->triggerIdCollection().nominal().isTrigger(360001)) {
528  return true;
529  }
530  } else if (!strcmp("AuAu19GeVMinBias2011",mRunPeriod)) {
531  if (muEvent->triggerIdCollection().nominal().isTrigger(340001) ||
532  muEvent->triggerIdCollection().nominal().isTrigger(340011) ||
533  muEvent->triggerIdCollection().nominal().isTrigger(340021)) {
534  return true;
535  }
536  } else if (!strcmp("AuAu11GeVMinBias2010",mRunPeriod)) {
537  if (muEvent->triggerIdCollection().nominal().isTrigger(310014)) {
538  return true;
539  }
540  } else if (!strcmp("AuAu7GeVMinBias2010",mRunPeriod)) {
541  if (muEvent->triggerIdCollection().nominal().isTrigger(290001) ||
542  muEvent->triggerIdCollection().nominal().isTrigger(290004)) {
543  return true;
544  }
545  } else if (!strcmp("AuAu200GeVMinBias2001",mRunPeriod)) {
546  StMuL3EventSummary l3 = muEvent->l3EventSummary();
547  if (l3.unbiasedTrigger()) {
548  unsigned int t = muEvent->l0Trigger().triggerWord();
549  if ( 0x1000 == t ) {
550  return true;
551  }
552  }
553  } else if (!strcmp("AuAu200GeVCentral2001",mRunPeriod)) {
554  StMuL3EventSummary l3 = muEvent->l3EventSummary();
555  if (l3.unbiasedTrigger()) {
556  unsigned int t = muEvent->l0Trigger().triggerWord();
557  if ( 0x1100 == t ) {
558  return true;
559  }
560  }
561  } else if (!strcmp("dAu200GeVMinBias2003",mRunPeriod)) {
562  if (muEvent->triggerIdCollection().nominal().isTrigger(2001) ||
563  muEvent->triggerIdCollection().nominal().isTrigger(2003)) {
564  return true;
565  }
566  } else if(!strcmp("ppMinBias",mRunPeriod)){
567  if(muEvent->triggerIdCollection().nominal().isTrigger(8192)) {
568  return true;
569  }
570  } else if(!strcmp("ppProductionMinBias2005",mRunPeriod)){
571  if(muEvent->triggerIdCollection().nominal().isTrigger(96011) ||
572  muEvent->triggerIdCollection().nominal().isTrigger(106011)) {
573  return true;
574  }
575  } else if(!strcmp("pp400MinBias2005",mRunPeriod)){
576  // Not 100% sure of these triggers. Small data set, probably not worth spending much time on.
577  if(muEvent->triggerIdCollection().nominal().isTrigger(96011) ||
578  muEvent->triggerIdCollection().nominal().isTrigger(106011)) {
579  return true;
580  }
581  } else if(!strcmp("pp2006MinBias2006",mRunPeriod)){
582  if(muEvent->triggerIdCollection().nominal().isTrigger(117001)) {
583  return true;
584  }
585  } else if(!strcmp("pp2pp_VPDMB_2009",mRunPeriod)){
586  if(muEvent->triggerIdCollection().nominal().isTrigger(7) ||
587  muEvent->triggerIdCollection().nominal().isTrigger(250107)) {
588  return true;
589  }
590  } else if(!strcmp("production2009_200GeV_Single",mRunPeriod)){
591  if(muEvent->triggerIdCollection().nominal().isTrigger(240025) &&
592  muDst->primaryVertex()->ranking()>0) {
593  return true;
594  }
595  } else if(!strcmp("ppProductionMB622006",mRunPeriod)){
596  if(muEvent->triggerIdCollection().nominal().isTrigger(147001)) {
597  // Not completely sure this is an optimal cut for reducing pileup.
598  if (muDst->primaryVertex()->ranking()>0) {
599  return true;
600  }
601  }
602  }
603  } else {
604  unsigned int t = muEvent->l0Trigger().triggerWord();
605  mvalues[mtWordName.idx] = (float)t;
606  return ( (mtWord[0]==mtWord[1] && mtWord[0]==0) ||
607  (t>=mtWord[0] && t<=mtWord[1]) ) ;
608  }
609  return false;
610 }
611 // Only early runs have ctbMultiplicity.
612 // Simply cut on ranking.
613 bool StEStructEventCuts::goodVertexTopology(StMuDst* muDst) {
614 // if (muDst->event()->refMult() >= 17) {
615 // if (fabs(muDst->primaryVertex()->meanDip())/muDst->event()->ctbMultiplicity() < (0.8/800)) {
616 // return true;
617 // }
618 // } else {
619  if (muDst->primaryVertex()->ranking()>-2.5) {
620  return true;
621  }
622 // }
623  return false;
624 }
625 
626 void StEStructEventCuts::printCutStats(ostream& ofs){
627 
628  // ofs<<"# ******************************************** "<<endl;
629  // ofs<<"# *************** Event Cuts ***************** "<<endl;
630  // ofs<<"# *** format = variable,minvalue,maxvalue *** "<<endl;
631  // ofs<<"# ******************************************** "<<endl;
632  ofs<<endl;
633  ofs<<mtWordName.name<<","<<mtWord[0]<<","<<mtWord[1]<<"\t\t\t"<<" # triggerWord cut"<<endl;
634  ofs<<mpVertexZName.name<<","<<mpVertexZ[0]<<","<<mpVertexZ[1]<<"\t\t"<<" # primary vertex cut"<<endl;
635  ofs<<mpVPDVertexName.name<<","<<mpVPDVertex[0]<<","<<mpVPDVertex[1]<<"\t\t"<<" # primary vertex - vpd position cut"<<endl;
636  ofs<<mpVertexRadiusName.name<<","<<mpVertexRadius[0]<<","<<mpVertexRadius[1]<<"\t\t"<<" # primary vertex radius cut"<<endl;
637  ofs<<mcentralityName.name<<","<<mcentrality[0]<<","<<mcentrality[1]<<"\t\t\t"<<" # number events passing centrality cuts"<<endl;
638  ofs<<mgoodtoffractionName.name<<","<<mgoodtoffraction[0]<<","<<mgoodtoffraction[1]<<"\t\t\t"<<" # number events passing centrality cuts"<<endl;
639  ofs<<mgoodprimaryfractionName.name<<","<<mgoodprimaryfraction[0]<<","<<mgoodprimaryfraction[1]<<"\t\t\t"<<" # number events passing centrality cuts"<<endl;
640  ofs<<mZVertSepName.name<<","<<mZVertSep[0]<<","<<mZVertSep[1]<<"\t\t\t"<<" # number events passing vertex separation pileup cuts"<<endl;
641  ofs<<mZVertMatchName.name<<","<<mZVertMatch[0]<<","<<mZVertMatch[1]<<"\t\t\t"<<" # number events passing sigle sided vertex cuts"<<endl;
642  // ofs<<"# ******************************************** "<<endl<<endl;
643 
644 }
645 
646 /***********************************************************************
647  *
648  * $Log: StEStructEventCuts.cxx,v $
649  * Revision 1.19 2012/11/16 21:19:06 prindle
650  * Moved EventCuts, TrackCuts to EventReader. Affects most readers.
651  * Added support to write and read EStructEvents.
652  * Cuts: 3D histo support, switch to control filling of histogram for reading EStructEvents
653  * EventCuts: A few new cuts
654  * MuDstReader: Add 2D to some histograms, treat ToFCut, PrimaryCuts, VertexRadius histograms like other cut histograms.
655  * QAHists: Add refMult
656  * TrackCuts: Add some hijing cuts.
657  *
658  * Revision 1.18 2011/08/02 20:31:25 prindle
659  * Change string handling
660  * Added event cuts for VPD, good fraction of global tracks are primary, vertex
661  * found only from tracks on single side of TPC, good fraction of primary tracks have TOF hits..
662  * Added methods to check if cuts imposed
663  * Added 2010 200GeV and 62 GeV, 2011 19 GeV AuAu datasets, 200 GeV pp2pp 2009 dataset.
664  * Added TOF vs. dEdx vs. p_t histograms
665  * Fix participant histograms in QAHists.
666  * Added TOFEMass cut in TrackCuts although I think we want to supersede this.
667  *
668  * Revision 1.17 2010/09/02 21:20:09 prindle
669  * Cuts: Add flag to not fill histograms. Important when scanning files for sorting.
670  * EventCuts: Add radius cut on vertex, ToF fraction cut. Merge 2004 AuAu 200 GeV datasets.
671  * Add 7, 11 and 39 GeV dataset selections
672  * MuDstReader: Add 2D histograms for vertex radius and ToF fraction cuts.
673  * Modify countGoodTracks to return number of dEdx and ToF pid identified tracks.
674  * Include code to set track pid information from Dst.
675  * QAHists: New ToF QA hists. Modify dEdx to include signed momentum.
676  *
677  * Revision 1.16 2010/06/23 22:29:41 prindle
678  * Hadd typo of 2004B instead of B2004 in EventCuts.cxx
679  * Added a couple of histograms in QAHists.
680  *
681  * Revision 1.15 2010/03/02 21:43:38 prindle
682  * Use outerHelix() for global tracks
683  * Add sensible triggerId histograms
684  * Starting to add support to sort events (available for Hijing)
685  *
686  * Revision 1.14 2009/05/08 00:04:22 prindle
687  * Just putting Yuri's TMath back in
688  *
689  * Revision 1.13 2008/12/02 23:35:33 prindle
690  * Added code for pileup rejection in EventCuts and MuDstReader.
691  * Modified trigger selections for some data sets in EventCuts.
692  *
693  * Revision 1.12 2008/03/19 22:01:59 prindle
694  * Updated some dataset definitions.
695  *
696  * Revision 1.11 2007/11/27 22:59:57 prindle
697  * Added cucu22 GeV data set as possible input
698  *
699  * Revision 1.10 2007/11/26 19:52:23 prindle
700  * Add cucu62, cucu200 2007ib production datasets.
701  * Included vertex cuts for case of ranked vertices. (Pass muDst pointer to EventCuts)
702  * Add n^(1/4) histograms to QAHists
703  *
704  * Revision 1.9 2006/10/02 22:14:08 prindle
705  * Changed for QA histograms. Also addition of ppMinBiasYear5 as a data sample.
706  *
707  * Revision 1.8 2006/04/25 21:02:50 msd
708  * Added AuAu200GeVCentral2001 and dAu200GeVMinBias2003
709  *
710  * Revision 1.7 2006/04/10 23:40:40 porter
711  * Fixed the minbias trigger definition for the CuCu 200 2005 run
712  *
713  * Revision 1.6 2006/04/04 22:05:05 porter
714  * a handful of changes:
715  * - changed the StEStructAnalysisMaker to contain 1 reader not a list of readers
716  * - added StEStructQAHists object to contain histograms that did exist in macros or elsewhere
717  * - made centrality event cut taken from StEStructCentrality singleton
718  * - put in ability to get any max,min val from the cut class - one must call setRange in class
719  *
720  * Revision 1.5 2006/02/22 22:03:17 prindle
721  * Removed all references to multRef
722  *
723  * Revision 1.4 2005/09/14 17:08:33 msd
724  * Fixed compiler warnings, a few tweaks and upgrades
725  *
726  * Revision 1.3 2004/09/24 01:41:41 prindle
727  * Allow for cuts to be defined by character strings. I use this to select trigger
728  * cuts appropriate for run periods
729  *
730  * Revision 1.2 2004/04/15 18:45:35 msd
731  * Removed hard-wired range of numTrack cut histograms
732  *
733  * Revision 1.1 2003/10/15 18:20:32 porter
734  * initial check in of Estruct Analysis maker codes.
735  *
736  *
737  *********************************************************************/
738 
739 
740 
741 
742 
743 
744 
745 
746 
static StMuPrimaryVertex * primaryVertex()
return pointer to current primary vertex
Definition: StMuDst.h:322
static StMuEvent * event()
returns pointer to current StMuEvent (class holding the event wise information, e.g. event number, run number)
Definition: StMuDst.h:320