RandomChannelStatusService.h
Go to the documentation of this file.
1 // Chris Backhouse - c.backhouse@ucl.ac.uk Dec 2017
2 
3 #ifndef DETVAR_RANDOMCHANNELSTATUS_SERVICE
4 #define DETVAR_RANDOMCHANNELSTATUS_SERVICE
5 
7 
8 namespace geo{class GeometryCore;}
9 
10 namespace detvar
11 {
13  {
14  public:
15  bool IsBad(raw::ChannelID_t chan) const override
16  {
17  return fBadChans.count(chan);
18  }
19 
20  bool IsPresent(raw::ChannelID_t) const override {return true;}
21  bool IsNoisy(raw::ChannelID_t) const override {return false;}
22 
23  std::set<raw::ChannelID_t> GoodChannels() const override
24  {
25  return fGoodChans;
26  }
27 
28  std::set<raw::ChannelID_t> BadChannels() const override
29  {
30  return fBadChans;
31  }
32 
33  std::set<raw::ChannelID_t> NoisyChannels() const override {return {};}
34 
35  protected:
36  enum EMode_t{
38  kRandomAPAs, ///< "APAs"
39  kRandomAPAsides, ///< "APAsides"
40  kRandomBoards, ///< "boards"
41  kRandomChips, ///< "chips"
42  kRandomChans ///< "channels"
43  };
44 
45 
48 
49  void MarkChansBad(unsigned int target);
50 
51  void MarkAPAsBad(unsigned int target);
52 
53  void MarkAPASidesBad(unsigned int target);
54 
55  void MarkBoardsOrChipsBad(EMode_t mode, unsigned int target);
56 
57  void MarkBoardBad(int board,
58  const std::vector<std::vector<raw::ChannelID_t>>& chans);
59 
60  void MarkChipBad(int board, int chip,
61  const geo::GeometryCore* geom,
62  const std::vector<std::vector<raw::ChannelID_t>>& chans);
63 
64  std::set<raw::ChannelID_t> fBadChans, fGoodChans;
65  };
66 
67 
69  {
70  public:
72  : fProvider(pset)
73  {
74  }
75 
76  protected:
78  {
79  return &fProvider;
80  }
81 
83  {
84  return fProvider;
85  }
86 
88  };
89 
90 } // namespace
91 
93 
94 #endif
bool IsNoisy(raw::ChannelID_t) const override
Returns whether the specified channel is noisy in the current run.
std::set< raw::ChannelID_t > NoisyChannels() const override
Returns a copy of set of noisy channel IDs for the current run.
bool IsBad(raw::ChannelID_t chan) const override
Returns whether the specified channel is bad in the current run.
const lariov::ChannelStatusProvider & DoGetProvider() const override
Returns a reference to the service provider.
DECLARE_ART_SERVICE_INTERFACE_IMPL(MySharedService, art::test::MyServiceInterface, SHARED) DEFINE_ART_SERVICE_INTERFACE_IMPL(MySharedService
struct vector vector
bool IsPresent(raw::ChannelID_t) const override
Returns whether the specified channel is physical and connected to wire.
RandomChannelStatusService(const fhicl::ParameterSet &pset)
std::set< raw::ChannelID_t > GoodChannels() const override
Returns a copy of set of good channel IDs for the current run.
const lariov::ChannelStatusProvider * DoGetProviderPtr() const override
Returns a pointer to the service provider.
Class providing information about the quality of channels.
Description of geometry of one entire detector.
unsigned int ChannelID_t
Type representing the ID of a readout channel.
Definition: RawTypes.h:28
Interface for experiment-specific service for channel quality info.
std::set< raw::ChannelID_t > BadChannels() const override
Returns a copy of set of bad channel IDs for the current run.
LArSoft geometry interface.
Definition: ChannelGeo.h:16
Service providing information about the quality of channels.