Public Member Functions | Private Attributes | List of all members
PDSPNearlineheader_module::PDSPNearlineHeaderModule Class Reference
Inheritance diagram for PDSPNearlineheader_module::PDSPNearlineHeaderModule:
art::EDAnalyzer art::detail::Analyzer art::detail::LegacyModule art::Observer art::ModuleBase

Public Member Functions

 PDSPNearlineHeaderModule (fhicl::ParameterSet const &pset)
 
virtual ~PDSPNearlineHeaderModule ()
 
void beginJob ()
 
void analyze (const art::Event &evt)
 
- Public Member Functions inherited from art::EDAnalyzer
 EDAnalyzer (fhicl::ParameterSet const &pset)
 
template<typename Config >
 EDAnalyzer (Table< Config > const &config)
 
std::string workerType () const
 
- Public Member Functions inherited from art::detail::Analyzer
virtual ~Analyzer () noexcept
 
 Analyzer (fhicl::ParameterSet const &pset)
 
template<typename Config >
 Analyzer (Table< Config > const &config)
 
void doBeginJob (SharedResources const &resources)
 
void doEndJob ()
 
void doRespondToOpenInputFile (FileBlock const &fb)
 
void doRespondToCloseInputFile (FileBlock const &fb)
 
void doRespondToOpenOutputFiles (FileBlock const &fb)
 
void doRespondToCloseOutputFiles (FileBlock const &fb)
 
bool doBeginRun (RunPrincipal &rp, ModuleContext const &mc)
 
bool doEndRun (RunPrincipal &rp, ModuleContext const &mc)
 
bool doBeginSubRun (SubRunPrincipal &srp, ModuleContext const &mc)
 
bool doEndSubRun (SubRunPrincipal &srp, ModuleContext const &mc)
 
bool doEvent (EventPrincipal &ep, ModuleContext const &mc, std::atomic< std::size_t > &counts_run, std::atomic< std::size_t > &counts_passed, std::atomic< std::size_t > &counts_failed)
 
- Public Member Functions inherited from art::Observer
 ~Observer () noexcept
 
 Observer (Observer const &)=delete
 
 Observer (Observer &&)=delete
 
Observeroperator= (Observer const &)=delete
 
Observeroperator= (Observer &&)=delete
 
void registerProducts (ProductDescriptions &, ModuleDescription const &)
 
void fillDescriptions (ModuleDescription const &)
 
fhicl::ParameterSetID selectorConfig () const
 
- Public Member Functions inherited from art::ModuleBase
virtual ~ModuleBase () noexcept
 
 ModuleBase ()
 
ModuleDescription const & moduleDescription () const
 
void setModuleDescription (ModuleDescription const &)
 
std::array< std::vector< ProductInfo >, NumBranchTypes > const & getConsumables () const
 
void sortConsumables (std::string const &current_process_name)
 
template<typename T , BranchType BT>
ViewToken< T > consumesView (InputTag const &tag)
 
template<typename T , BranchType BT>
ViewToken< T > mayConsumeView (InputTag const &tag)
 

Private Attributes

int fRun
 
int fSubRun
 
double fTimeStamp
 
TTree * fPDSPNearlineHeaderTree
 
std::vector< TString > runset
 

Additional Inherited Members

- Public Types inherited from art::EDAnalyzer
using WorkerType = WorkerT< EDAnalyzer >
 
using ModuleType = EDAnalyzer
 
- Protected Member Functions inherited from art::Observer
std::string const & processName () const
 
bool wantAllEvents () const noexcept
 
bool wantEvent (ScheduleID id, Event const &e) const
 
Handle< TriggerResultsgetTriggerResults (Event const &e) const
 
 Observer (fhicl::ParameterSet const &config)
 
 Observer (std::vector< std::string > const &select_paths, std::vector< std::string > const &reject_paths, fhicl::ParameterSet const &config)
 
- Protected Member Functions inherited from art::ModuleBase
ConsumesCollectorconsumesCollector ()
 
template<typename T , BranchType = InEvent>
ProductToken< T > consumes (InputTag const &)
 
template<typename Element , BranchType = InEvent>
ViewToken< Element > consumesView (InputTag const &)
 
template<typename T , BranchType = InEvent>
void consumesMany ()
 
template<typename T , BranchType = InEvent>
ProductToken< T > mayConsume (InputTag const &)
 
template<typename Element , BranchType = InEvent>
ViewToken< Element > mayConsumeView (InputTag const &)
 
template<typename T , BranchType = InEvent>
void mayConsumeMany ()
 

Detailed Description

Definition at line 37 of file PDSPNearlineHeader_module.cc.

Constructor & Destructor Documentation

PDSPNearlineheader_module::PDSPNearlineHeaderModule::PDSPNearlineHeaderModule ( fhicl::ParameterSet const &  pset)
explicit

Definition at line 61 of file PDSPNearlineHeader_module.cc.

61  : EDAnalyzer(pset){
62 
64 
65  // Define output tree
66  fPDSPNearlineHeaderTree = tfs->make<TTree>("PDSPNearlineHeader", "PDSP Nearline header tree");
67  fPDSPNearlineHeaderTree->Branch("fRun", &fRun, "fRun/I");
68  fPDSPNearlineHeaderTree->Branch("fSubRun", &fSubRun, "fSubRun/I");
69  fPDSPNearlineHeaderTree->Branch("fTimeStamp", &fTimeStamp, "fTimeStamp/D");
70  }
EDAnalyzer(fhicl::ParameterSet const &pset)
Definition: EDAnalyzer.h:25
PDSPNearlineheader_module::PDSPNearlineHeaderModule::~PDSPNearlineHeaderModule ( )
virtual

Definition at line 73 of file PDSPNearlineHeader_module.cc.

73 {}

Member Function Documentation

void PDSPNearlineheader_module::PDSPNearlineHeaderModule::analyze ( const art::Event evt)

Definition at line 79 of file PDSPNearlineHeader_module.cc.

79  {
80 
81  fRun = evt.run();
82  fSubRun = evt.subRun();
83  //fTimeStamp = evt.time().value();
84 
85  art::Timestamp ts = evt.time();
86  //std::cout<<ts.timeHigh()<<" "<<ts.timeLow()<<std::endl;
87  if (ts.timeHigh() == 0){
88  TTimeStamp ts2(ts.timeLow());
89  fTimeStamp = ts2.AsDouble();
90  }
91  else{
92  TTimeStamp ts2(ts.timeHigh(), ts.timeLow());
93  fTimeStamp = ts2.AsDouble();
94  }
95 
96  TString tempstring = Form("%i-%i",fRun,fSubRun);
97 
98  int num_items = std::count(runset.begin(), runset.end(), tempstring);
99  if(num_items == 0){ // run-subrun not in vector - add it and save
100  runset.push_back(tempstring);
101  fPDSPNearlineHeaderTree->Fill();
102  }
103  }
constexpr std::uint32_t timeLow() const
Definition: Timestamp.h:29
constexpr std::uint32_t timeHigh() const
Definition: Timestamp.h:34
Timestamp time() const
SubRunNumber_t subRun() const
Definition: DataViewImpl.cc:78
RunNumber_t run() const
Definition: DataViewImpl.cc:71
void PDSPNearlineheader_module::PDSPNearlineHeaderModule::beginJob ( )
virtual

Reimplemented from art::EDAnalyzer.

Definition at line 76 of file PDSPNearlineHeader_module.cc.

76 {}

Member Data Documentation

TTree* PDSPNearlineheader_module::PDSPNearlineHeaderModule::fPDSPNearlineHeaderTree
private

Definition at line 53 of file PDSPNearlineHeader_module.cc.

int PDSPNearlineheader_module::PDSPNearlineHeaderModule::fRun
private

Definition at line 48 of file PDSPNearlineHeader_module.cc.

int PDSPNearlineheader_module::PDSPNearlineHeaderModule::fSubRun
private

Definition at line 49 of file PDSPNearlineHeader_module.cc.

double PDSPNearlineheader_module::PDSPNearlineHeaderModule::fTimeStamp
private

Definition at line 51 of file PDSPNearlineHeader_module.cc.

std::vector<TString> PDSPNearlineheader_module::PDSPNearlineHeaderModule::runset
private

Definition at line 55 of file PDSPNearlineHeader_module.cc.


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