31 #include <boost/format.hpp> 39 typedef std::pair<uint32_t, uint32_t>
TimeWindow;
60 (std::map<std::string, rb::Cluster>
const& input_clusters,
61 std::unique_ptr<std::vector<rb::Cluster> > & output_clusters,
69 produces<std::vector<rb::Cluster> >();
70 produces<std::vector<novaddt::TriggerDecision> >();
82 e.
getByLabel(
"smmhighadcfilter",
"HEHits", ddt_hits);
87 assert(raw_triggers->size() == 1);
92 std::vector<art::Ptr<rb::CellHit> > hitptrs;
93 for (
unsigned i = 0;
i < hits->size(); ++
i)
94 hitptrs.emplace_back(hits,
i);
96 int16_t adc_cut = 150;
98 event_time(raw_triggers->at(0).fTriggerTimingMarker_TimeStart);
106 config.max_plane_gap_cut = 30;
107 config.sparsification_factor = 10;
110 std::unique_ptr<std::vector<novaddt::TriggerDecision> >
114 std::cout <<
"MF: Trigger Decision Report" 115 <<
"\nMF: Run " << e.
run() <<
" Event " << e.
event()
116 <<
"\nMF: Trigger Decisions Size = " << trigger_decisions->size()
126 std::unique_ptr<std::vector<rb::Cluster> >
127 clusters(
new std::vector<rb::Cluster>);
129 if (trigger_decisions->size() > 0)
134 (hitptrs, time_window.first, time_window.second, adc_cut);
138 std::map<std::string, rb::Cluster> essential_clusters;
141 for (
auto const& essential_hit : essential_hit_list.second)
146 std::vector<art::Ptr<rb::CellHit> >
cluster_hits = hitptrs;
149 (cluster_hits.begin(), cluster_hits.end(),
155 if (matched_offline_hit != cluster_hits.end())
157 essential_clusters[essential_hit_list.first].
158 Add(*matched_offline_hit);
178 e.
put(std::move(trigger_decisions));
179 e.
put(std::move(clusters));
190 auto t_start = td.
start() + 2 * buffer - event_time;
191 auto t_end = td.
start() + td.
duration() - 2 * buffer - event_time;
199 (std::map<std::string, rb::Cluster>
const& input_clusters,
200 std::unique_ptr<std::vector<rb::Cluster> > & output_clusters,
203 auto cluster = input_clusters.find(cluster_name);
205 if (cluster != input_clusters.end())
207 if (cluster->second.NCell() > 0)
208 output_clusters->push_back(cluster->second);
void append_cluster(std::map< std::string, rb::Cluster > const &input_clusters, std::unique_ptr< std::vector< rb::Cluster > > &output_clusters, std::string const cluster_name) const
std::vector< novaddt::TriggerDecision > trigger_decisions() const
rb::Cluster cluster_hits(std::vector< art::Ptr< rb::CellHit > > const &hits, int32_t t_start, int32_t t_end, int16_t adc_cut=0)
A collection of associated CellHits.
std::pair< Spectrum *, CheatDecomp * > make_pair(SpectrumLoaderBase &loader_data, SpectrumLoaderBase &loader_mc, HistAxis *axis, Cut *cut, const SystShifts &shift, const Var &wei)
DEFINE_ART_MODULE(TestTMapFile)
::xsd::cxx::tree::buffer< char > buffer
bool filter(art::Event &e) override
std::map< std::string, novaddt::HitList > essential_hit_lists() const
ProductID put(std::unique_ptr< PROD > &&product)
void print(novaddt::DAQHit const &h, unsigned long long const &event_time=0)
unsigned trigger_decision_time_buffer() const
SlowMonopoleFilt(fhicl::ParameterSet const &p)
EventNumber_t event() const
std::pair< uint32_t, uint32_t > TimeWindow
TimeWindow calculate_time_window(novaddt::TriggerDecision const &td, unsigned buffer, novaddt::TDC event_time) const
bool getByLabel(std::string const &label, std::string const &productInstanceName, Handle< PROD > &result) const
assert(nhit_max >=nhit_nbins)
SlowMonopoleFilt & operator=(SlowMonopoleFilt const &)=delete
TDC::value_type duration() const
TDC::value_type start() const
bool is_equal(novaddt::DAQHit const &ddthit, art::Ptr< rb::CellHit > const &cellhit, novaddt::TDC const &event_time)