All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Classes | Public Types | Public Member Functions | Private Attributes | List of all members
sbn::EXTRetriever Class Reference
Inheritance diagram for sbn::EXTRetriever:

Classes

struct  Config
 

Public Types

using Parameters = art::EDProducer::Table< Config >
 

Public Member Functions

 EXTRetriever (Parameters const &params)
 
 EXTRetriever (EXTRetriever const &)=delete
 
 EXTRetriever (EXTRetriever &&)=delete
 
EXTRetrieveroperator= (EXTRetriever const &)=delete
 
EXTRetrieveroperator= (EXTRetriever &&)=delete
 
void produce (art::Event &e) override
 
void beginSubRun (art::SubRun &sr) override
 
void endSubRun (art::SubRun &sr) override
 

Private Attributes

std::vector< sbn::EXTCountInfofOutExtInfos
 
std::string raw_data_label_
 
int TotalEXTCounts
 

Detailed Description

Definition at line 42 of file EXTRetriever_module.cc.

Member Typedef Documentation

using sbn::EXTRetriever::Parameters = art::EDProducer::Table<Config>

Definition at line 57 of file EXTRetriever_module.cc.

Constructor & Destructor Documentation

sbn::EXTRetriever::EXTRetriever ( Parameters const &  params)
explicit

Definition at line 85 of file EXTRetriever_module.cc.

86  : EDProducer{params},
87  raw_data_label_(params().RawDataLabel())
88 {
89 
90  produces< std::vector< sbn::EXTCountInfo >, art::InSubRun >();
91  TotalEXTCounts = 0;
92 }
sbn::EXTRetriever::EXTRetriever ( EXTRetriever const &  )
delete
sbn::EXTRetriever::EXTRetriever ( EXTRetriever &&  )
delete

Member Function Documentation

void sbn::EXTRetriever::beginSubRun ( art::SubRun &  sr)
override

Definition at line 138 of file EXTRetriever_module.cc.

139 {
140  return;
141 }
void sbn::EXTRetriever::endSubRun ( art::SubRun &  sr)
override

Definition at line 144 of file EXTRetriever_module.cc.

145 {
146  // We will add all of the EXTCountInfo data-products to the
147  // art::SubRun so it persists
148  auto p = std::make_unique< std::vector< sbn::EXTCountInfo > >(fOutExtInfos);
149 
150  sr.put(std::move(p));
151 
152  return;
153 }
pdgs p
Definition: selectors.fcl:22
std::vector< sbn::EXTCountInfo > fOutExtInfos
EXTRetriever& sbn::EXTRetriever::operator= ( EXTRetriever const &  )
delete
EXTRetriever& sbn::EXTRetriever::operator= ( EXTRetriever &&  )
delete
void sbn::EXTRetriever::produce ( art::Event &  e)
override

Definition at line 94 of file EXTRetriever_module.cc.

95 {
96 
97  //Here we read in the artdaq Fragments and extract three pieces of information:
98  // 1. The time of the current event, t_current_event
99  // 2. the time of the previously triggered event, t_previous_event (NOTE: Events are non-sequential!)
100  // 3. the number of beam spills since the previously triggered event, number_of_gates_since_previous_event
101 
102  int gate_type = 0;
103  auto const & raw_data = e.getProduct< std::vector<artdaq::Fragment> >({ raw_data_label_, "ICARUSTriggerUDP" });
104 
105  unsigned int number_of_gates_since_previous_event = 0;
106 
107  for(auto raw_datum : raw_data){
108 
109  icarus::ICARUSTriggerUDPFragment frag(raw_datum);
110  std::string data = frag.GetDataString();
111  char *buffer = const_cast<char*>(data.c_str());
112  icarus::ICARUSTriggerInfo datastream_info = icarus::parse_ICARUSTriggerString(buffer);
113  gate_type = datastream_info.gate_type;
114  number_of_gates_since_previous_event = frag.getDeltaGatesBNB();
115 
116  }
117 
118  //We only want to process EXT gates, i.e. type 3
119  if(gate_type == 3)
120  {
121  // Keep track of the number of beam gates the DAQ thinks
122  // are in this file
123  TotalEXTCounts += number_of_gates_since_previous_event;
124 
125  //Store everything in our data-product
126  sbn::EXTCountInfo extInfo;
127  extInfo.gates_since_last_trigger = number_of_gates_since_previous_event;
128 
129  fOutExtInfos.push_back(extInfo);
130  // We do not write these to the art::Events because
131  // we can filter events but want to keep all the POT
132  // information, so we'll write it to the SubRun
133 
134  }//end check on gate type
135 } //end loop over events
std::vector< sbn::EXTCountInfo > fOutExtInfos
int gates_since_last_trigger
Definition: EXTCountInfo.h:16
do i e

Member Data Documentation

std::vector< sbn::EXTCountInfo > sbn::EXTRetriever::fOutExtInfos
private

Definition at line 76 of file EXTRetriever_module.cc.

std::string sbn::EXTRetriever::raw_data_label_
private

Definition at line 79 of file EXTRetriever_module.cc.

int sbn::EXTRetriever::TotalEXTCounts
private

Definition at line 80 of file EXTRetriever_module.cc.


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