Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes | List of all members
mcdatadaq::MockDataDAQAna Class Reference
Inheritance diagram for mcdatadaq::MockDataDAQAna:
art::EDAnalyzer art::EventObserverBase art::Consumer art::EngineCreator

Public Types

using WorkerType = WorkerT< EDAnalyzer >
 
using ModuleType = EDAnalyzer
 

Public Member Functions

 MockDataDAQAna (fhicl::ParameterSet const &pset)
 
virtual ~MockDataDAQAna ()
 
void analyze (art::Event const &evt)
 
void beginJob ()
 
void endJob ()
 
std::string workerType () const
 
bool modifiesEvent () const
 
void registerProducts (MasterProductRegistry &, ProductDescriptions &, ModuleDescription const &)
 
std::string const & processName () const
 
bool wantAllEvents () const
 
bool wantEvent (Event const &e)
 
fhicl::ParameterSetID selectorConfig () const
 
art::Handle< art::TriggerResultsgetTriggerResults (Event const &e) const
 
template<typename T , BranchType = InEvent>
ProductToken< Tconsumes (InputTag const &)
 
template<typename T , art::BranchType BT>
art::ProductToken< Tconsumes (InputTag const &it)
 
template<typename T , BranchType = InEvent>
void consumesMany ()
 
template<typename Element , BranchType = InEvent>
ViewToken< Element > consumesView (InputTag const &)
 
template<typename T , art::BranchType BT>
art::ViewToken< TconsumesView (InputTag const &it)
 
template<typename T , BranchType = InEvent>
ProductToken< TmayConsume (InputTag const &)
 
template<typename T , art::BranchType BT>
art::ProductToken< TmayConsume (InputTag const &it)
 
template<typename T , BranchType = InEvent>
void mayConsumeMany ()
 
template<typename Element , BranchType = InEvent>
ViewToken< Element > mayConsumeView (InputTag const &)
 
template<typename T , art::BranchType BT>
art::ViewToken< TmayConsumeView (InputTag const &it)
 
base_engine_tcreateEngine (seed_t seed)
 
base_engine_tcreateEngine (seed_t seed, std::string const &kind_of_engine_to_make)
 
base_engine_tcreateEngine (seed_t seed, std::string const &kind_of_engine_to_make, label_t const &engine_label)
 
seed_t get_seed_value (fhicl::ParameterSet const &pset, char const key[]="seed", seed_t const implicit_seed=-1)
 

Static Public Member Functions

static cet::exempt_ptr< Consumernon_module_context ()
 

Protected Member Functions

CurrentProcessingContext const * currentContext () const
 
detail::CachedProducts & cachedProducts ()
 
void validateConsumedProduct (BranchType const bt, ProductInfo const &pi)
 
void prepareForJob (fhicl::ParameterSet const &pset)
 
void showMissingConsumes () const
 

Private Member Functions

bool init ()
 Initializes detector and stuff. More...
 

Private Attributes

std::string fRawDataLabel
 Label name for RawDigits. More...
 
DAQSimulator fDAQSimulator
 DAQSimulator instance. More...
 

Detailed Description

Definition at line 34 of file MockDataDAQAna_module.cc.

Member Typedef Documentation

Definition at line 39 of file EDAnalyzer.h.

Definition at line 38 of file EDAnalyzer.h.

Constructor & Destructor Documentation

mcdatadaq::MockDataDAQAna::MockDataDAQAna ( fhicl::ParameterSet const &  pset)
explicit

Initialize Configuration with parameters from the fcl file

Definition at line 56 of file MockDataDAQAna_module.cc.

References om::cout, fRawDataLabel, and mcdatadaq::Configuration::setInstance().

56  :
57  EDAnalyzer(pset),
58  fRawDataLabel(pset.get< std::string >("RawDataLabel"))
59 {
60  /// Initialize Configuration with parameters from the fcl file
62 
63  std::cout<<"RawDataLabel:"<<fRawDataLabel<<"\n";
64 }
static bool setInstance(fhicl::ParameterSet const &pset)
Method to set the class instance with parameters from fhicl.
EDAnalyzer(Table< Config > const &config)
Definition: EDAnalyzer.h:100
OStream cout
Definition: OStream.cxx:6
std::string fRawDataLabel
Label name for RawDigits.
enum BeamMode string
mcdatadaq::MockDataDAQAna::~MockDataDAQAna ( )
virtual

Definition at line 67 of file MockDataDAQAna_module.cc.

67 {}

Member Function Documentation

void mcdatadaq::MockDataDAQAna::analyze ( art::Event const &  evt)
virtual

If Detector is unknown, try to initialize it

If initialization returned failed, then something is wrong

Pull the Raw Digits information out

Simulate the current event in the DAQ

Implements art::EDAnalyzer.

Definition at line 73 of file MockDataDAQAna_module.cc.

References om::cout, art::Event::event(), exit(), fDAQSimulator, fRawDataLabel, art::DataViewImpl::getByLabel(), mcdatadaq::Configuration::getInstance(), init(), mcdatadaq::Configuration::isDetectorUnknown(), and mcdatadaq::DAQSimulator::processEvent().

73  {
74 
75  const uint32_t event = evt.event();
76  std::cout<<"Processing event "<<event<<"\n";
77 
79 
80  /// If Detector is unknown, try to initialize it
81  if(config->isDetectorUnknown()){
82  /// If initialization returned failed, then something is wrong
83  if(!init()){
84  std::cout<<"From MockDataDAQAna::analyze Initialization failed\n";
85  exit(1);
86  }// end of checking whether the init was not good
87  }// end of checking if Detector is unknown
88 
89  /// Pull the Raw Digits information out
91  try{
92  evt.getByLabel(fRawDataLabel, diglist);
93  }// end of try
94  catch(...){
95  }// end of catch
96 
97  /// Simulate the current event in the DAQ
98  fDAQSimulator.processEvent(*diglist);
99 
100 }// end of MockDataDAQAna::analyze
bool init()
Initializes detector and stuff.
DAQSimulator fDAQSimulator
DAQSimulator instance.
Definition: config.py:1
static Configuration * getInstance()
Method to obtain the class instance.
int evt
bool processEvent(const std::vector< rawdata::RawDigit > &)
OStream cout
Definition: OStream.cxx:6
std::string fRawDataLabel
Label name for RawDigits.
exit(0)
void mcdatadaq::MockDataDAQAna::beginJob ( )
virtual

Reimplemented from art::EDAnalyzer.

Definition at line 70 of file MockDataDAQAna_module.cc.

70 { }
detail::CachedProducts& art::EventObserverBase::cachedProducts ( )
inlineprotectedinherited

Definition at line 79 of file EventObserverBase.h.

References art::EventObserverBase::selectors_.

80  {
81  return selectors_;
82  }
detail::CachedProducts selectors_
template<typename T , BranchType = InEvent>
ProductToken<T> art::Consumer::consumes ( InputTag const &  )
inherited
template<typename T , art::BranchType BT>
art::ProductToken<T> art::Consumer::consumes ( InputTag const &  it)
inherited

Definition at line 146 of file Consumer.h.

References art::InputTag::instance(), PandAna.reco_validation.prod5_pid_validation::invalid, art::InputTag::label(), art::InputTag::process(), and T.

147 {
148  if (!moduleContext_)
149  return ProductToken<T>::invalid();
150 
151  consumables_[BT].emplace_back(ConsumableType::Product,
152  TypeID{typeid(T)},
153  it.label(),
154  it.instance(),
155  it.process());
156  return ProductToken<T>{it};
157 }
set< int >::iterator it
static ProductToken< T > invalid()
Definition: ProductToken.h:47
ConsumableProducts consumables_
Definition: Consumer.h:137
double T
Definition: Xdiff_gwt.C:5
bool moduleContext_
Definition: Consumer.h:135
template<typename T , art::BranchType BT>
void art::Consumer::consumesMany ( )
inherited

Definition at line 161 of file Consumer.h.

References T.

162 {
163  if (!moduleContext_)
164  return;
165 
166  consumables_[BT].emplace_back(ConsumableType::Many, TypeID{typeid(T)});
167 }
ConsumableProducts consumables_
Definition: Consumer.h:137
double T
Definition: Xdiff_gwt.C:5
bool moduleContext_
Definition: Consumer.h:135
template<typename Element , BranchType = InEvent>
ViewToken<Element> art::Consumer::consumesView ( InputTag const &  )
inherited
template<typename T , art::BranchType BT>
art::ViewToken<T> art::Consumer::consumesView ( InputTag const &  it)
inherited

Definition at line 171 of file Consumer.h.

References art::InputTag::instance(), PandAna.reco_validation.prod5_pid_validation::invalid, art::InputTag::label(), art::InputTag::process(), and T.

172 {
173  if (!moduleContext_)
174  return ViewToken<T>::invalid();
175 
176  consumables_[BT].emplace_back(ConsumableType::ViewElement,
177  TypeID{typeid(T)},
178  it.label(),
179  it.instance(),
180  it.process());
181  return ViewToken<T>{it};
182 }
set< int >::iterator it
static ViewToken< Element > invalid()
Definition: ProductToken.h:75
ConsumableProducts consumables_
Definition: Consumer.h:137
double T
Definition: Xdiff_gwt.C:5
bool moduleContext_
Definition: Consumer.h:135
base_engine_t& art::EngineCreator::createEngine ( seed_t  seed)
inherited
base_engine_t& art::EngineCreator::createEngine ( seed_t  seed,
std::string const &  kind_of_engine_to_make 
)
inherited
base_engine_t& art::EngineCreator::createEngine ( seed_t  seed,
std::string const &  kind_of_engine_to_make,
label_t const &  engine_label 
)
inherited
CurrentProcessingContext const* art::EDAnalyzer::currentContext ( ) const
protectedinherited
void mcdatadaq::MockDataDAQAna::endJob ( )
virtual

Reimplemented from art::EDAnalyzer.

Definition at line 117 of file MockDataDAQAna_module.cc.

References DEFINE_ART_MODULE().

117 {}
seed_t art::EngineCreator::get_seed_value ( fhicl::ParameterSet const &  pset,
char const  key[] = "seed",
seed_t const  implicit_seed = -1 
)
inherited
art::Handle<art::TriggerResults> art::EventObserverBase::getTriggerResults ( Event const &  e) const
inlineinherited

Definition at line 61 of file EventObserverBase.h.

References art::detail::CachedProducts::getOneTriggerResults(), and art::EventObserverBase::selectors_.

62  {
64  }
detail::CachedProducts selectors_
art::Handle< art::TriggerResults > getOneTriggerResults(Event const &) const
Float_t e
Definition: plot.C:35
bool mcdatadaq::MockDataDAQAna::init ( )
private

Initializes detector and stuff.

Initializing job configuration

Initialize DAQSimulator

Definition at line 104 of file MockDataDAQAna_module.cc.

References fDAQSimulator, mcdatadaq::Configuration::getInstance(), mcdatadaq::Configuration::init(), and mcdatadaq::DAQSimulator::init().

Referenced by demo.App::__init__(), testem0.App::__init__(), Lesson1.App::__init__(), ExN03.App::__init__(), and analyze().

104  {
105 
106  /// Initializing job configuration
108  if(!config->init())return false;
109 
110  /// Initialize DAQSimulator
111  if(!fDAQSimulator.init()) return false;
112 
113  return true;
114 }// end of init()
DAQSimulator fDAQSimulator
DAQSimulator instance.
bool init()
Initialize DAQ Simulator. Need to know the Geometry at this point.
Definition: config.py:1
static Configuration * getInstance()
Method to obtain the class instance.
template<typename T , BranchType = InEvent>
ProductToken<T> art::Consumer::mayConsume ( InputTag const &  )
inherited
template<typename T , art::BranchType BT>
art::ProductToken<T> art::Consumer::mayConsume ( InputTag const &  it)
inherited

Definition at line 189 of file Consumer.h.

References art::InputTag::instance(), PandAna.reco_validation.prod5_pid_validation::invalid, art::InputTag::label(), art::InputTag::process(), and T.

190 {
191  if (!moduleContext_)
192  return ProductToken<T>::invalid();
193 
194  consumables_[BT].emplace_back(ConsumableType::Product,
195  TypeID{typeid(T)},
196  it.label(),
197  it.instance(),
198  it.process());
199  return ProductToken<T>{it};
200 }
set< int >::iterator it
static ProductToken< T > invalid()
Definition: ProductToken.h:47
ConsumableProducts consumables_
Definition: Consumer.h:137
double T
Definition: Xdiff_gwt.C:5
bool moduleContext_
Definition: Consumer.h:135
template<typename T , art::BranchType BT>
void art::Consumer::mayConsumeMany ( )
inherited

Definition at line 204 of file Consumer.h.

References T.

205 {
206  if (!moduleContext_)
207  return;
208 
209  consumables_[BT].emplace_back(ConsumableType::Many, TypeID{typeid(T)});
210 }
ConsumableProducts consumables_
Definition: Consumer.h:137
double T
Definition: Xdiff_gwt.C:5
bool moduleContext_
Definition: Consumer.h:135
template<typename Element , BranchType = InEvent>
ViewToken<Element> art::Consumer::mayConsumeView ( InputTag const &  )
inherited
template<typename T , art::BranchType BT>
art::ViewToken<T> art::Consumer::mayConsumeView ( InputTag const &  it)
inherited

Definition at line 214 of file Consumer.h.

References art::InputTag::instance(), PandAna.reco_validation.prod5_pid_validation::invalid, art::InputTag::label(), art::InputTag::process(), and T.

215 {
216  if (!moduleContext_)
217  return ViewToken<T>::invalid();
218 
219  consumables_[BT].emplace_back(ConsumableType::ViewElement,
220  TypeID{typeid(T)},
221  it.label(),
222  it.instance(),
223  it.process());
224  return ViewToken<T>{it};
225 }
set< int >::iterator it
static ViewToken< Element > invalid()
Definition: ProductToken.h:75
ConsumableProducts consumables_
Definition: Consumer.h:137
double T
Definition: Xdiff_gwt.C:5
bool moduleContext_
Definition: Consumer.h:135
bool art::EventObserverBase::modifiesEvent ( ) const
inlineinherited

Definition at line 25 of file EventObserverBase.h.

26  {
27  return false;
28  }
static cet::exempt_ptr<Consumer> art::Consumer::non_module_context ( )
staticinherited
void art::Consumer::prepareForJob ( fhicl::ParameterSet const &  pset)
protectedinherited
std::string const& art::EventObserverBase::processName ( ) const
inlineinherited
void art::EventObserverBase::registerProducts ( MasterProductRegistry ,
ProductDescriptions ,
ModuleDescription const &   
)
inlineinherited

Definition at line 33 of file EventObserverBase.h.

References string.

36  {}
fhicl::ParameterSetID art::EventObserverBase::selectorConfig ( ) const
inlineinherited

Definition at line 56 of file EventObserverBase.h.

References art::EventObserverBase::selector_config_id_.

57  {
58  return selector_config_id_;
59  }
fhicl::ParameterSetID selector_config_id_
void art::Consumer::showMissingConsumes ( ) const
protectedinherited

Referenced by art::RootOutput::endJob().

void art::Consumer::validateConsumedProduct ( BranchType const  bt,
ProductInfo const &  pi 
)
protectedinherited
bool art::EventObserverBase::wantAllEvents ( ) const
inlineinherited

Definition at line 46 of file EventObserverBase.h.

References art::EventObserverBase::wantAllEvents_.

Referenced by art::RootOutput::RootOutput().

47  {
48  return wantAllEvents_;
49  }
bool art::EventObserverBase::wantEvent ( Event const &  e)
inlineinherited

Definition at line 51 of file EventObserverBase.h.

References art::EventObserverBase::selectors_, and art::detail::CachedProducts::wantEvent().

52  {
53  return selectors_.wantEvent(e);
54  }
detail::CachedProducts selectors_
Float_t e
Definition: plot.C:35
bool wantEvent(Event const &)
std::string art::EDAnalyzer::workerType ( ) const
inlineinherited

Definition at line 109 of file EDAnalyzer.h.

References art::EDAnalyzer::currentContext().

110  {
111  return "WorkerT<EDAnalyzer>";
112  }

Member Data Documentation

DAQSimulator mcdatadaq::MockDataDAQAna::fDAQSimulator
private

DAQSimulator instance.

Definition at line 50 of file MockDataDAQAna_module.cc.

Referenced by analyze(), and init().

std::string mcdatadaq::MockDataDAQAna::fRawDataLabel
private

Label name for RawDigits.

Definition at line 49 of file MockDataDAQAna_module.cc.

Referenced by analyze(), and MockDataDAQAna().


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