00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #include "StHbtMaker/Cut/AverageSepPairCut.h"
00021 #include <string>
00022 #include <cstdio>
00023
00024 #ifdef __ROOT__
00025 ClassImp(AverageSepPairCut)
00026 #endif
00027
00028
00029 AverageSepPairCut::AverageSepPairCut(){
00030 mNPairsPassed = mNPairsFailed = 0;
00031 }
00032
00033
00034
00035
00036
00037 bool AverageSepPairCut::Pass(const StHbtPair* pair){
00038 double sep = pair->NominalTpcAverageSeparation();
00039 bool temp = ( (sep>mAveSepLo) &&
00040 (sep<mAveSepHi) );
00041
00042 temp ? mNPairsPassed++ : mNPairsFailed++;
00043 return temp;
00044 }
00045
00046 StHbtString AverageSepPairCut::Report(){
00047 string Stemp = "Average Separation Pair Cut\n";
00048 char Ctemp[100];
00049 sprintf(Ctemp,"Range of cut:\t%E ... \t%E\n",mAveSepLo,mAveSepHi);
00050 Stemp += Ctemp;
00051 sprintf(Ctemp,"Number of pairs which passed:\t%ld Number which failed:\t%ld\n",mNPairsPassed,mNPairsFailed);
00052 Stemp += Ctemp;
00053 StHbtString returnThis = Stemp;
00054 return returnThis;
00055 }
00056
00057 void AverageSepPairCut::SetAveSepRange(const double& Lo, const double& Hi) {
00058 mAveSepLo = Lo;
00059 mAveSepHi = Hi;
00060 }
00061