Public Member Functions | Private Attributes | List of all members
arttest::FlushingGeneratorDetail Class Reference

Public Member Functions

 FlushingGeneratorDetail (FlushingGeneratorDetail const &)=delete
 
FlushingGeneratorDetailoperator= (FlushingGeneratorDetail const &)=delete
 
 FlushingGeneratorDetail (fhicl::ParameterSet const &ps, art::ProductRegistryHelper &help, art::SourceHelper const &sHelper)
 
void closeCurrentFile ()
 
void readFile (std::string const &name, art::FileBlock *&fb)
 
bool readNext (art::RunPrincipal *const inR, art::SubRunPrincipal *const inSR, art::RunPrincipal *&outR, art::SubRunPrincipal *&outSR, art::EventPrincipal *&outE)
 

Private Attributes

bool readFileCalled_
 
art::SourceHelper const & sHelper_
 
size_t ev_num_
 
art::EventID curr_evid_
 

Detailed Description

Definition at line 15 of file FlushingGenerator_source.cc.

Constructor & Destructor Documentation

arttest::FlushingGeneratorDetail::FlushingGeneratorDetail ( FlushingGeneratorDetail const &  )
delete
arttest::FlushingGeneratorDetail::FlushingGeneratorDetail ( fhicl::ParameterSet const &  ps,
art::ProductRegistryHelper help,
art::SourceHelper const &  sHelper 
)

Member Function Documentation

void arttest::FlushingGeneratorDetail::closeCurrentFile ( )

Definition at line 49 of file FlushingGenerator_source.cc.

50 {}
FlushingGeneratorDetail& arttest::FlushingGeneratorDetail::operator= ( FlushingGeneratorDetail const &  )
delete
void arttest::FlushingGeneratorDetail::readFile ( std::string const &  name,
art::FileBlock *&  fb 
)

Definition at line 53 of file FlushingGenerator_source.cc.

55 {
56  assert(!readFileCalled_);
57  assert(name.empty());
58  readFileCalled_ = true;
59  fb = new art::FileBlock(art::FileFormatVersion(1, "FlushingGenerator2012"),
60  "nothing");
61 }
bool arttest::FlushingGeneratorDetail::readNext ( art::RunPrincipal *const  inR,
art::SubRunPrincipal *const  inSR,
art::RunPrincipal *&  outR,
art::SubRunPrincipal *&  outSR,
art::EventPrincipal *&  outE 
)

Definition at line 64 of file FlushingGenerator_source.cc.

69 {
70  art::Timestamp runstart;
71  if (++ev_num_ > 17) { // Done.
72  return false;
73  } else if (ev_num_ == 3) { // Flush subrun, current run.
74  art::EventID const evid(art::EventID::flushEvent(inR->runID()));
75  outSR = sHelper_.makeSubRunPrincipal(evid.subRunID(), runstart);
76  outE = sHelper_.makeEventPrincipal(evid, runstart);
78  } else if (ev_num_ == 6) { // Flush run.
80  outR = sHelper_.makeRunPrincipal(evid.runID(), runstart);
81  outSR = sHelper_.makeSubRunPrincipal(evid.subRunID(), runstart);
82  outE = sHelper_.makeEventPrincipal(evid, runstart);
84  } else if (ev_num_ == 11 || ev_num_ == 12 ||
85  ev_num_ == 16) { // Flush event. current run, next subrun
87  runstart);
88  art::EventID const evid(art::EventID::flushEvent(outSR->subRunID()));
89  outE = sHelper_.makeEventPrincipal(evid, runstart);
91  } else {
92  if (inR == nullptr || inR->runID() != curr_evid_.runID()) {
93  outR = sHelper_.makeRunPrincipal(curr_evid_.runID(), runstart);
94  }
95  if (inSR == nullptr || inSR->subRunID() != curr_evid_.subRunID()) {
96  outSR = sHelper_.makeSubRunPrincipal(curr_evid_.subRunID(), runstart);
97  }
98  outE = sHelper_.makeEventPrincipal(curr_evid_, runstart);
100  }
101  std::cout << "ev_num_ = " << ev_num_ << std::endl;
102  return true;
103 }
RunID const & runID() const
Definition: EventID.h:93
static constexpr EventID flushEvent() noexcept
Definition: EventID.h:222
SubRunID const & subRunID() const
Definition: EventID.h:105
EventID next() const
Definition: EventID.h:135
RunID const & runID() const
Definition: Principal.cc:1174
SubRunPrincipal * makeSubRunPrincipal(SubRunAuxiliary const &subRunAux) const
Definition: SourceHelper.cc:83
RunPrincipal * makeRunPrincipal(RunAuxiliary const &runAux) const
Definition: SourceHelper.cc:55
SubRunID subRunID() const
Definition: Principal.cc:1180
EventID nextSubRun(EventNumber_t first=IDNumber< Level::Event >::first()) const
Definition: EventID.h:148
EventPrincipal * makeEventPrincipal(EventAuxiliary const &eventAux, std::unique_ptr< History > &&history) const
EventID nextRun() const
Definition: EventID.h:154

Member Data Documentation

art::EventID arttest::FlushingGeneratorDetail::curr_evid_
private

Definition at line 38 of file FlushingGenerator_source.cc.

size_t arttest::FlushingGeneratorDetail::ev_num_
private

Definition at line 37 of file FlushingGenerator_source.cc.

bool arttest::FlushingGeneratorDetail::readFileCalled_
private

Definition at line 35 of file FlushingGenerator_source.cc.

art::SourceHelper const& arttest::FlushingGeneratorDetail::sHelper_
private

Definition at line 36 of file FlushingGenerator_source.cc.


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