StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
fabricesPairCut.cxx
1 /***************************************************************************
2  *
3  * $Id: fabricesPairCut.cxx,v 1.3 2003/09/02 17:58:21 perev Exp $
4  *
5  * Author: Mike Lisa, Ohio State, lisa@mps.ohio-state.edu
6  ***************************************************************************
7  *
8  * Description: part of STAR HBT Framework: StHbtMaker package
9  * a do-nothing pair cut that simply says "true" to every pair
10  *
11  ***************************************************************************
12  *
13  * $Log: fabricesPairCut.cxx,v $
14  * Revision 1.3 2003/09/02 17:58:21 perev
15  * gcc 3.2 updates + WarnOff
16  *
17  * Revision 1.2 2002/12/12 17:03:51 kisiel
18  * Add NDedxHits cut, slight modification for Y cuts and Fabrices probability
19  *
20  * Revision 1.1 2001/12/14 23:11:27 fretiere
21  * Add class HitMergingCut. Add class fabricesPairCut = HitMerginCut + pair purity cuts. Add TpcLocalTransform function which convert to local tpc coord (not pretty). Modify StHbtTrack, StHbtParticle, StHbtHiddenInfo, StHbtPair to handle the hit information and cope with my code
22  *
23  * Revision 1.3 2000/01/25 17:35:02 laue
24  * I. In order to run the stand alone version of the StHbtMaker the following
25  * changes have been done:
26  * a) all ClassDefs and ClassImps have been put into #ifdef __ROOT__ statements
27  * b) unnecessary includes of StMaker.h have been removed
28  * c) the subdirectory StHbtMaker/doc/Make has been created including everything
29  * needed for the stand alone version
30  *
31  * II. To reduce the amount of compiler warning
32  * a) some variables have been type casted
33  * b) some destructors have been declared as virtual
34  *
35  * Revision 1.2 1999/07/06 22:33:21 lisa
36  * Adjusted all to work in pro and new - dev itself is broken
37  *
38  * Revision 1.1.1.1 1999/06/29 16:02:56 lisa
39  * Installation of StHbtMaker
40  *
41  **************************************************************************/
42 
43 #include "StHbtMaker/Cut/fabricesPairCut.h"
44 #include <string>
45 #include <cstdio>
46 #include <Stsstream.h>
47 
48 #ifdef __ROOT__
49 ClassImp(fabricesPairCut)
50 #endif
51 
52 //__________________
53 fabricesPairCut::fabricesPairCut():HitMergingPairCut(){
54  mNPairsPassed = mNPairsFailed = 0;
55  mPiKPairMinProb=0.;
56  mPiPPairMinProb=0.;
57  mElPairMaxProb=1.;
58  mPiPiPairMaxProb=1.;
59  mKKPairMaxProb=1.;
60 }
61 //__________________
62 //fabricesPairCut::~fabricesPairCut(){
63 // /* no-op */
64 //}
65 //__________________
66 bool fabricesPairCut::Pass(const StHbtPair* pair){
67  bool temp = ( pair->track1()->TrackId()!=pair->track2()->TrackId() &&
68  pair->ElectronPairProbability() < mElPairMaxProb &&
69  ((pair->track1()->Track()->PidProbPion()) *
70  (pair->track2()->Track()->PidProbPion()))<=mPiPiPairMaxProb &&
71  ((pair->track1()->Track()->PidProbKaon()) *
72  (pair->track2()->Track()->PidProbKaon()))<=mKKPairMaxProb &&
73  ((pair->track1()->Track()->PidProbPion()) *
74  (pair->track2()->Track()->PidProbKaon()))>=mPiKPairMinProb &&
75  ((pair->track1()->Track()->PidProbPion()) *
76  (pair->track2()->Track()->PidProbProton()))>=mPiPPairMinProb &&
77  pair->getFracOfMergedRow()<mMaxFracPair
78  );
79  temp ? mNPairsPassed++ : mNPairsFailed++;
80  return temp;
81 }
82 //__________________
83 StHbtString fabricesPairCut::Report(){
84  string Stemp = "Fabrices Pair Cut - total dummy-- always returns true\n";
85  char Ctemp[100];
86  sprintf(Ctemp,"Number of pairs which passed:\t%ld Number which failed:\t%ld\n",mNPairsPassed,mNPairsFailed);
87  Stemp += Ctemp;
88  StHbtString returnThis = Stemp;
89  return returnThis;
90 }
91 //__________________
92 std::ostringstream* fabricesPairCut::finalReport() const{
93  std::ostringstream* tFinalReport = new std::ostringstream;
94  (*tFinalReport) << "_____ Fabrices pair Cut _____ " << endl
95  << " N pairs passed : " << mNPairsPassed << endl
96  << " N pairs failed : " << mNPairsFailed << endl
97  << ends;
98  return tFinalReport;
99 }