Public Member Functions | Private Attributes | List of all members
dq::FlasherFinder Class Reference

#include "/cvmfs/nova-development.opensciencegrid.org/novasoft/releases/N20-12-01/DataQuality/FlasherFinder/FlasherFinder.h"

Public Member Functions

 FlasherFinder ()
 
unsigned int FindInstigators (std::vector< art::Ptr< rawdata::RawDigit > > &d)
 
bool Veto (const art::Ptr< rawdata::RawDigit > &d) const
 
bool Veto (const art::Ptr< rb::CellHit > &ch) const
 
bool IsInstigator (const art::Ptr< rawdata::RawDigit > &d) const
 
bool IsInstigator (const art::Ptr< rb::CellHit > &ch) const
 
unsigned int Filter (std::vector< art::Ptr< rawdata::RawDigit > > &d)
 
std::vector< art::Ptr< rawdata::RawDigit > > FEBFlashHits (std::vector< art::Ptr< rawdata::RawDigit >> &d)
 
unsigned int Nflash (const art::Ptr< rb::Cluster > &c) const
 
bool InstegatorsOK ()
 
std::vector< FEBHitInstigators ()
 
unsigned int IntesgatorQ ()
 
unsigned int InstigatorT ()
 
unsigned int VetoQ ()
 
unsigned int VetoT ()
 
void SetIntesgatorQ (unsigned int Q)
 
void SetInstigatorT (unsigned int T)
 
void SetVetoQ (unsigned int VetoQ)
 
void SetVetoT (unsigned int VetoT)
 

Private Attributes

bool fInstigatorsOK
 Is the instigator list ready for use? More...
 
std::vector< FEBHitfInstigators
 The list of instigators. More...
 
unsigned int fInstigatorQ
 Charge threshold for instigators [ADC]. More...
 
unsigned int fInstigatorT
 Time window for instigator hits [TDC]. More...
 
unsigned int fVetoT
 Time to veto FEB after instigator [TDC]. More...
 
unsigned int fVetoQ
 Only veto below this charge [ADC]. More...
 

Detailed Description

Class to help identify FEB flash instigators and tag/filter the noise hits they produce

Definition at line 37 of file FlasherFinder.h.

Constructor & Destructor Documentation

FlasherFinder::FlasherFinder ( )

Definition at line 24 of file FlasherFinder.cxx.

24  :
25  fInstigatorQ(10000), //12-10,000 for FarDet, ~30,000 for NearDet, based on DocDB-13008, slides 21,22
26  fInstigatorT(64),
27  fVetoT(960), //640 (10 us), 960 (15 us), 1280 (20 us)
28  fVetoQ(500)
29 { }
unsigned int fVetoQ
Only veto below this charge [ADC].
unsigned int fInstigatorQ
Charge threshold for instigators [ADC].
unsigned int fVetoT
Time to veto FEB after instigator [TDC].
unsigned int fInstigatorT
Time window for instigator hits [TDC].

Member Function Documentation

std::vector< art::Ptr< rawdata::RawDigit > > FlasherFinder::FEBFlashHits ( std::vector< art::Ptr< rawdata::RawDigit >> &  d)

Construct a vector of FEB flash raw digits

Parameters
d- The digit list. Should be the complete list for the event as a whole.
Returns
a vector of vetoed raw digits

Definition at line 177 of file FlasherFinder.cxx.

References d, MECModelEnuComparisons::i, and Veto().

Referenced by sn::FEBFlasherRemover::remove().

178 {
179  std::vector<art::Ptr<rawdata::RawDigit>> filtered;
180  for (unsigned int i=0; i<d.size(); ++i) {
181  if (this->Veto(d[i])) {
182  filtered.push_back(d[i]);
183  }
184  }
185 
186  return filtered;
187 }
Float_t d
Definition: plot.C:236
bool Veto(const art::Ptr< rawdata::RawDigit > &d) const
unsigned int FlasherFinder::Filter ( std::vector< art::Ptr< rawdata::RawDigit > > &  d)

Remove FEB flash hits from a digit list

Returns
number of filtered hits

Definition at line 156 of file FlasherFinder.cxx.

References d, MECModelEnuComparisons::i, plot_timing_data::swap, and Veto().

157 {
158  std::vector<art::Ptr<rawdata::RawDigit>> filtered;
159  unsigned int i;
160  unsigned int nfilt = 0;
161 
162  for (i=0; i<d.size(); ++i) {
163  if (this->Veto(d[i])) {
164  ++nfilt;
165  }
166  else {
167  filtered.push_back(d[i]);
168  }
169  }
170 
171  swap(d, filtered);
172  return nfilt;
173 }
Float_t d
Definition: plot.C:236
bool Veto(const art::Ptr< rawdata::RawDigit > &d) const
unsigned int FlasherFinder::FindInstigators ( std::vector< art::Ptr< rawdata::RawDigit > > &  d)

Locate FEB instigators in a raw digit list

Parameters
d- The digit list. Should be the complete list for the event as a whole.

< Pixel is low 8 bits

Definition at line 33 of file FlasherFinder.cxx.

References d, fInstigatorQ, fInstigators, fInstigatorsOK, fInstigatorT, gsFEBTimeSort(), MECModelEnuComparisons::i, calib::j, and ana::kInTime.

Referenced by sn::FEBFlasherRemover::remove().

34 {
35  //
36  // Extract the information I need from the digit list then sort by
37  // FEB and time
38  //
39 
40  unsigned int i, j;
41  std::vector<FEBHit> febhit(d.size());
42  for (i=0; i<d.size(); ++i) {
43  febhit[i].fFEB = d[i]->DaqChannel() & 0xFFFFFF00; ///< Pixel is low 8 bits
44  febhit[i].fTDC = d[i]->TDC();
45  febhit[i].fADC = d[i]->ADC();
46  febhit[i].fDAQ = d[i]->DaqChannel();
47  }
48 
49  //
50  // Search for time windows where summed ADC crosses threshold
51  //
52  sort(febhit.begin(), febhit.end(), gsFEBTimeSort);
53  for (i=0; i<febhit.size(); ++i) {
54  unsigned int sumADC = 0;
55  for (j=i+1; j<febhit.size(); ++j) {
56  bool kInSameFEB = (febhit[j].fFEB == febhit[i].fFEB);
57  bool kInTime = ((febhit[j].fTDC - febhit[i].fTDC) < fInstigatorT);
58 
59  if (!kInSameFEB || !kInTime) break;
60  sumADC += febhit[j].fADC;
61  }
62 
63  //
64  // Check the ADC to see if it crossed threshold
65  //
66  if (sumADC>fInstigatorQ) {
67  fInstigators.push_back(febhit[i]);
68  }
69  }
70  fInstigatorsOK = true;
71  return fInstigators.size();
72 }
static bool gsFEBTimeSort(const FEBHit &h1, const FEBHit &h2)
std::vector< FEBHit > fInstigators
The list of instigators.
unsigned int fInstigatorQ
Charge threshold for instigators [ADC].
const Cut kInTime([](const caf::SRProxy *sr){return(sr->slc.meantime >=208000 && sr->slc.meantime<=236000);})
Cut events that are not in time 208us - 236us.
Definition: Cuts.h:32
Float_t d
Definition: plot.C:236
const double j
Definition: BetheBloch.cxx:29
unsigned int fInstigatorT
Time window for instigator hits [TDC].
bool fInstigatorsOK
Is the instigator list ready for use?
bool dq::FlasherFinder::InstegatorsOK ( )
inline

Definition at line 89 of file FlasherFinder.h.

89 { return fInstigatorsOK; }
bool fInstigatorsOK
Is the instigator list ready for use?
std::vector<FEBHit> dq::FlasherFinder::Instigators ( )
inline

Definition at line 90 of file FlasherFinder.h.

90 { return fInstigators; }
std::vector< FEBHit > fInstigators
The list of instigators.
unsigned int dq::FlasherFinder::InstigatorT ( )
inline

Definition at line 93 of file FlasherFinder.h.

93 { return fInstigatorT; }
unsigned int fInstigatorT
Time window for instigator hits [TDC].
unsigned int dq::FlasherFinder::IntesgatorQ ( )
inline

Definition at line 92 of file FlasherFinder.h.

92 { return fInstigatorQ; }
unsigned int fInstigatorQ
Charge threshold for instigators [ADC].
bool FlasherFinder::IsInstigator ( const art::Ptr< rawdata::RawDigit > &  d) const

Match feb, adc, tdc to see if this hit is instigator. bad way to check to this

Definition at line 76 of file FlasherFinder.cxx.

References ana::assert(), rawdata::RawDigit::DaqChannel(), fInstigators, fInstigatorsOK, calib::j, and rawdata::RawDigit::TDC().

77 {
79  unsigned int j;
80 
81  int DAQ = d->DaqChannel();
82  unsigned int TDC = d->TDC();
83 
84  for (j=0; j<fInstigators.size(); j++) {
85  if (fInstigators[j].fDAQ == DAQ && fInstigators[j].fTDC == TDC)
86  return true;
87  }
88 
89  return false;
90 }
int32_t TDC() const
The time of the last baseline sample.
Definition: RawDigit.h:94
std::vector< FEBHit > fInstigators
The list of instigators.
uint32_t DaqChannel() const
Definition: RawDigit.h:85
const double j
Definition: BetheBloch.cxx:29
assert(nhit_max >=nhit_nbins)
bool fInstigatorsOK
Is the instigator list ready for use?
bool FlasherFinder::IsInstigator ( const art::Ptr< rb::CellHit > &  ch) const

Definition at line 94 of file FlasherFinder.cxx.

References ana::assert(), rawdata::RawDigit::DaqChannel(), fInstigators, fInstigatorsOK, calib::j, and rawdata::RawDigit::TDC().

95 {
97  unsigned int j;
98 
99  int DAQ = ch->DaqChannel();
100  unsigned int TDC = ch->TDC();
101 
102  for (j=0; j<fInstigators.size(); j++) {
103  if (fInstigators[j].fDAQ == DAQ && fInstigators[j].fTDC == TDC)
104  return true;
105  }
106 
107  return false;
108 }
int32_t TDC() const
The time of the last baseline sample.
Definition: RawDigit.h:94
std::vector< FEBHit > fInstigators
The list of instigators.
uint32_t DaqChannel() const
Definition: RawDigit.h:85
const double j
Definition: BetheBloch.cxx:29
assert(nhit_max >=nhit_nbins)
bool fInstigatorsOK
Is the instigator list ready for use?
unsigned int FlasherFinder::Nflash ( const art::Ptr< rb::Cluster > &  c) const

Count the number of hits that may result from FEB flashed in the cluster c

Definition at line 191 of file FlasherFinder.cxx.

References rb::Cluster::AllCells(), MECModelEnuComparisons::i, demo1::nhit, art::PtrVector< T >::size(), and Veto().

192 {
193  unsigned int i;
194  unsigned int nhit = 0;
195 
196  art::PtrVector<rb::CellHit> slicehits = c->AllCells();
197  for (i=0; i<slicehits.size(); ++i) {
198  if (this->Veto(slicehits[i])) ++nhit;
199  }
200 
201  return nhit;
202 }
nhit
Definition: demo1.py:25
art::PtrVector< rb::CellHit > AllCells() const
Get all cells from both views.
Definition: Cluster.cxx:180
bool Veto(const art::Ptr< rawdata::RawDigit > &d) const
size_type size() const
Definition: PtrVector.h:308
void dq::FlasherFinder::SetInstigatorT ( unsigned int  T)
inline

Definition at line 98 of file FlasherFinder.h.

References T.

Referenced by sn::FEBFlasherRemover::remove().

98 { fInstigatorT = T; }
unsigned int fInstigatorT
Time window for instigator hits [TDC].
double T
Definition: Xdiff_gwt.C:5
void dq::FlasherFinder::SetIntesgatorQ ( unsigned int  Q)
inline

Definition at line 97 of file FlasherFinder.h.

Referenced by sn::FEBFlasherRemover::remove().

97 { fInstigatorQ = Q; }
unsigned int fInstigatorQ
Charge threshold for instigators [ADC].
void dq::FlasherFinder::SetVetoQ ( unsigned int  VetoQ)
inline

Definition at line 99 of file FlasherFinder.h.

Referenced by sn::FEBFlasherRemover::remove().

99 { fVetoQ = VetoQ; }
unsigned int fVetoQ
Only veto below this charge [ADC].
unsigned int VetoQ()
Definition: FlasherFinder.h:94
void dq::FlasherFinder::SetVetoT ( unsigned int  VetoT)
inline

Definition at line 100 of file FlasherFinder.h.

Referenced by sn::FEBFlasherRemover::remove().

100 { fVetoT = VetoT; }
unsigned int fVetoT
Time to veto FEB after instigator [TDC].
unsigned int VetoT()
Definition: FlasherFinder.h:95
bool FlasherFinder::Veto ( const art::Ptr< rawdata::RawDigit > &  d) const

Should we veto this digit?

Definition at line 112 of file FlasherFinder.cxx.

References rawdata::RawDigit::ADC(), ana::assert(), rawdata::RawDigit::DaqChannel(), APDHVSetting::feb, fInstigators, fInstigatorsOK, fVetoQ, fVetoT, calib::j, ana::kInTime, and rawdata::RawDigit::TDC().

Referenced by FEBFlashHits(), Filter(), and Nflash().

113 {
114  if ((unsigned int)d->ADC() > fVetoQ) return false;
115 
117  unsigned int j;
118 
119  unsigned int feb = d->DaqChannel() & 0xFFFFFF00;
120  unsigned int tdc = d->TDC();
121 
122  for (j=0; j<fInstigators.size(); ++j) {
123  bool kInSameFEB = (fInstigators[j].fFEB == feb);
124  bool kInTime = (tdc > fInstigators[j].fTDC && tdc < fInstigators[j].fTDC + fVetoT);
125 
126  if (kInSameFEB && kInTime) return true;
127  }
128 
129  return false;
130 }
int32_t TDC() const
The time of the last baseline sample.
Definition: RawDigit.h:94
unsigned int fVetoQ
Only veto below this charge [ADC].
std::vector< FEBHit > fInstigators
The list of instigators.
unsigned int fVetoT
Time to veto FEB after instigator [TDC].
const Cut kInTime([](const caf::SRProxy *sr){return(sr->slc.meantime >=208000 && sr->slc.meantime<=236000);})
Cut events that are not in time 208us - 236us.
Definition: Cuts.h:32
uint32_t DaqChannel() const
Definition: RawDigit.h:85
const double j
Definition: BetheBloch.cxx:29
int16_t ADC(uint32_t i) const
Definition: RawDigit.cxx:58
assert(nhit_max >=nhit_nbins)
bool fInstigatorsOK
Is the instigator list ready for use?
bool FlasherFinder::Veto ( const art::Ptr< rb::CellHit > &  ch) const

Definition at line 134 of file FlasherFinder.cxx.

References rawdata::RawDigit::ADC(), ana::assert(), rawdata::RawDigit::DaqChannel(), APDHVSetting::feb, fInstigators, fInstigatorsOK, fVetoQ, fVetoT, calib::j, ana::kInTime, and rawdata::RawDigit::TDC().

135 {
136  if ((unsigned int)ch->ADC() > fVetoQ) return false;
137 
139  unsigned int j;
140 
141  unsigned int feb = ch->DaqChannel()&0xFFFFFF00;
142  unsigned int tdc = ch->TDC();
143 
144  for (j=0; j<fInstigators.size(); ++j) {
145  bool kInSameFEB = (fInstigators[j].fFEB == feb);
146  bool kInTime = (tdc > fInstigators[j].fTDC && tdc < fInstigators[j].fTDC + fVetoT);
147 
148  if (kInSameFEB && kInTime) return true;
149  }
150 
151  return false;
152 }
int32_t TDC() const
The time of the last baseline sample.
Definition: RawDigit.h:94
unsigned int fVetoQ
Only veto below this charge [ADC].
std::vector< FEBHit > fInstigators
The list of instigators.
unsigned int fVetoT
Time to veto FEB after instigator [TDC].
const Cut kInTime([](const caf::SRProxy *sr){return(sr->slc.meantime >=208000 && sr->slc.meantime<=236000);})
Cut events that are not in time 208us - 236us.
Definition: Cuts.h:32
uint32_t DaqChannel() const
Definition: RawDigit.h:85
const double j
Definition: BetheBloch.cxx:29
int16_t ADC(uint32_t i) const
Definition: RawDigit.cxx:58
assert(nhit_max >=nhit_nbins)
bool fInstigatorsOK
Is the instigator list ready for use?
unsigned int dq::FlasherFinder::VetoQ ( )
inline

Definition at line 94 of file FlasherFinder.h.

94 { return fVetoQ; }
unsigned int fVetoQ
Only veto below this charge [ADC].
unsigned int dq::FlasherFinder::VetoT ( )
inline

Definition at line 95 of file FlasherFinder.h.

95 { return fVetoT; }
unsigned int fVetoT
Time to veto FEB after instigator [TDC].

Member Data Documentation

unsigned int dq::FlasherFinder::fInstigatorQ
private

Charge threshold for instigators [ADC].

Definition at line 106 of file FlasherFinder.h.

Referenced by FindInstigators().

std::vector<FEBHit> dq::FlasherFinder::fInstigators
private

The list of instigators.

Definition at line 104 of file FlasherFinder.h.

Referenced by FindInstigators(), IsInstigator(), and Veto().

bool dq::FlasherFinder::fInstigatorsOK
private

Is the instigator list ready for use?

Definition at line 103 of file FlasherFinder.h.

Referenced by FindInstigators(), IsInstigator(), and Veto().

unsigned int dq::FlasherFinder::fInstigatorT
private

Time window for instigator hits [TDC].

Definition at line 107 of file FlasherFinder.h.

Referenced by FindInstigators().

unsigned int dq::FlasherFinder::fVetoQ
private

Only veto below this charge [ADC].

Definition at line 109 of file FlasherFinder.h.

Referenced by Veto().

unsigned int dq::FlasherFinder::fVetoT
private

Time to veto FEB after instigator [TDC].

Definition at line 108 of file FlasherFinder.h.

Referenced by Veto().


The documentation for this class was generated from the following files: