20 #include "canvas/Persistency/Common/FindManyP.h" 68 art::FindManyP<raw::ExternalTrigger> triggers(t0Handle,e,
fT0ModuleLabel);
70 for (
size_t i_t0 = 0; i_t0 < t0Handle->size(); i_t0++)
73 std::vector< art::Ptr<raw::ExternalTrigger> > trigvec = triggers.at(i_t0);
74 if (trigvec.size() != 3)
continue;
76 int contains_111 = 0, contains_112 = 0, contains_113 = 0;
77 int contains_Ntrigs = 0, contains_NU = 0, contains_NL = 0, contains_SU = 0, contains_SL = 0;
78 int contains_EL = 0, contains_WU = 0, contains_TEL = 0;
79 for (
auto const &trig : trigvec)
81 unsigned int trigID = trig->GetTrigID();
84 if (trigID <= 5) contains_SL++;
85 if (trigID >= 6 && trigID <= 15) contains_EL++;
86 if (trigID >= 16 && trigID <= 21) contains_NL++;
87 if (trigID >= 22 && trigID <= 27) contains_NU++;
88 if (trigID >= 28 && trigID <= 37) contains_WU++;
89 if (trigID >= 38 && trigID <= 43) contains_SU++;
90 if (trigID >= 44 && trigID <= 92) contains_TEL++;
91 if (trigID == 111) contains_111++;
92 if (trigID == 112) contains_112++;
93 if (trigID == 113) contains_113++;
96 if (contains_111 + contains_112 + contains_113 != 1)
continue;
98 (contains_NU || contains_NL || contains_SU || contains_SL || contains_EL || contains_WU))
continue;
99 if (contains_Ntrigs != 3)
continue;
100 if (contains_111 && (contains_NU || contains_NL || contains_SU || contains_SL))
continue;
101 if (contains_112 && (contains_EL || contains_WU || contains_SU || contains_NL))
continue;
102 if (contains_113 && (contains_EL || contains_WU || contains_NU || contains_SL))
continue;
103 if (contains_111 && (!contains_EL || !contains_WU))
continue;
104 if (contains_112 && (!contains_NU || !contains_SL))
continue;
105 if (contains_113 && (!contains_SU || !contains_NL))
continue;
107 std::vector<unsigned int> counterIDs;
108 unsigned int trignum = 0;
109 for (
auto const &trig : trigvec)
111 unsigned int trigID = trig->GetTrigID();
112 if (trigID >= 44 && trigID <= 100)
continue;
113 if (trigID >= 111 && trigID <= 113)
118 counterIDs.push_back(trigID);
120 if (counterIDs.size() != 2)
continue;
121 if (trignum == 0)
continue;
125 std::cout <<
"!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" <<
std::endl;
127 std::cout <<
" counter IDs " << counterIDs[0] <<
" and " << counterIDs[1] <<
std::endl;
128 std::cout <<
"!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" <<
std::endl;
139 if (c.size() != 2)
return false;
140 unsigned int c1 = c[0];
141 unsigned int c2 = c[1];
142 if (c1==c2)
return false;
143 if (c1%22 == c2 || c2%22 == c1)
return true;
EventNumber_t event() const
Handle< PROD > getHandle(SelectorBase const &) const
bool filter(art::Event &e) override
bool OppositeEW(std::vector< unsigned int > c)
#define DEFINE_ART_MODULE(klass)
T get(std::string const &key) const
CounterFilter(fhicl::ParameterSet const &p)
std::string fT0ModuleLabel
void reconfigure(fhicl::ParameterSet const &p)
EDFilter(fhicl::ParameterSet const &pset)
CounterFilter & operator=(CounterFilter const &)=delete
QTextStream & endl(QTextStream &s)