14 #include "StEStructCutBin.h"
15 #include "StEStructPairCuts.h"
28 StEStructCutBin::~StEStructCutBin(){};
30 void StEStructCutBin::setMode(
int mode){
38 if (mcutModeName && mode==mcutMode) silent =
true;
39 if (!silent && mode!=mcutMode) cout<<
" Changing cut mode from mode="<<mcutMode<<
" to mode="<<mode<<endl;
41 if(mcutModeName)
delete [] mcutModeName;
42 mcutModeName=
new char[128];
49 strcpy(mcutModeName,
" No Cut Binning ");
56 strcpy(mcutModeName,
" yt1 x yt2 Cut Binning, 27 bins ");
63 strcpy(mcutModeName,
"Simple soft/hard same-side/away-side, 6 bins");
70 strcpy(mcutModeName,
" yt_sum, yt_delta, same-side, away-side Cut Binning, 16 bins");
77 strcpy(mcutModeName,
" yt_sum, yt_delta, same-side, away-side, minijet fine binning, 16 bins");
86 strcpy(mcutModeName,
" identified particles, 10 bins");
93 strcpy(mcutModeName,
" event-wise z-vertex binning, 10 bins");
100 strcpy(mcutModeName,
" event-wise z-vertex binning & soft/hard SS/AS, 60 bins");
107 strcpy(mcutModeName,
" Checking LS pair cuts for soft-hard combinations, 6 bins");
114 strcpy(mcutModeName,
" only p_t binning");
121 strcpy(mcutModeName,
" yt x yt dependence, 45 bins");
126 cout<<
"Warning: cut bin mode="<<mode<<
" not defined "<<endl;
132 if (!silent) cout<<
" Cut Bin Mode = "<<printCutBinName()<<endl;
134 int StEStructCutBin::getMode() {
137 void StEStructCutBin::setCutBinHistMode(
int mode) {
138 mcutBinHistMode = mode;
140 int StEStructCutBin::getCutBinHistMode() {
153 static int __yt1_x_yt2_bin[7]={0,7,13,18,22,25,27};
157 int imin,imax,istore;
166 return __yt1_x_yt2_bin[imin]+imax-imin;
181 float yt1=pc->Track1()->Yt();
182 float yt2=pc->Track2()->Yt();
185 if (yt1+yt2 <= 3.3) iyt = 0;
186 if (yt1>=2 && yt2>=2) iyt = 1;
188 if (pc->sameSide()) idp = 0;
191 retVal = iyt + 3*idp;
218 static int __yt_deta_dphi_bin[4][4]={ {0,1,2,3}, {4,5,6,7}, {8,9,10,11}, {12,13,14,15} };
224 float yt1=pc->Track1()->Yt();
225 float yt2=pc->Track2()->Yt();
228 if(yt1<1.99 && yt2<1.99){
230 }
else if( ((1.99<yt1) && (yt1<2.383)) && ((1.99<yt2) && (yt2<2.383))) {
232 }
else if(yt1>=2.383 && yt2>=2.383){
238 float deta=fabs(pc->DeltaEta());
243 if(deta<0.5*mMaxDEta) {
257 return __yt_deta_dphi_bin[iyt][idedp];
264 if (getCutBinMode3(pc) < 12) {
275 if (getCutBinMode3(pc) < 12) {
278 if (pc->Track1()->Yt() > pc->Track2()->Yt()) {
283 int StEStructCutBin::notSymmetrizedXX3(
int cutBin,
int pairCharge) {
312 if( !pc->sameSide() ) iside+=16;
313 if(yt1<=1.8 && yt2<=1.8)
return iside;
316 float ytdel=fabs(yt1-yt2);
318 if(ytdel<1.8 && ytsum>4.0){
319 ival=(int)floor((ytsum-4.0)/0.25)+1;
321 if(ival==12 || ival==13){
327 }
else if(yt1>2.0 && yt2>2.0){
360 int mode[4][4] = {{9, 0, 4, 7}, {0, 1, 2, 3}, {4, 2, 5, 6}, {7, 3, 6, 8}};
362 int it1 = pc->Track1()->PID();
363 int it2 = pc->Track2()->PID();
364 if (it1 < 0 || 3 < it1) {
367 if (it2 < 0 || 3 < it2) {
370 int iBin = mode[it1][it2];
372 if (!mcutBinHistMode) {
377 double e, e1, e2, p1, p2, p[3], m, m1, m2;
378 p1 = pc->Track1()->Ptot();
379 p2 = pc->Track2()->Ptot();
380 p[0] = pc->Track1()->Px() + pc->Track2()->Px();
381 p[1] = pc->Track1()->Py() + pc->Track2()->Py();
382 p[2] = pc->Track1()->Pz() + pc->Track2()->Pz();
383 float Mass[] = {0.1396, 0.1396, 0.497, 0.9383};
384 float Mass2[] = {0.01949, 0.01949, 0.247, 0.880};
394 e1 = sqrt(p1*p1 + Mass2[it1]);
395 e2 = sqrt(p2*p2 + Mass2[it2]);
398 m = sqrt(e*e - p[0]*p[0] - p[1]*p[1] - p[2]*p[2]);
400 mHCutBinHists[pairCase][iBin]->Fill(m - m1 - m2 + 0.1);
402 e1 = sqrt(p1*p1 + Mass2[1]);
403 e2 = sqrt(p2*p2 + Mass2[1]);
405 m = sqrt(e*e - p[0]*p[0] - p[1]*p[1] - p[2]*p[2]) - Mass[1] - Mass[1] + 0.1;
406 mHCutBinHists[pairCase][10]->Fill(m);
415 int ic1 = pc->Track1()->Charge();
416 int ic2 = pc->Track2()->Charge();
430 int ip1 = pc->Track1()->PID();
431 int ip2 = pc->Track2()->PID();
455 if ( pc->Track1()->Charge() != pc->Track2()->Charge() ) {
458 int ip1 = pc->Track1()->PID();
459 int ip2 = pc->Track2()->PID();
471 int ipid1 = pc->Track1()->PID();
472 int ipid2 = pc->Track2()->PID();
473 if (ipid1 == ipid2) {
474 if ( (-1 == pc->Track1()->Charge()) &&
475 (+1 == pc->Track2()->Charge()) ) {
485 int StEStructCutBin::notSymmetrizedXX5(
int cutBin,
int pairCharge) {
488 if (1==cutBin || 5==cutBin || 8==cutBin || 9==cutBin) {
489 if (0==pairCharge || 3==pairCharge) {
495 void StEStructCutBin::initCutBinHists5(){
496 if (mcutBinHistMode) {
498 const char *types[] = {
"Sibpp",
"Sibpm",
"Sibmp",
"Sibmm",
499 "Mixpp",
"Mixpm",
"Mixmp",
"Mixmm"};
500 const char *bases[] = {
"piAll",
"pipi",
"piK",
"pip",
501 "KAll",
"KK",
"Kp",
"pAll",
503 for (
int pairCase=0;pairCase<8;pairCase++) {
504 mHCutBinHists[pairCase] =
new TH1D*[11];
505 for (
int it=0;it<11;it++) {
508 hname += types[pairCase];
509 mHCutBinHists[pairCase][it] =
new TH1D(hname.Data(),hname.Data(),500,0.0,3.0);
515 void StEStructCutBin::writeCutBinHists5() {
516 if (mcutBinHistMode) {
517 for (
int pairCase=0;pairCase<8;pairCase++) {
518 if (mHCutBinHists[pairCase]) {
519 for (
int it=0;it<11;it++) {
520 if (mHCutBinHists[pairCase][it]) {
521 mHCutBinHists[pairCase][it]->Write();
523 delete mHCutBinHists[pairCase][it];
524 mHCutBinHists[pairCase][it] = 0;
528 delete [] mHCutBinHists[pairCase];
529 mHCutBinHists[pairCase] = 0;
553 if (zbin<0 || zbin>9)
return 0;
558 float yt1=pc->Track1()->Yt();
559 float yt2=pc->Track2()->Yt();
562 if (yt1+yt2 <= 3.3) iyt = 0;
563 if (yt1>=2 && yt2>=2) iyt = 1;
565 if (pc->sameSide()) idp = 0;
568 retVal = zbin*6 + iyt + 3*idp;
592 float yt1=pc->Track1()->Yt();
593 float yt2=pc->Track2()->Yt();
596 if(yt1<1.8 && yt2<1.8){
599 }
else if(yt1<1.8 && yt2<2.2){
601 }
else if(yt1<2.2 && yt2<1.8){
603 }
else if(yt1<2.2 && yt2<2.2){
623 if (getCutBinMode8(pc) < 3) {
634 if (getCutBinMode8(pc) < 3) {
637 if (pc->Track1()->Yt() > pc->Track2()->Yt()) {
642 int StEStructCutBin::notSymmetrizedXX8(
int cutBin,
int pairCharge) {
657 int mode[6][6] = {{ 0, 6, 11, 15, 18, 20},
658 { 6, 1, 7, 12, 16, 19},
659 {11, 7, 2, 8, 13, 17},
660 {15, 12, 8, 3, 9, 14},
661 {18, 16, 13, 9, 4, 10},
662 {20, 19, 17, 14, 10, 5}};
665 float pt1 = pc->Track1()->Pt();
666 float pt2 = pc->Track2()->Pt();
671 }
else if (pt1 < 1.0) {
673 }
else if (pt1 < 2.0) {
675 }
else if (pt1 < 3.0) {
677 }
else if (pt1 < 4.0) {
684 }
else if (pt2 < 1.0) {
686 }
else if (pt2 < 2.0) {
688 }
else if (pt2 < 3.0) {
690 }
else if (pt2 < 4.0) {
695 return mode[ipt1][ipt2];
703 int StEStructCutBin::notSymmetrizedXX9(
int cutBin,
int pairCharge) {
725 float yt1=pc->Track1()->Yt();
726 float yt2=pc->Track2()->Yt();
729 int binMap[9][9] = { 0, 1, 2, 3, 4, 5, 6, 7, 8,
730 1, 9, 10, 11, 12, 13, 14, 15, 16,
731 2, 10, 17, 18, 19, 20, 21, 22, 23,
732 3, 11, 18, 24, 25, 26, 27, 28, 29,
733 4, 12, 19, 25, 30, 31, 32, 33, 34,
734 5, 13, 20, 26, 31, 35, 36, 37, 38,
735 6, 14, 21, 27, 32, 36, 39, 40, 41,
736 7, 15, 22, 28, 33, 37, 40, 42, 43,
737 8, 16, 23, 29, 34, 38, 41, 43, 44};
739 int i1 = ((int) ((yt1-1.)/.4));
740 int i2 = ((int) ((yt2-1.)/.4));
745 retVal = binMap[i1][i2];