Classes | Public Types | Public Member Functions | Private Member Functions | Private Attributes | List of all members
geo::DumpGeometry Class Reference

Describes on screen the current geometry. More...

Inheritance diagram for geo::DumpGeometry:
art::EDAnalyzer art::detail::Analyzer art::detail::LegacyModule art::Observer art::ModuleBase

Classes

struct  Config
 

Public Types

using Parameters = art::EDAnalyzer::Table< Config >
 
- Public Types inherited from art::EDAnalyzer
using WorkerType = WorkerT< EDAnalyzer >
 
using ModuleType = EDAnalyzer
 

Public Member Functions

 DumpGeometry (Parameters const &config)
 
 DumpGeometry (DumpGeometry const &)=delete
 
 DumpGeometry (DumpGeometry &&)=delete
 
DumpGeometryoperator= (DumpGeometry const &)=delete
 
DumpGeometryoperator= (DumpGeometry &&)=delete
 
virtual void analyze (art::Event const &) override
 
virtual void beginJob () override
 Dumps the geometry at once. More...
 
virtual void beginRun (art::Run const &run) override
 Dumps the geometry if changed from the previous run. More...
 
- 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 Member Functions

template<typename Stream >
void dumpGeometryCore (Stream &&out, geo::GeometryCore const &geom) const
 Dumps the specified geometry into the specified output stream. More...
 
template<typename Stream >
void dump (Stream &&out, geo::GeometryCore const &geom)
 Dumps the geometry and records it. More...
 
bool shouldDumpGeometry (geo::GeometryCore const &geom) const
 Returns whether the specified geometry should be dumped. More...
 

Private Attributes

std::string fOutputCategory
 Name of the category for output. More...
 
std::string fLastDetectorName
 Name of the last geometry dumped. More...
 

Additional Inherited Members

- 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

Describes on screen the current geometry.


One print is performed at the beginning of each run.

Configuration parameters

Definition at line 38 of file DumpGeometry_module.cc.

Member Typedef Documentation

Definition at line 54 of file DumpGeometry_module.cc.

Constructor & Destructor Documentation

geo::DumpGeometry::DumpGeometry ( Parameters const &  config)
explicit

Definition at line 104 of file DumpGeometry_module.cc.

105  : EDAnalyzer(config)
106  , fOutputCategory(config().outputCategory())
107  {}
EDAnalyzer(fhicl::ParameterSet const &pset)
Definition: EDAnalyzer.h:25
static Config * config
Definition: config.cpp:1054
std::string fOutputCategory
Name of the category for output.
geo::DumpGeometry::DumpGeometry ( DumpGeometry const &  )
delete
geo::DumpGeometry::DumpGeometry ( DumpGeometry &&  )
delete

Member Function Documentation

virtual void geo::DumpGeometry::analyze ( art::Event const &  )
inlineoverridevirtual

Implements art::EDAnalyzer.

Definition at line 65 of file DumpGeometry_module.cc.

65 {}
void geo::DumpGeometry::beginJob ( )
overridevirtual

Dumps the geometry at once.

Reimplemented from art::EDAnalyzer.

Definition at line 111 of file DumpGeometry_module.cc.

111  {
112 
113  auto const& geom = *(lar::providerFrom<geo::Geometry>());
115 
116 } // geo::DumpGeometry::beginJob()
void dump(Stream &&out, geo::GeometryCore const &geom)
Dumps the geometry and records it.
std::string fOutputCategory
Name of the category for output.
void geo::DumpGeometry::beginRun ( art::Run const &  run)
overridevirtual

Dumps the geometry if changed from the previous run.

Reimplemented from art::EDAnalyzer.

Definition at line 120 of file DumpGeometry_module.cc.

120  {
121 
122  auto const& geom = *(lar::providerFrom<geo::Geometry>());
123  if (shouldDumpGeometry(geom)) {
125  log << "\nGeometry used in " << run.id() << ":\n";
126  dump(log, geom);
127  }
128 
129 } // geo::DumpGeometry::beginRun()
void dump(Stream &&out, geo::GeometryCore const &geom)
Dumps the geometry and records it.
std::string fOutputCategory
Name of the category for output.
bool shouldDumpGeometry(geo::GeometryCore const &geom) const
Returns whether the specified geometry should be dumped.
template<typename Stream >
void geo::DumpGeometry::dump ( Stream &&  out,
geo::GeometryCore const &  geom 
)
private

Dumps the geometry and records it.

Definition at line 146 of file DumpGeometry_module.cc.

146  {
147 
148  fLastDetectorName = geom.DetectorName();
149  dumpGeometryCore(std::forward<Stream>(out), geom);
150 
151 } // geo::DumpGeometry::dump()
void dumpGeometryCore(Stream &&out, geo::GeometryCore const &geom) const
Dumps the specified geometry into the specified output stream.
std::string fLastDetectorName
Name of the last geometry dumped.
template<typename Stream >
void geo::DumpGeometry::dumpGeometryCore ( Stream &&  out,
geo::GeometryCore const &  geom 
) const
private

Dumps the specified geometry into the specified output stream.

Definition at line 135 of file DumpGeometry_module.cc.

136 {
137 
138  out << "Detector description: '" << geom.ROOTFile() << "'\n";
139  geom.Print(std::forward<Stream>(out));
140 
141 } // geo::DumpGeometry::dumpGeometryCore()
DumpGeometry& geo::DumpGeometry::operator= ( DumpGeometry const &  )
delete
DumpGeometry& geo::DumpGeometry::operator= ( DumpGeometry &&  )
delete
bool geo::DumpGeometry::shouldDumpGeometry ( geo::GeometryCore const &  geom) const
private

Returns whether the specified geometry should be dumped.

Definition at line 155 of file DumpGeometry_module.cc.

156 {
157 
158  // only dump if not already dumped
159  return geom.DetectorName() != fLastDetectorName;
160 
161 } // geo::DumpGeometry::shouldDumpGeometry()
std::string fLastDetectorName
Name of the last geometry dumped.

Member Data Documentation

std::string geo::DumpGeometry::fLastDetectorName
private

Name of the last geometry dumped.

Definition at line 76 of file DumpGeometry_module.cc.

std::string geo::DumpGeometry::fOutputCategory
private

Name of the category for output.

Definition at line 75 of file DumpGeometry_module.cc.


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