00001
00002
00003
00004
00005
00006
00007
00009 #include <iostream>
00010 using namespace std;
00011
00012 #include "CandNtupleSR/Module/NtpSRFilterModule.h"
00013 #include "CandNtupleSR/NtpSRRecord.h"
00014 #include "MessageService/MsgService.h"
00015 #include "JobControl/JobCModuleRegistry.h"
00016 #include "JobControl/JobCommand.h"
00017 #include "MinosObjectMap/MomNavigator.h"
00018
00019 #include <cassert>
00020
00021 ClassImp(NtpSRFilterModule)
00022
00023
00024
00025
00026 CVSID("$Id: NtpSRFilterModule.cxx,v 1.10 2005/03/06 04:26:34 asousa Exp $");
00027 JOBMODULE(NtpSRFilterModule, "NtpSRFilterModule",
00028 "A module for filtering filled SR ntuple records.");
00029
00030
00031
00032
00033
00034
00035
00036 const Registry& NtpSRFilterModule::DefaultConfig() const {
00037
00038
00039
00040
00041
00042
00043
00044
00045 MSG("NtpSR",Msg::kDebug) <<
00046 "NtpSRFilterModule::DefaultConfig" << endl;
00047
00048 static Registry r;
00049 std::string name = this->JobCModule::GetName();
00050 name += ".config.default";
00051 r.SetName(name.c_str());
00052
00053 r.UnLockValues();
00054 r.Set("PreScale",1000000000);
00055 r.Set("RecordName","Primary");
00056 r.LockValues();
00057
00058 return r;
00059 }
00060
00061
00062
00063 void NtpSRFilterModule::Config(const Registry& r) {
00064
00065
00066
00067
00068
00069
00070
00071
00072 MSG("NtpSR",Msg::kDebug) << "NtpSRFilterModule::Config" << endl;
00073
00074 Int_t tmpi;
00075
00076 const Char_t* tmps;
00077
00078 if ( r.Get("PreScale",tmpi) ) fPreScale = tmpi;
00079 if ( r.Get("RecordName",tmps) ) fRecordName = tmps;
00080
00081 }
00082
00083
00084
00085 JobCResult NtpSRFilterModule::Reco(MomNavigator *mom) {
00086
00087
00088
00089
00090
00091
00092
00093
00094 JobCResult result(JobCResult::kPassed);
00095 MSG("NtpSR",Msg::kDebug) << "NtpSRFilterModule::Reco" << endl;
00096
00097
00098 assert(mom);
00099
00100 NtpSRRecord* ntprec = dynamic_cast<NtpSRRecord*>
00101 (mom->GetFragment("NtpSRRecord",fRecordName.c_str()));
00102 if (!ntprec) {
00103 MSG("NtpSR",Msg::kWarning) << "No NtpSRRecord of name "
00104 << fRecordName.c_str() << " in Mom" << endl;
00105 result.SetWarning().SetFailed();
00106 return result;
00107 }
00108
00109 fNReco++;
00110 if ( fNReco%fPreScale == 0 ) return result;
00111
00112
00113 ntprec -> ClearStrips();
00114
00115 return result;
00116
00117 }
00118
00119
00120
00121
00122
00123