65 Name(
"OutputCategory"),
66 Comment(
"output category used by the message facility to output information (INFO level)"),
70 Comment(
"print all the wires corresponding to each channel"),
74 Comment(
"print which channel covers each wire"),
78 Name(
"OpDetChannels"),
79 Comment(
"print for each optical detector channel ID the optical detector ID and its center"),
84 Comment(
"ID of the lowest channel to be printed (default: no limit)"),
89 Comment(
"ID of the highest channel to be printed (default: no limit)"),
128 class DumpChannelToWires {
154 void CheckConfig()
const;
159 class DumpWireToChannel {
162 DumpWireToChannel() {}
174 void CheckConfig()
const;
179 class DumpOpticalDetectorChannels {
182 DumpOpticalDetectorChannels() {}
194 void CheckConfig()
const;
198 geo::OpDetGeo const* getOpticalDetector(
unsigned int channelID)
const;
226 DumpChannelToWires dumper;
233 DumpWireToChannel dumper;
240 DumpOpticalDetectorChannels dumper;
254 void DumpChannelToWires::CheckConfig()
const 260 <<
"DumpChannelToWires: no valid geometry available!";
272 unsigned int const NChannels = pGeom->Nchannels();
274 if (NChannels == 0) {
275 mf::LogError(OutputCategory) <<
"Nice detector we have here, with no channels.";
285 unsigned int const NPrintedChannels = (PrintLast - PrintFirst) + 1;
286 if (NPrintedChannels == NChannels) {
287 mf::LogInfo(OutputCategory) <<
"Printing all " << NChannels <<
" channels";
291 <<
" (" << NPrintedChannels <<
" channels out of " << NChannels
297 for (
raw::ChannelID_t channel = PrintFirst; channel <= PrintLast; ++channel) {
298 std::vector<geo::WireID>
const Wires = pGeom->ChannelToWire(channel);
300 log <<
"\n " << ((int)channel) <<
" ->";
301 switch (Wires.size()) {
302 case 0: log <<
" no wires";
break;
304 default: log <<
" [" << Wires.size() <<
" wires]";
break;
308 log <<
" { " << std::string(wireID) <<
" };";
317 void DumpWireToChannel::CheckConfig()
const 323 <<
"DumpWireToChannel: no valid geometry available!";
335 unsigned int const NChannels = pGeom->Nchannels();
337 if (NChannels == 0) {
338 mf::LogError(OutputCategory) <<
"Nice detector we have here, with no channels.";
343 mf::LogInfo(OutputCategory) <<
"Printing wire channels for up to " << NChannels <<
" channels";
349 log <<
"\n { " << std::string(wireID) <<
" } => ";
361 void DumpOpticalDetectorChannels::CheckConfig()
const 367 <<
"DumpOpticalDetectorChannels: no valid geometry available!";
372 geo::OpDetGeo const* DumpOpticalDetectorChannels::getOpticalDetector(
unsigned int channelID)
const 375 return &(pGeom->OpDetGeoFromOpChannel(channelID));
383 void DumpOpticalDetectorChannels::Dump(std::string
OutputCategory)
const 390 unsigned int const NChannels = pGeom->NOpChannels();
392 if (NChannels == 0) {
393 mf::LogError(OutputCategory) <<
"Nice detector we have here, with no optical channels.";
398 mf::LogInfo(OutputCategory) <<
"Printing optical detectors for up to " << NChannels
403 for (
unsigned int channelID = 0; channelID < NChannels; ++channelID) {
404 log <<
"\nChannel " << channelID <<
" => ";
410 log << opDet->
ID() <<
" at " << opDet->
GetCenter() <<
" cm";
bool DoOpDetChannels
Dump optical detector channel -> optical detector.
std::string OutputCategory
Name of the category for output.
MaybeLogger_< ELseverityLevel::ELsev_info, false > LogInfo
fhicl::Atom< std::string > OutputCategory
MaybeLogger_< ELseverityLevel::ELsev_error, false > LogError
EDAnalyzer(fhicl::ParameterSet const &pset)
fhicl::Atom< bool > OpDetChannels
DumpChannelMap & operator=(DumpChannelMap const &)=delete
Access the description of detector geometry.
constexpr ChannelID_t InvalidChannelID
ID of an invalid channel.
#define DEFINE_ART_MODULE(klass)
void beginRun(art::Run const &) override
Drives the dumping.
constexpr bool isValidChannelID(raw::ChannelID_t channel)
bool DoWireToChannel
Dump wire -> channel mapping.
Description of geometry of one entire detector.
Definition of data types for geometry description.
bool DoChannelToWires
Dump channel -> wires mapping.
raw::ChannelID_t LastChannel
Last channel to be printed.
Encapsulate the geometry of an optical detector.
geo::Point_t const & GetCenter() const
cet::coded_exception< errors::ErrorCodes, ExceptionDetail::translate > Exception
fhicl::Atom< raw::ChannelID_t > FirstChannel
fhicl::Atom< raw::ChannelID_t > LastChannel
fhicl::Atom< bool > ChannelToWires
Prints on screen the current channel-wire and optical detector maps.
geo::OpDetID const & ID() const
Returns the geometry ID of this optical detector.
fhicl::Atom< bool > WireToChannel
raw::ChannelID_t FirstChannel
First channel to be printed.
unsigned int ChannelID_t
Type representing the ID of a readout channel.
DumpChannelMap(Parameters const &config)
Namespace collecting geometry-related classes utilities.
void analyze(art::Event const &) override
art framework interface to geometry description
cet::coded_exception< error, detail::translate > exception