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

Public Types

using WorkerType = WorkerT< EDAnalyzer >
 
using ModuleType = EDAnalyzer
 

Public Member Functions

 BeamlineRecoValidation (const fhicl::ParameterSet &pset)
 
void reconfigure (const fhicl::ParameterSet &pset)
 
void analyze (const art::Event &evt)
 
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

void initializeHists ()
 

Private Attributes

art::InputTag fToFRawDigitLabel
 
art::InputTag fToFRecoDigitLabel
 
art::InputTag fRecoCherenkovLabel
 
art::InputTag fRecoToFLabel
 
art::InputTag fRecoWCTrackLabel
 
TH1D * hNumToF
 
TH1D * hNumWCTrack
 
TH2D * hAverageADC
 
TH1D * hRecoStartTime
 
TH1D * hToF
 
TH1D * hMomentum
 
TH2D * hPID
 
art::ServiceHandle< art::TFileServicetfs
 

Detailed Description

Definition at line 40 of file BeamlineRecoValidation_module.cc.

Member Typedef Documentation

Definition at line 39 of file EDAnalyzer.h.

Definition at line 38 of file EDAnalyzer.h.

Constructor & Destructor Documentation

testbeam::BeamlineRecoValidation::BeamlineRecoValidation ( const fhicl::ParameterSet pset)

Definition at line 80 of file BeamlineRecoValidation_module.cc.

References initializeHists(), and reconfigure().

80  : EDAnalyzer(pset) {
81  this->reconfigure(pset);
82  this->initializeHists();
83 }
EDAnalyzer(Table< Config > const &config)
Definition: EDAnalyzer.h:100
void reconfigure(const fhicl::ParameterSet &pset)

Member Function Documentation

void testbeam::BeamlineRecoValidation::analyze ( const art::Event evt)

Definition at line 106 of file BeamlineRecoValidation_module.cc.

References om::cout, allTimeWatchdog::endl, art::Event::event(), art::fill_ptr_vector(), fRecoCherenkovLabel, fRecoToFLabel, fRecoWCTrackLabel, fToFRawDigitLabel, fToFRecoDigitLabel, art::DataViewImpl::getByLabel(), hAverageADC, hMomentum, hNumToF, hNumWCTrack, hPID, hRecoStartTime, and hToF.

106  {
107 
108  std::cout << std::endl << "Event " << evt.event() << std::endl;
109 
110  std::vector<art::Ptr<rawdata::RawBeamlineDigit> > rawDigits;
112  if (evt.getByLabel(fToFRawDigitLabel, rawDigitHandle))
113  art::fill_ptr_vector(rawDigits, rawDigitHandle);
114 
115  std::vector<art::Ptr<brb::BeamlineDigit> > recoDigits;
117  if (evt.getByLabel(fToFRecoDigitLabel, recoDigitHandle))
118  art::fill_ptr_vector(recoDigits, recoDigitHandle);
119 
120  std::vector<art::Ptr<brb::Cherenkov> > cherenkovs;
121  art::Handle<std::vector<brb::Cherenkov> > cherenkovHandle;
122  if (evt.getByLabel(fRecoCherenkovLabel, cherenkovHandle))
123  art::fill_ptr_vector(cherenkovs, cherenkovHandle);
124 
125  std::vector<art::Ptr<brb::ToF> > tofs;
127  if (evt.getByLabel(fRecoToFLabel, tofHandle))
128  art::fill_ptr_vector(tofs, tofHandle);
129 
130  std::vector<art::Ptr<brb::WCTrack> > wcTracks;
132  if (evt.getByLabel(fRecoWCTrackLabel, wcTrackHandle))
133  art::fill_ptr_vector(wcTracks, wcTrackHandle);
134 
135  hNumToF->Fill(tofs.size());
136  hNumWCTrack->Fill(wcTracks.size());
137  for (std::vector<art::Ptr<rawdata::RawBeamlineDigit> >::const_iterator digitIt = rawDigits.begin();
138  digitIt != rawDigits.end(); ++digitIt) {
139  std::vector<uint16_t> adcs = (*digitIt)->ADCs();
140  hAverageADC->Fill((*digitIt)->ChannelID().Channel, TMath::Mean(adcs.begin(), adcs.end()));
141  }
142  for (std::vector<art::Ptr<brb::BeamlineDigit> >::const_iterator digitIt = recoDigits.begin();
143  digitIt != recoDigits.end(); ++digitIt) {
144  std::cout << "reco start time " << (*digitIt)->StartTimeInNanoSec() << std::endl;
145  hRecoStartTime->Fill((*digitIt)->StartTimeInNanoSec());
146  }
147  for (std::vector<art::Ptr<brb::ToF> >::const_iterator tofIt = tofs.begin();
148  tofIt != tofs.end(); ++tofIt)
149  hToF->Fill((*tofIt)->Time());
150  for (std::vector<art::Ptr<brb::WCTrack> >::const_iterator wcTrackIt = wcTracks.begin();
151  wcTrackIt != wcTracks.end(); ++wcTrackIt)
152  hMomentum->Fill((*wcTrackIt)->Momentum());
153  if (tofs.size() and wcTracks.size())
154  hPID->Fill(wcTracks[0]->Momentum(), tofs[0]->Time());
155 
156  return;
157 
158 }
EventNumber_t event() const
Definition: Event.h:67
OStream cout
Definition: OStream.cxx:6
bool getByLabel(std::string const &label, std::string const &productInstanceName, Handle< PROD > &result) const
Definition: DataViewImpl.h:344
void fill_ptr_vector(std::vector< Ptr< T >> &ptrs, H const &h)
Definition: Ptr.h:464
Definition: fwd.h:28
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
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
void testbeam::BeamlineRecoValidation::initializeHists ( )
private

Definition at line 95 of file BeamlineRecoValidation_module.cc.

References hAverageADC, hMomentum, hNumToF, hNumWCTrack, hPID, hRecoStartTime, hToF, art::TFileDirectory::make(), and tfs.

Referenced by BeamlineRecoValidation().

95  {
96  hNumToF = tfs->make<TH1D>("NumToF", ";Number of ToF per trigger;", 100, 0, 100);
97  hNumWCTrack = tfs->make<TH1D>("NumWCTracks", ";Number of WC tracks;", 100, 0, 100);
98  hAverageADC = tfs->make<TH2D>("AverageADC", ";Average ADC;", 12, 0, 12, 100, 0, 5000);
99  hRecoStartTime = tfs->make<TH1D>("RecoStartTime", ";Start Time (ns);", 100, 0, 200);
100  hToF = tfs->make<TH1D>("ToF", ";Time-of-flight (ns);", 100, 0, 1000);
101  hMomentum = tfs->make<TH1D>("Momentum", ";Momentum (MeV);", 100, 0, 5000);
102  hPID = tfs->make<TH2D>("PID", ";Momentum (MeV);Time-of-flight (ns);", 100, 0, 5000, 100, 0, 1000);
103 }
art::ServiceHandle< art::TFileService > tfs
T * make(ARGS...args) const
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 testbeam::BeamlineRecoValidation::reconfigure ( const fhicl::ParameterSet pset)
void art::EventObserverBase::registerProducts ( MasterProductRegistry ,
ProductDescriptions ,
ModuleDescription const &   
)
inlineinherited

Definition at line 33 of file EventObserverBase.h.

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

art::InputTag testbeam::BeamlineRecoValidation::fRecoCherenkovLabel
private

Definition at line 54 of file BeamlineRecoValidation_module.cc.

Referenced by analyze(), and reconfigure().

art::InputTag testbeam::BeamlineRecoValidation::fRecoToFLabel
private

Definition at line 55 of file BeamlineRecoValidation_module.cc.

Referenced by analyze(), and reconfigure().

art::InputTag testbeam::BeamlineRecoValidation::fRecoWCTrackLabel
private

Definition at line 56 of file BeamlineRecoValidation_module.cc.

Referenced by analyze(), and reconfigure().

art::InputTag testbeam::BeamlineRecoValidation::fToFRawDigitLabel
private

Definition at line 52 of file BeamlineRecoValidation_module.cc.

Referenced by analyze(), and reconfigure().

art::InputTag testbeam::BeamlineRecoValidation::fToFRecoDigitLabel
private

Definition at line 53 of file BeamlineRecoValidation_module.cc.

Referenced by analyze(), and reconfigure().

TH2D* testbeam::BeamlineRecoValidation::hAverageADC
private

Definition at line 64 of file BeamlineRecoValidation_module.cc.

Referenced by analyze(), and initializeHists().

TH1D* testbeam::BeamlineRecoValidation::hMomentum
private

Definition at line 67 of file BeamlineRecoValidation_module.cc.

Referenced by analyze(), and initializeHists().

TH1D* testbeam::BeamlineRecoValidation::hNumToF
private

Definition at line 62 of file BeamlineRecoValidation_module.cc.

Referenced by analyze(), and initializeHists().

TH1D* testbeam::BeamlineRecoValidation::hNumWCTrack
private

Definition at line 63 of file BeamlineRecoValidation_module.cc.

Referenced by analyze(), and initializeHists().

TH2D* testbeam::BeamlineRecoValidation::hPID
private

Definition at line 68 of file BeamlineRecoValidation_module.cc.

Referenced by analyze(), and initializeHists().

TH1D* testbeam::BeamlineRecoValidation::hRecoStartTime
private

Definition at line 65 of file BeamlineRecoValidation_module.cc.

Referenced by analyze(), and initializeHists().

TH1D* testbeam::BeamlineRecoValidation::hToF
private

Definition at line 66 of file BeamlineRecoValidation_module.cc.

Referenced by analyze(), and initializeHists().

art::ServiceHandle<art::TFileService> testbeam::BeamlineRecoValidation::tfs
private

Definition at line 71 of file BeamlineRecoValidation_module.cc.

Referenced by initializeHists().


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