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

Public Member Functions

 TestHardwareMapper (fhicl::ParameterSet const &pset)
 
 TestHardwareMapper (TestHardwareMapper const &)=delete
 
 TestHardwareMapper (TestHardwareMapper &&)=delete
 
TestHardwareMapperoperator= (TestHardwareMapper const &)=delete
 
TestHardwareMapperoperator= (TestHardwareMapper &&)=delete
 
void analyze (art::Event const &evt) override
 
void beginJob () override
 
void reconfigure (fhicl::ParameterSet const &pset)
 
- 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 (SharedResources const &resources)
 
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 &)
 
fhicl::ParameterSetID selectorConfig () const
 
- Public Member Functions inherited from art::ModuleBase
virtual ~ModuleBase () noexcept
 
 ModuleBase ()
 
ModuleDescription const & moduleDescription () const
 
void setModuleDescription (ModuleDescription const &)
 
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

unsigned int fLogLevel
 
art::ServiceHandle< HardwareMapperServicemapperService
 
std::string fModuleName
 

Additional Inherited Members

- Public Types inherited from art::EDAnalyzer
using WorkerType = WorkerT< EDAnalyzer >
 
using ModuleType = EDAnalyzer
 
- Protected Member Functions inherited from art::Observer
std::string const & processName () const
 
bool wantAllEvents () const noexcept
 
bool wantEvent (ScheduleID id, Event const &e) const
 
Handle< TriggerResultsgetTriggerResults (Event const &e) const
 
 Observer (fhicl::ParameterSet const &config)
 
 Observer (std::vector< std::string > const &select_paths, std::vector< std::string > const &reject_paths, fhicl::ParameterSet const &config)
 
- Protected Member Functions inherited from art::ModuleBase
ConsumesCollectorconsumesCollector ()
 
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 ()
 

Detailed Description

Definition at line 28 of file TestHardwareMapper_module.cc.

Constructor & Destructor Documentation

TestHardwareMapper::TestHardwareMapper ( fhicl::ParameterSet const &  pset)
explicit

Definition at line 54 of file TestHardwareMapper_module.cc.

55  : EDAnalyzer(pset), fLogLevel(1), fModuleName("TestHardwareMapper")
56 {
57  pset.get_if_present<unsigned int>("LogLevel", fLogLevel);
58  std::string func_name("TestHardwareMapper");
59  if(fLogLevel>1) mf::LogInfo(fModuleName) << " in Function: " << func_name;
60  this->reconfigure(pset);
61 }
std::string string
Definition: nybbler.cc:12
MaybeLogger_< ELseverityLevel::ELsev_info, false > LogInfo
EDAnalyzer(fhicl::ParameterSet const &pset)
Definition: EDAnalyzer.h:25
void reconfigure(fhicl::ParameterSet const &pset)
TestHardwareMapper::TestHardwareMapper ( TestHardwareMapper const &  )
delete
TestHardwareMapper::TestHardwareMapper ( TestHardwareMapper &&  )
delete

Member Function Documentation

void TestHardwareMapper::analyze ( art::Event const &  evt)
overridevirtual

Implements art::EDAnalyzer.

Definition at line 70 of file TestHardwareMapper_module.cc.

70  {
71  std::string func_name("TestHardwareMapper");
72  if(fLogLevel>1) mf::LogInfo(fModuleName) << " in Function: " << func_name;
73 
74  //jpd -- this is how to loop through TPCs, asking the hardware mapper for the channels associated with each one
75  unsigned int num_tpcs = mapperService->getNTPCs();
76  {
77  mf::LogInfo loginfo(fModuleName);
78  for(unsigned int tpc_id = 0; tpc_id < num_tpcs; tpc_id++){
79  //jpd -- now get the vector of channels
80  std::vector<raw::ChannelID_t> tpc_channel_vector = mapperService->getTPCChannels(tpc_id);
81  loginfo << "Got TPC number: " << tpc_id
82  << " - it has " << tpc_channel_vector.size() << " channels"
83  << " - first channel is " << tpc_channel_vector.at(0)
84  << "\n";
85  }//loop over TPCs
86  }//annonymous to wrap loginfo
87 
88  //jpd -- this is how to loop through APAs, asking the hardware mapper for the channels associated with each one
89  unsigned int num_apas = mapperService->getNAPAs();
90  {
91  mf::LogInfo loginfo(fModuleName);
92  for(unsigned int apa_id = 0; apa_id < num_apas; apa_id++){
93  //jpd -- now get the vector of channels
94  std::vector<raw::ChannelID_t> apa_channel_vector = mapperService->getAPAChannels(apa_id);
95  loginfo << "Got APA number: " << apa_id
96  << " - it has " << apa_channel_vector.size() << " channels"
97  << " - first channel is " << apa_channel_vector.at(0)
98  << "\n";
99  }//loop over APAs
100  }//annonymous to wrap loginfo
101 }
std::vector< raw::ChannelID_t > const & getAPAChannels(Hardware::ID apa_id)
std::string string
Definition: nybbler.cc:12
MaybeLogger_< ELseverityLevel::ELsev_info, false > LogInfo
unsigned int getNAPAs() const
std::vector< raw::ChannelID_t > const & getTPCChannels(Hardware::ID tpc_id)
art::ServiceHandle< HardwareMapperService > mapperService
unsigned int getNTPCs() const
void TestHardwareMapper::beginJob ( )
overridevirtual

Reimplemented from art::EDAnalyzer.

Definition at line 104 of file TestHardwareMapper_module.cc.

104  {
105  std::string func_name("TestHardwareMapper");
106  if(fLogLevel>1) mf::LogInfo(fModuleName) << " in Function: " << func_name;
108 }
std::string string
Definition: nybbler.cc:12
MaybeLogger_< ELseverityLevel::ELsev_info, false > LogInfo
art::ServiceHandle< HardwareMapperService > mapperService
TestHardwareMapper& TestHardwareMapper::operator= ( TestHardwareMapper const &  )
delete
TestHardwareMapper& TestHardwareMapper::operator= ( TestHardwareMapper &&  )
delete
void TestHardwareMapper::reconfigure ( fhicl::ParameterSet const &  pset)

Definition at line 64 of file TestHardwareMapper_module.cc.

64  {
65  std::string func_name("TestHardwareMapper");
66  if(fLogLevel>1) mf::LogInfo(fModuleName) << " in Function: " << func_name;
67 }
std::string string
Definition: nybbler.cc:12
MaybeLogger_< ELseverityLevel::ELsev_info, false > LogInfo

Member Data Documentation

unsigned int TestHardwareMapper::fLogLevel
private

Definition at line 48 of file TestHardwareMapper_module.cc.

std::string TestHardwareMapper::fModuleName
private

Definition at line 50 of file TestHardwareMapper_module.cc.

art::ServiceHandle<HardwareMapperService> TestHardwareMapper::mapperService
private

Definition at line 49 of file TestHardwareMapper_module.cc.


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