StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
qualityPairCut.cxx
1 /***************************************************************************
2  *
3  * $Id: qualityPairCut.cxx,v 1.2 2000/07/31 01:19:24 lisa Exp $
4  *
5  * Author: Randy Wells, Ohio State, rcwells@mps.ohio-state.edu
6  ***************************************************************************
7  *
8  * Description: part of STAR HBT Framework: StHbtMaker package
9  * Checks the Quality factor between two tracks ... if to high get thrown away
10  *
11  ***************************************************************************
12  *
13  * $Log: qualityPairCut.cxx,v $
14  * Revision 1.2 2000/07/31 01:19:24 lisa
15  * add PairCut which contains collection of PairCuts - also 3D bertsch-pratt CorrFctn
16  *
17  * Revision 1.1 2000/04/05 18:56:18 rcwells
18  * Adding class qualityPairCut
19  *
20  * Revision 1.3 2000/01/25 17:35:02 laue
21  * I. In order to run the stand alone version of the StHbtMaker the following
22  * changes have been done:
23  * a) all ClassDefs and ClassImps have been put into #ifdef __ROOT__ statements
24  * b) unnecessary includes of StMaker.h have been removed
25  * c) the subdirectory StHbtMaker/doc/Make has been created including everything
26  * needed for the stand alone version
27  *
28  * II. To reduce the amount of compiler warning
29  * a) some variables have been type casted
30  * b) some destructors have been declared as virtual
31  *
32  * Revision 1.2 1999/07/06 22:33:21 lisa
33  * Adjusted all to work in pro and new - dev itself is broken
34  *
35  * Revision 1.1.1.1 1999/06/29 16:02:56 lisa
36  * Installation of StHbtMaker
37  *
38  **************************************************************************/
39 
40 #include "StHbtMaker/Cut/qualityPairCut.h"
41 #include <string>
42 #include <cstdio>
43 
44 #ifdef __ROOT__
45 ClassImp(qualityPairCut)
46 #endif
47 
48 //__________________
49 qualityPairCut::qualityPairCut(){
50  mNPairsPassed = mNPairsFailed = 0;
51 }
52 //__________________
53 //qualityPairCut::~qualityPairCut(){
54 // /* no-op */
55 //}
56 //__________________
57 bool qualityPairCut::Pass(const StHbtPair* pair){
58  double qual = pair->quality();
59  bool temp = ( (qual>mQualCutLo) &&
60  (qual<mQualCutHi) );
61 
62  temp ? mNPairsPassed++ : mNPairsFailed++;
63  return temp;
64 }
65 //__________________
66 StHbtString qualityPairCut::Report(){
67  string Stemp = "Quality Pair Cut\n";
68  char Ctemp[100];
69  sprintf(Ctemp,"Range of cut:\t%E ... \t%E\n",mQualCutLo,mQualCutHi);
70  Stemp += Ctemp;
71  sprintf(Ctemp,"Number of pairs which passed:\t%ld Number which failed:\t%ld\n",mNPairsPassed,mNPairsFailed);
72  Stemp += Ctemp;
73  StHbtString returnThis = Stemp;
74  return returnThis;
75 }
76 //__________________
77 void qualityPairCut::SetQualityCut(const double& QualCutLo, const double& QualCutHi) {
78  mQualCutLo = QualCutLo;
79  mQualCutHi = QualCutHi;
80 }
81 //__________________