All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Classes | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | List of all members
sbn::details::TriggerResponseManager::Extractors Class Reference

Trigger information extractors tied to an event. More...

#include <TriggerResponseManager.h>

Classes

struct  TriggerInputData_t
 Data pertaining a single branch. More...
 

Public Member Functions

 Extractors (art::Event const &event, std::vector< TriggerInfoBranch_t > &branchInfoList)
 Reads all data from events needed for branches in branchInfoList. More...
 
void fetch (std::size_t iEntry)
 
 Extractors (art::Event const &event, std::vector< TriggerInfoBranch_t > &branchInfoList)
 Reads all data from events needed for branches in branchInfoList. More...
 
void fetch (std::size_t iEntry)
 

Static Public Member Functions

static void consumesInputData (art::ConsumesCollector &collector, TriggerInfoBranch_t const &branchInfo)
 Declares all data products that need to be read for branchInfo. More...
 
static void consumesInputData (art::ConsumesCollector &collector, TriggerInfoBranch_t const &branchInfo)
 Declares all data products that need to be read for branchInfo. More...
 

Private Member Functions

TriggerInputData_t buildInputData (art::Event const &event, TriggerInfoBranch_t const &branchInfo) const
 Returns all data necessary to branchInfo extracted from event. More...
 
void fetchBranch (TriggerInfoBranch_t const &info, TriggerInputData_t &inputData, std::size_t iEntry)
 
TriggerInputData_t buildInputData (art::Event const &event, TriggerInfoBranch_t const &branchInfo) const
 Returns all data necessary to branchInfo extracted from event. More...
 
void fetchBranch (TriggerInfoBranch_t const &info, TriggerInputData_t &inputData, std::size_t iEntry)
 

Private Attributes

std::vector
< TriggerInfoBranch_t > const * 
fBranchInfo { nullptr }
 Pointer to the information for each supported branch. More...
 
std::vector< TriggerInputData_tfInputData
 Data for each branch in this event (index parallel to fBranchInfo). More...
 

Detailed Description

Trigger information extractors tied to an event.

Definition at line 130 of file Analysis/trigger/details/TriggerResponseManager.h.

Constructor & Destructor Documentation

sbn::details::TriggerResponseManager::Extractors::Extractors ( art::Event const &  event,
std::vector< TriggerInfoBranch_t > &  branchInfoList 
)

Reads all data from events needed for branches in branchInfoList.

Definition at line 36 of file Analysis/trigger/details/TriggerResponseManager.cxx.

37  : fBranchInfo(&branchInfoList)
38 {
39 
40  for (TriggerInfoBranch_t const& branchInfo: *fBranchInfo)
41  fInputData.emplace_back(buildInputData(event, branchInfo));
42 
43 } // sbn::details::TriggerResponseManager::Extractors::Extractors()
TriggerInputData_t buildInputData(art::Event const &event, TriggerInfoBranch_t const &branchInfo) const
Returns all data necessary to branchInfo extracted from event.
std::vector< TriggerInfoBranch_t > const * fBranchInfo
Pointer to the information for each supported branch.
std::vector< TriggerInputData_t > fInputData
Data for each branch in this event (index parallel to fBranchInfo).
sbn::details::TriggerResponseManager::Extractors::Extractors ( art::Event const &  event,
std::vector< TriggerInfoBranch_t > &  branchInfoList 
)

Reads all data from events needed for branches in branchInfoList.

Member Function Documentation

auto sbn::details::TriggerResponseManager::Extractors::buildInputData ( art::Event const &  event,
TriggerInfoBranch_t const &  branchInfo 
) const
private

Returns all data necessary to branchInfo extracted from event.

Definition at line 72 of file Analysis/trigger/details/TriggerResponseManager.cxx.

74 {
75 
76  return TriggerInputData_t{
77  event.getValidHandle<std::vector<raw::Trigger>>(branchInfo.triggerTag)
78  .product() // triggers
79  };
80 
81 } // sbn::details::TriggerResponseManager::Extractors::buildInputData()
TriggerInputData_t sbn::details::TriggerResponseManager::Extractors::buildInputData ( art::Event const &  event,
TriggerInfoBranch_t const &  branchInfo 
) const
private

Returns all data necessary to branchInfo extracted from event.

static void sbn::details::TriggerResponseManager::Extractors::consumesInputData ( art::ConsumesCollector &  collector,
TriggerInfoBranch_t const &  branchInfo 
)
static

Declares all data products that need to be read for branchInfo.

void sbn::details::TriggerResponseManager::Extractors::consumesInputData ( art::ConsumesCollector &  collector,
TriggerInfoBranch_t const &  branchInfo 
)
static

Declares all data products that need to be read for branchInfo.

Definition at line 62 of file Analysis/trigger/details/TriggerResponseManager.cxx.

63 {
64 
65  collector.consumes<std::vector<raw::Trigger>>(branchInfo.triggerTag);
66 
67 } // sbn::details::TriggerResponseManager::Extractors::consumesInputData()
void sbn::details::TriggerResponseManager::Extractors::fetch ( std::size_t  iEntry)

Fills all branch data with information from trigger entries with index iEntry.

void sbn::details::TriggerResponseManager::Extractors::fetch ( std::size_t  iEntry)

Fills all branch data with information from trigger entries with index iEntry.

Definition at line 47 of file Analysis/trigger/details/TriggerResponseManager.cxx.

48 {
49  assert(fBranchInfo);
50 
51  std::vector<TriggerInfoBranch_t> const& branchInfo = *fBranchInfo;
52  assert(branchInfo.size() == fInputData.size());
53 
54  for (std::size_t iBranch: util::counter(branchInfo.size()))
55  fetchBranch(branchInfo[iBranch], fInputData[iBranch], iEntry);
56 
57 } // sbn::details::TriggerResponseManager::Extractors::fetch()
void fetchBranch(TriggerInfoBranch_t const &info, TriggerInputData_t &inputData, std::size_t iEntry)
std::vector< TriggerInfoBranch_t > const * fBranchInfo
Pointer to the information for each supported branch.
auto counter(T begin, T end)
Returns an object to iterate values from begin to end in a range-for loop.
Definition: counter.h:285
std::vector< TriggerInputData_t > fInputData
Data for each branch in this event (index parallel to fBranchInfo).
void sbn::details::TriggerResponseManager::Extractors::fetchBranch ( TriggerInfoBranch_t const &  info,
TriggerInputData_t inputData,
std::size_t  iEntry 
)
private

Fills the specified trigger logic branch with information from its trigger results using the inputData entry with index iEntry.

Definition at line 85 of file Analysis/trigger/details/TriggerResponseManager.cxx.

89  {
90  assert(inputData.triggers);
91 
92  raw::Trigger const& trigger = inputData.triggers->at(iEntry);
93  TriggerInfo_t& data = *(info.data);
94 
95  data.fired = (trigger.TriggerBits() != 0);
96  data.triggerTime = trigger.TriggerTime();
97  data.gateTime = trigger.BeamGateTime();
98 
99 } // sbn::details::TriggerResponseManager::Extractors::fetchBranch()
double TriggerTime() const
Trigger time w.r.t. electronics clock T0 in us.
Definition: TriggerData.h:50
double BeamGateTime() const
BeamGate time w.r.t. electronics clock T0 in us.
Definition: TriggerData.h:52
unsigned int TriggerBits() const
Trigger Bits.
Definition: TriggerData.h:54
void sbn::details::TriggerResponseManager::Extractors::fetchBranch ( TriggerInfoBranch_t const &  info,
TriggerInputData_t inputData,
std::size_t  iEntry 
)
private

Fills the specified trigger logic branch with information from its trigger results using the inputData entry with index iEntry.

Member Data Documentation

std::vector< TriggerInfoBranch_t > const * sbn::details::TriggerResponseManager::Extractors::fBranchInfo { nullptr }
private

Pointer to the information for each supported branch.

Definition at line 138 of file Analysis/trigger/details/TriggerResponseManager.h.

std::vector< TriggerInputData_t > sbn::details::TriggerResponseManager::Extractors::fInputData
private

Data for each branch in this event (index parallel to fBranchInfo).

Definition at line 141 of file Analysis/trigger/details/TriggerResponseManager.h.


The documentation for this class was generated from the following files: