StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
OpenAngPairCut.cxx
1 /***************************************************************************
2  *
3  * $Id: OpenAngPairCut.cxx,v 1.1 2000/10/26 16:09:11 lisa 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  * cut on nominal Opening angle of the pair - for dealing with track merging
10  *
11  ***************************************************************************
12  *
13  * $Log: OpenAngPairCut.cxx,v $
14  * Revision 1.1 2000/10/26 16:09:11 lisa
15  * Added OpeningAngle PairCut class and method to StHbtPair
16  *
17  *
18  **************************************************************************/
19 
20 #include "StHbtMaker/Cut/OpenAngPairCut.h"
21 #include <string>
22 #include <cstdio>
23 
24 #ifdef __ROOT__
25 ClassImp(OpenAngPairCut)
26 #endif
27 
28 //__________________
29 OpenAngPairCut::OpenAngPairCut(){
30  mNPairsPassed = mNPairsFailed = 0;
31 }
32 //__________________
33 //OpenAngPairCut::~OpenAngPairCut(){
34 // /* no-op */
35 //}
36 //__________________
37 bool OpenAngPairCut::Pass(const StHbtPair* pair){
38  double openAng = pair->OpeningAngle();
39  bool temp = ( (openAng>mLo) &&
40  (openAng<mHi) );
41 
42  temp ? mNPairsPassed++ : mNPairsFailed++;
43  return temp;
44 }
45 //__________________
46 StHbtString OpenAngPairCut::Report(){
47  string Stemp = "Opening Angle Pair Cut\n";
48  char Ctemp[100];
49  sprintf(Ctemp,"Range of cut:\t%E ... \t%E\n",mLo,mHi);
50  Stemp += Ctemp;
51  sprintf(Ctemp,"Number of pairs which passed:\t%ld Number which failed:\t%ld\n",mNPairsPassed,mNPairsFailed);
52  Stemp += Ctemp;
53  StHbtString returnThis = Stemp;
54  return returnThis;
55 }
56 //__________________
57 void OpenAngPairCut::SetOpenAngRange(const double& Lo, const double& Hi) {
58  mLo = Lo;
59  mHi = Hi;
60 }
61 //__________________