32 void dumpChannelToWires(std::string
const& OutputCategory,
38 unsigned int const NChannels = wireReadoutGeom.
Nchannels();
41 mf::LogError(OutputCategory) <<
"Nice detector we have here, with no channels.";
51 unsigned int const NPrintedChannels = (PrintLast - PrintFirst) + 1;
52 if (NPrintedChannels == NChannels) {
53 mf::LogInfo(OutputCategory) <<
"Printing all " << NChannels <<
" channels";
56 mf::LogInfo(OutputCategory) <<
"Printing channels from " << PrintFirst <<
" to " 57 << LastChannel <<
" (" << NPrintedChannels <<
" channels out of " 63 for (
raw::ChannelID_t channel = PrintFirst; channel <= PrintLast; ++channel) {
64 std::vector<geo::WireID>
const Wires = wireReadoutGeom.
ChannelToWire(channel);
66 log <<
"\n " << ((int)channel) <<
" ->";
67 switch (Wires.size()) {
68 case 0: log <<
" no wires";
break;
70 default: log <<
" [" << Wires.size() <<
" wires]";
break;
74 log <<
" { " << std::string(wireID) <<
" };";
80 void dumpWireToChannel(std::string
const& OutputCategory,
84 unsigned int const NChannels = wireReadoutGeom.
Nchannels();
87 mf::LogError(OutputCategory) <<
"Nice detector we have here, with no channels.";
92 mf::LogInfo(OutputCategory) <<
"Printing wire channels for up to " << NChannels <<
" channels";
98 log <<
"\n { " << std::string(wireID) <<
" } => ";
108 unsigned int channelID)
119 void dumpOpticalDetectorChannels(std::string
const& OutputCategory,
123 unsigned int const NChannels = wireReadoutGeom.
NOpChannels();
125 if (NChannels == 0) {
126 mf::LogError(OutputCategory) <<
"Nice detector we have here, with no optical channels.";
131 mf::LogInfo(OutputCategory) <<
"Printing optical detectors for up to " << NChannels
136 for (
unsigned int channelID = 0; channelID < NChannels; ++channelID) {
137 log <<
"\nChannel " << channelID <<
" => ";
138 geo::OpDetGeo const* opDet = getOpticalDetector(wireReadoutGeom, channelID);
143 log << opDet->
ID() <<
" at " << opDet->
GetCenter() <<
" cm";
149 class DumpChannelMap;
184 Name(
"OutputCategory"),
185 Comment(
"output category used by the message facility to output information (INFO level)"),
189 Comment(
"print all the wires corresponding to each channel"),
193 Comment(
"print which channel covers each wire"),
197 Name(
"OpDetChannels"),
198 Comment(
"print for each optical detector channel ID the optical detector ID and its center"),
202 Name(
"FirstChannel"),
203 Comment(
"ID of the lowest channel to be printed (default: no limit)"),
208 Comment(
"ID of the highest channel to be printed (default: no limit)"),
243 , OutputCategory(config().OutputCategory())
247 , FirstChannel(config().FirstChannel())
248 , LastChannel(config().LastChannel())
257 dumpChannelToWires(OutputCategory, wireReadoutGeom, FirstChannel, LastChannel);
259 if (
DoWireToChannel) { dumpWireToChannel(OutputCategory, wireReadoutGeom); }
260 if (
DoOpDetChannels) { dumpOpticalDetectorChannels(OutputCategory, wireReadoutGeom); }
bool DoOpDetChannels
Dump optical detector channel -> optical detector.
std::string OutputCategory
Name of the category for output.
MaybeLogger_< ELseverityLevel::ELsev_info, false > LogInfo
virtual unsigned int Nchannels() const =0
Returns the total number of channels present (not necessarily contiguous)
Point_t const & GetCenter() const
cout<< "Opened file "<< fin<< " ixs= "<< ixs<< endl;if(ixs==0) hhh=(TH1F *) fff-> Get("h1")
MaybeLogger_< ELseverityLevel::ELsev_error, false > LogError
EDAnalyzer(fhicl::ParameterSet const &pset)
fhicl::Atom< bool > OpDetChannels
DumpChannelMap & operator=(DumpChannelMap const &)=delete
Access the description of the physical detector geometry.
OpDetGeo const & OpDetGeoFromOpChannel(unsigned int opChannel) const
Returns the optical detector the specified optical channel belongs.
constexpr ChannelID_t InvalidChannelID
ID of an invalid channel.
#define DEFINE_ART_MODULE(klass)
Interface for a class providing readout channel mapping to geometry.
void beginRun(art::Run const &) override
Drives the dumping.
constexpr bool isValidChannelID(raw::ChannelID_t channel)
virtual raw::ChannelID_t PlaneWireToChannel(WireID const &wireID) const =0
Returns the channel ID a wire is connected to.
bool DoWireToChannel
Dump wire -> channel mapping.
Definition of data types for geometry description.
bool DoChannelToWires
Dump channel -> wires mapping.
raw::ChannelID_t LastChannel
Last channel to be printed.
OpDetID const & ID() const
Returns the geometry ID of this optical detector.
Encapsulate the geometry of an optical detector.
virtual std::vector< WireID > ChannelToWire(raw::ChannelID_t channel) const =0
virtual unsigned int NOpChannels(unsigned int NOpDets) const
Returns the number of optical channels contained in some detectors.
fhicl::Atom< bool > ChannelToWires
range_type< T > Iterate() const
Prints on screen the current channel-wire and optical detector maps.
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)
void analyze(art::Event const &) override
Interface to geometry for wire readouts .
cet::coded_exception< error, detail::translate > exception