StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StEStructCutBin.cxx
1 /**********************************************************************
2  *
3  * $Id: StEStructCutBin.cxx,v 1.17 2012/11/16 21:22:27 prindle Exp $
4  *
5  * Author: Jeff Porter
6  *
7  **********************************************************************
8  *
9  * Description: Cut-bins for building histograms based on kinematic selections
10  * Singleton class with several implementations based on
11  * a mode ID
12  *
13  ***********************************************************************/
14 #include "StEStructCutBin.h"
15 #include "StEStructPairCuts.h"
16 
17 ClassImp(StEStructCutBin)
18 
19 
20 StEStructCutBin* StEStructCutBin::mInstance=0;
21 
22 StEStructCutBin* StEStructCutBin::Instance(){
23  if(!mInstance) mInstance=new StEStructCutBin();
24  return mInstance;
25 }
26 
27 
28 StEStructCutBin::~StEStructCutBin(){};
29 
30 void StEStructCutBin::setMode(int mode){
31 
32  /* if(mcutModeName && mode!=mcutMode){
33  cout<<" Changing cut mode from mode="<<mcutMode<<" to mode="<<mode<<endl;
34  delete [] mcutModeName;
35  }*/
36 
37  bool silent = false; // do we need to output cutbin info?
38  if (mcutModeName && mode==mcutMode) silent = true;
39  if (!silent && mode!=mcutMode) cout<<" Changing cut mode from mode="<<mcutMode<<" to mode="<<mode<<endl;
40 
41  if(mcutModeName) delete [] mcutModeName;
42  mcutModeName=new char[128];
43 
44  switch(mode){
45  case 0:
46  {
47  mnumBins=1;
48  mnumParentBins=1;
49  strcpy(mcutModeName," No Cut Binning ");
50  break;
51  }
52  case 1:
53  {
54  mnumBins=27;
55  mnumParentBins=1;
56  strcpy(mcutModeName," yt1 x yt2 Cut Binning, 27 bins ");
57  break;
58  }
59  case 2:
60  {
61  mnumBins=6;
62  mnumParentBins=1;
63  strcpy(mcutModeName,"Simple soft/hard same-side/away-side, 6 bins"); // *** new change
64  break;
65  }
66  case 3:
67  {
68  mnumBins=16;
69  mnumParentBins=3;
70  strcpy(mcutModeName," yt_sum, yt_delta, same-side, away-side Cut Binning, 16 bins");
71  break;
72  }
73  case 4:
74  {
75  mnumBins=32;
76  mnumParentBins=1;
77  strcpy(mcutModeName," yt_sum, yt_delta, same-side, away-side, minijet fine binning, 16 bins");
78  break;
79  }
80  case 5:
81  {
82  // mnumBins=14;
83  mnumBins=10;
84  mnumParentBins=4;
85  // strcpy(mcutModeName," same-side, away-side, identified particles, 14 bins");
86  strcpy(mcutModeName," identified particles, 10 bins");
87  break;
88  }
89  case 6:
90  {
91  mnumBins=10;
92  mnumParentBins=1;
93  strcpy(mcutModeName," event-wise z-vertex binning, 10 bins");
94  break;
95  }
96  case 7:
97  {
98  mnumBins=60;
99  mnumParentBins=1;
100  strcpy(mcutModeName," event-wise z-vertex binning & soft/hard SS/AS, 60 bins");
101  break;
102  }
103  case 8:
104  {
105  mnumBins=6;
106  mnumParentBins=3;
107  strcpy(mcutModeName," Checking LS pair cuts for soft-hard combinations, 6 bins");
108  break;
109  }
110  case 9:
111  {
112  mnumBins=21;
113  mnumParentBins=6;
114  strcpy(mcutModeName," only p_t binning");
115  break;
116  }
117  case 10:
118  {
119  mnumBins=45;
120  mnumParentBins=1;
121  strcpy(mcutModeName," yt x yt dependence, 45 bins");
122  break;
123  }
124  default:
125  {
126  cout<<"Warning: cut bin mode="<<mode<<" not defined "<<endl;
127  break;
128  }
129  }
130 
131  mcutMode=mode;
132  if (!silent) cout<<" Cut Bin Mode = "<<printCutBinName()<<endl;
133 }
134 int StEStructCutBin::getMode() {
135  return mcutMode;
136 }
137 void StEStructCutBin::setCutBinHistMode(int mode) {
138  mcutBinHistMode = mode;
139 }
140 int StEStructCutBin::getCutBinHistMode() {
141  return mcutMode;
142 }
143 //------------------------- Mode=0 ----------------------------------------
144 // no cut
145 
146 //------------------------ Mode=1 -------------------------------------------
147 
148 // ytyt space in even bins:
149 // - 7 bins from 1.0-4.5 (>4.5 included in last bin)
150 // - diagonal symmetry
151 // - 6 bins (7-12), 5 bins (13-17), 4 bins( 19-22), 2 bins (23-25), 1 bin (27)
152 
153 static int __yt1_x_yt2_bin[7]={0,7,13,18,22,25,27};
154 
155 int StEStructCutBin::getCutBinMode1(StEStructPairCuts* pc){
156 
157  int imin,imax,istore;
158  imin=((StEStructTrack*)pc->Track1())->getYtBin();
159  imax=((StEStructTrack*)pc->Track2())->getYtBin();
160 
161  if( imin > imax ){
162  istore=imin;
163  imin=imax;
164  imax=istore;
165  }
166  return __yt1_x_yt2_bin[imin]+imax-imin;
167 }
168 
169 //------------------------ Mode=2 -------------------------------------------
170 
171 // now trying simple soft/hard SS/AS binning
172 // using cut from pp ytxyt paper with soft == yt_sum < 3.3
173 // should also require yt > 2 for hard, but I don't want to make a third case right now
174 // 0 = soft SS; 1 = hard SS; 2 = other SS; 3 = soft AS; 4 = hard AS; 5 = other AS;
175 
176 int StEStructCutBin::getCutBinMode2(StEStructPairCuts* pc){
177 
178  int retVal;
179  int iyt, idp;
180 
181  float yt1=pc->Track1()->Yt();
182  float yt2=pc->Track2()->Yt();
183 
184  iyt = 2;
185  if (yt1+yt2 <= 3.3) iyt = 0;
186  if (yt1>=2 && yt2>=2) iyt = 1;
187 
188  if (pc->sameSide()) idp = 0;
189  else idp = 1;
190 
191  retVal = iyt + 3*idp;
192 
193  return retVal;
194 
195 }
196 
197 
198 
199 //------------------------ Mode=3 -------------------------------------------
200 //
201 // --> now modified for
202 // soft= yt<1.99 = 0.5 GeV
203 // neck=1.99<=yt<=2.383 = 0.75 GeV
204 // hard=yt>2.383
205 // rest .. is the rest in the 2pt space ... all pt's satisfy it
206 
207 // ytyt plot deta,dphi
208 // 0-3 = soft
209 // 4-7 = 'neck'
210 // 8-11 = hard
211 // 12-15 = rest
212 // 0,4,8,12 away-side large deta
213 // 1,5,9,13 away-side small deta
214 // 2,6,10,14 same-side small deta
215 // 3,7,11,15 same-side large deta
216 
217 //static int __yt_deta_dphi_bin[4][4]={0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15};
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} }; // remove compiler warning
219 
220 int StEStructCutBin::getCutBinMode3(StEStructPairCuts* pc){
221 
222  int iyt;
223 
224  float yt1=pc->Track1()->Yt();
225  float yt2=pc->Track2()->Yt();
226 
227  // These numbers are also used in StEStructCutBin::getParentBin (change both)
228  if(yt1<1.99 && yt2<1.99){
229  iyt=0;
230  } else if( ((1.99<yt1) && (yt1<2.383)) && ((1.99<yt2) && (yt2<2.383))) {
231  iyt=1;
232  } else if(yt1>=2.383 && yt2>=2.383){
233  iyt=2;
234  } else {
235  iyt=3;
236  }
237 
238  float deta=fabs(pc->DeltaEta());
239  // float dphi=fabs(pc->DeltaPhi());
240 
241  int idedp;
242 
243  if(deta<0.5*mMaxDEta) {
244  if(pc->sameSide()){ // dphi<M_PI/2.0 || dphi> 1.5*M_PI){
245  idedp=2;
246  } else {
247  idedp=1;
248  }
249  } else {
250  if(pc->sameSide()){ // dphi<M_PI/2. || dphi> 1.5*M_PI){
251  idedp=3;
252  } else {
253  idedp=0;
254  }
255  }
256 
257  return __yt_deta_dphi_bin[iyt][idedp];
258 }
259 int StEStructCutBin::symmetrizeXX3(StEStructPairCuts* pc) {
260 
261  /*
262  * Off diagonal yt-yt bins are not symmetrized.
263  */
264  if (getCutBinMode3(pc) < 12) {
265  return 1;
266  }
267  return 0;
268 }
269 int StEStructCutBin::switchXX3(StEStructPairCuts* pc) {
270 
271  /*
272  * For soft-neck and soft-hard want soft first.
273  * For neck-hard want neck first.
274  */
275  if (getCutBinMode3(pc) < 12) {
276  return 0;
277  }
278  if (pc->Track1()->Yt() > pc->Track2()->Yt()) {
279  return 1;
280  }
281  return 0;
282 }
283 int StEStructCutBin::notSymmetrizedXX3(int cutBin, int pairCharge) {
284  // Used in HAdd.
285  // Return true if XX histogram was not symmetrized (i.e. phi,phi).
286  // This is case for off-diagonal Yt-Yt.
287  if (cutBin < 12) {
288  return 0;
289  }
290  return 1;
291 }
292 //------------------------ Mode=4 -------------------------------------------
293 
294 /*
295  ns, as:
296 
297  0,16 = soft (yt<1.8)
298  1-13,17-29 = dyt<1.8, syt>=4.0, binned in 0.25 up to 6.75 then by 0.5
299  14,30 = yt>2.0, dyt>2.0
300  15,31 = rest
301 
302 */
303 
304 int StEStructCutBin::getCutBinMode4(StEStructPairCuts* pc){
305 
306  float yt1=((StEStructTrack*)pc->Track1())->Yt();
307  float yt2=((StEStructTrack*)pc->Track2())->Yt();
308 
309  // float dphi=fabs(pc->DeltaPhi());
310  int iside=0;
311 
312  if( !pc->sameSide() ) iside+=16; // away-side
313  if(yt1<=1.8 && yt2<=1.8) return iside;
314 
315  float ytsum=yt1+yt2;
316  float ytdel=fabs(yt1-yt2);
317  int ival=0;
318  if(ytdel<1.8 && ytsum>4.0){
319  ival=(int)floor((ytsum-4.0)/0.25)+1;
320  if(ival>11){
321  if(ival==12 || ival==13){
322  ival=12;
323  } else {
324  ival=13;
325  }
326  }
327  } else if(yt1>2.0 && yt2>2.0){
328  ival=14;
329  } else {
330  ival=15;
331  }
332 
333  ival+=iside;
334  return ival;
335 }
336 
337 //------------------------ Mode=5 -------------------------------------------
338 //
339 // Particle id using dE/dx plus ToF identification.
340 // If we have both dEdx and ToF information require it to agree.
341 // With ToF we can think of Yt cuts although ToF efficiency appears to be around 60% which might be a problem
342 //
343 // The cut values and their meanings are:
344 // 0 pi-o pair (where o is not pi, K or p)
345 // 1 pi-pi pair.
346 // 2 pi-K pair
347 // 3 pi-p pair
348 // 4 K-o pair (where o is not pi, K or p)
349 // 5 K-K pair
350 // 6 K-p pair
351 // 7 p-o pair (where o is not pi, K or p)
352 // 8 p-p pair
353 // 9 o-o pair (where o is not pi, K or p)
354 //
355 // To check on charge symmetry we have split out the -+ from the +-
356 // in the other parts of the Correlation code.
357 
358 int StEStructCutBin::getCutBinMode5(StEStructPairCuts* pc, int pairCase) {
359 
360  int mode[4][4] = {{9, 0, 4, 7}, {0, 1, 2, 3}, {4, 2, 5, 6}, {7, 3, 6, 8}};
361 
362  int it1 = pc->Track1()->PID();
363  int it2 = pc->Track2()->PID();
364  if (it1 < 0 || 3 < it1) {
365  return -1;
366  }
367  if (it2 < 0 || 3 < it2) {
368  return -2;
369  }
370  int iBin = mode[it1][it2];
371 
372  if (!mcutBinHistMode) {
373  return iBin;
374  }
375 
376  // Might want to make invariant mass cuts.
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};
385  if (9 == iBin) {
386  // For o-o try using m1 = m2 = 0.
387  m1 = 0;
388  m2 = 0;
389  e1 = p1;
390  e2 = p2;
391  } else {
392  m1 = Mass[it1];
393  m2 = Mass[it2];
394  e1 = sqrt(p1*p1 + Mass2[it1]);
395  e2 = sqrt(p2*p2 + Mass2[it2]);
396  }
397  e = e1 + e2;
398  m = sqrt(e*e - p[0]*p[0] - p[1]*p[1] - p[2]*p[2]);
399 
400  mHCutBinHists[pairCase][iBin]->Fill(m - m1 - m2 + 0.1);
401 
402  e1 = sqrt(p1*p1 + Mass2[1]);
403  e2 = sqrt(p2*p2 + Mass2[1]);
404  e = e1 + e2;
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);
407 
408  return iBin;
409 }
410 int StEStructCutBin::ignorePair5(StEStructPairCuts* pc) {
411 
412  /*
413  * Accept pair if charges are the same.
414  */
415  int ic1 = pc->Track1()->Charge();
416  int ic2 = pc->Track2()->Charge();
417  if ( ic1 == ic2 ) {
418  return 0;
419  }
420 
421  /*
422  * Ignore particles with the same pid and opposite charge when the first
423  * charge is negative.
424  * In the main track pair loop every pair will come up twice, the
425  * second time in reversed order and we only want it one time.
426  *
427  * If both particles are un-identified we put pair in ipid=9
428  * bin and treat as identical.
429  */
430  int ip1 = pc->Track1()->PID();
431  int ip2 = pc->Track2()->PID();
432  if (ip1 == ip2) {
433  if (-1 == ic1) {
434  return 1;
435  } else {
436  return 0;
437  }
438  }
439  /*
440  * For particles with different pid and opposite charge we only keep if
441  * o < pi < K < p
442  */
443  if (ip1 < ip2) {
444  return 0;
445  }
446  return 1;
447 }
448 int StEStructCutBin::symmetrizeXX5(StEStructPairCuts* pc) {
449 
450  /*
451  * If particle types and charges are the same we symmetrize.
452  * If both particles are un-identified the pair will be treated
453  * as identical.
454  */
455  if ( pc->Track1()->Charge() != pc->Track2()->Charge() ) {
456  return 0;
457  }
458  int ip1 = pc->Track1()->PID();
459  int ip2 = pc->Track2()->PID();
460  if (ip1 != ip2) {
461  return 0;
462  }
463  return 1;
464 }
465 int StEStructCutBin::switchXX5(StEStructPairCuts* pc) {
466 
467  /*
468  * For different pid order as 0 < pi < K < p.
469  * For same pid want + before -.
470  */
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()) ) {
476  return 1;
477  }
478  return 0;
479  }
480  if (ipid2 < ipid1) {
481  return 1;
482  }
483  return 0;
484 }
485 int StEStructCutBin::notSymmetrizedXX5(int cutBin, int pairCharge) {
486  // Used in HAdd.
487  // Return true if XX histogram was not symmetrized (i.e. phi,phi).
488  if (1==cutBin || 5==cutBin || 8==cutBin || 9==cutBin) {
489  if (0==pairCharge || 3==pairCharge) {
490  return 0;
491  }
492  }
493  return 1;
494 }
495 void StEStructCutBin::initCutBinHists5(){
496  if (mcutBinHistMode) {
497  TString hname;
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",
502  "pp", "OO", "All"};
503  for (int pairCase=0;pairCase<8;pairCase++) {
504  mHCutBinHists[pairCase] = new TH1D*[11];
505  for (int it=0;it<11;it++) {
506  hname = "Mass";
507  hname += bases[it];
508  hname += types[pairCase];
509  mHCutBinHists[pairCase][it] = new TH1D(hname.Data(),hname.Data(),500,0.0,3.0);
510 // cout << "Creating histogram for " << hname.Data() << endl;
511  }
512  }
513  }
514 }
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();
522 // cout << "Deleting histogram [" << pairCase << "][" << it << "]" << endl;
523  delete mHCutBinHists[pairCase][it];
524  mHCutBinHists[pairCase][it] = 0;
525  }
526  }
527 // cout << "Deleting array [" << pairCase << "]" << endl;
528  delete [] mHCutBinHists[pairCase];
529  mHCutBinHists[pairCase] = 0;
530  }
531  }
532  }
533 }
534 
535 
536 //------------------------ Mode=6 -------------------------------------------
537 // Event-wise z-vertex binning
538 // This mode breaks the model of everything else, so it is a hack.
539 // pc object doesn't have event level info, so cutbin number is set in
540 // 2ptanalysis by looking at mixing event buffer index.
541 
542 int StEStructCutBin::getCutBinMode6(StEStructPairCuts*, int zbin){
543  // This function should never be used, can't access z-vertex position from here...
544  return zbin;
545 }
546 
547 //------------------------ Mode=7 -------------------------------------------
548 // Combines modes 2 and 6:
549 // Event-wise z-vertex binning WITH soft/hard SS/AS binning
550 
551 int StEStructCutBin::getCutBinMode7(StEStructPairCuts* pc, int zbin){
552 
553  if (zbin<0 || zbin>9) return 0;
554 
555  int retVal;
556  int iyt, idp;
557 
558  float yt1=pc->Track1()->Yt();
559  float yt2=pc->Track2()->Yt();
560 
561  iyt = 2;
562  if (yt1+yt2 <= 3.3) iyt = 0;
563  if (yt1>=2 && yt2>=2) iyt = 1;
564 
565  if (pc->sameSide()) idp = 0;
566  else idp = 1;
567 
568  retVal = zbin*6 + iyt + 3*idp;
569 
570  return retVal;
571 
572 }
573 
574 //------------------------ Mode=8 -------------------------------------------
575 //
576 // --> Having problem with soft-hard pair cuts.
577 // When tracks have quite different yt then LS has split peak at 0,0
578 
579 // ytyt plot deta,dphi
580 // 0 = soft
581 // 1 = 'neck'
582 // 2 = hard
583 // 3 = soft-neck
584 // 4 = soft-hard
585 // 5 = neck-hard
586 
587 
588 int StEStructCutBin::getCutBinMode8(StEStructPairCuts* pc){
589 
590  int iyt;
591 
592  float yt1=pc->Track1()->Yt();
593  float yt2=pc->Track2()->Yt();
594 
595  // These numbers are also used in StEStructCutBin::getParentBin (change both)
596  if(yt1<1.8 && yt2<1.8){
597  iyt=0;
598 //>>>>> Test moving soft-hard pairs. Am having trouble with pair cuts for LS in this region
599  } else if(yt1<1.8 && yt2<2.2){
600  iyt=3;
601  } else if(yt1<2.2 && yt2<1.8){
602  iyt=3;
603  } else if(yt1<2.2 && yt2<2.2){
604  iyt=1;
605  } else if(yt1<1.8){
606  iyt=4;
607  } else if(yt2<1.8){
608  iyt=4;
609  } else if(yt1<2.2){
610  iyt=5;
611  } else if(yt2<2.2){
612  iyt=5;
613  } else {
614  iyt=2;
615  }
616  return iyt;
617 }
618 int StEStructCutBin::symmetrizeXX8(StEStructPairCuts* pc) {
619 
620  /*
621  * softNeck, softHard and neckHard are not symmetrized.
622  */
623  if (getCutBinMode8(pc) < 3) {
624  return 1;
625  }
626  return 0;
627 }
628 int StEStructCutBin::switchXX8(StEStructPairCuts* pc) {
629 
630  /*
631  * For soft-neck and soft-hard want soft first.
632  * For neck-hard want neck first.
633  */
634  if (getCutBinMode8(pc) < 3) {
635  return 0;
636  }
637  if (pc->Track1()->Yt() > pc->Track2()->Yt()) {
638  return 1;
639  }
640  return 0;
641 }
642 int StEStructCutBin::notSymmetrizedXX8(int cutBin, int pairCharge) {
643  // Used in HAdd.
644  // Return true if XX histogram was not symmetrized (i.e. phi,phi).
645  if (cutBin < 3) {
646  return 0;
647  }
648  return 1;
649 }
650 //------------------------ Mode=9 -------------------------------------------
651 //
652 // pt binning only. Create a grid of pt1 vs. pt2 so we can recreate
653 // 1 < p_t < 3 GeV as well as exploring some pt dependence.
654 
655 int StEStructCutBin::getCutBinMode9(StEStructPairCuts* pc){
656 
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}};
663  int ipt1, ipt2;
664 
665  float pt1 = pc->Track1()->Pt();
666  float pt2 = pc->Track2()->Pt();
667 
668  // These numbers are also used in StEStructCutBin::getParentBin (change both)
669  if (pt1 < 0.5) {
670  ipt1 = 0;
671  } else if (pt1 < 1.0) {
672  ipt1 = 1;
673  } else if (pt1 < 2.0) {
674  ipt1 = 2;
675  } else if (pt1 < 3.0) {
676  ipt1 = 3;
677  } else if (pt1 < 4.0) {
678  ipt1 = 4;
679  } else {
680  ipt1 = 5;
681  }
682  if (pt2 < 0.5) {
683  ipt2 = 0;
684  } else if (pt2 < 1.0) {
685  ipt2 = 1;
686  } else if (pt2 < 2.0) {
687  ipt2 = 2;
688  } else if (pt2 < 3.0) {
689  ipt2 = 3;
690  } else if (pt2 < 4.0) {
691  ipt2 = 4;
692  } else {
693  ipt2 = 5;
694  }
695  return mode[ipt1][ipt2];
696 }
697 int StEStructCutBin::symmetrizeXX9(StEStructPairCuts* pc) {
698  return 1;
699 }
700 int StEStructCutBin::switchXX9(StEStructPairCuts* pc) {
701  return 0;
702 }
703 int StEStructCutBin::notSymmetrizedXX9(int cutBin, int pairCharge) {
704  return 0;
705 }
706 
707 //------------------------ Mode=10 -------------------------------------------
708 // Full 2D yt x yt dependence
709 // Part 1
710 //
711 // An explanation of the binning is in order. See the following map in yt x yt space:
712 //
713 // 8 16 23 29 34 38 41 43 44
714 // 7 15 22 28 33 37 40 42 43
715 // 6 14 21 27 32 36 39 40 41
716 // 5 13 20 26 31 35 36 37 38
717 // 4 12 19 25 30 31 32 33 34
718 // 3 11 18 24 25 26 27 28 29
719 // 2 10 17 18 19 20 21 22 23
720 // 1 9 10 11 12 13 14 15 16
721 // 0 1 2 3 4 5 6 7 8
722 //
723 
724 int StEStructCutBin::getCutBinMode10(StEStructPairCuts* pc){
725  float yt1=pc->Track1()->Yt();
726  float yt2=pc->Track2()->Yt();
727  int retVal;
728 
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};
738 
739  int i1 = ((int) ((yt1-1.)/.4));
740  int i2 = ((int) ((yt2-1.)/.4));
741 
742  if(i1>8) i1=8;
743  if(i2>8) i2=8;
744 
745  retVal = binMap[i1][i2];
746 
747  return retVal;
748 }
749 
750 
751 
752 /***********************************************************************
753  *
754  * $Log: StEStructCutBin.cxx,v $
755  * Revision 1.17 2012/11/16 21:22:27 prindle
756  * 2ptCorrelations: SS, AS histograms. Get eta limits from cuts. Fit PtAll histogram. Add histograms to keep track of eta, phi limits. A few more histograms
757  * Binning: Add quality cut.
758  * CutBin: modify mode9
759  * PairCuts: modify goodDeltaZ for case of one track leaving via endcap.
760  *
761  * Revision 1.16 2012/10/30 00:16:50 dkettler
762  * Cut bins for marginal pt bins added
763  *
764  * Revision 1.15 2011/08/02 20:34:02 prindle
765  * More detailed histograms for event mixing.
766  * Buffer: increased mixed events to 4 (from 2)
767  * CutBin: added mode 9 for exploration of p_t space, fixed place in mode 5 where
768  * histogram was written before checking it existed.
769  * OneBuffer: added ZDC coincidence rate to event sorting space.
770  *
771  * Revision 1.14 2010/09/02 21:24:07 prindle
772  * 2ptCorrelations: Fill histograms for event mixing information
773  * Option for common mixing buffer
774  * Switch to selectively fill QInv histograms (which take a long time)
775  * CutBin: Moved PID code to Track class from Pair class. Needed to update this code.
776  * PairCuts: Moved PID code from here to Track class.
777  * Removed unnecessary creation of StThreeVector which seem to take a long time
778  * Add ToF momentum cuts, modify dEdx momentum cuts. (Now allow dEdx to be
779  * be identified up to 15GeV/c, ToF up to 10GeV/c.)
780  *
781  * Revision 1.13 2009/11/09 21:32:41 prindle
782  * Fix warnings about casting char * to a const char * by redeclaring as const char *.
783  *
784  * Revision 1.12 2008/12/02 23:45:06 prindle
785  * Changed switchYt to switchXX (etc.) to better reflect function.
786  * Change minYt to 1.0 in Binning so YtYt histogram doesn't have empty lower bin (pt = 0.164 for yt = 1.0)
787  * In CutBin: remove initPtBin
788  * add mode 8
789  * add notSymmetrized (used in Support)
790  * Added LUT (Look Up Table) for pair cuts. Experimental for now.
791  * Modified cutMerging2 (to look at track separation at a few radii)
792  * and cutCrossing2 so it doesn't accidentally reject almost back to back tracks.
793  *
794  * Revision 1.11 2008/03/19 22:06:01 prindle
795  * Added doInvariantMass flag.
796  * Added some plots in pairDensityHistograms.
797  * SetZOffset used to only be done when doPairDensity was true.
798  * Moved creating/copying pairDensity histograms to same place as other histograms.
799  * Added cutBinHistMode
800  * mode3 neck was defined as yt1<2.2 && yt2<2.2 (and not soft)
801  * now is 1.8<yt1<2.2 && 1.8<yt2<2.2
802  * Added gooddzdxy, Merging2 and Crossing2 to pair cuts.
803  *
804  * Revision 1.10 2007/11/26 19:55:24 prindle
805  * In 2ptCorrelations: Support for keeping all z-bins of selected centralities
806  * Change way \hat{p_t} is calculated for parent distributions in pid case.
807  * Binning Added parent binning (for \hat{p_t}
808  * CutBin: Mode 5 extensively modified.
809  * Added invariant mass cuts (probably a bad idea in general.)
810  *
811  * Revision 1.9 2007/05/27 22:45:02 msd
812  * Added new cut bin modes 2 (soft/hard SS/AS), 6 (z-vertex binning), and 7 (modes 2*6).
813  * Fixed bug in merging cut.
814  * Added a few histograms to 2pt corr.
815  *
816  * Revision 1.8 2007/01/26 17:17:09 msd
817  * Implemented new binning scheme: dEta stored in array with bin centered at zero, dPhi array has bins centered at zero and pi. Final DEtaDPhi has 25x25 bins with dPhi bin width of pi/12 so all major angles are centered in bins.
818  *
819  * Revision 1.7 2006/10/02 22:21:00 prindle
820  * Store only quadrant of eta_Delta - phi_Delta array/histogram.
821  * Store half of eta_Sigma - phi_Delta array/histogram.
822  * This required modifications in Binning.
823  * I had a bug in the pair loop (which left +- not fully symmetrized)
824  * and had to make changes in cut bins for mode 5 (and 3 I think)
825  * when I fixed this.
826  * Also change crossing cut to use only two parameters, the sign of
827  * the magnetic field being taken from the MuDst.
828  *
829  * Revision 1.6 2006/04/10 23:42:32 porter
830  * Added sameSide() & awaySide() methods to PairCut (so only defined in 1 place)
831  * and added the eta_delta weighting as a binned correctin defined by the eta-limits in
832  * the StEStructBinning object
833  *
834  * Revision 1.5 2006/04/06 01:01:19 prindle
835  *
836  * New mode in CutBin, 5, to do pid correlations. There is still an issue
837  * of how to set the pt ranges allowed for the different particle types.
838  * For data we probably want to restrict p to below 1GeV for pi and K, but
839  * for Hijing and Pythia we can have perfect pid. Currently cuts are type
840  * into the code (so you have to re-compile to change them.)
841  *
842  * In the Correlations code I split -+ from +- and am keeping track of
843  * pt for each cut bin. These required changes in the Support code.
844  *
845  * Revision 1.4 2006/02/22 22:05:16 prindle
846  * Removed all references to multRef (?)
847  * Added cut mode 5 for particle identified correlations.
848  * Other cut modes should be same as before
849  *
850  * Revision 1.3 2005/09/14 17:14:23 msd
851  * Large update, added new pair-cut system, added pair density plots for new analysis mode (4), added event mixing cuts (rewrote buffer for this)
852  *
853  * Revision 1.2 2005/03/03 01:30:44 porter
854  * updated StEStruct2ptCorrelations to include pt-correlations and removed
855  * old version of pt-correlations from chunhuih (StEStruct2ptPtNbar)
856  *
857  * Revision 1.1 2004/06/25 03:11:49 porter
858  * New cut-binning implementation and modified pair-cuts for chunhui to review
859  *
860  *
861  *********************************************************************/