Public Member Functions | Private Attributes | List of all members
arttest::FindManySpeedTestAnalyzer Class Reference
Inheritance diagram for arttest::FindManySpeedTestAnalyzer:
art::EDAnalyzer art::detail::Analyzer art::detail::LegacyModule art::Observer art::ModuleBase

Public Member Functions

 FindManySpeedTestAnalyzer (fhicl::ParameterSet const &p)
 
 FindManySpeedTestAnalyzer (FindManySpeedTestAnalyzer const &)=delete
 
 FindManySpeedTestAnalyzer (FindManySpeedTestAnalyzer &&)=delete
 
FindManySpeedTestAnalyzeroperator= (FindManySpeedTestAnalyzer const &)=delete
 
FindManySpeedTestAnalyzeroperator= (FindManySpeedTestAnalyzer &&)=delete
 
void analyze (art::Event const &e) override
 
- Public Member Functions inherited from art::EDAnalyzer
 EDAnalyzer (fhicl::ParameterSet const &pset)
 
template<typename Config >
 EDAnalyzer (Table< Config > const &config)
 
std::string workerType () const
 
- Public Member Functions inherited from art::detail::Analyzer
virtual ~Analyzer () noexcept
 
 Analyzer (fhicl::ParameterSet const &pset)
 
template<typename Config >
 Analyzer (Table< Config > const &config)
 
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::Observer
 ~Observer () noexcept
 
 Observer (Observer const &)=delete
 
 Observer (Observer &&)=delete
 
Observeroperator= (Observer const &)=delete
 
Observeroperator= (Observer &&)=delete
 
void registerProducts (ProductDescriptions &, ModuleDescription const &)
 
void fillDescriptions (ModuleDescription const &)
 
std::string const & processName () const
 
bool wantAllEvents () const
 
bool wantEvent (Event const &e)
 
fhicl::ParameterSetID selectorConfig () const
 
Handle< TriggerResultsgetTriggerResults (Event const &e) const
 
- Public Member Functions inherited from art::ModuleBase
virtual ~ModuleBase () noexcept
 
 ModuleBase ()
 
ModuleDescription const & moduleDescription () const
 
void setModuleDescription (ModuleDescription const &)
 
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 ()
 
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 const producerLabel_
 
bool const perTrackDiag_
 

Additional Inherited Members

- Public Types inherited from art::EDAnalyzer
using WorkerType = WorkerT< EDAnalyzer >
 
using ModuleType = EDAnalyzer
 
- Protected Member Functions inherited from art::Observer
 Observer (fhicl::ParameterSet const &config)
 
 Observer (std::vector< std::string > const &paths, fhicl::ParameterSet const &config)
 
detail::ProcessAndEventSelectorsprocessAndEventSelectors ()
 

Detailed Description

Definition at line 31 of file FindManySpeedTestAnalyzer_module.cc.

Constructor & Destructor Documentation

arttest::FindManySpeedTestAnalyzer::FindManySpeedTestAnalyzer ( fhicl::ParameterSet const &  p)
explicit

Definition at line 52 of file FindManySpeedTestAnalyzer_module.cc.

54  : EDAnalyzer(p)
55  , producerLabel_(p.get<std::string>("producerLabel"))
56  , perTrackDiag_(p.get<bool>("perTrackDiag", false))
57 {}
std::string string
Definition: nybbler.cc:12
EDAnalyzer(fhicl::ParameterSet const &pset)
Definition: EDAnalyzer.h:27
p
Definition: test.py:228
arttest::FindManySpeedTestAnalyzer::FindManySpeedTestAnalyzer ( FindManySpeedTestAnalyzer const &  )
delete
arttest::FindManySpeedTestAnalyzer::FindManySpeedTestAnalyzer ( FindManySpeedTestAnalyzer &&  )
delete

Member Function Documentation

void arttest::FindManySpeedTestAnalyzer::analyze ( art::Event const &  e)
overridevirtual

Implements art::EDAnalyzer.

Definition at line 60 of file FindManySpeedTestAnalyzer_module.cc.

61 {
62  auto hH = e.getValidHandle<std::vector<Hit>>(producerLabel_);
63  std::cout << "Hit collection size: " << hH->size() << ".\n";
64  auto hT = e.getValidHandle<std::vector<Track>>(producerLabel_);
65  std::cout << "Track collection size: " << hT->size() << ".\n";
66  auto hA = e.getValidHandle<art::Assns<Hit, Track>>(producerLabel_);
67  std::cout << "Assns size = " << hA->size() << ".\n";
68 
69  // Make a collection of Ptrs so we can exercise the algorithm at
70  // issue.
72  e.getView<Track>(producerLabel_, tv);
74  tv.fill(tPtrs);
75  assert(tPtrs.size() == hT->size());
76 
77  // Time the activity under test.
78  cet::cpu_timer timer;
79  timer.start();
80  art::FindManyP<Hit> fmp(tPtrs, e, producerLabel_);
81  timer.stop();
82  std::cout << "FindManyP size = " << fmp.size() << ".\n";
83  std::cout << "FindManyP construction time (CPU, real): (" << timer.cpuTime()
84  << ", " << timer.realTime() << ") s.\n";
85  if (perTrackDiag_) {
86  for (size_t i = 0, e = fmp.size(); i != e; ++i) {
87  std::cout << "Track # " << i << " has " << fmp.at(i).size()
88  << " associated hits.\n";
89  }
90  }
91 }
size_type size() const
Definition: Assns.h:447
void fill(PtrVector< T > &pv) const
Definition: View.h:158
const double e
Definition: fwd.h:43
TrackCollectionProxyElement< TrackCollProxy > Track
Proxy to an element of a proxy collection of recob::Track objects.
Definition: Track.h:1035
void start()
Definition: cpu_timer.cc:83
FindManySpeedTestAnalyzer& arttest::FindManySpeedTestAnalyzer::operator= ( FindManySpeedTestAnalyzer const &  )
delete
FindManySpeedTestAnalyzer& arttest::FindManySpeedTestAnalyzer::operator= ( FindManySpeedTestAnalyzer &&  )
delete

Member Data Documentation

bool const arttest::FindManySpeedTestAnalyzer::perTrackDiag_
private

Definition at line 49 of file FindManySpeedTestAnalyzer_module.cc.

std::string const arttest::FindManySpeedTestAnalyzer::producerLabel_
private

Definition at line 48 of file FindManySpeedTestAnalyzer_module.cc.


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