ColdHotChannelsRemover.cxx
Go to the documentation of this file.
1 ////////////////////////////////////////////////////////////////////////
2 // Class: ColdHotChannelsRemover
3 // File: ColdHotChannelsRemover.cxx
4 ////////////////////////////////////////////////////////////////////////
5 
6 #include "RawData/RawDigit.h"
10 
11 
12 // ............................................................................
13 sn::ColdHotChannelsRemover::ColdHotChannelsRemover(sn::HitVetoMap& vetoMap, sn::DaqChannelMask& channelMask, float coldRateThreshold, float hotRateThreshold):
14 fVetoMap(vetoMap),
15 fChannelMask(channelMask),
16 fColdRateThreshold(coldRateThreshold),
17 fHotRateThreshold(hotRateThreshold),
18 fNumRemovedCold(0),
19 fNumRemovedHot(0)
20 {
21 }
22 
23 // ............................................................................
25 
26 
27 // ............................................................................
29 {
30  if (this->fChannelMask.ChannelIsMasked(*hit)) {
31  if (this->fChannelMask.Rate(*hit) < fColdRateThreshold) {
32  this->fVetoMap.AddHit(*hit);
33  ++this->fNumRemovedCold;
34  }
35 
36  if (this->fChannelMask.Rate(*hit) > fHotRateThreshold) {
37  this->fVetoMap.AddHit(*hit);
38  ++this->fNumRemovedHot;
39  }
40  }
41 
42  return;
43 }
44 
45 
46 // ............................................................................
48 {
49  if (this->fChannelMask.ChannelIsMasked(*hit)) {
50  if (this->fChannelMask.Rate(*hit) < fColdRateThreshold) {
51  this->fVetoMap.AddHit(*hit);
52  ++this->fNumRemovedCold;
53  }
54 
55  if (this->fChannelMask.Rate(*hit) > fHotRateThreshold) {
56  this->fVetoMap.AddHit(*hit);
57  ++this->fNumRemovedHot;
58  }
59  }
60 
61  return;
62 }
63 
64 
65 // ............................................................................
67 {
69  this->remove(hit);
70  }
71  return;
72 }
73 
74 
75 // ............................................................................
77 {
79  this->remove(hit);
80  }
81  return;
82 }
83 
84 
85 // ............................................................................
87 {
88  return this->fNumRemovedCold;
89 }
90 
91 
92 // ............................................................................
94 {
95  return this->fNumRemovedHot;
96 }
float Rate(rawdata::RawDigit d)
void hits()
Definition: readHits.C:15
void AddHit(rawdata::RawDigit h)
Definition: HitVetoMap.cxx:27
ColdHotChannelsRemover(sn::HitVetoMap &vetoMap, sn::DaqChannelMask &channelMask, float coldRateThreshold, float hotRateThreshold)
void remove(art::Ptr< rawdata::RawDigit > hit)
bool ChannelIsMasked(rawdata::RawDigit d)
Definition: structs.h:12
Definition: fwd.h:29
sn::DaqChannelMask & fChannelMask