All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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:

Classes

struct  Config
 

Public Types

using Parameters = art::EDAnalyzer::Table< Config >
 

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...
 

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...
 

Detailed Description

Describes on screen the current geometry.


One print is performed at the beginning of each run.

Configuration parameters

Definition at line 44 of file DumpGeometry_module.cc.

Member Typedef Documentation

using geo::DumpGeometry::Parameters = art::EDAnalyzer::Table<Config>

Definition at line 60 of file DumpGeometry_module.cc.

Constructor & Destructor Documentation

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

Definition at line 103 of file DumpGeometry_module.cc.

104  : EDAnalyzer(config)
105  , fOutputCategory(config().outputCategory())
106  {}
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

Definition at line 71 of file DumpGeometry_module.cc.

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

Dumps the geometry at once.

Definition at line 110 of file DumpGeometry_module.cc.

110  {
111 
112  auto const& geom = *(lar::providerFrom<geo::Geometry>());
113  dump(mf::LogVerbatim(fOutputCategory), geom);
114 
115 } // 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.

Definition at line 119 of file DumpGeometry_module.cc.

119  {
120 
121  auto const& geom = *(lar::providerFrom<geo::Geometry>());
122  if (shouldDumpGeometry(geom)) {
123  mf::LogVerbatim log(fOutputCategory);
124  log << "\nGeometry used in " << run.id() << ":\n";
125  dump(log, geom);
126  }
127 
128 } // 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 145 of file DumpGeometry_module.cc.

145  {
146 
147  fLastDetectorName = geom.DetectorName();
148  dumpGeometryCore(std::forward<Stream>(out), geom);
149 
150 } // 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 134 of file DumpGeometry_module.cc.

135 {
136 
137  out << "Detector description: '" << geom.ROOTFile() << "'\n";
138  geom.Print(std::forward<Stream>(out));
139 
140 } // 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 154 of file DumpGeometry_module.cc.

155 {
156 
157  // only dump if not already dumped
158  return geom.DetectorName() != fLastDetectorName;
159 
160 } // 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 82 of file DumpGeometry_module.cc.

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

Name of the category for output.

Definition at line 81 of file DumpGeometry_module.cc.


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