ProtoDUNEChannelMapAlgv8.h
Go to the documentation of this file.
1 ////////////////////////////////////////////////////////////////////////
2 /// \file ProtoDUNEChannelMapAlgv8.h
3 /// \brief Interface to algorithm class for a specific detector channel mapping in protoDUNE
4 ///
5 /// \version $Id: $
6 /// \author Laura Paulucci
7 ///
8 ///
9 /// June 2021
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_ProtoDUNEChannelMapAlgv8_H
16 #define geo_ProtoDUNEChannelMapAlgv8_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 ProtoDUNEChannelMapAlgv8
69 
70  //----------------------------------------------------------------------------
71 
72 
73 }
74 #endif
75 
Index MaxOpChannel(Index NOpDets) const override
Returns the number of optical channels contained in some detectors.
std::map< Index, Index > fSSPChOne
std::map< Index, Index > fHWChannel
Classes identifying readout-related concepts.
Index NOpChannels(Index NOpDets) const override
Returns the number of optical channels contained in some detectors.
Index NOpHardwareChannels(Index opDet) const override
Returns the number of channels in the specified optical detectors.
Index OpDetFromOpChannel(Index opChannel) const override
Returns the optical detector the specified optical channel belongs.
bool IsValidOpChannel(Index opChannel, Index) const override
Returns whether the ID identifies a valid optical detector channel.
Interface to algorithm class for a specific detector channel mapping.
uint8_t channel
Definition: CRTFragment.hh:201
Index FirstSSPChFromOpDet(Index OpDet) const
Index OpChannel(Index detNum, Index channel) const override
Returns the channel ID of the specified hardware channel.
ProtoDUNEChannelMapAlgv8(const fhicl::ParameterSet &pset)
Interface to algorithm class for sorting geo::XXXGeo objects.
void Uninitialize() override
Deconfiguration: prepare for a following call of Initialize()
Index HardwareChannelFromOpChannel(Index opChannel) const override
Returns the hardware channel number of specified optical channel.
void Initialize(GeometryData_t const &geodata) override
Geometry initialisation.
Index SSPfromOpDet(Index opDet) const
Data in the geometry description.
Definition: GeometryData.h:31
Interface to algorithm class for a specific detector channel mapping.
Index OpChannelFromSSP(Index ssp, Index sspch) const
LArSoft geometry interface.
Definition: ChannelGeo.h:16