All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
InputSeeker.cc
Go to the documentation of this file.
2 
3 #include "art/Framework/Services/Registry/ActivityRegistry.h"
4 
5 #include "art_root_io/RootInput.h"
6 
7 namespace evd
8 {
9  //--------------------------------------------------------------------
10  InputSeeker::InputSeeker(const fhicl::ParameterSet&,
11  art::ActivityRegistry& reg)
12  {
13  reg.sPostBeginJobWorkers.watch(this, &InputSeeker::postBeginJobWorkers);
14  }
15 
16  //--------------------------------------------------------------------
17  void InputSeeker::postBeginJobWorkers(art::InputSource* src,
18  const std::vector<art::Worker*>&)
19  {
20  fSrc = dynamic_cast<art::RootInput*>(src);
21  if(!fSrc){
22  std::cout << "InputSource is not RootInput -- will not be able to seek backward" << std::endl;
23  }
24  }
25 
26  //--------------------------------------------------------------------
28  {
29  if(!fSrc){
30  std::cout << "Unable to seek" << std::endl;
31  return;
32  }
33  fSrc->seekToEvent(offset);
34  }
35 
36  //--------------------------------------------------------------------
37  void InputSeeker::seekToEvent(art::EventID evt)
38  {
39  if(!fSrc){
40  std::cout << "Unable to seek" << std::endl;
41  return;
42  }
43  fSrc->seekToEvent(evt);
44  }
45 }
BEGIN_PROLOG TPC Trig offset(g4 rise time) ProjectToHeight
Definition: CORSIKAGen.fcl:7
InputSeeker(const fhicl::ParameterSet &pset, art::ActivityRegistry &reg)
Definition: InputSeeker.cc:10
art::RootInput * fSrc
Definition: InputSeeker.h:23
void seekToEvent(int offset)
Definition: InputSeeker.cc:27
void postBeginJobWorkers(art::InputSource *src, const std::vector< art::Worker * > &workers)
Definition: InputSeeker.cc:17
TCEvent evt
Definition: DataStructs.cxx:8
BEGIN_PROLOG could also be cout