13 #include "StEStructEventCuts.h"
21 StEStructEventCuts::StEStructEventCuts(
const char* cutfileName):
StEStructCuts(cutfileName) { init(); };
23 StEStructEventCuts::~StEStructEventCuts() {};
25 void StEStructEventCuts::init() {
26 mtrgByRunPeriod=
false;
27 strcpy(mcutTypeName,
"Event");
36 void StEStructEventCuts::initCuts(){
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;
50 void StEStructEventCuts::initNames(){
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");
63 bool StEStructEventCuts::loadBaseCuts(
const char* name,
const char** vals,
int nvals){
65 if (!strcmp(name,mtWordName.name)) {
67 sscanf(vals[0],
"%s\t",mRunPeriod);
71 if (!strcmp(
"AuAu200GeVMinBias2001",mRunPeriod)) {
76 }
else if (!strcmp(
"AuAu200GeVCentral2001",mRunPeriod)) {
81 }
else if (!strcmp(
"AuAu200GeVProductionMinBias2004",mRunPeriod) ||
82 !strcmp(
"AuAu200GeVProductionMinBiasA2004",mRunPeriod) ||
83 !strcmp(
"AuAu200GeVProductionMinBiasB2004",mRunPeriod)) {
91 }
else if (!strcmp(
"AuAu200GeVProductionLow2004",mRunPeriod)) {
97 }
else if (!strcmp(
"AuAu200GeVProductionMid2004",mRunPeriod)) {
103 }
else if (!strcmp(
"AuAu200GeVProductionHigh2004",mRunPeriod)) {
109 }
else if (!strcmp(
"AuAu200GeVMinBias2010",mRunPeriod)) {
114 }
else if (!strcmp(
"AuAu200GeVMinBias2011",mRunPeriod)) {
119 }
else if (!strcmp(
"2007ProductionMinBias",mRunPeriod)) {
124 }
else if (!strcmp(
"2007Production2",mRunPeriod)) {
129 }
else if (!strcmp(
"2007LowLuminosity",mRunPeriod)) {
134 }
else if (!strcmp(
"AuAu62GeVMinBias2010",mRunPeriod)) {
139 }
else if (!strcmp(
"AuAu62GeVMinBias2004",mRunPeriod)) {
144 }
else if (!strcmp(
"AuAu39GeVMinBias2010",mRunPeriod)) {
149 }
else if (!strcmp(
"AuAu27GeVMinBias2011",mRunPeriod)) {
154 }
else if (!strcmp(
"AuAu19GeVMinBias2011",mRunPeriod)) {
159 }
else if (!strcmp(
"AuAu11GeVMinBias2010",mRunPeriod)) {
165 }
else if (!strcmp(
"AuAu7GeVMinBias2010",mRunPeriod)) {
170 }
else if (!strcmp(
"CuCu200GeVProductionMinBias2005",mRunPeriod)) {
175 }
else if (!strcmp(
"CuCu200GeVProductionMinBias2007ic",mRunPeriod)) {
180 }
else if (!strcmp(
"CuCu62GeVProductionMinBias2005",mRunPeriod)) {
185 }
else if (!strcmp(
"CuCu62GeVProductionMinBias2007ic",mRunPeriod)) {
190 }
else if (!strcmp(
"CuCu22GeVProductionMinBiasP05if",mRunPeriod)) {
195 }
else if (!strcmp(
"dAu200GeVMinBias2003",mRunPeriod)) {
200 }
else if (!strcmp(
"ppProductionMinBias2005",mRunPeriod)) {
205 }
else if (!strcmp(
"pp400MinBias2005",mRunPeriod)) {
210 }
else if (!strcmp(
"pp2006MinBias2006",mRunPeriod)) {
215 }
else if (!strcmp(
"pp2pp_VPDMB_2009",mRunPeriod)) {
220 }
else if (!strcmp(
"ppProductionMB622006",mRunPeriod)) {
225 }
else if (!strcmp(
"production2009_200GeV_Single",mRunPeriod)) {
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());
268 mtrgByRunPeriod=
true;
270 cout <<
" Warning: unknown run period " << name << endl;
273 mtWord[0]=(
unsigned int)atoi(vals[0]);
274 mtWord[1]=(
unsigned int)atoi(vals[1]);
275 if (mtWord[0]==mtWord[1]) {
277 arange[0]=mtWord[0]-0.05*mtWord[0];
278 arange[1]=mtWord[0]+0.05*mtWord[0];
279 mtWordName.idx=createCutHists(name,arange);
281 mtWordName.idx=createCutHists(name,mtWord);
284 setRange(mtWordName.name,mtWord[0],mtWord[1]);
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]);
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]);
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]);
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]);
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]);
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]);
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]);
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]);
356 bool StEStructEventCuts::goodTrigger(
StMuDst* muDst) {
359 if (mtrgByRunPeriod) {
361 if (!strcmp(
"CuCu22GeVProductionMinBiasP05if",mRunPeriod)) {
364 }
else if (!strcmp(
"CuCu62GeVProductionMinBias2005",mRunPeriod)) {
365 if (muEvent->triggerIdCollection().nominal().isTrigger(76007) ||
366 muEvent->triggerIdCollection().nominal().isTrigger(76011)) {
369 }
else if (!strcmp(
"CuCu200GeVProductionMinBias2005",mRunPeriod)) {
370 if (muEvent->triggerIdCollection().nominal().isTrigger(66007)) {
373 }
else if (!strcmp(
"CuCu62GeVProductionMinBias2007ic",mRunPeriod)) {
376 if (muEvent->runNumber()<6069077) {
377 if (muEvent->triggerIdCollection().nominal().isTrigger(76002) ||
378 muEvent->triggerIdCollection().nominal().isTrigger(76011)) {
379 return goodVertexTopology(muDst);
382 if (muEvent->triggerIdCollection().nominal().isTrigger(76007) ||
383 muEvent->triggerIdCollection().nominal().isTrigger(76011)) {
384 return goodVertexTopology(muDst);
387 }
else if (!strcmp(
"CuCu200GeVProductionMinBias2007ic",mRunPeriod)) {
388 if (muEvent->triggerIdCollection().nominal().isTrigger(66007)) {
389 return goodVertexTopology(muDst);
391 }
else if (!strcmp(
"2007ProductionMinBias",mRunPeriod)) {
397 if (muEvent->triggerIdCollection().nominal().isTrigger(200001) ||
398 muEvent->triggerIdCollection().nominal().isTrigger(200003) ||
399 muEvent->triggerIdCollection().nominal().isTrigger(200020)) {
402 if (muEvent->triggerIdCollection().nominal().isTrigger(200013)) {
403 return goodVertexTopology(muDst);
405 }
else if (!strcmp(
"2007Production2",mRunPeriod)) {
410 if (muEvent->triggerIdCollection().nominal().isTrigger(200001) ||
411 muEvent->triggerIdCollection().nominal().isTrigger(200003) ||
412 muEvent->triggerIdCollection().nominal().isTrigger(200020)) {
415 if (muEvent->triggerIdCollection().nominal().isTrigger(200013)) {
416 return goodVertexTopology(muDst);
418 }
else if (!strcmp(
"2007LowLuminosity",mRunPeriod)) {
420 if (muEvent->triggerIdCollection().nominal().isTrigger(200001) ||
421 muEvent->triggerIdCollection().nominal().isTrigger(200003) ||
422 muEvent->triggerIdCollection().nominal().isTrigger(200013)) {
425 if (muEvent->triggerIdCollection().nominal().isTrigger(200020)) {
426 return goodVertexTopology(muDst);
428 }
else if (!strcmp(
"AuAu200GeVProductionMinBias2004",mRunPeriod)) {
429 if (muEvent->runNumber() < 5023099) {
430 if (muEvent->triggerIdCollection().nominal().isTrigger(15003)) {
433 }
else if (muEvent->runNumber() > 503098) {
434 if (muEvent->triggerIdCollection().nominal().isTrigger(15007)) {
438 }
else if (!strcmp(
"AuAu200GeVProductionMinBiasA2004",mRunPeriod)) {
439 if (muEvent->runNumber() < 5023099) {
440 if (muEvent->triggerIdCollection().nominal().isTrigger(15003)) {
444 }
else if (!strcmp(
"AuAu200GeVProductionMinBiasB2004",mRunPeriod)) {
445 if (muEvent->runNumber() > 503098) {
446 if (muEvent->triggerIdCollection().nominal().isTrigger(15007)) {
450 }
else if (!strcmp(
"AuAu200GeVProductionLow2004",mRunPeriod)) {
451 if (muEvent->runNumber() > 5042040) {
452 if (muEvent->triggerIdCollection().nominal().isTrigger(15007)) {
456 }
else if (!strcmp(
"AuAu200GeVProductionMid2004",mRunPeriod)) {
457 if (muEvent->runNumber() > 5042040) {
458 if (muEvent->triggerIdCollection().nominal().isTrigger(15007)) {
462 }
else if (!strcmp(
"AuAu200GeVProductionHigh2004",mRunPeriod)) {
463 if (muEvent->runNumber() > 5042040) {
464 if (muEvent->triggerIdCollection().nominal().isTrigger(15007)) {
468 }
else if (!strcmp(
"AuAu200GeVMinBias2010",mRunPeriod)) {
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)) {
481 if (muEvent->triggerIdCollection().nominal().isTrigger(9)) {
483 }
else if (muEvent->triggerIdCollection().nominal().isTrigger(260001)) {
485 }
else if (muEvent->triggerIdCollection().nominal().isTrigger(260011)) {
487 }
else if (muEvent->triggerIdCollection().nominal().isTrigger(260014)) {
489 }
else if (muEvent->triggerIdCollection().nominal().isTrigger(260021)) {
491 }
else if (muEvent->triggerIdCollection().nominal().isTrigger(260024)) {
493 }
else if (muEvent->triggerIdCollection().nominal().isTrigger(260031)) {
497 }
else if (!strcmp(
"AuAu200GeVMinBias2011",mRunPeriod)) {
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)) {
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)) {
513 }
else if (!strcmp(
"AuAu62GeVMinBias2004",mRunPeriod)) {
514 if (((muEvent->triggerIdCollection().nominal().isTrigger(35004) ||
515 muEvent->triggerIdCollection().nominal().isTrigger(35007))
517 ((muEvent->triggerIdCollection().nominal().isTrigger(35001) ||
518 muEvent->triggerIdCollection().nominal().isTrigger(35009) )
519 && muEvent->ctbMultiplicity()>15))) {
522 }
else if (!strcmp(
"AuAu39GeVMinBias2010",mRunPeriod)) {
523 if (muEvent->triggerIdCollection().nominal().isTrigger(280001)) {
526 }
else if (!strcmp(
"AuAu27GeVMinBias2011",mRunPeriod)) {
527 if (muEvent->triggerIdCollection().nominal().isTrigger(360001)) {
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)) {
536 }
else if (!strcmp(
"AuAu11GeVMinBias2010",mRunPeriod)) {
537 if (muEvent->triggerIdCollection().nominal().isTrigger(310014)) {
540 }
else if (!strcmp(
"AuAu7GeVMinBias2010",mRunPeriod)) {
541 if (muEvent->triggerIdCollection().nominal().isTrigger(290001) ||
542 muEvent->triggerIdCollection().nominal().isTrigger(290004)) {
545 }
else if (!strcmp(
"AuAu200GeVMinBias2001",mRunPeriod)) {
547 if (l3.unbiasedTrigger()) {
548 unsigned int t = muEvent->l0Trigger().triggerWord();
553 }
else if (!strcmp(
"AuAu200GeVCentral2001",mRunPeriod)) {
555 if (l3.unbiasedTrigger()) {
556 unsigned int t = muEvent->l0Trigger().triggerWord();
561 }
else if (!strcmp(
"dAu200GeVMinBias2003",mRunPeriod)) {
562 if (muEvent->triggerIdCollection().nominal().isTrigger(2001) ||
563 muEvent->triggerIdCollection().nominal().isTrigger(2003)) {
566 }
else if(!strcmp(
"ppMinBias",mRunPeriod)){
567 if(muEvent->triggerIdCollection().nominal().isTrigger(8192)) {
570 }
else if(!strcmp(
"ppProductionMinBias2005",mRunPeriod)){
571 if(muEvent->triggerIdCollection().nominal().isTrigger(96011) ||
572 muEvent->triggerIdCollection().nominal().isTrigger(106011)) {
575 }
else if(!strcmp(
"pp400MinBias2005",mRunPeriod)){
577 if(muEvent->triggerIdCollection().nominal().isTrigger(96011) ||
578 muEvent->triggerIdCollection().nominal().isTrigger(106011)) {
581 }
else if(!strcmp(
"pp2006MinBias2006",mRunPeriod)){
582 if(muEvent->triggerIdCollection().nominal().isTrigger(117001)) {
585 }
else if(!strcmp(
"pp2pp_VPDMB_2009",mRunPeriod)){
586 if(muEvent->triggerIdCollection().nominal().isTrigger(7) ||
587 muEvent->triggerIdCollection().nominal().isTrigger(250107)) {
590 }
else if(!strcmp(
"production2009_200GeV_Single",mRunPeriod)){
591 if(muEvent->triggerIdCollection().nominal().isTrigger(240025) &&
595 }
else if(!strcmp(
"ppProductionMB622006",mRunPeriod)){
596 if(muEvent->triggerIdCollection().nominal().isTrigger(147001)) {
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]) ) ;
613 bool StEStructEventCuts::goodVertexTopology(
StMuDst* muDst) {
626 void StEStructEventCuts::printCutStats(ostream& ofs){
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;
static StMuPrimaryVertex * primaryVertex()
return pointer to current primary vertex
static StMuEvent * event()
returns pointer to current StMuEvent (class holding the event wise information, e.g. event number, run number)