13 #include "StEStructPairCuts.h"
20 StEStructPairCuts::StEStructPairCuts(
const char* cutfileName):
StEStructCuts(cutfileName) { init(); };
22 StEStructPairCuts::~StEStructPairCuts() {
26 void StEStructPairCuts::init(){
28 strcpy(mcutTypeName,
"Pair");
32 if(isLoaded())loadCuts();
36 void StEStructPairCuts::initCuts(){
40 mgooddzdxy[0]=mgooddzdxy[1]=0;
43 mEntSep[0]=mEntSep[1]=0;
44 mExitSep[0]=mExitSep[1]=0;
45 mQuality[0]=mQuality[1]=0;
46 mMidTpcSepLS[0]=mMidTpcSepLS[1]=0;
47 mMidTpcSepUS[0]=mMidTpcSepUS[1]=0;
48 mHBT[0]=mHBT[1]=mHBT[2]=mHBT[3]=0;
49 mCoulomb[0]=mCoulomb[1]=mCoulomb[2]=mCoulomb[3]=0;
50 mMerging[0]=mMerging[1]=0;
51 mMerging2[0]=mMerging2[1]=0;
52 mCrossing[0]=mCrossing[1]=0;
53 mCrossing2[0]=mCrossing2[1]=0;
54 mLUTParams[0]=mLUTParams[1]=0;
63 mdEdxMomentumCut[0][0] = 0.0;
64 mdEdxMomentumCut[0][1] = 999.0;
65 mdEdxMomentumCut[1][0] = 0.1;
66 mdEdxMomentumCut[1][1] = 15.0;
67 mdEdxMomentumCut[2][0] = 0.1;
68 mdEdxMomentumCut[2][1] = 15.0;
69 mdEdxMomentumCut[3][0] = 0.2;
70 mdEdxMomentumCut[3][1] = 15.0;
72 mToFMomentumCut[0][0] = 0.0;
73 mToFMomentumCut[0][1] = 999.0;
74 mToFMomentumCut[1][0] = 0.1;
75 mToFMomentumCut[1][1] = 10.0;
76 mToFMomentumCut[2][0] = 0.1;
77 mToFMomentumCut[2][1] = 10.0;
78 mToFMomentumCut[3][0] = 0.2;
79 mToFMomentumCut[3][1] = 10.0;
81 mdeltaPhiCut=mdeltaEtaCut=mGooddeltaZdeltaXYCut=mdeltaMtCut=mqInvCut=mEntSepCut=mExitSepCut=mQualityCut=mMidTpcSepLSCut=mMidTpcSepUSCut=
false;
82 mHBTCut=mCoulombCut=mMergingCut=mCrossingCut=mMergingCut2=mCrossingCut2=mLUTCut =
false;
83 mpionMomentumCut=mKaonMomentumCut=mprotonMomentumCut =
false;
84 mpionOtherMassCut=mpionpionMassCut=mpionKaonMassCut=mpionprotonMassCut =
false;
85 mKaonOtherMassCut=mKaonKaonMassCut=mKaonprotonMassCut=mprotonOtherMassCut =
false;
86 mprotonprotonMassCut=mOtherOtherMassCut =
false;
89 for(
int i=0;i<4;i++) {
90 mdphiCounter[i]=mdetaCounter[i]=mgooddzdxyCounter[i]=mdmtCounter[i]=mqInvCounter[i]=mEntSepCounter[i]=0;
91 mExitSepCounter[i]=mQualityCounter[i]=msplitLSCounter[i]=msplitUSCounter[i]=0;
92 mHBTCounter[i]=mCoulombCounter[i]=mMergingCounter[i]=mCrossingCounter[i]=mMergingCounter2[i]=mCrossingCounter2[i]=mLUTCounter[i]=0;
93 mpionMomentumCounter[i]=mKaonMomentumCounter[i]=mprotonMomentumCounter[i]=0;
94 mpionOtherMassCounter[i]=mpionpionMassCounter[i]=mpionKaonMassCounter[i]=mpionprotonMassCounter[i]=0;
95 mKaonOtherMassCounter[i]=mKaonKaonMassCounter[i]=mKaonprotonMassCounter[i]=mprotonOtherMassCounter[i]=0;
96 mprotonprotonMassCounter[i]=mOtherOtherMassCounter[i]=0;
98 mdeltaPhi=mdeltaEta=mdeltaMt=mqInvariant= mEntranceSeparation=mExitSeparation=mQualityVal=mMidTpcSeparationLS=mMidTpcSeparationUS=0;
100 mapMask0 = 0xFFFFFF00;
102 for(
int i=0;i<32;i++)bitI[i]=1UL<<i;
108 void StEStructPairCuts::initNames(){
110 strcpy(mdphiName.name,
"DeltaPhi");
111 strcpy(mdetaName.name,
"DeltaEta");
112 strcpy(mgooddzdxyName.name,
"GoodDeltaZDeltaXY");
113 strcpy(mdmtName.name,
"DeltaMt");
114 strcpy(mqInvName.name,
"qInv");
115 strcpy(mEntSepName.name,
"EntranceSep");
116 strcpy(mExitSepName.name,
"ExitSep");
117 strcpy(mQualityName.name,
"Quality");
118 strcpy(mMidTpcSepLSName.name,
"MidTpcSepLikeSign");
119 strcpy(mMidTpcSepUSName.name,
"MidTpcSepUnlikeSign");
120 strcpy(mHBTName.name,
"HBT");
121 strcpy(mCoulombName.name,
"Coulomb");
122 strcpy(mMergingName.name,
"Merging");
123 strcpy(mMergingName2.name,
"Merging2");
124 strcpy(mCrossingName.name,
"Crossing");
125 strcpy(mCrossingName2.name,
"Crossing2");
126 strcpy(mLUTName.name,
"LUT");
127 strcpy(mpionMomentumName.name,
"pionMomentumRange");
128 strcpy(mKaonMomentumName.name,
"KaonMomentumRange");
129 strcpy(mprotonMomentumName.name,
"protonMomentumRange");
131 strcpy(mpionOtherMassName.name,
"pionOtherMass");
132 strcpy(mpionpionMassName.name,
"pionpionMass");
133 strcpy(mpionKaonMassName.name,
"pionKaonMass");
134 strcpy(mpionprotonMassName.name,
"pionprotonMass");
135 strcpy(mKaonOtherMassName.name,
"KaonOtherMass");
136 strcpy(mKaonKaonMassName.name,
"KaonKaonMass");
137 strcpy(mKaonprotonMassName.name,
"KaonprotonMass");
138 strcpy(mprotonOtherMassName.name,
"protonOtherMass");
139 strcpy(mprotonprotonMassName.name,
"protonprotonMass");
140 strcpy(mOtherOtherMassName.name,
"OtherOtherMass");
145 bool StEStructPairCuts::loadBaseCuts(
const char* name,
const char** vals,
int nvals){
148 if(!strcmp(name,mdphiName.name)){
149 mdphi[0]=(float)(M_PI*atof(vals[0])); mdphi[1]=(float)(M_PI*atof(vals[1]));
150 mdphiName.idx=createCutHists(name,mdphi);
155 if(!strcmp(name,mdetaName.name)){
156 mdeta[0]=atof(vals[0]); mdeta[1]=atof(vals[1]);
157 mdetaName.idx=createCutHists(name,mdeta);
162 if(!strcmp(name,mgooddzdxyName.name)){
163 mgooddzdxy[0]=atof(vals[0]); mgooddzdxy[1]=atof(vals[1]);
164 mgooddzdxyName.idx=createCutHists(name,mgooddzdxy);
165 mGooddeltaZdeltaXYCut=
true;
169 if(!strcmp(name,mdmtName.name)){
170 mdmt[0]=atof(vals[0]); mdmt[1]=atof(vals[1]);
171 mdmtName.idx=createCutHists(name,mdmt);
176 if(!strcmp(name,mqInvName.name)){
177 mqInv[0]=atof(vals[0]); mqInv[1]=atof(vals[1]);
178 mqInvName.idx=createCutHists(name,mqInv);
183 if(!strcmp(name,mEntSepName.name)){
184 mEntSep[0]=atof(vals[0]); mEntSep[1]=atof(vals[1]);
185 mEntSepName.idx=createCutHists(name,mEntSep);
190 if(!strcmp(name,mExitSepName.name)){
191 mExitSep[0]=atof(vals[0]); mExitSep[1]=atof(vals[1]);
192 mExitSepName.idx=createCutHists(name,mExitSep);
197 if(!strcmp(name,mQualityName.name)){
198 mQuality[0]=atof(vals[0]); mQuality[1]=atof(vals[1]);
199 mQualityName.idx=createCutHists(name,mQuality);
204 if(!strcmp(name,mMidTpcSepLSName.name)){
205 mMidTpcSepLS[0]=atof(vals[0]); mMidTpcSepLS[1]=atof(vals[1]);
206 mMidTpcSepLSName.idx=createCutHists(name,mMidTpcSepLS);
207 mMidTpcSepLSCut=
true;
211 if(!strcmp(name,mMidTpcSepUSName.name)){
212 mMidTpcSepUS[0]=atof(vals[0]); mMidTpcSepUS[1]=atof(vals[1]);
213 mMidTpcSepUSName.idx=createCutHists(name,mMidTpcSepUS);
214 mMidTpcSepUSCut=
true;
218 if(!strcmp(name,mHBTName.name)){
219 mHBT[0]=atof(vals[0]); mHBT[1]=atof(vals[1]);
220 mHBT[2]=atof(vals[2]); mHBT[3]=atof(vals[3]);
223 cout <<
" Loading HBT cut with range of cuts = "<<mHBT[0]<<
","<<mHBT[1]<<
","<<mHBT[2]<<
","<<mHBT[3]<<endl;
227 if(!strcmp(name,mCoulombName.name)){
228 mCoulomb[0]=atof(vals[0]); mCoulomb[1]=atof(vals[1]);
229 mCoulomb[2]=atof(vals[2]); mCoulomb[3]=atof(vals[3]);
232 cout <<
" Loading Coulomb cut with range of cuts = "<<mCoulomb[0]<<
","<<mCoulomb[1]<<
","<<mCoulomb[2]<<
","<<mCoulomb[3]<<endl;
236 if(!strcmp(name,mMergingName.name)){
237 mMerging[0]=atof(vals[0]); mMerging[1]=atof(vals[1]);
240 cout <<
" Loading Merging cut with range of cuts = "<<mMerging[0]<<
","<<mMerging[1]<<endl;
244 if(!strcmp(name,mMergingName2.name)){
245 mMerging2[0]=atof(vals[0]); mMerging2[1]=atof(vals[1]);
248 cout <<
" Loading Merging2 cut with range of cuts = "<<mMerging2[0]<<
","<<mMerging2[1]<<endl;
252 if(!strcmp(name,mCrossingName.name)){
253 mCrossing[0]=atof(vals[0]); mCrossing[1]=atof(vals[1]);
256 cout <<
" Loading Crossing cut with range of cuts = "<<mCrossing[0]<<
","<<mCrossing[1]<<endl;
260 if(!strcmp(name,mCrossingName2.name)){
261 mCrossing2[0]=atof(vals[0]); mCrossing2[1]=atof(vals[1]);
264 cout <<
" Loading Crossing2 cut with range of cuts = "<<mCrossing2[0]<<
","<<mCrossing2[1]<<endl;
267 if(!strcmp(name,mLUTName.name)){
268 mLUTParams[0]=atof(vals[0]); mLUTParams[1]=atof(vals[1]);
270 cout <<
" Calculating Look Up Table with dXY cut = "<<mLUTParams[0]<<
" and dZ cut = "<<mLUTParams[1]<<
" (takes a little while)" <<endl;
271 mLUT->mDelXYCut = mLUTParams[0];
272 mLUT->mDelZCut = mLUTParams[1];
275 cout <<
" LUT has been calculated " <<endl;
279 if(!strcmp(name,mpionMomentumName.name)){
280 mdEdxMomentumCut[1][0]=atof(vals[0]); mdEdxMomentumCut[1][1]=atof(vals[1]);
281 mToFMomentumCut[1][0]=atof(vals[0]); mToFMomentumCut[1][1]=atof(vals[1]);
282 mpionMomentumCut=
true;
283 cout <<
" Loading pion momentum cut with range of values = "<<mdEdxMomentumCut[1][0]<<
","<<mdEdxMomentumCut[1][1]<<endl;
287 if(!strcmp(name,mKaonMomentumName.name)){
288 mdEdxMomentumCut[2][0]=atof(vals[0]); mdEdxMomentumCut[2][1]=atof(vals[1]);
289 mToFMomentumCut[2][0]=atof(vals[0]); mToFMomentumCut[2][1]=atof(vals[1]);
290 mKaonMomentumCut=
true;
291 cout <<
" Loading Kaon momentum cut with range of values = "<<mdEdxMomentumCut[2][0]<<
","<<mdEdxMomentumCut[2][1]<<endl;
295 if(!strcmp(name,mprotonMomentumName.name)){
296 mdEdxMomentumCut[3][0]=atof(vals[0]); mdEdxMomentumCut[3][1]=atof(vals[1]);
297 mToFMomentumCut[3][0]=atof(vals[0]); mToFMomentumCut[3][1]=atof(vals[1]);
298 mprotonMomentumCut=
true;
299 cout <<
" Loading proton momentum cut with range of values = "<<mdEdxMomentumCut[3][0]<<
","<<mdEdxMomentumCut[3][1]<<endl;
return true;
302 if(!strcmp(name,mpionOtherMassName.name)){
303 mpionOtherMass[0]=atof(vals[0]); mpionOtherMass[1]=atof(vals[1]);
304 mpionOtherMassCut=
true;
305 cout <<
" Loading pion-Other mass cut with range of values = "<<mpionOtherMass[0]<<
","<<mpionOtherMass[1]<<endl;
return true;
307 if(!strcmp(name,mpionpionMassName.name)){
308 mpionpionMass[0]=atof(vals[0]); mpionpionMass[1]=atof(vals[1]);
309 mpionpionMassCut=
true;
310 cout <<
" Loading pion-pion mass cut with range of values = "<<mpionpionMass[0]<<
","<<mpionpionMass[1]<<endl;
return true;
312 if(!strcmp(name,mpionKaonMassName.name)){
313 mpionKaonMass[0]=atof(vals[0]); mpionKaonMass[1]=atof(vals[1]);
314 mpionKaonMassCut=
true;
315 cout <<
" Loading pion-Kaon mass cut with range of values = "<<mpionKaonMass[0]<<
","<<mpionKaonMass[1]<<endl;
return true;
317 if(!strcmp(name,mpionprotonMassName.name)){
318 mpionprotonMass[0]=atof(vals[0]); mpionprotonMass[1]=atof(vals[1]);
319 mpionprotonMassCut=
true;
320 cout <<
" Loading pion-proton mass cut with range of values = "<<mpionprotonMass[0]<<
","<<mpionprotonMass[1]<<endl;
return true;
322 if(!strcmp(name,mKaonOtherMassName.name)){
323 mKaonOtherMass[0]=atof(vals[0]); mKaonOtherMass[1]=atof(vals[1]);
324 mKaonOtherMassCut=
true;
325 cout <<
" Loading Kaon-Other mass cut with range of values = "<<mKaonOtherMass[0]<<
","<<mKaonOtherMass[1]<<endl;
return true;
327 if(!strcmp(name,mKaonKaonMassName.name)){
328 mKaonKaonMass[0]=atof(vals[0]); mKaonKaonMass[1]=atof(vals[1]);
329 mKaonKaonMassCut=
true;
330 cout <<
" Loading Kaon-Kaon mass cut with range of values = "<<mKaonKaonMass[0]<<
","<<mKaonKaonMass[1]<<endl;
return true;
332 if(!strcmp(name,mKaonprotonMassName.name)){
333 mKaonprotonMass[0]=atof(vals[0]); mKaonprotonMass[1]=atof(vals[1]);
334 mKaonprotonMassCut=
true;
335 cout <<
" Loading Kaon-proton mass cut with range of values = "<<mKaonprotonMass[0]<<
","<<mKaonprotonMass[1]<<endl;
return true;
337 if(!strcmp(name,mprotonOtherMassName.name)){
338 mprotonOtherMass[0]=atof(vals[0]); mprotonOtherMass[1]=atof(vals[1]);
339 mprotonOtherMassCut=
true;
340 cout <<
" Loading proton-Other mass cut with range of values = "<<mprotonOtherMass[0]<<
","<<mprotonOtherMass[1]<<endl;
return true;
342 if(!strcmp(name,mprotonprotonMassName.name)){
343 mprotonprotonMass[0]=atof(vals[0]); mprotonprotonMass[1]=atof(vals[1]);
344 mprotonprotonMassCut=
true;
345 cout <<
" Loading proton-proton mass cut with range of values = "<<mprotonprotonMass[0]<<
","<<mprotonprotonMass[1]<<endl;
return true;
347 if(!strcmp(name,mOtherOtherMassName.name)){
348 mOtherOtherMass[0]=atof(vals[0]); mOtherOtherMass[1]=atof(vals[1]);
349 mOtherOtherMassCut=
true;
350 cout <<
" Loading Other-Other mass cut with range of values = "<<mOtherOtherMass[0]<<
","<<mOtherOtherMass[1]<<endl;
return true;
357 void StEStructPairCuts::printCutCounts(ostream& ofs,
const char* cutName,
int c1,
int c2){
358 ofs<<cutName<<c1<<
" + "<<c2<<
" = "<<c1+c2<<endl;
362 void StEStructPairCuts::printCutStats(ostream& ofs){
371 const char* cutTypes[]={
"#--- Sibling Pairs : LS + US = ",
372 "#--- Mixed Pairs : LS + US = "};
374 ofs<<mdphiName.name<<
","<<mdphi[0]/M_PI<<
","<<mdphi[1]/M_PI<<
"\t\t\t"<<
" # pair dphi cut"<<endl;
375 printCutCounts(ofs,cutTypes[0],mdphiCounter[0],mdphiCounter[1]);
376 printCutCounts(ofs,cutTypes[1],mdphiCounter[2],mdphiCounter[3]);
379 ofs<<mdetaName.name<<
","<<mdeta[0]<<
","<<mdeta[1]<<
"\t\t\t"<<
" # pair deta cut"<<endl;
380 printCutCounts(ofs,cutTypes[0],mdetaCounter[0],mdetaCounter[1]);
381 printCutCounts(ofs,cutTypes[1],mdetaCounter[2],mdetaCounter[3]);
383 if(mGooddeltaZdeltaXYCut){
384 ofs<<mgooddzdxyName.name<<
","<<mgooddzdxy[0]<<
","<<mgooddzdxy[1]<<
"\t\t\t"<<
" # pair deta cut"<<endl;
385 printCutCounts(ofs,cutTypes[0],mgooddzdxyCounter[0],mgooddzdxyCounter[1]);
386 printCutCounts(ofs,cutTypes[1],mgooddzdxyCounter[2],mgooddzdxyCounter[3]);
390 ofs<<mdmtName.name<<
","<<mdmt[0]<<
","<<mdmt[1]<<
"\t\t\t"<<
" # pair dmt cut"<<endl;
391 printCutCounts(ofs,cutTypes[0],mdmtCounter[0],mdmtCounter[1]);
392 printCutCounts(ofs,cutTypes[1],mdmtCounter[2],mdmtCounter[3]);
396 ofs<<mqInvName.name<<
","<<mqInv[0]<<
","<<mqInv[1]<<
"\t\t\t"<<
" # pair qInv cut"<<endl;
397 printCutCounts(ofs,cutTypes[0],mqInvCounter[0],mqInvCounter[1]);
398 printCutCounts(ofs,cutTypes[1],mqInvCounter[2],mqInvCounter[3]);
402 ofs<<mEntSepName.name<<
","<<mEntSep[0]<<
","<<mEntSep[1]<<
"\t\t\t"<<
" # pair EntSep cut"<<endl;
403 printCutCounts(ofs,cutTypes[0],mEntSepCounter[0],mEntSepCounter[1]);
404 printCutCounts(ofs,cutTypes[1],mEntSepCounter[2],mEntSepCounter[3]);
408 ofs<<mExitSepName.name<<
","<<mExitSep[0]<<
","<<mExitSep[1]<<
"\t\t\t"<<
" # pair ExitSep cut"<<endl;
409 printCutCounts(ofs,cutTypes[0],mExitSepCounter[0],mExitSepCounter[1]);
410 printCutCounts(ofs,cutTypes[1],mExitSepCounter[2],mExitSepCounter[3]);
414 ofs<<mQualityName.name<<
","<<mQuality[0]<<
","<<mQuality[1]<<
"\t\t\t"<<
" # pair Quality cut"<<endl;
415 printCutCounts(ofs,cutTypes[0],mQualityCounter[0],mQualityCounter[1]);
416 printCutCounts(ofs,cutTypes[1],mQualityCounter[2],mQualityCounter[3]);
420 ofs<<mMidTpcSepLSName.name<<
","<<mMidTpcSepLS[0]<<
","<<mMidTpcSepLS[1]<<
"\t\t\t"<<
" # pair MidTpcSepLS cut"<<endl;
421 printCutCounts(ofs,cutTypes[0],msplitLSCounter[0],msplitLSCounter[1]);
422 printCutCounts(ofs,cutTypes[1],msplitLSCounter[2],msplitLSCounter[3]);
426 ofs<<mMidTpcSepUSName.name<<
","<<mMidTpcSepUS[0]<<
","<<mMidTpcSepUS[1]<<
"\t\t\t"<<
" # pair MidTpcSepUS cut"<<endl;
427 printCutCounts(ofs,cutTypes[0],msplitUSCounter[0],msplitUSCounter[1]);
428 printCutCounts(ofs,cutTypes[1],msplitUSCounter[2],msplitUSCounter[3]);
432 ofs<<mHBTName.name<<
","<<mHBT[0]<<
","<<mHBT[1]<<
","<<mHBT[2]<<
","<<mHBT[3]<<
"\t\t"<<
" # pair HBT cut"<<endl;
433 printCutCounts(ofs,cutTypes[0],mHBTCounter[0],mHBTCounter[1]);
434 printCutCounts(ofs,cutTypes[1],mHBTCounter[2],mHBTCounter[3]);
437 ofs<<mCoulombName.name<<
","<<mCoulomb[0]<<
","<<mCoulomb[1]<<
","<<mCoulomb[2]<<
","<<mCoulomb[3]<<
"\t"<<
" # pair Coulomb cut"<<endl;
438 printCutCounts(ofs,cutTypes[0],mCoulombCounter[0],mCoulombCounter[1]);
439 printCutCounts(ofs,cutTypes[1],mCoulombCounter[2],mCoulombCounter[3]);
442 ofs<<mMergingName.name<<
","<<mMerging[0]<<
","<<mMerging[1]<<
"\t\t\t"<<
" # pair Merging cut"<<endl;
443 printCutCounts(ofs,cutTypes[0],mMergingCounter[0],mMergingCounter[1]);
444 printCutCounts(ofs,cutTypes[1],mMergingCounter[2],mMergingCounter[3]);
447 ofs<<mMergingName2.name<<
","<<mMerging2[0]<<
","<<mMerging2[1]<<
"\t\t\t"<<
" # pair Merging2 cut"<<endl;
448 printCutCounts(ofs,cutTypes[0],mMergingCounter2[0],mMergingCounter2[1]);
449 printCutCounts(ofs,cutTypes[1],mMergingCounter2[2],mMergingCounter2[3]);
452 ofs<<mCrossingName.name<<
","<<mCrossing[0]<<
","<<mCrossing[1]<<
"\t\t"<<
" # pair Crossing cut"<<endl;
453 printCutCounts(ofs,cutTypes[0],mCrossingCounter[0],mCrossingCounter[1]);
454 printCutCounts(ofs,cutTypes[1],mCrossingCounter[2],mCrossingCounter[3]);
457 ofs<<mCrossingName2.name<<
","<<mCrossing2[0]<<
","<<mCrossing2[1]<<
"\t\t"<<
" # pair Crossing2 cut"<<endl;
458 printCutCounts(ofs,cutTypes[0],mCrossingCounter2[0],mCrossingCounter2[1]);
459 printCutCounts(ofs,cutTypes[1],mCrossingCounter2[2],mCrossingCounter2[3]);
462 ofs<<mLUTName.name<<
","<<mLUTParams[0]<<
","<<mLUTParams[1]<<
"\t\t"<<
" # pair LUT cut"<<endl;
463 printCutCounts(ofs,cutTypes[0],mLUTCounter[0],mLUTCounter[1]);
464 printCutCounts(ofs,cutTypes[1],mLUTCounter[2],mLUTCounter[3]);
466 if(mpionMomentumCut){
467 ofs<<mpionMomentumName.name<<
","<<mdEdxMomentumCut[1][0]<<
","<<mdEdxMomentumCut[1][1]<<
"\t\t"<<
" # pion momentum range cut"<<endl;
468 printCutCounts(ofs,cutTypes[0],mpionMomentumCounter[0],mpionMomentumCounter[1]);
469 printCutCounts(ofs,cutTypes[1],mpionMomentumCounter[2],mpionMomentumCounter[3]);
471 if(mKaonMomentumCut){
472 ofs<<mKaonMomentumName.name<<
","<<mdEdxMomentumCut[2][0]<<
","<<mdEdxMomentumCut[2][1]<<
"\t\t"<<
" # Kaon momentum range cut"<<endl;
473 printCutCounts(ofs,cutTypes[0],mKaonMomentumCounter[0],mKaonMomentumCounter[1]);
474 printCutCounts(ofs,cutTypes[1],mKaonMomentumCounter[2],mKaonMomentumCounter[3]);
476 if(mprotonMomentumCut){
477 ofs<<mprotonMomentumName.name<<
","<<mdEdxMomentumCut[3][0]<<
","<<mdEdxMomentumCut[3][1]<<
"\t\t"<<
" # proton momentum range cut"<<endl;
478 printCutCounts(ofs,cutTypes[0],mprotonMomentumCounter[0],mprotonMomentumCounter[1]);
479 printCutCounts(ofs,cutTypes[1],mprotonMomentumCounter[2],mprotonMomentumCounter[3]);
482 if(mpionOtherMassCut){
483 ofs<<mpionOtherMassName.name<<
","<<mpionOtherMass[0]<<
","<<mpionOtherMass[1]<<
"\t\t"<<
" # pion-Other mass cut range cut"<<endl;
484 printCutCounts(ofs,cutTypes[0],mpionOtherMassCounter[0],mpionOtherMassCounter[1]);
485 printCutCounts(ofs,cutTypes[1],mpionOtherMassCounter[2],mpionOtherMassCounter[3]);
487 if(mpionpionMassCut){
488 ofs<<mpionpionMassName.name<<
","<<mpionpionMass[0]<<
","<<mpionpionMass[1]<<
"\t\t"<<
" # pion-pion mass cut range cut"<<endl;
489 printCutCounts(ofs,cutTypes[0],mpionpionMassCounter[0],mpionpionMassCounter[1]);
490 printCutCounts(ofs,cutTypes[1],mpionpionMassCounter[2],mpionpionMassCounter[3]);
492 if(mpionKaonMassCut){
493 ofs<<mpionKaonMassName.name<<
","<<mpionKaonMass[0]<<
","<<mpionKaonMass[1]<<
"\t\t"<<
" # pion-Kaon mass cut range cut"<<endl;
494 printCutCounts(ofs,cutTypes[0],mpionKaonMassCounter[0],mpionKaonMassCounter[1]);
495 printCutCounts(ofs,cutTypes[1],mpionKaonMassCounter[2],mpionKaonMassCounter[3]);
497 if(mpionprotonMassCut){
498 ofs<<mpionprotonMassName.name<<
","<<mpionprotonMass[0]<<
","<<mpionprotonMass[1]<<
"\t\t"<<
" # pion-proton mass cut range cut"<<endl;
499 printCutCounts(ofs,cutTypes[0],mpionprotonMassCounter[0],mpionprotonMassCounter[1]);
500 printCutCounts(ofs,cutTypes[1],mpionprotonMassCounter[2],mpionprotonMassCounter[3]);
502 if(mKaonOtherMassCut){
503 ofs<<mKaonOtherMassName.name<<
","<<mKaonOtherMass[0]<<
","<<mKaonOtherMass[1]<<
"\t\t"<<
" # pion-Other mass cut range cut"<<endl;
504 printCutCounts(ofs,cutTypes[0],mKaonOtherMassCounter[0],mKaonOtherMassCounter[1]);
505 printCutCounts(ofs,cutTypes[1],mKaonOtherMassCounter[2],mKaonOtherMassCounter[3]);
507 if(mKaonKaonMassCut){
508 ofs<<mKaonKaonMassName.name<<
","<<mKaonKaonMass[0]<<
","<<mKaonKaonMass[1]<<
"\t\t"<<
" # Kaon-Kaon mass cut range cut"<<endl;
509 printCutCounts(ofs,cutTypes[0],mKaonKaonMassCounter[0],mKaonKaonMassCounter[1]);
510 printCutCounts(ofs,cutTypes[1],mKaonKaonMassCounter[2],mKaonKaonMassCounter[3]);
512 if(mKaonprotonMassCut){
513 ofs<<mKaonprotonMassName.name<<
","<<mKaonprotonMass[0]<<
","<<mKaonprotonMass[1]<<
"\t\t"<<
" # Kaon-proton mass cut range cut"<<endl;
514 printCutCounts(ofs,cutTypes[0],mKaonprotonMassCounter[0],mKaonprotonMassCounter[1]);
515 printCutCounts(ofs,cutTypes[1],mKaonprotonMassCounter[2],mKaonprotonMassCounter[3]);
517 if(mprotonOtherMassCut){
518 ofs<<mprotonOtherMassName.name<<
","<<mprotonOtherMass[0]<<
","<<mprotonOtherMass[1]<<
"\t\t"<<
" # proton-Other mass cut range cut"<<endl;
519 printCutCounts(ofs,cutTypes[0],mprotonOtherMassCounter[0],mprotonOtherMassCounter[1]);
520 printCutCounts(ofs,cutTypes[1],mprotonOtherMassCounter[2],mprotonOtherMassCounter[3]);
522 if(mprotonprotonMassCut){
523 ofs<<mprotonprotonMassName.name<<
","<<mprotonprotonMass[0]<<
","<<mprotonprotonMass[1]<<
"\t\t"<<
" # proton-proton mass cut range cut"<<endl;
524 printCutCounts(ofs,cutTypes[0],mprotonprotonMassCounter[0],mprotonprotonMassCounter[1]);
525 printCutCounts(ofs,cutTypes[1],mprotonprotonMassCounter[2],mprotonprotonMassCounter[3]);
527 if(mOtherOtherMassCut){
528 ofs<<mOtherOtherMassName.name<<
","<<mOtherOtherMass[0]<<
","<<mOtherOtherMass[1]<<
"\t\t"<<
" # Other-Other mass cut range cut"<<endl;
529 printCutCounts(ofs,cutTypes[0],mOtherOtherMassCounter[0],mOtherOtherMassCounter[1]);
530 printCutCounts(ofs,cutTypes[1],mOtherOtherMassCounter[2],mOtherOtherMassCounter[3]);
540 int StEStructPairCuts::cutPair(){
567 if (goodDeltaZ() || goodDeltaXY()) {
570 if(cutMerging() || cutCrossing()) {
573 if(cutMerging2() || cutCrossing2()) {
579 if(cutCoulomb() || cutHBT()) {
584 mdeltaEta = fabs(DeltaEta());
590 if(cutqInvORNominalEntranceSep())
return 1;
592 if(mType==1 || mType==3) {
593 if(cutMidTpcSepUS())
return 1;
595 if(cutMidTpcSepLS())
return 1;
603 if(cutMass())
return 1;
610 int StEStructPairCuts::cutPairHistograms(){
624 cutCount+=cutDeltaPhiH();
625 cutCount+=cutDeltaEtaH();
626 cutCount+=cutDeltaMtH();
629 cutCount+=cutCoulomb();
630 cutCount+=cutMerging();
631 cutCount+=cutCrossing();
634 cutCount+=cutqInvH();
635 cutCount+=cutEntranceSepH();
636 if(mType==1 || mType==3){
637 cutCount+=cutMidTpcSepUSH();
638 if(mMidTpcSepLSCut)mvalues[mMidTpcSepLSName.idx]=mMidTpcSepLS[1]+2.0*(mMidTpcSepLS[1]-mMidTpcSepLS[0]);
640 cutCount+=cutMidTpcSepLSH();
641 if(mMidTpcSepUSCut)mvalues[mMidTpcSepUSName.idx]=mMidTpcSepUS[1]+2.0*(mMidTpcSepUS[1]-mMidTpcSepUS[0]);
644 if(mqInvCut)mvalues[mqInvName.idx]=mqInv[1]+2.0*(mqInv[1]-mqInv[0]);
645 if(mEntSepCut)mvalues[mEntSepName.idx]=mEntSep[1]+2.0*(mEntSep[1]-mEntSep[0]);
646 if(mMidTpcSepUSCut)mvalues[mMidTpcSepUSName.idx]=mMidTpcSepUS[1]+2.0*(mMidTpcSepUS[1]-mMidTpcSepUS[0]);
647 if(mMidTpcSepLSCut)mvalues[mMidTpcSepLSName.idx]=mMidTpcSepLS[1]+2.0*(mMidTpcSepLS[1]-mMidTpcSepLS[0]);
650 cutCount+=cutExitSepH();
651 cutCount+=cutQualityH();
653 fillHistograms((cutCount==0));
659 StEStructPairCuts::fourMomentumSum()
const
666 StEStructPairCuts::fourMomentumDiff()
const
673 StEStructPairCuts::quality()
const {
676 unsigned long padRow1To24Track1 = mTrack1->TopologyMapData(0) & mapMask0;
677 unsigned long padRow25To45Track1 = mTrack1->TopologyMapData(1) & mapMask1;
678 unsigned long padRow1To24Track2 = mTrack2->TopologyMapData(0) & mapMask0;
679 unsigned long padRow25To45Track2 = mTrack2->TopologyMapData(1) & mapMask1;
682 unsigned long bothPads1To24 = padRow1To24Track1 & padRow1To24Track2;
683 unsigned long bothPads25To45 = padRow25To45Track1 & padRow25To45Track2;
685 unsigned long onePad1To24 = padRow1To24Track1 ^ padRow1To24Track2;
686 unsigned long onePad25To45 = padRow25To45Track1 ^ padRow25To45Track2;
690 double normQual = 0.0;
693 int MaxQuality = mTrack1->TopologyMapTPCNHits() + mTrack2->TopologyMapTPCNHits();
695 for (ibits=8;ibits<=31;ibits++) {
698 if ( onePad1To24 & bitI[ibits] ) {
701 }
else if ( bothPads1To24 & bitI[ibits] ) {
706 for (ibits=0;ibits<=20;ibits++) {
709 if ( onePad25To45 & bitI[ibits] ) {
712 }
else if ( bothPads25To45 & bitI[ibits] ) {
717 normQual = (double)Quality/((
double)MaxQuality );
724 StEStructPairCuts::OpeningAngle()
const {
727 double dAngInv = 57.296*acos((p1.dot(p2))/(p1.mag()*p2.mag()));
734 StEStructPairCuts::NominalTpcExitSeparation()
const {
736 StThreeVectorF diff = mTrack1->NominalTpcExitPoint() - mTrack2->NominalTpcExitPoint() + off;
737 return (
double)(diff.mag());
741 StEStructPairCuts::NominalTpcXYExitSeparation()
const {
742 StThreeVectorF diff = mTrack1->NominalTpcExitPoint() - mTrack2->NominalTpcExitPoint();
743 return (
double)(diff.perp());
747 StEStructPairCuts::NominalTpcZExitSeparation()
const {
756 if ( mTrack1->EndCapOuter()!=0 || mTrack2->EndCapOuter()!=0 ) {
757 if ( mTrack1->EndCapOuter()==mTrack2->EndCapOuter() ) {
759 }
else if ( mTrack1->EndCapOuter()==0 || mTrack2->EndCapOuter()==0 ) {
765 double diff = mTrack1->NominalTpcExitPoint().z() - mTrack2->NominalTpcExitPoint().z();
766 return (
double)(fabs(diff+mZoffset));
770 StEStructPairCuts::TpcRadialEndCapSeparation()
const {
773 float rdiff = mTrack1->EndCapRadius() - mTrack2->EndCapRadius();
774 return (
double)(fabs(rdiff));
780 StEStructPairCuts::NominalTpcEntranceSeparation()
const {
782 StThreeVectorF diff = mTrack1->NominalTpcEntrancePoint() - mTrack2->NominalTpcEntrancePoint() + off;
783 return (
double)(diff.mag());
787 StEStructPairCuts::NominalTpcXYEntranceSeparation()
const {
788 StThreeVectorF diff = mTrack1->NominalTpcEntrancePoint() - mTrack2->NominalTpcEntrancePoint();
789 return (
double)(diff.perp());
792 StEStructPairCuts::NominalTpcZEntranceSeparation()
const {
793 double diff = mTrack1->NominalTpcEntrancePoint().z() - mTrack2->NominalTpcEntrancePoint().z();
794 return (
double)(fabs(diff + mZoffset));
799 StEStructPairCuts::NominalTpcAvgXYSeparation()
const {
800 double x1=NominalTpcXYEntranceSeparation();
801 double x2=MidTpcXYSeparation();
802 double x3=NominalTpcXYExitSeparation();
803 return (x1+x2+x3)/3.;
806 StEStructPairCuts::NominalTpcAvgZSeparation()
const {
807 double x1=NominalTpcZEntranceSeparation();
808 double x2=MidTpcZSeparation();
809 double x3=NominalTpcZExitSeparation();
810 if (x3==-1)
return (x1+x2)/2.;
811 else return (x1+x2+x3)/3.;
813 bool StEStructPairCuts::TracksCrossInPhi()
const {
817 double phiEnt1 = mTrack1->NominalTpcEntrancePoint().phi();
818 double phiEnt2 = mTrack2->NominalTpcEntrancePoint().phi();
819 double dphiEnt = phiEnt1 - phiEnt2;
820 while (dphiEnt > M_PI) {
823 while (dphiEnt < -M_PI) {
826 double phiExit1 = mTrack1->NominalTpcExitPoint().phi();
827 double phiExit2 = mTrack2->NominalTpcExitPoint().phi();
828 double dphiExit = phiExit1 - phiExit2;
829 while (dphiExit > M_PI) {
832 while (dphiExit < -M_PI) {
835 if ((dphiEnt*dphiExit < 0) && (fabs(dphiEnt) < M_PI/4)) {
843 StEStructPairCuts::MidTpcSeparation()
const {
845 StThreeVectorF diff = mTrack1->MidTpcPoint() - mTrack2->MidTpcPoint() + off;
847 return (
double)(diff.mag());
851 StEStructPairCuts::MidTpcXYSeparation()
const {
852 StThreeVectorF diff = mTrack1->MidTpcPoint() - mTrack2->MidTpcPoint();
854 return (
double)(diff.perp());
858 StEStructPairCuts::MidTpcZSeparation()
const {
859 double diff = mTrack1->MidTpcPoint().z() - mTrack2->MidTpcPoint().z();
861 return (
double)(fabs(diff+mZoffset));
864 double StEStructPairCuts::OuterMidTpcSeparation()
const {
866 StThreeVectorF diff = mTrack1->OuterMidTpcPoint() - mTrack2->OuterMidTpcPoint() + off;
867 return (
double)(diff.mag());
870 double StEStructPairCuts::OuterMidTpcXYSeparation()
const {
871 StThreeVectorF diff = mTrack1->OuterMidTpcPoint() - mTrack2->OuterMidTpcPoint();
872 return (
double)(diff.perp());
875 double StEStructPairCuts::OuterMidTpcZSeparation()
const {
877 if ( mTrack1->EndCapOuterMid()!=0 || mTrack2->EndCapOuterMid()!=0 ) {
878 if ( mTrack1->EndCapOuterMid()==mTrack2->EndCapOuterMid() ) {
880 }
else if ( mTrack1->EndCapOuterMid()==0 || mTrack2->EndCapOuterMid()==0 ) {
886 double diff = mTrack1->OuterMidTpcPoint().z() - mTrack2->OuterMidTpcPoint().z();
887 return (
double)(fabs(diff+mZoffset));