StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
ManyPairCuts.cxx
1 /***************************************************************************
2  *
3  * $Id: ManyPairCuts.cxx,v 1.2 2003/02/02 21:43:58 magestro 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  * ManyPairCuts is a StHbtPairCut that simply owns a collection
10  * of StHbtPairCut objects, and returns the AND of their return values
11  *
12  ***************************************************************************
13  *
14  * $Log: ManyPairCuts.cxx,v $
15  * Revision 1.2 2003/02/02 21:43:58 magestro
16  * Small change to remove compiler warning
17  *
18  * Revision 1.1 2000/07/31 01:19:24 lisa
19  * add PairCut which contains collection of PairCuts - also 3D bertsch-pratt CorrFctn
20  *
21  *
22  **************************************************************************/
23 
24 #include "StHbtMaker/Cut/ManyPairCuts.h"
25 #include <string>
26 #include <cstdio>
27 
28 #ifdef __ROOT__
29 ClassImp(ManyPairCuts)
30 #endif
31 
32 //__________________
33 ManyPairCuts::ManyPairCuts(){
34  mNPairsPassed = mNPairsFailed = 0;
35 }
36 //__________________
37 //ManyPairCuts::~ManyPairCuts(){
38 // /* no-op */
39 //}
40 //__________________
41 bool ManyPairCuts::Pass(const StHbtPair* pair){
42  // loop over all PairCuts in the collection... at the first failure, return "false"
43 
44  for (StHbtPairCutIterator iter=mPairCutCollection.begin();iter!=mPairCutCollection.end();iter++){
45  if (!((*iter)->Pass(pair))){
46  mNPairsFailed++;
47  return false;
48  }
49  }
50  // if you make it out of that loop, then you passed all cuts...
51  mNPairsPassed++;
52  return true;
53 }
54 //__________________
55 StHbtString ManyPairCuts::Report(){
56  string Stemp = "ManyPairCuts Report\n";
57  char Ctemp[100];
58  sprintf(Ctemp,"Number of pairs which passed:\t%li Number which failed:\t%li\n",mNPairsPassed,mNPairsFailed);
59  Stemp += Ctemp;
60  sprintf(Ctemp,"Here are the reports from the\t%i PairCuts in the collection\n",mPairCutCollection.size());
61  Stemp += Ctemp;
62 
63  for (StHbtPairCutIterator iter=mPairCutCollection.begin();iter!=mPairCutCollection.end();iter++){
64  Stemp += (*iter)->Report();
65  }
66  StHbtString returnThis = Stemp;
67  return returnThis;
68 }
69 //__________________