00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012 #include "MessageService/MsgService.h"
00013 #include "MinosObjectMap/MomNavigator.h"
00014 #include "CandData/CandRecord.h"
00015 #include "CandData/CandHeader.h"
00016 #include "RecoBase/CandFitTrackListHandle.h"
00017 #include "RecoBase/CandFitTrackHandle.h"
00018 #include "JobControl/JobCModuleRegistry.h"
00019
00020 #include "DataUtil/GetCandidate.h"
00021 #include "DataUtil/GetCandHeader.h"
00022 #include "DataUtil/CDL2STL.h"
00023
00024 #include "StopMuFilterModule.h"
00025 #include "StopMuFinder.h"
00026 #include "StopMuFinderFactory.h"
00027
00028 JOBMODULE(StopMuFilterModule, "StopMuFilterModule",
00029 "Filter out stopping mu candidates");
00030
00031 CVSID("$Id: StopMuFilterModule.cxx,v 1.3 2007/03/01 17:15:43 rhatcher Exp $");
00032
00033 using std::list;
00034 using DataUtil::GetCandidate;
00035 using DataUtil::GetCandHeader;
00036 using DataUtil::CDL2STLlist;
00037
00038
00040 StopMuFilterModule::StopMuFilterModule()
00041 {
00042 MSG("StopMuFilterModule",Msg::kDebug)
00043 << "StopMuFilterModule::StopMuFilterModule()" << endl;
00044
00045
00046
00047 fStopMuFinder = 0;
00048 }
00049
00050
00051
00053 StopMuFilterModule::~StopMuFilterModule()
00054 {
00055 MSG("StopMuFilterModule",Msg::kDebug)
00056 << "StopMuFilterModule::~StopMuFilterModule()" << endl;
00057
00058
00059 delete fStopMuFinder;
00060 }
00061
00062
00063
00065 void StopMuFilterModule::BeginJob()
00066 {
00067 MSG("StopMuFilterModule",Msg::kDebug)
00068 << "StopMuFilterModule::BeginJob()" << endl;
00069
00070 }
00071
00072
00073
00075 void StopMuFilterModule::EndJob()
00076 {
00077 MSG("StopMuFilterModule",Msg::kDebug)
00078 << "StopMuFilterModule::EndJob()" << endl;
00079
00080 }
00081
00082
00083
00085 JobCResult StopMuFilterModule::Ana(const MomNavigator* mom)
00086 {
00087 MSG("StopMuFilterModule",Msg::kDebug)
00088 << "StopMuFilterModule::Ana(const MomNavigator*)" << endl;
00089
00090
00091 static Bool_t first = kTRUE;
00092 if ( first ) {
00093 first = kFALSE;
00094
00095
00096 const CandHeader* candHeader = GetCandHeader ( mom );
00097
00098 if ( !candHeader ) {
00099 MSG("StopMuFilterModule",Msg::kFatal)
00100 << "No CandHeader when reading the first record - "
00101 "input file must be candidates!!" << endl;
00102 exit(0);
00103 }
00104
00105 const VldContext vldc = candHeader->GetVldContext();
00106
00107
00108 fStopMuFinder = StopMuFinderFactory::Instance().
00109 CreateStopMuFinder(vldc);
00110
00111
00112 fStopMuFinder->Configure(GetConfig());
00113 }
00114
00115
00116 if ( fStopMuFinder->IsStopping(mom) ) {
00117 return JobCResult::kPassed;
00118 } else {
00119 return JobCResult::kFailed;
00120 }
00121 }
00122
00123
00124
00126 const Registry& StopMuFilterModule::DefaultConfig() const
00127 {
00128 MSG("StopMuFilterModule",Msg::kDebug)
00129 << "const Registry& StopMuFilterModule::DefaultConfig() const" << endl;
00130
00131 static Registry r;
00132
00133
00134 std::string name = this->GetName();
00135 name += ".config.default";
00136 r.SetName(name.c_str());
00137
00138
00139 r.UnLockValues();
00140
00141
00142 r.Set("CandTrackList", "CandFitTrackSRList");
00143 r.Set("MinZDistance", 0.5);
00144 r.Set("MinRadius", 0.5);
00145 r.Set("MaxRadius", 3.5);
00146 r.Set("MinNPlanes", 10);
00147 r.LockValues();
00148
00149 return r;
00150 }