StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
HitMergingPairCut.cxx
1 /***************************************************************************
2  *
3  * $Id: HitMergingPairCut.cxx,v 1.2 2003/09/02 17:58:21 perev Exp $
4  *
5  * Author: Fabrice Retiere
6  ***************************************************************************
7  *
8  * Description: Allow to cut on hit merging
9  * Usage :
10  * HitMergingPairCut* pairCut = new HitMergingPairCut();
11  * pairCut->setDefaultHalfFieldMergingPar();
12  * pairCut->setMaxFracOfMergedRow(MaxMergedHit);
13  *
14  ***************************************************************************
15  *
16  * $Log: HitMergingPairCut.cxx,v $
17  * Revision 1.2 2003/09/02 17:58:21 perev
18  * gcc 3.2 updates + WarnOff
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  *
24  **************************************************************************/
25 
26 #include "StHbtMaker/Cut/HitMergingPairCut.h"
27 #include "Infrastructure/StHbtPair.hh"
28 #include <string>
29 #include <cstdio>
30 #include <Stsstream.h>
31 
32 #ifdef __ROOT__
33 ClassImp(HitMergingPairCut)
34 #endif
35 
36 //__________________
37 HitMergingPairCut::HitMergingPairCut(){
38  mNPairsPassed = mNPairsFailed = 0;
39  mMaxFracPair= 0.2;
40  setDefaultHalfFieldMergingPar();
41 }
42 //__________________
43 //HitMergingPairCut::~HitMergingPairCut(){
44 // /* no-op */
45 //}
46 
47 void HitMergingPairCut::setMergingPar(double aMaxDuInner, double aMaxDzInner,
48  double aMaxDuOuter, double aMaxDzOuter){
49  StHbtPair tPair;
50  tPair.setMergingPar(aMaxDuInner, aMaxDzInner,
51  aMaxDuOuter, aMaxDzOuter);
52 }
53 void HitMergingPairCut::setDefaultFullFieldMergingPar(){
54  StHbtPair tPair;
55  tPair.setDefaultFullFieldMergingPar();
56 }
57 void HitMergingPairCut::setDefaultHalfFieldMergingPar(){
58  StHbtPair tPair;
59  tPair.setDefaultHalfFieldMergingPar();
60 }
61 
62 //__________________
63 bool HitMergingPairCut::Pass(const StHbtPair* pair){
64  bool temp = pair->getFracOfMergedRow()<mMaxFracPair;
65  temp ? mNPairsPassed++ : mNPairsFailed++;
66  return temp;
67 }
68 //__________________
69 StHbtString HitMergingPairCut::Report(){
70  string Stemp = "HitMerging Pair Cut - total dummy-- always returns true\n";
71  char Ctemp[100];
72  sprintf(Ctemp,"Number of pairs which passed:\t%ld Number which failed:\t%ld\n",mNPairsPassed,mNPairsFailed);
73  Stemp += Ctemp;
74  StHbtString returnThis = Stemp;
75  return returnThis;
76 }
77 //__________________
78 std::ostringstream* HitMergingPairCut::finalReport() const{
79  std::ostringstream* tFinalReport = new std::ostringstream;
80  (*tFinalReport) << "_____ HitMerging pair Cut _____ " << endl
81  << " N pairs passed : " << mNPairsPassed << endl
82  << " N pairs failed : " << mNPairsFailed << endl
83  << ends;
84  return tFinalReport;
85 }