17 #include "art/Framework/Principal/Handle.h"
36 (art::Event
const& event, std::vector<TriggerInfoBranch_t>& branchInfoList)
37 : fBranchInfo(&branchInfoList)
41 fInputData.emplace_back(buildInputData(event, branchInfo));
51 std::vector<TriggerInfoBranch_t>
const& branchInfo = *
fBranchInfo;
52 assert(branchInfo.size() ==
fInputData.size());
65 collector.consumes<std::vector<raw::Trigger>>(branchInfo.
triggerTag);
77 event.getValidHandle<std::vector<raw::Trigger>>(branchInfo.
triggerTag)
110 static std::string
const specs {
"time/D:gateStart/D:fired/O" };
118 art::ConsumesCollector& collector,
124 declareConsumables(collector);
139 (art::ConsumesCollector& collector)
const
142 Extractors::consumesInputData(collector, branchInfo);
148 (TTree& tree, std::vector<TriggerInputSpec_t>
const&
triggerSpecs)
const
149 -> std::vector<TriggerInfoBranch_t>
151 std::vector<TriggerInfoBranch_t> branchInfoList;
153 branchInfoList.push_back(buildTriggerResponseBranch(tree, spec));
154 return branchInfoList;
168 branchInfo.
branch = tree.Branch(
169 spec.
name.c_str(), branchInfo.
data.get(),
170 TriggerInfo_t::TriggerResponseBranchStructure().c_str()
void declareConsumables(art::ConsumesCollector &collector) const
Declares all the data products we are going to read.
TriggerInfoBranch_t buildTriggerResponseBranch(TTree &tree, TriggerInputSpec_t const &spec) const
Sets up a tree branch and returns its branch information structure.
Data for a single trigger logic output branch.
std::vector< TriggerInfoBranch_t > fBranchInfo
Data structures for the tree.
static std::string const & TriggerResponseBranchStructure()
ROOT TTree specification for this data structure (leaf list).
std::unique_ptr< TriggerInfo_t > data
double TriggerTime() const
Trigger time w.r.t. electronics clock T0 in us.
auto counter(T begin, T end)
Returns an object to iterate values from begin to end in a range-for loop.
Helper managing the trigger response part of a TTree.
double BeamGateTime() const
BeamGate time w.r.t. electronics clock T0 in us.
Test of util::counter and support utilities.
std::vector< TriggerInfoBranch_t > buildTriggerResponseBranches(TTree &tree, std::vector< TriggerInputSpec_t > const &triggerSpecs) const
Sets up the tree branches and returns the branch information structures.
TriggerResponseManager(std::vector< TriggerInputSpec_t > const &triggerSpecs, art::ConsumesCollector &collector, TTree &tree)
Initializes tree to accommodate the specified trigger information.
Extractors extractorsFor(art::Event const &event)
Returns an object to extract trigger information from event.
Information about a single trigger logic (hardware or emulated).
unsigned int TriggerBits() const
Trigger Bits.
double gateTime
Time of the opening of the gate for the trigger evaluation.
bool fired
Whether this trigger fired.