Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes | Protected Member Functions | Private Attributes | List of all members
novaddt::DDTStreamer Class Reference
Inheritance diagram for novaddt::DDTStreamer:
art::EDFilter art::ProducerBase art::Consumer art::EngineCreator art::ProductRegistryHelper

Public Types

using ModuleType = EDFilter
 
using WorkerType = WorkerT< EDFilter >
 
template<typename UserConfig >
using Table = ProducerBase::Table< UserConfig >
 

Public Member Functions

 DDTStreamer (fhicl::ParameterSet const &p)
 
virtual ~DDTStreamer ()
 
virtual bool filter (art::Event &e)
 
void endJob () override
 
template<typename PROD , BranchType B = InEvent>
ProductID getProductID (std::string const &instanceName={}) const
 
template<typename PROD , BranchType B>
ProductID getProductID (ModuleDescription const &moduleDescription, std::string const &instanceName) const
 
bool modifiesEvent () 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 ()
 

Static Public Attributes

static constexpr bool Pass {true}
 
static constexpr bool Fail {false}
 

Protected Member Functions

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

Private Attributes

unsigned int _prescale
 prescale factor (1 out of every this many passes are issued as real triggers) More...
 
std::string _slicelabel
 
std::string _sliceinstance
 
unsigned int _nEvents = 0
 
unsigned int _trigger_counts = 0
 
unsigned int _prescaled_trigger_counts = 0
 

Detailed Description

Definition at line 32 of file DDTStreamer_module.cc.

Member Typedef Documentation

using art::EDFilter::ModuleType = EDFilter
inherited

Definition at line 37 of file EDFilter.h.

template<typename UserConfig >
using art::EDFilter::Table = ProducerBase::Table<UserConfig>
inherited

Definition at line 46 of file EDFilter.h.

using art::EDFilter::WorkerType = WorkerT<EDFilter>
inherited

Definition at line 38 of file EDFilter.h.

Constructor & Destructor Documentation

novaddt::DDTStreamer::DDTStreamer ( fhicl::ParameterSet const &  p)
explicit

Definition at line 48 of file DDTStreamer_module.cc.

References _prescale, _sliceinstance, _slicelabel, om::cout, and allTimeWatchdog::endl.

49  : _prescale (p.get<unsigned int>("prescale")),
50  _slicelabel(p.get<std::string>("slice_label")),
51  _sliceinstance(p.get<std::string>("slice_instance"))
52 {
53  std::cout << "--- novaddt::DDTStreamer instantiate" << std::endl;
54  std::cout << "\t prescale: " << _prescale << std::endl;
55  std::cout << "\t SliceModuleLabel: " << _slicelabel << std::endl;
56  std::cout << "\t SliceInstanceLabel: " << _sliceinstance << std::endl;
57  produces<std::vector<TriggerDecision>>();
58 }
const char * p
Definition: xmltok.h:285
unsigned int _prescale
prescale factor (1 out of every this many passes are issued as real triggers)
OStream cout
Definition: OStream.cxx:6
enum BeamMode string
novaddt::DDTStreamer::~DDTStreamer ( )
virtual

Definition at line 60 of file DDTStreamer_module.cc.

61 {
62  // Clean up dynamic memory and other resources here.
63 }

Member Function Documentation

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::EDFilter::currentContext ( ) const
protectedinherited
void novaddt::DDTStreamer::endJob ( )
overridevirtual

Reimplemented from art::EDFilter.

Definition at line 124 of file DDTStreamer_module.cc.

References _nEvents, _prescaled_trigger_counts, _trigger_counts, om::cout, DEFINE_ART_MODULE(), and allTimeWatchdog::endl.

125 {
126  std::cout << "--- novaddt::DDTStreamer endJob" << std::endl;
127  std::cout << "\tNumber of events seen: " << _nEvents << std::endl;
128  std::cout << "\tNumber that pass the trigger: " << _trigger_counts << std::endl;
129  std::cout << "\t after prescale: " << _prescaled_trigger_counts << std::endl;
130 }
unsigned int _prescaled_trigger_counts
OStream cout
Definition: OStream.cxx:6
bool novaddt::DDTStreamer::filter ( art::Event e)
virtual

Implements art::EDFilter.

Definition at line 65 of file DDTStreamer_module.cc.

References _nEvents, _prescale, _prescaled_trigger_counts, _sliceinstance, _slicelabel, _trigger_counts, om::cout, allTimeWatchdog::endl, art::DataViewImpl::getByLabel(), hits(), art::Event::put(), fillBadChanDBTables::result, and novaddt::TDC::val.

66 {
67  //std::cout << " DDTStreamer::filter. Event: "
68  // << e.id().event()
69  // << std::endl;
70  _nEvents++;
71  bool result = false;
72 
73  // static unsigned event = 1;
74  // event++;
75  // if (event == 13)
76  // {
77  // std::cout << "\nSleeping now!\n" << std::endl;
78  // sleep(60);
79  // }
80 
81  std::unique_ptr<std::vector<TriggerDecision>>
82  trigger_decisions(new std::vector<TriggerDecision>);
83 
86 
87  //std::cout << "\tgot " << hits->size() << " hits" << std::endl;
88  // This event contains at least one useful slice, so let's keep it around:
89  result = true;
91 
92  // check the prescale
95  //std::cout<< "\t\t - not prescaled" << std::endl;
96 
97  TDC t_begin = hits->front().TDC();
98  TDC t_end = hits->back().TDC();
99 
100  std::cout << "\tbegin: " << t_begin.val
101  << ", end: " << t_end.val
102  << std::endl;
103 
104  /*
105  This streamer trigger will NOT WORK because of the GT design.
106  In DDT, we send all of our trigger messages to the DDTServerMailbox,
107  but the manual bit, which is being sent below, needs to be sent
108  to the ManServerMailbox.
109 
110  Alec suggests that we use the ManSender instead to collect streamer
111  data.
112  */
113 
114  // trigger_decisions->emplace_back(t_begin, t_end - t_begin,
115  // daqdataformats::trigID::TRIG_ID_SOFT_MANUAL,
116  // _prescale);
117  } // end of check on prescale
118 
119  e.put(std::move(trigger_decisions));
120 
121  return result;
122 }
unsigned int _prescaled_trigger_counts
ProductID put(std::unique_ptr< PROD > &&product)
Definition: Event.h:102
void hits()
Definition: readHits.C:15
unsigned int _prescale
prescale factor (1 out of every this many passes are issued as real triggers)
OStream cout
Definition: OStream.cxx:6
bool getByLabel(std::string const &label, std::string const &productInstanceName, Handle< PROD > &result) const
Definition: DataViewImpl.h:344
seed_t art::EngineCreator::get_seed_value ( fhicl::ParameterSet const &  pset,
char const  key[] = "seed",
seed_t const  implicit_seed = -1 
)
inherited
template<typename PROD , BranchType B>
ProductID art::EDFilter::getProductID ( std::string const &  instanceName = {}) const
inlineinherited

Definition at line 131 of file EDFilter.h.

References art::EDFilter::moduleDescription_.

Referenced by novaddt::HoughTrackMaker::create_associations().

132  {
133  return ProducerBase::getProductID<PROD, B>(moduleDescription_,
134  instanceName);
135  }
ModuleDescription moduleDescription_
Definition: EDFilter.h:124
template<typename PROD , BranchType B>
ProductID art::ProducerBase::getProductID ( ModuleDescription const &  moduleDescription,
std::string const &  instanceName 
) const
inherited

Definition at line 56 of file ProducerBase.h.

References art::ModuleDescription::moduleLabel().

Referenced by art::ProducerBase::modifiesEvent().

58  {
59  auto const& pd =
60  get_ProductDescription<PROD>(B, md.moduleLabel(), instanceName);
61  return pd.productID();
62  }
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::ProducerBase::modifiesEvent ( ) const
inlineinherited

Definition at line 40 of file ProducerBase.h.

References art::ProducerBase::getProductID(), and string.

41  {
42  return true;
43  }
static cet::exempt_ptr<Consumer> art::Consumer::non_module_context ( )
staticinherited
void art::Consumer::prepareForJob ( fhicl::ParameterSet const &  pset)
protectedinherited
void art::Consumer::showMissingConsumes ( ) const
protectedinherited

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

void art::Consumer::validateConsumedProduct ( BranchType const  bt,
ProductInfo const &  pi 
)
protectedinherited

Member Data Documentation

unsigned int novaddt::DDTStreamer::_nEvents = 0
private

Definition at line 42 of file DDTStreamer_module.cc.

Referenced by endJob(), and filter().

unsigned int novaddt::DDTStreamer::_prescale
private

prescale factor (1 out of every this many passes are issued as real triggers)

Definition at line 39 of file DDTStreamer_module.cc.

Referenced by DDTStreamer(), and filter().

unsigned int novaddt::DDTStreamer::_prescaled_trigger_counts = 0
private

Definition at line 44 of file DDTStreamer_module.cc.

Referenced by endJob(), and filter().

std::string novaddt::DDTStreamer::_sliceinstance
private

Definition at line 41 of file DDTStreamer_module.cc.

Referenced by DDTStreamer(), and filter().

std::string novaddt::DDTStreamer::_slicelabel
private

Definition at line 40 of file DDTStreamer_module.cc.

Referenced by DDTStreamer(), and filter().

unsigned int novaddt::DDTStreamer::_trigger_counts = 0
private

Definition at line 43 of file DDTStreamer_module.cc.

Referenced by endJob(), and filter().

constexpr bool art::EDFilter::Fail {false}
staticinherited

Definition at line 33 of file EDFilter.h.

Referenced by evgen::GENIEFilter::filter().

constexpr bool art::EDFilter::Pass {true}
staticinherited

Definition at line 32 of file EDFilter.h.

Referenced by evgen::GENIEFilter::filter().


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