61 Name(
"OutputCategory"),
63 "output category used by the message facility to output information (INFO level)" 69 Name(
"ChannelToWires"),
70 Comment(
"print all the wires corresponding to each channel"),
75 Name(
"WireToChannel"),
76 Comment(
"print which channel covers each wire"),
81 Name(
"OpDetChannels"),
83 "print for each optical detector channel ID the optical detector ID and its center" 90 Comment(
"ID of the lowest channel to be printed (default: no limit)"),
96 Comment(
"ID of the highest channel to be printed (default: no limit)"),
144 class DumpChannelToWires {
155 { pGeom = &geometry; }
173 void CheckConfig()
const;
179 class DumpWireToChannel {
183 DumpWireToChannel() {}
187 { pGeom = &geometry; }
197 void CheckConfig()
const;
203 class DumpOpticalDetectorChannels {
207 DumpOpticalDetectorChannels() {}
211 { pGeom = &geometry; }
221 void CheckConfig()
const;
225 geo::OpDetGeo const* getOpticalDetector(
unsigned int channelID)
const;
264 DumpChannelToWires dumper;
271 DumpWireToChannel dumper;
278 DumpOpticalDetectorChannels dumper;
293 #include "larcoreobj/SimpleTypesAndConstants/geo_types.h" // geo::WireID 305 void DumpChannelToWires::CheckConfig()
const {
310 <<
"DumpChannelToWires: no valid geometry available!";
321 unsigned int const NChannels = pGeom->Nchannels();
323 if (NChannels == 0) {
325 <<
"Nice detector we have here, with no channels.";
335 unsigned int const NPrintedChannels = (PrintLast - PrintFirst) + 1;
336 if (NPrintedChannels == NChannels) {
337 mf::LogInfo(OutputCategory) <<
"Printing all " << NChannels <<
" channels";
340 mf::LogInfo(OutputCategory) <<
"Printing channels from " << PrintFirst
341 <<
" to " <<
LastChannel <<
" (" << NPrintedChannels
342 <<
" channels out of " << NChannels <<
")";
348 std::vector<geo::WireID>
const Wires = pGeom->ChannelToWire(
channel);
351 switch (Wires.size()) {
352 case 0: log <<
" no wires";
break;
354 default: log <<
" [" << Wires.size() <<
" wires]";
break;
367 void DumpWireToChannel::CheckConfig()
const {
372 <<
"DumpWireToChannel: no valid geometry available!";
383 unsigned int const NChannels = pGeom->Nchannels();
385 if (NChannels == 0) {
387 <<
"Nice detector we have here, with no channels.";
393 <<
"Printing wire channels for up to " << NChannels <<
" channels";
397 for (
geo::WireID const& wireID: pGeom->IterateWireIDs()) {
401 else log <<
"invalid!";
410 void DumpOpticalDetectorChannels::CheckConfig()
const {
415 <<
"DumpOpticalDetectorChannels: no valid geometry available!";
421 geo::OpDetGeo const* DumpOpticalDetectorChannels::getOpticalDetector
422 (
unsigned int channelID)
const 425 return &(pGeom->OpDetGeoFromOpChannel(channelID));
441 unsigned int const NChannels = pGeom->NOpChannels();
443 if (NChannels == 0) {
445 <<
"Nice detector we have here, with no optical channels.";
451 <<
"Printing optical detectors for up to " << NChannels <<
" channels";
455 for (
unsigned int channelID = 0; channelID < NChannels; ++channelID) {
456 log <<
"\nChannel " << channelID <<
" => ";
462 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
ChannelGroupService::Name Name
fhicl::Atom< std::string > OutputCategory
void GetCenter(double *xyz, double localz=0.0) const
MaybeLogger_< ELseverityLevel::ELsev_error, false > LogError
EDAnalyzer(fhicl::ParameterSet const &pset)
fhicl::Atom< bool > OpDetChannels
art framework interface to geometry description
DumpChannelMap & operator=(DumpChannelMap const &)=delete
constexpr ChannelID_t InvalidChannelID
ID of an invalid channel.
#define DEFINE_ART_MODULE(klass)
virtual 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.
bool DoChannelToWires
Dump channel -> wires mapping.
raw::ChannelID_t LastChannel
Last channel to be printed.
Encapsulate the geometry of an optical detector.
cet::coded_exception< errors::ErrorCodes, ExceptionDetail::translate > Exception
virtual void analyze(art::Event const &) override
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.
Access the description of detector geometry.
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)
LArSoft geometry interface.
cet::coded_exception< error, detail::translate > exception