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

Public Types

using WorkerType = WorkerT< EDAnalyzer >
 
using ModuleType = EDAnalyzer
 

Public Member Functions

 Mono (fhicl::ParameterSet const &p)
 
 Mono (Mono const &)=delete
 
 Mono (Mono &&)=delete
 
Monooperator= (Mono const &)=delete
 
Monooperator= (Mono &&)=delete
 
void analyze (art::Event const &e) override
 
void endSubRun (art::SubRun const &s) override
 
void beginJob () override
 
void endJob () override
 
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 Attributes

unsigned int fRun
 Run number. More...
 
unsigned int fTrigLength
 
unsigned int fSubRun
 trigger length More...
 
unsigned int fEvent
 Event number. More...
 
unsigned int fTrigger
 Trigger type. More...
 
unsigned int n_events
 
uint32_t fprescale
 number of events More...
 
unsigned int prescale_sum
 
float prescale_mean
 sum of prescales More...
 
std::string fRawDataLabel
 average prescale More...
 
art::ServiceHandle< art::TFileServicetfs
 
TTree * Job
 

Detailed Description

Definition at line 50 of file DDTPrescaleOffline_module.cc.

Member Typedef Documentation

Definition at line 39 of file EDAnalyzer.h.

Definition at line 38 of file EDAnalyzer.h.

Constructor & Destructor Documentation

Mono::Mono::Mono ( fhicl::ParameterSet const &  p)
explicit

Definition at line 88 of file DDTPrescaleOffline_module.cc.

89  :
90  EDAnalyzer(p), // ,
91  fRun(0),
92  fTrigLength(0),
93  fSubRun(0),
94  fEvent(0),
95  fTrigger(0),
96  n_events(0),
97  fprescale(0),
98  prescale_sum(0),
99  prescale_mean(0),
100  fRawDataLabel(p.get<std::string>("RawDataLabel"))
101 {}
unsigned int fRun
Run number.
unsigned int fTrigger
Trigger type.
const char * p
Definition: xmltok.h:285
unsigned int fTrigLength
float prescale_mean
sum of prescales
unsigned int prescale_sum
unsigned int fEvent
Event number.
EDAnalyzer(Table< Config > const &config)
Definition: EDAnalyzer.h:100
unsigned int fSubRun
trigger length
std::string fRawDataLabel
average prescale
uint32_t fprescale
number of events
enum BeamMode string
Mono::Mono::Mono ( Mono const &  )
delete
Mono::Mono::Mono ( Mono &&  )
delete

Member Function Documentation

void Mono::Mono::analyze ( art::Event const &  e)
overridevirtual

Implements art::EDAnalyzer.

Definition at line 103 of file DDTPrescaleOffline_module.cc.

References om::cout, allTimeWatchdog::endl, art::Event::event(), rawdata::RawTrigger::fTriggerMask_Prescale, rawdata::RawTrigger::fTriggerMask_TriggerType, rawdata::RawTrigger::fTriggerRange_TriggerLength, art::DataViewImpl::getByLabel(), test_Tier::n_events, art::Event::run(), and art::Event::subRun().

104 {
105 
106 // use art:event method to get run,subrun and event numbers
107  fRun = e.run();
108  fSubRun = e.subRun();
109  fEvent = e.event();
110 
111  // use rawdata::RawTrigger method to get trigger ID
113  e.getByLabel(fRawDataLabel, trigv);
114  const rawdata::RawTrigger& trig = (*trigv)[0];
116 
117  // use rawdata::RawTrigger method to get prescale number
119  e.getByLabel(fRawDataLabel, rawtrigger);
120  const rawdata::RawTrigger& pre = (*rawtrigger)[0];
122 
123  // use rawdata::RawTrigger method to get prescale number
125  e.getByLabel(fRawDataLabel, rawtrigger2);
126  const rawdata::RawTrigger& pree = (*rawtrigger2)[0];
128 
129 
130 // sum of prescale and get number of events.
132 n_events += 1;
133 // averaging the prescale over events and get prescale average per SubRun
135 
136 
137  // Now to print our values
138 // std::cout << "run = " << fRun << std::endl;
139 // std::cout << "SubRun = " << fSubRun << std::endl;
140 std::cout << "Event = " << fEvent << std::endl;
141 std::cout << "Trigger length = " << fTrigLength << std::endl;
142 std::cout << "TriggerID = " << fTrigger << std::endl;
143 // std::cout << "Prescale = " << fprescale << std::endl;
144 
145 }
uint32_t fTriggerMask_Prescale
Definition: RawTrigger.h:44
unsigned int fRun
Run number.
unsigned int fTrigger
Trigger type.
unsigned int fTrigLength
uint8_t fTriggerMask_TriggerType
Definition: RawTrigger.h:43
float prescale_mean
sum of prescales
unsigned int prescale_sum
unsigned int fEvent
Event number.
OStream cout
Definition: OStream.cxx:6
unsigned int fSubRun
trigger length
uint32_t fTriggerRange_TriggerLength
Definition: RawTrigger.h:40
Float_t e
Definition: plot.C:35
std::string fRawDataLabel
average prescale
uint32_t fprescale
number of events
void Mono::Mono::beginJob ( )
overridevirtual

Reimplemented from art::EDAnalyzer.

Definition at line 163 of file DDTPrescaleOffline_module.cc.

References test_Tier::n_events.

164 {
165 
166  Job = tfs->make<TTree>("Trigger", "Trigger");
167 
168 
169  Job->Branch("Run", &fRun);
170  Job->Branch("SubRun", &fSubRun);
171  Job->Branch("Event", &fEvent);
172  Job->Branch("TriggerID", &fTrigger);
173  Job->Branch("Prescale", &fprescale);
174  Job->Branch("number of events", &n_events);
175  Job->Branch("Trigger length", &fTrigLength);
176 
177 
178 }
unsigned int fRun
Run number.
unsigned int fTrigger
Trigger type.
unsigned int fTrigLength
unsigned int fEvent
Event number.
unsigned int fSubRun
trigger length
T * make(ARGS...args) const
art::ServiceHandle< art::TFileService > tfs
uint32_t fprescale
number of events
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 Mono::Mono::endJob ( )
overridevirtual

Reimplemented from art::EDAnalyzer.

Definition at line 180 of file DDTPrescaleOffline_module.cc.

References DEFINE_ART_MODULE().

181  {
182  // Implementation of optional member function here.
183 }
void Mono::Mono::endSubRun ( art::SubRun const &  s)
overridevirtual

Reimplemented from art::EDAnalyzer.

Definition at line 148 of file DDTPrescaleOffline_module.cc.

References om::cout, and allTimeWatchdog::endl.

150 {
151 
152 // We want to get these numbers per SubRun so we print them in endSubRun level.
153  //std::cout << "run = " << fRun << std::endl;
154 //std::cout << "SubRun = " << fSubRun << std::endl;
155 std::cout << "TriggerID = " << fTrigger << std::endl;
156 // std::cout << "prescale total = " << prescale_sum << std::endl;
157 // std::cout << "n_events = " << n_events << std::endl;
158 std::cout << "average prescale = " << prescale_mean << std::endl;
159 Job->Fill();
160 
161 
162 }
unsigned int fTrigger
Trigger type.
float prescale_mean
sum of prescales
OStream cout
Definition: OStream.cxx:6
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
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
Mono& Mono::Mono::operator= ( Mono const &  )
delete
Mono& Mono::Mono::operator= ( Mono &&  )
delete
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

unsigned int Mono::Mono::fEvent
private

Event number.

Definition at line 72 of file DDTPrescaleOffline_module.cc.

uint32_t Mono::Mono::fprescale
private

number of events

prescale number

Definition at line 75 of file DDTPrescaleOffline_module.cc.

std::string Mono::Mono::fRawDataLabel
private

average prescale

ART module label for Raw Data

Definition at line 78 of file DDTPrescaleOffline_module.cc.

unsigned int Mono::Mono::fRun
private

Run number.

Definition at line 69 of file DDTPrescaleOffline_module.cc.

unsigned int Mono::Mono::fSubRun
private

trigger length

Subrun number

Definition at line 71 of file DDTPrescaleOffline_module.cc.

unsigned int Mono::Mono::fTrigger
private

Trigger type.

Definition at line 73 of file DDTPrescaleOffline_module.cc.

unsigned int Mono::Mono::fTrigLength
private

Definition at line 70 of file DDTPrescaleOffline_module.cc.

TTree* Mono::Mono::Job
private

Definition at line 83 of file DDTPrescaleOffline_module.cc.

unsigned int Mono::Mono::n_events
private

Definition at line 74 of file DDTPrescaleOffline_module.cc.

float Mono::Mono::prescale_mean
private

sum of prescales

Definition at line 77 of file DDTPrescaleOffline_module.cc.

unsigned int Mono::Mono::prescale_sum
private

Definition at line 76 of file DDTPrescaleOffline_module.cc.

art::ServiceHandle<art::TFileService> Mono::Mono::tfs
private

Definition at line 82 of file DDTPrescaleOffline_module.cc.


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