BeamlineChannelMap.h
Go to the documentation of this file.
1 ////////////////////////////////////////////////////////////////////////////
2 /// \file BeamlineChannelMap.h
3 /// \brief Channel mapping service which may be used to interpret the
4 /// channels which are read out by the various beamline detector
5 /// elements.
6 /// NB/ Consider moving to fragments package, which is a
7 /// dependence for both the online and offline software bases,
8 /// so online processes (e.g. online monitoring) may use it.
9 /// \author Mike Wallbank (University of Cincinnati) <wallbank@fnal.gov>
10 /// \date August 2019
11 ////////////////////////////////////////////////////////////////////////////
12 
13 #ifndef BeamlineChannelMap_H
14 #define BeamlineChannelMap_H
15 
16 // framework
19 #include "fhiclcpp/ParameterSet.h"
20 
21 // nova
22 #include "BeamlineGeometry.h"
23 
24 // stl
25 #include <map>
26 #include <vector>
27 #include <iostream>
28 #include <limits>
29 #include <fstream>
30 
34 
35 // -----------------------------------------------------------------------
36 namespace beamlineutil {
37  class BeamlineChannelMap;
38 }
39 
40 // -----------------------------------------------------------------------
42 
43 public:
44 
47 
48  /// Enquire whether this online digitizer channel is active
49  bool ActiveDigitChannel(unsigned int channel) const;
50 
51  /// Offline SystemID for this online digitizer channel
52  SystemID DigitSystem(unsigned int channel) const;
53 
54  /// Offline DetectorID for this online digitizer channel
55  DetectorID DigitDetector(unsigned int channel) const;
56 
57  /// Offline ChannelID for this online digitizer channel
58  ChannelID DigitChannel(unsigned int channel) const;
59 
60  /// Online digiziter channel number for this offline ChannelID
61  unsigned int OnlineDigitChannel(ChannelID channel) const;
62 
63  /// Offline DetectorID for trigger
64  DetectorID TrigDetector() const;
65 
66  /// Offline DetectorID for this online WC detector
67  DetectorID WCDetector(unsigned int detector) const;
68 
69  /// All the SystemIDs in this channel mapping
70  std::vector<SystemID> SystemIDs() const;
71 
72  /// All the DetectorIDs in this channel mapping
73  std::vector<DetectorID> DetectorIDs() const;
74 
75  /// All the ChannelIDs in this channel mapping
76  std::vector<ChannelID> ChannelIDs() const;
77 
78 private:
79 
80  // Maps to fill with channel information and function to fill
81  std::map<unsigned int, ChannelID> fDigitOnlineToOffline;
82  std::map<ChannelID, unsigned int> fDigitOfflineToOnline;
84 
85 };
86 
87 // -----------------------------------------------------------------------
89 
90 #endif
DetectorID TrigDetector() const
Offline DetectorID for trigger.
std::vector< SystemID > SystemIDs() const
All the SystemIDs in this channel mapping.
std::vector< ChannelID > ChannelIDs() const
All the ChannelIDs in this channel mapping.
#define DECLARE_ART_SERVICE(svc, scope)
Definition: ServiceMacros.h:91
Definition of the beamline offline geometry. Also implementation of a service to obtain this informat...
std::map< ChannelID, unsigned int > fDigitOfflineToOnline
unsigned int OnlineDigitChannel(ChannelID channel) const
Online digiziter channel number for this offline ChannelID.
void FillBeamlineChannels(const fhicl::ParameterSet &map)
bool ActiveDigitChannel(unsigned int channel) const
Enquire whether this online digitizer channel is active.
DetectorID DigitDetector(unsigned int channel) const
Offline DetectorID for this online digitizer channel.
std::vector< DetectorID > DetectorIDs() const
All the DetectorIDs in this channel mapping.
std::map< unsigned int, ChannelID > fDigitOnlineToOffline
SystemID DigitSystem(unsigned int channel) const
Offline SystemID for this online digitizer channel.
ChannelID DigitChannel(unsigned int channel) const
Offline ChannelID for this online digitizer channel.
BeamlineChannelMap(fhicl::ParameterSet const &pset)
DetectorID WCDetector(unsigned int detector) const
Offline DetectorID for this online WC detector.