![]() |
LArSoft
v10_04_05
Liquid Argon Software toolkit - https://larsoft.org/
|
Algorithm dumping the full detector geometry down to wires. More...
#include "WireReadoutDumper.h"
Classes | |
struct | StreamAdapter |
Helper for insertion into C++ output streams. More... | |
Public Member Functions | |
WireReadoutDumper (geo::GeometryCore const *geom, geo::WireReadoutGeom const *wireGeom, geo::AuxDetGeometryCore const *auxGeom) | |
Constructor: acquires geometry service providers. More... | |
void | dump (std::ostream &out, std::string const &indent, std::string const &firstIndent) const |
Dumps the full geometry information into a stream. More... | |
void | dump (std::ostream &out, std::string const &indent="") const |
Dumps the full geometry information into a stream. More... | |
StreamAdapter | toStream (std::string indent, std::string firstIndent) const |
Adapter to send the dump to a C++ output stream via insertion. More... | |
auto | toStream (std::string indent="") const |
Adapter to send the dump to a C++ output stream via insertion. More... | |
Private Member Functions | |
void | dumpDetectorInfo (std::ostream &out, std::string const &indent, std::string const &firstIndent) const |
Dumps the general detector information. More... | |
void | dumpCryostat (std::ostream &out, geo::CryostatGeo const &cryostat, std::string const &indent, std::string const &firstIndent) const |
Dumps all content of the specified cryostat . More... | |
void | dumpTPCplane (std::ostream &out, geo::PlaneGeo const &plane, std::string const &indent, std::string const &firstIndent) const |
Dumps the information from the specified plane (including wires). More... | |
void | dumpAuxiliaryDetectors (std::ostream &out, std::string const &indent, std::string const &firstIndent) const |
Dumps all auxiliary detector information. More... | |
Private Attributes | |
geo::GeometryCore const * | fGeom = nullptr |
Cached geometry service provider. More... | |
geo::WireReadoutGeom const * | fWireGeom = nullptr |
Cached wire readout service provider. More... | |
geo::AuxDetGeometryCore const * | fAuxGeom = nullptr |
Cached auxiliary detector geometry service provider. More... | |
Friends | |
std::ostream & | operator<< (std::ostream &out, StreamAdapter const &dumpAdapter) |
Helper for geo::WireReadoutDumper::toStream() . More... | |
Algorithm dumping the full detector geometry down to wires.
This algorithm dumps all the available information from the geometry, including the chamber information (from geo::GeometryCore
), the wire and readout information (from geo::WireReadoutGeom
) and the auxiliary detectors (from geo::AuxDetGeometryCore
). Any of the service providers can be omitted (nullptr
), in which case the relative information will not be printed.
A typical usage example is to create the algorithm and then call its dump()
method, like in:
The interface supports only dumping to C++ output streams (including std::ostringstream
to bridge to libraries which can us strings). However, for streams which support inserter operators to std::ostream
, the following is also possible:
The messagefacility library streams (like in this example) fall into this category.
The output is documented in the dump()
method.
Definition at line 59 of file WireReadoutDumper.h.
geo::WireReadoutDumper::WireReadoutDumper | ( | geo::GeometryCore const * | geom, |
geo::WireReadoutGeom const * | wireGeom, | ||
geo::AuxDetGeometryCore const * | auxGeom | ||
) |
Constructor: acquires geometry service providers.
Definition at line 24 of file WireReadoutDumper.cxx.
References fAuxGeom, and fWireGeom.
void geo::WireReadoutDumper::dump | ( | std::ostream & | out, |
std::string const & | indent, | ||
std::string const & | firstIndent | ||
) | const |
Dumps the full geometry information into a stream.
out | the stream to write the information in |
indent | string to be prepended to each output line except the first |
firstIndent | string to be prepended to the first line only |
The output is in human-readable format, structured as follows:
The output starts on the current line of the stream and it ends with a new line.
Definition at line 31 of file WireReadoutDumper.cxx.
References dumpAuxiliaryDetectors(), dumpCryostat(), dumpDetectorInfo(), fAuxGeom, fGeom, and geo::Iterable< IterationPolicy, Transform >::Iterate().
Referenced by geo::operator<<().
|
inline |
Dumps the full geometry information into a stream.
out | the stream to write the information in |
indent | (default: none) string to be prepended to all output lines |
Dumps the geometry like dump(std::ostream&, std::string const&, std::string const&) const
does, but using the same indentation string for all lines.
Definition at line 117 of file WireReadoutDumper.h.
References dump(), geo::WireReadoutDumper::StreamAdapter::firstIndent, geo::WireReadoutDumper::StreamAdapter::indent, and toStream().
Referenced by dump().
|
private |
Dumps all auxiliary detector information.
Definition at line 151 of file WireReadoutDumper.cxx.
References geo::AuxDetGeometryCore::AuxDet(), util::counter(), fAuxGeom, geo::AuxDetSensitiveGeo::MaxVerbosity, geo::AuxDetGeo::MaxVerbosity, geo::AuxDetGeometryCore::NAuxDets(), geo::AuxDetGeo::NSensitiveVolume(), geo::AuxDetSensitiveGeo::PrintAuxDetInfo(), geo::AuxDetGeo::PrintAuxDetInfo(), and geo::AuxDetGeo::SensitiveVolume().
Referenced by dump(), and toStream().
|
private |
Dumps all content of the specified cryostat
.
Definition at line 83 of file WireReadoutDumper.cxx.
References util::counter(), dumpTPCplane(), fWireGeom, art::detail::indent(), geo::Iterable< IterationPolicy, Transform >::Iterate(), geo::CryostatGeo::IterateTPCs(), geo::CryostatGeo::MaxVerbosity, geo::OpDetGeo::MaxVerbosity, geo::CryostatGeo::NOpDet(), geo::CryostatGeo::OpDet(), geo::CryostatGeo::PrintCryostatInfo(), and geo::OpDetGeo::PrintOpDetInfo().
Referenced by dump(), and toStream().
|
private |
Dumps the general detector information.
Definition at line 63 of file WireReadoutDumper.cxx.
References geo::GeometryCore::DetectorEnclosureBox(), geo::GeometryCore::DetectorName(), fAuxGeom, fGeom, geo::BoxBoundedGeo::Max(), geo::BoxBoundedGeo::Min(), geo::AuxDetGeometryCore::NAuxDets(), geo::GeometryCore::Ncryostats(), geo::BoxBoundedGeo::SizeX(), geo::BoxBoundedGeo::SizeY(), geo::BoxBoundedGeo::SizeZ(), and util::to_string().
Referenced by dump(), and toStream().
|
private |
Dumps the information from the specified plane
(including wires).
Definition at line 126 of file WireReadoutDumper.cxx.
References util::counter(), fWireGeom, geo::PlaneGeo::ID(), geo::WireGeo::MaxVerbosity, geo::PlaneGeo::MaxVerbosity, geo::PlaneGeo::Nwires(), geo::PlaneGeo::PrintPlaneInfo(), geo::WireGeo::PrintWireInfo(), geo::WireReadoutGeom::SignalType(), geo::SignalTypeName(), and geo::PlaneGeo::Wire().
Referenced by dumpCryostat(), and toStream().
geo::WireReadoutDumper::StreamAdapter geo::WireReadoutDumper::toStream | ( | std::string | indent, |
std::string | firstIndent | ||
) | const |
Adapter to send the dump to a C++ output stream via insertion.
indent | (default: none) string to be prepended to all output lines |
firstIndent | string to be prepended to the first line only |
dump()
Example: after a geo::WireReadoutDumper dumper
has been initialized,
will dump the full geometry into std::cout
.
Definition at line 55 of file WireReadoutDumper.cxx.
Referenced by dump().
|
inline |
Adapter to send the dump to a C++ output stream via insertion.
indent | (default: none) string to be prepended to all output lines |
dump()
Example: after a geo::WireReadoutDumper dumper
has been initialized,
will dump the full geometry into std::cout
.
Definition at line 148 of file WireReadoutDumper.h.
References dumpAuxiliaryDetectors(), dumpCryostat(), dumpDetectorInfo(), dumpTPCplane(), operator<<, and toStream().
Referenced by toStream().
|
friend |
Helper for geo::WireReadoutDumper::toStream()
.
Referenced by toStream().
|
private |
Cached auxiliary detector geometry service provider.
Definition at line 68 of file WireReadoutDumper.h.
Referenced by dump(), dumpAuxiliaryDetectors(), dumpDetectorInfo(), and WireReadoutDumper().
|
private |
Cached geometry service provider.
Definition at line 62 of file WireReadoutDumper.h.
Referenced by dump(), and dumpDetectorInfo().
|
private |
Cached wire readout service provider.
Definition at line 65 of file WireReadoutDumper.h.
Referenced by dumpCryostat(), dumpTPCplane(), and WireReadoutDumper().