15 #include "art_root_io/TFileService.h" 44 ProtoDUNEFembFilter::ProtoDUNEFembFilter::ProtoDUNEFembFilter(
fhicl::ParameterSet const & pset):
53 if(fRequireBeamsideFembsOnly){
54 std::cout <<
"Filtering events with inactive FEMBs on beamside APAs"<<
std::endl;
57 std::cout <<
"Filtering events with any inactive FEMBs"<<
std::endl;
59 if(fRequireBeamsideTimestampConsistencyOnly){
60 std::cout <<
"Filtering events with inconsistent timestmaps on beamside APAs"<<
std::endl;
63 std::cout <<
"Filtering events with any inconsistent timestamps"<<
std::endl;
72 fSelectedEvents = tfs->make<TH1D>(
"fSelectedEvents",
"Number of Selected Events", 3, 0, 3);
73 fTotalEvents = tfs->make<TH1D>(
"fTotalEvents",
"Total Events", 3, 0, 3);
91 std::vector<int> BeamsideAPAs;
92 std::vector<int> AllAPAs;
93 std::vector<int> checkedAPAs;
94 std::vector<int> TScheckedAPAs;
97 BeamsideAPAs.push_back(0);
98 BeamsideAPAs.push_back(2);
99 BeamsideAPAs.push_back(4);
101 AllAPAs.push_back(0);
102 AllAPAs.push_back(1);
103 AllAPAs.push_back(2);
104 AllAPAs.push_back(3);
105 AllAPAs.push_back(4);
106 AllAPAs.push_back(5);
108 const std::string myname =
"ProtoDUNEFembFilter::filter: ";
111 checkedAPAs=BeamsideAPAs;
117 TScheckedAPAs=BeamsideAPAs;
120 TScheckedAPAs=AllAPAs;
125 std::set<int> checkedAPAset;
126 for (
size_t i=0; i < checkedAPAs.size(); ++i)
128 checkedAPAset.emplace(TScheckedAPAs.at(i));
135 for (
auto APA = checkedAPAs.begin(); APA != checkedAPAs.end(); ++APA){
147 ULong64_t timestamp=0;
148 ULong64_t timestamp2=0;
153 if (
fLogLevel >=2) std::cout<<
"ProtoDUNEFembFilter Timestamp mismatch: " << timestamp <<
" vs " << timestamp2 <<
" on TPC set " << apainconsist <<
std::endl;
156 if (
fLogLevel >=2 ) std::cout << myname << (keep ?
"Keep" :
"Reject") <<
"ing event." <<
std::endl;
protoana::ProtoDUNEDataUtils fDataUtils
virtual bool filter(art::Event &e)
ProtoDUNEFembFilter(fhicl::ParameterSet const &pset)
bool fRequireBeamsideFembsOnly
bool fRequireBeamsideTimestampConsistencyOnly
#define DEFINE_ART_MODULE(klass)
virtual ~ProtoDUNEFembFilter()
T get(std::string const &key) const
int GetNActiveFembsForAPA(art::Event const &evt, int apa) const
Get number of active fembs in an APA.
bool CheckTimeStampConsistencyForAPAs(art::Event const &evt, std::set< int > apas, ULong64_t ×tamp, ULong64_t ×tamp2, int &apainconsist) const
Check for consistency of timestamp values for a set of APAs. True if consistent, false if there are m...
EDFilter(fhicl::ParameterSet const &pset)
auto const & get(AssnsNode< L, R, D > const &r)
QTextStream & endl(QTextStream &s)