ProtoDUNEChannelMapAlg.h
Go to the documentation of this file.
1 ////////////////////////////////////////////////////////////////////////
2 /// \file ProtoDUNEChannelMapAlg.h
3 /// \brief Interface to algorithm class for a specific detector channel mapping in protoDUNE
4 ///
5 /// \version $Id: $
6 /// \author Alex Himmel
7 ///
8 ///
9 /// November 2016
10 ///
11 /// Inherits from the central DuneApaChannelMapAlg, just adding special channel-mapping
12 /// specific to the photon detectors in protoDUNE.
13 ///
14 ////////////////////////////////////////////////////////////////////////
15 #ifndef geo_ProtoDUNEChannelMapAlg_H
16 #define geo_ProtoDUNEChannelMapAlg_H
17 
18 #include <map>
19 #include "cetlib_except/exception.h"
20 #include "larcoreobj/SimpleTypesAndConstants/readout_types.h" // readout::ROPID, ...
21 #include "larcoreobj/SimpleTypesAndConstants/RawTypes.h" // raw::ChannelID_t
24 #include "fhiclcpp/ParameterSet.h"
26 
27 
28 namespace geo{
29 
31 
32  public:
33 
34  typedef unsigned int Index;
35 
37 
38  void Initialize(GeometryData_t const& geodata) override;
39  void Uninitialize() override;
40 
41 
42  // Photon detector methos being overridden here
43  Index NOpChannels(Index NOpDets) const override;
44  Index MaxOpChannel(Index NOpDets) const override;
45  Index NOpHardwareChannels(Index opDet) const override;
46  Index OpChannel(Index detNum, Index channel) const override;
47  Index OpDetFromOpChannel(Index opChannel) const override;
48  Index HardwareChannelFromOpChannel(Index opChannel) const override;
49  bool IsValidOpChannel(Index opChannel, Index /*NOpDets*/) const override
50  {return fOpDet.count(opChannel); }
51 
52  // ProtoDUNE-specific
53  Index SSPfromOpDet(Index opDet) const;
54  Index FirstSSPChFromOpDet(Index OpDet) const;
55  Index OpChannelFromSSP(Index ssp, Index sspch) const;
56  void PrintChannelMaps() const;
57 
58  private:
59 
61  Index fNOpChannels;
62  std::map<Index, Index> fSSP;
63  std::map<Index, Index> fSSPChOne;
64  std::map<Index, Index> fOpDet;
65  std::map<Index, Index> fHWChannel;
66 
67 
68  }; // class ProtoDUNEChannelMapAlg
69 
70  //----------------------------------------------------------------------------
71 
72 
73 }
74 #endif
75 
bool IsValidOpChannel(Index opChannel, Index) const override
Returns whether the ID identifies a valid optical detector channel.
Classes identifying readout-related concepts.
Index NOpChannels(Index NOpDets) const override
Returns the number of optical channels contained in some detectors.
std::map< Index, Index > fSSPChOne
Index OpChannelFromSSP(Index ssp, Index sspch) const
std::map< Index, Index > fHWChannel
Index SSPfromOpDet(Index opDet) const
Index NOpHardwareChannels(Index opDet) const override
Returns the number of channels in the specified optical detectors.
Interface to algorithm class for a specific detector channel mapping.
uint8_t channel
Definition: CRTFragment.hh:201
Interface to algorithm class for sorting geo::XXXGeo objects.
Index HardwareChannelFromOpChannel(Index opChannel) const override
Returns the hardware channel number of specified optical channel.
Index MaxOpChannel(Index NOpDets) const override
Returns the number of optical channels contained in some detectors.
std::map< Index, Index > fSSP
void Initialize(GeometryData_t const &geodata) override
Geometry initialisation.
Index FirstSSPChFromOpDet(Index OpDet) const
ProtoDUNEChannelMapAlg(const fhicl::ParameterSet &pset)
void Uninitialize() override
Deconfiguration: prepare for a following call of Initialize()
Data in the geometry description.
Definition: GeometryData.h:31
Interface to algorithm class for a specific detector channel mapping.
LArSoft geometry interface.
Definition: ChannelGeo.h:16
Index OpDetFromOpChannel(Index opChannel) const override
Returns the optical detector the specified optical channel belongs.
std::map< Index, Index > fOpDet
Index OpChannel(Index detNum, Index channel) const override
Returns the channel ID of the specified hardware channel.