All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
ICARUSChannelMapProvider.h
Go to the documentation of this file.
1 ////////////////////////////////////////////////////////////////////////
2 /// \file icaruscode/Decode/ChannelMapping/ICARUSChannelMapProvider.h
3 /// \author T. Usher (factorised by Gianluca Petrillo, petrillo@slac.stanford.edu)
4 /// \see icaruscode/Decode/ChannelMapping/ICARUSChannelMapProvider.cxx
5 ////////////////////////////////////////////////////////////////////////
6 
7 #ifndef ICARUSCODE_DECODE_CHANNELMAPPING_ICARUSCHANNELMAPPROVIDER_H
8 #define ICARUSCODE_DECODE_CHANNELMAPPING_ICARUSCHANNELMAPPROVIDER_H
9 
10 // ICARUS libraries
13 
14 // framework libraries
15 #include "fhiclcpp/ParameterSet.h"
16 #include "cetlib_except/exception.h"
17 
18 // C/C++ standard libraries
19 #include <string>
20 #include <memory> // std::unique_ptr<>
21 
22 
23 // -----------------------------------------------------------------------------
24 namespace icarusDB { class ICARUSChannelMapProvider; }
26 {
27 public:
28 
29  // Constructor, destructor.
30  ICARUSChannelMapProvider(const fhicl::ParameterSet& pset);
31 
32  // Section to access fragment to board mapping
33  bool hasFragmentID(const unsigned int) const override;
34 
35  /// Returns the number of TPC fragment IDs known to the service.
36  unsigned int nTPCfragmentIDs() const override;
37  const std::string& getCrateName(const unsigned int) const override;
38  const ReadoutIDVec& getReadoutBoardVec(const unsigned int) const override;
40 
41  // Section to access channel information for a given board
42  bool hasBoardID(const unsigned int) const override;
43 
44  /// Returns the number of TPC board IDs known to the service.
45  unsigned int nTPCboardIDs() const override;
46  unsigned int getBoardSlot(const unsigned int) const override;
47  const ChannelPlanePairVec& getChannelPlanePair(const unsigned int) const override;
48 
49  // Section for PMT channel mapping
50  bool hasPMTDigitizerID(const unsigned int) const override;
51 
52  /// Returns the number of PMT fragment IDs known to the service.
53  unsigned int nPMTfragmentIDs() const override;
54  const DigitizerChannelChannelIDPairVec& getChannelIDPairVec(const unsigned int) const override;
55 
56  // Section for CRT channel mapping
57  unsigned int getSimMacAddress (const unsigned int) const override;
58  unsigned int gettopSimMacAddress(const unsigned int) const override;
59 
60  /// Returns the Gain and Pedestal for Side CRT
61  std::pair<double, double> getSideCRTCalibrationMap(int mac5, int chan) const override;
62 
63  /// Returns the channel mapping database key for the specified PMT fragment ID.
64  static constexpr unsigned int PMTfragmentIDtoDBkey(unsigned int fragmentID);
65 
66  /// Returns the PMT fragment ID for the specified channel mapping database key.
67  static constexpr unsigned int DBkeyToPMTfragmentID(unsigned int DBkey);
68 
69 private:
70 
72 
74 
76 
78 
80 
82 
84 
85  std::unique_ptr<IChannelMapping> fChannelMappingTool;
86 
87  /// Returns the list of board channel-to-PMT channel ID mapping within the specified fragment.
88  /// @returns a pointer to the mapping list, or `nullptr` if invalid fragment
90  (unsigned int fragmentID) const;
91 
92 }; // icarusDB::ICARUSChannelMapProvider
93 
94 
95 // -----------------------------------------------------------------------------
96 
97 #endif // ICARUSCODE_DECODE_CHANNELMAPPING_ICARUSCHANNELMAPPROVIDER_H
bool hasBoardID(const unsigned int) const override
std::vector< ChannelPlanePair > ChannelPlanePairVec
std::vector< DigitizerChannelChannelIDPair > DigitizerChannelChannelIDPairVec
std::vector< unsigned int > ReadoutIDVec
const ChannelPlanePairVec & getChannelPlanePair(const unsigned int) const override
static constexpr unsigned int DBkeyToPMTfragmentID(unsigned int DBkey)
Returns the PMT fragment ID for the specified channel mapping database key.
This provides an art tool interface definition for tools handle the channel mapping The idea is to be...
unsigned int nTPCboardIDs() const override
Returns the number of TPC board IDs known to the service.
IChannelMapping::SideCRTChannelToCalibrationMap fSideCRTChannelToCalibrationMap
IChannelMapping::TopCRTHWtoSimMacAddressPairMap fTopCRTHWtoSimMacAddressPairMap
std::map< unsigned int, CRTHWtoSimMacAddressPair > CRTChannelIDToHWtoSimMacAddressPairMap
DigitizerChannelChannelIDPairVec const * findPMTfragmentEntry(unsigned int fragmentID) const
const ReadoutIDVec & getReadoutBoardVec(const unsigned int) const override
std::pair< double, double > getSideCRTCalibrationMap(int mac5, int chan) const override
Returns the Gain and Pedestal for Side CRT.
const std::string & getCrateName(const unsigned int) const override
IChannelMapping::TPCFragmentIDToReadoutIDMap fFragmentToReadoutMap
std::map< unsigned int, SlotChannelVecPair > TPCReadoutBoardToChannelMap
unsigned int nPMTfragmentIDs() const override
Returns the number of PMT fragment IDs known to the service.
ICARUSChannelMapProvider(const fhicl::ParameterSet &pset)
unsigned int nTPCfragmentIDs() const override
Returns the number of TPC fragment IDs known to the service.
const TPCReadoutBoardToChannelMap & getReadoutBoardToChannelMap() const override
const DigitizerChannelChannelIDPairVec & getChannelIDPairVec(const unsigned int) const override
bool hasFragmentID(const unsigned int) const override
std::map< SideCRTMac5ToChannelPair, SideCRTGainToPedPair > SideCRTChannelToCalibrationMap
std::map< unsigned int, SlotChannelVecPair > TPCReadoutBoardToChannelMap
static constexpr unsigned int PMTfragmentIDtoDBkey(unsigned int fragmentID)
Returns the channel mapping database key for the specified PMT fragment ID.
unsigned int getSimMacAddress(const unsigned int) const override
std::map< unsigned int, CrateNameReadoutIDPair > TPCFragmentIDToReadoutIDMap
std::unique_ptr< IChannelMapping > fChannelMappingTool
std::map< size_t, DigitizerChannelChannelIDPairVec > FragmentToDigitizerChannelMap
unsigned int getBoardSlot(const unsigned int) const override
IChannelMapping::CRTChannelIDToHWtoSimMacAddressPairMap fCRTChannelIDToHWtoSimMacAddressPairMap
IChannelMapping::FragmentToDigitizerChannelMap fFragmentToDigitizerMap
bool hasPMTDigitizerID(const unsigned int) const override
std::map< unsigned int, unsigned int > TopCRTHWtoSimMacAddressPairMap
unsigned int gettopSimMacAddress(const unsigned int) const override
IChannelMapping::TPCReadoutBoardToChannelMap fReadoutBoardToChannelMap