StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
adamsPairCut.cxx
1 /***************************************************************************
2  *
3  * $Id: adamsPairCut.cxx,v 1.2 2003/09/02 17:58:21 perev Exp $
4  *
5  * Author: Adam Kisiel, Warsaw University of Technology, kisiel@if.pw.edu.pl
6  ***************************************************************************
7  *
8  * Description: part of STAR HBT Framework: StHbtMaker package
9  * Cuts on probability of a pair being e+e-, pi+pi- or K+K-
10  * using dEdx NSigma PID information
11  *
12  ***************************************************************************
13  *
14  *
15  **************************************************************************/
16 
17 #include "StHbtMaker/Cut/adamsPairCut.h"
18 #include <string>
19 #include <cstdio>
20 #include <Stsstream.h>
21 
22 #ifdef __ROOT__
23 ClassImp(adamsPairCut)
24 #endif
25 
26 //__________________
27 adamsPairCut::adamsPairCut():HitMergingPairCut(){
28  mNPairsPassed = mNPairsFailed = 0;
29  mElSigma=0.0;
30  mPiSigma=0.0;
31  mKSigma =0.0;
32  mElPIDMax=1.0;
33  mPiPIDMax=1.0;
34  mKPIDMax =1.0;
35  mPIDPThreshold= 0.0;
36 }
37 //__________________
38 //adamsPairCut::~adamsPairCut(){
39 // /* no-op */
40 //}
41 //________`__________
42 bool adamsPairCut::Pass(const StHbtPair* pair){
43  bool isElPair, isPiPair, isKPair;
44 
45  if (pair->track1()->Track()->P().mag() < mPIDPThreshold)
46  {
47  bool is1El = (TMath::Abs(pair->track1()->Track()->NSigmaElectron()) < mElSigma);
48  bool is1Pi = (TMath::Abs(pair->track1()->Track()->NSigmaPion()) < mPiSigma);
49  bool is1K = (TMath::Abs(pair->track1()->Track()->NSigmaKaon()) < mKSigma);
50  if (pair->track2()->Track()->P().mag() < mPIDPThreshold)
51  {
52  isElPair = is1El && (TMath::Abs(pair->track2()->Track()->NSigmaElectron()) < mElSigma);
53  isPiPair = is1Pi && (TMath::Abs(pair->track2()->Track()->NSigmaPion()) < mPiSigma);
54  isKPair = is1K && (TMath::Abs(pair->track2()->Track()->NSigmaKaon()) < mKSigma);
55  }
56  else
57  {
58  isElPair = is1El && (pair->track2()->Track()->PidProbElectron() <= mElPIDMax);
59  isPiPair = is1Pi && (pair->track2()->Track()->PidProbPion() <= mPiPIDMax);
60  isKPair = is1K && (pair->track2()->Track()->PidProbKaon() <= mKPIDMax);
61  }
62  }
63  else
64  {
65  if (pair->track2()->Track()->P().mag() < mPIDPThreshold)
66  {
67  bool is2El = (TMath::Abs(pair->track2()->Track()->NSigmaElectron()) < mElSigma);
68  bool is2Pi = (TMath::Abs(pair->track2()->Track()->NSigmaPion()) < mPiSigma);
69  bool is2K = (TMath::Abs(pair->track2()->Track()->NSigmaKaon()) < mKSigma);
70  isElPair = is2El && (pair->track1()->Track()->PidProbElectron() <= mElPIDMax);
71  isPiPair = is2Pi && (pair->track1()->Track()->PidProbPion() <= mPiPIDMax);
72  isKPair = is2K && (pair->track1()->Track()->PidProbKaon() <= mKPIDMax);
73  }
74  else
75  {
76  isElPair = (pair->track1()->Track()->PidProbElectron() * pair->track2()->Track()->PidProbElectron()) < mElPIDMax;
77  isPiPair = (pair->track1()->Track()->PidProbPion() * pair->track2()->Track()->PidProbPion()) < mPiPIDMax;
78  isKPair = (pair->track1()->Track()->PidProbKaon() * pair->track2()->Track()->PidProbKaon()) < mKPIDMax;
79  }
80  }
81  bool temp = ( pair->track1()->TrackId()!=pair->track2()->TrackId() &&
82  (!isElPair) &&
83  (!isPiPair) &&
84  (!isKPair) &&
85  pair->getFracOfMergedRow()<mMaxFracPair
86  );
87  temp ? mNPairsPassed++ : mNPairsFailed++;
88  return temp;
89 }
90 //__________________
91 StHbtString adamsPairCut::Report(){
92  string Stemp = "Adams Pair Cut - cut on e+e- pi+pi+ K+K- using NSigma\n";
93  char Ctemp[100];
94  sprintf(Ctemp,"Number of pairs which passed:\t%ld Number which failed:\t%ld\n",mNPairsPassed,mNPairsFailed);
95  Stemp += Ctemp;
96  StHbtString returnThis = Stemp;
97  return returnThis;
98 }
99 //__________________
100 std::ostringstream* adamsPairCut::finalReport() const{
101  std::ostringstream* tFinalReport = new std::ostringstream;
102  (*tFinalReport) << "_____ Adams pair Cut _____ " << endl
103  << " N pairs passed : " << mNPairsPassed << endl
104  << " N pairs failed : " << mNPairsFailed << endl
105  << ends;
106  return tFinalReport;
107 }