Public Member Functions | Private Attributes | List of all members
DAQToOffline::SSPToOffline Class Reference
Inheritance diagram for DAQToOffline::SSPToOffline:
art::EDProducer art::detail::Producer art::detail::LegacyModule art::Modifier art::ModuleBase art::ProductRegistryHelper

Public Member Functions

 SSPToOffline (fhicl::ParameterSet const &pset)
 
 SSPToOffline (SSPToOffline const &)=delete
 
 SSPToOffline (SSPToOffline &&)=delete
 
SSPToOfflineoperator= (SSPToOffline const &)=delete
 
SSPToOfflineoperator= (SSPToOffline &&)=delete
 
void produce (art::Event &evt) override
 
void reconfigure (fhicl::ParameterSet const &pset)
 
void printParameterSet ()
 
- Public Member Functions inherited from art::EDProducer
 EDProducer (fhicl::ParameterSet const &pset)
 
template<typename Config >
 EDProducer (Table< Config > const &config)
 
std::string workerType () const
 
- Public Member Functions inherited from art::detail::Producer
virtual ~Producer () noexcept
 
 Producer (fhicl::ParameterSet const &)
 
 Producer (Producer const &)=delete
 
 Producer (Producer &&)=delete
 
Produceroperator= (Producer const &)=delete
 
Produceroperator= (Producer &&)=delete
 
void doBeginJob ()
 
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::Modifier
 ~Modifier () noexcept
 
 Modifier ()
 
 Modifier (Modifier const &)=delete
 
 Modifier (Modifier &&)=delete
 
Modifieroperator= (Modifier const &)=delete
 
Modifieroperator= (Modifier &&)=delete
 
- 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

std::string fFragType
 
std::string fRawDataLabel
 
std::string fOutputDataLabel
 
SSPReformatterAlgs sspReform
 

Additional Inherited Members

- Public Types inherited from art::EDProducer
using ModuleType = EDProducer
 
using WorkerType = WorkerT< EDProducer >
 
- Public Types inherited from art::detail::Producer
template<typename UserConfig , typename KeysToIgnore = void>
using Table = Modifier::Table< UserConfig, KeysToIgnore >
 
- Public Types inherited from art::Modifier
template<typename UserConfig , typename UserKeysToIgnore = void>
using Table = ProducerTable< UserConfig, detail::ModuleConfig, UserKeysToIgnore >
 
- Static Public Member Functions inherited from art::EDProducer
static void commitEvent (EventPrincipal &ep, Event &e)
 
- 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 46 of file SSPToOffline_module.cc.

Constructor & Destructor Documentation

DAQToOffline::SSPToOffline::SSPToOffline ( fhicl::ParameterSet const &  pset)
explicit

Definition at line 82 of file SSPToOffline_module.cc.

83  : EDProducer{pset}, sspReform(pset.get<fhicl::ParameterSet>("SSPReformatter"))
84 {
85 
86  this->reconfigure(pset);
87 
88  produces< std::vector<raw::OpDetWaveform> > (fOutputDataLabel);
89  produces< std::vector<recob::OpHit> > (fOutputDataLabel);
90 
91  //first_FirstSample = -1;
92  //first_TimeStamp = -1;
93 }
EDProducer(fhicl::ParameterSet const &pset)
Definition: EDProducer.h:20
void reconfigure(fhicl::ParameterSet const &pset)
DAQToOffline::SSPToOffline::SSPToOffline ( SSPToOffline const &  )
delete
DAQToOffline::SSPToOffline::SSPToOffline ( SSPToOffline &&  )
delete

Member Function Documentation

SSPToOffline& DAQToOffline::SSPToOffline::operator= ( SSPToOffline const &  )
delete
SSPToOffline& DAQToOffline::SSPToOffline::operator= ( SSPToOffline &&  )
delete
void DAQToOffline::SSPToOffline::printParameterSet ( )

Definition at line 108 of file SSPToOffline_module.cc.

108  {
109 
110  mf::LogDebug("SSPToOffline") << "====================================" << "\n"
111  << "Parameter Set" << "\n"
112  << "====================================" << "\n"
113  << "fFragType: " << fFragType << "\n"
114  << "fRawDataLabel: " << fRawDataLabel << "\n"
115  << "fOutputDataLabel: " << fOutputDataLabel << "\n"
116  << "====================================" << "\n";
117 }
MaybeLogger_< ELseverityLevel::ELsev_success, false > LogDebug
void DAQToOffline::SSPToOffline::produce ( art::Event evt)
overridevirtual

Implements art::EDProducer.

Definition at line 120 of file SSPToOffline_module.cc.

121 {
122 
123  art::Handle<artdaq::Fragments> rawFragments;
124  evt.getByLabel(fRawDataLabel, fFragType, rawFragments);
125 
126  // Create the output data structures
127  std::vector<raw::OpDetWaveform> waveforms;
128  std::vector<recob::OpHit> hits;
129 
130 
131  // Check if there is SSP data in this event
132  // Don't crash code if not present, just don't save anything
133  try {
134  rawFragments->size();
135  }
136  catch(std::exception const&) {
137  mf::LogWarning("SSPToOffline") << "WARNING: Raw SSP data not found in event " << evt.event();
138  evt.put(std::make_unique<decltype(waveforms)>(std::move(waveforms)), fOutputDataLabel);
139  evt.put(std::make_unique<decltype(hits)>(std::move(hits)), fOutputDataLabel);
140  return;
141  }
142 
143  // Check that the data is valid
144  if(!rawFragments.isValid()){
145  mf::LogError("SSPToOffline") << "Run: " << evt.run()
146  << ", SubRun: " << evt.subRun()
147  << ", Event: " << evt.event()
148  << " is NOT VALID";
149  throw cet::exception("raw NOT VALID");
150  return;
151  }
152 
153  sspReform.SSPFragmentToWaveformsAndHits(*rawFragments, waveforms, hits);
154 
155  evt.put(std::make_unique<decltype(waveforms)>(std::move(waveforms)), fOutputDataLabel);
156  evt.put(std::make_unique<decltype(hits)>(std::move(hits)), fOutputDataLabel);
157 
158 }
void SSPFragmentToWaveformsAndHits(artdaq::Fragments const &rawFragments, std::vector< raw::OpDetWaveform > &opDetWaveformVector, std::vector< recob::OpHit > &opHitVector)
EventNumber_t event() const
Definition: DataViewImpl.cc:96
MaybeLogger_< ELseverityLevel::ELsev_error, false > LogError
bool isValid() const
Definition: Handle.h:183
bool getByLabel(std::string const &label, std::string const &instance, Handle< PROD > &result) const
Definition: DataViewImpl.h:446
def move(depos, offset)
Definition: depos.py:107
SubRunNumber_t subRun() const
Definition: DataViewImpl.cc:89
RunNumber_t run() const
Definition: DataViewImpl.cc:82
MaybeLogger_< ELseverityLevel::ELsev_warning, false > LogWarning
ProductID put(std::unique_ptr< PROD > &&edp, FullSemantic< Level::Run > const semantic)
Definition: DataViewImpl.h:730
cet::coded_exception< error, detail::translate > exception
Definition: exception.h:33
void DAQToOffline::SSPToOffline::reconfigure ( fhicl::ParameterSet const &  pset)

Definition at line 95 of file SSPToOffline_module.cc.

95  {
96 
97  fFragType = pset.get<std::string>("FragType");
98  fRawDataLabel = pset.get<std::string>("RawDataLabel");
99  fOutputDataLabel = pset.get<std::string>("OutputDataLabel");
100 
101  //fDebug = pset.get<bool>("Debug");
102  //fZeroThreshold=0;
103  //fCompression=raw::kNone;
104 
106 }
std::string string
Definition: nybbler.cc:12

Member Data Documentation

std::string DAQToOffline::SSPToOffline::fFragType
private

Definition at line 63 of file SSPToOffline_module.cc.

std::string DAQToOffline::SSPToOffline::fOutputDataLabel
private

Definition at line 65 of file SSPToOffline_module.cc.

std::string DAQToOffline::SSPToOffline::fRawDataLabel
private

Definition at line 64 of file SSPToOffline_module.cc.

SSPReformatterAlgs DAQToOffline::SSPToOffline::sspReform
private

Definition at line 67 of file SSPToOffline_module.cc.


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