CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
ZeroSuppressFP420 Class Reference

#include <ZeroSuppressFP420.h>

Inheritance diagram for ZeroSuppressFP420:
ZSuppressFP420

Public Member Functions

void initParams (const edm::ParameterSet &conf_)
 
ZSuppressFP420::DigitalMapType trkFEDclusterizer (const DigitalMapType &, int)
 
ZSuppressFP420::DigitalMapType zeroSuppress (const DigitalMapType &, int) override
 
 ZeroSuppressFP420 (const edm::ParameterSet &conf, float noise)
 
 ~ZeroSuppressFP420 () override
 
- Public Member Functions inherited from ZSuppressFP420
virtual ~ZSuppressFP420 ()
 

Private Attributes

int algoConf
 
edm::ParameterSet conf_
 
double highthreshConf
 
double lowthreshConf
 
float noiseInAdc
 
short theFEDalgorithm
 
float theFEDhighThresh
 
float theFEDlowThresh
 
short theNumFEDalgos
 
int verbosity
 

Additional Inherited Members

- Public Types inherited from ZSuppressFP420
typedef DConverterFP420::DigitalMapType DigitalMapType
 

Detailed Description

Definition at line 7 of file ZeroSuppressFP420.h.

Constructor & Destructor Documentation

◆ ZeroSuppressFP420()

ZeroSuppressFP420::ZeroSuppressFP420 ( const edm::ParameterSet conf,
float  noise 
)

Definition at line 10 of file ZeroSuppressFP420.cc.

10  : conf_(conf), theNumFEDalgos(4) {
11  noiseInAdc = noise;
13  verbosity = conf_.getUntrackedParameter<int>("VerbosityLevel");
14  // initParams();
15  if (verbosity > 0) {
16  std::cout << "ZeroSuppressFP420: constructor: noiseInAdc= " << noiseInAdc << std::endl;
17  }
18 }

References conf_, gather_cfg::cout, edm::ParameterSet::getUntrackedParameter(), initParams(), hgcalDigitizer_cfi::noise, noiseInAdc, and verbosity.

◆ ~ZeroSuppressFP420()

ZeroSuppressFP420::~ZeroSuppressFP420 ( )
inlineoverride

Definition at line 11 of file ZeroSuppressFP420.h.

11 {}

Member Function Documentation

◆ initParams()

void ZeroSuppressFP420::initParams ( const edm::ParameterSet conf_)

Definition at line 26 of file ZeroSuppressFP420.cc.

26  {
27  verbosity = conf_.getUntrackedParameter<int>("VerbosityLevel");
28  algoConf = conf_.getParameter<int>("FedFP420Algorithm"); // FedFP420Algorithm: =1 (,2,3,4)
29  lowthreshConf = conf_.getParameter<double>("FedFP420LowThreshold"); // FedFP420LowThreshold =3.
30  highthreshConf = conf_.getParameter<double>("FedFP420HighThreshold"); // FedFP420HighThreshold =4.
31 
32  /*
33  * There are four possible algorithms, the default of which (4)
34  * has different thresholds for isolated channels and ones in clusters.
35  * It also merges clusters (single or multi channels) that are only separated
36  * by one hole. This channel is selected as signal even though it is below
37  * both thresholds.
38  */
39 
43 
44  if (verbosity > 0) {
45  std::cout << "ZeroSuppressFP420: initParams: !!! theFEDalgorithm= " << theFEDalgorithm << std::endl;
46  std::cout << " lowthreshConf= " << lowthreshConf << " highthreshConf= " << highthreshConf
47  << " theFEDlowThresh= " << theFEDlowThresh << " theFEDhighThresh= " << theFEDhighThresh << std::endl;
48  }
49 
50  // Check zero suppress algorithm
51  if (theFEDalgorithm < 1 || theFEDalgorithm > theNumFEDalgos) {
52  edm::LogError("FP420DigiInfo") << "ZeroSuppressFP420 FATAL ERROR: Unknown zero suppress algorithm "
53  << theFEDalgorithm;
54  exit(1);
55  }
56 
57  // Check thresholds
59  edm::LogError("FP420DigiInfo") << "ZeroSuppressFP420 FATAL ERROR: Low threshold exceeds high "
60  "threshold: "
61  << theFEDlowThresh << " > " << theFEDhighThresh;
62  exit(2);
63  }
64 }

References algoConf, conf_, gather_cfg::cout, beamvalidation::exit(), edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), highthreshConf, lowthreshConf, noiseInAdc, theFEDalgorithm, theFEDhighThresh, theFEDlowThresh, theNumFEDalgos, and verbosity.

Referenced by ZeroSuppressFP420().

◆ trkFEDclusterizer()

ZSuppressFP420::DigitalMapType ZeroSuppressFP420::trkFEDclusterizer ( const DigitalMapType in,
int  vrb 
)

Definition at line 74 of file ZeroSuppressFP420.cc.

74  {
75  const std::string s2("ZeroSuppressFP420::trkFEDclusterizer1");
76 
77  DigitalMapType selectedSignal;
78  DigitalMapType::const_iterator i, iPrev, iNext, iPrev2, iNext2;
79 
80  if (vrb > 0) {
81  std::cout << "Before For loop" << std::endl;
82  }
83 
84  for (i = in.begin(); i != in.end(); i++) {
85  // Find adc values for neighbouring strips
86  int strip = i->first;
87  int adc = i->second;
88  iPrev = in.find(strip - 1);
89  iNext = in.find(strip + 1);
90  if (vrb > 0) {
91  std::cout << "Inside For loop trkFEDclusterizer: strip= " << strip << " adc= " << adc << std::endl;
92  }
93  // Set values for channels just outside module to infinity.
94  // This is to avoid losing channels at the edges,
95  // which otherwise would pass cuts if strips were next to each other.
96  int adcPrev = -99999;
97  int adcNext = -99999;
98  if (((strip) % 128) == 127)
99  adcNext = 99999;
100  if (((strip) % 128) == 0)
101  adcPrev = 99999;
102  // Otherwise if channel was found then find it's ADC count.
103  if (iPrev != in.end())
104  adcPrev = iPrev->second;
105  if (iNext != in.end())
106  adcNext = iNext->second;
107  int adcMaxNeigh = std::max(adcPrev, adcNext);
108  if (vrb > 0) {
109  std::cout << "adcPrev= " << adcPrev << " adcNext= " << adcNext << " adcMaxNeigh= " << adcMaxNeigh << std::endl;
110  }
111 
112  // Find adc values for next neighbouring channes
113  iPrev2 = in.find(strip - 2);
114  iNext2 = in.find(strip + 2);
115  // See above
116  int adcPrev2 = -99999;
117  int adcNext2 = -99999;
118  if (((strip) % 128) == 126)
119  adcNext2 = 99999;
120  if (((strip) % 128) == 1)
121  adcPrev2 = 99999;
122  if (iPrev2 != in.end())
123  adcPrev2 = iPrev2->second;
124  if (iNext2 != in.end())
125  adcNext2 = iNext2->second;
126 
127  if (vrb > 0) {
128  std::cout << "adcPrev2= " << adcPrev2 << " adcNext2= " << adcNext2 << std::endl;
129  std::cout << "To be accepted or not? adc= " << adc << " >= theFEDlowThresh=" << theFEDlowThresh << std::endl;
130  }
131  // Decide if this channel should be accepted.
132  bool accept = false;
133  switch (theFEDalgorithm) {
134  case 1:
135  accept = (adc >= theFEDlowThresh);
136  break;
137 
138  case 2:
139  accept = (adc >= theFEDhighThresh || (adc >= theFEDlowThresh && adcMaxNeigh >= theFEDlowThresh));
140  break;
141 
142  case 3:
143  accept = (adc >= theFEDhighThresh || (adc >= theFEDlowThresh && adcMaxNeigh >= theFEDhighThresh));
144  break;
145 
146  case 4:
147  accept = ((adc >= theFEDhighThresh) || // Test for adc>highThresh (same as
148  // algorithm 2)
149  ((adc >= theFEDlowThresh) && // Test for adc>lowThresh, with neighbour
150  // adc>lowThresh (same as algorithm 2)
151  (adcMaxNeigh >= theFEDlowThresh)) ||
152  ((adc < theFEDlowThresh) && // Test for adc<lowThresh
153  (((adcPrev >= theFEDhighThresh) && // with both neighbours>highThresh
154  (adcNext >= theFEDhighThresh)) ||
155  ((adcPrev >= theFEDhighThresh) && // OR with previous neighbour>highThresh and
156  (adcNext >= theFEDlowThresh) && // both the next neighbours>lowThresh
157  (adcNext2 >= theFEDlowThresh)) ||
158  ((adcNext >= theFEDhighThresh) && // OR with next neighbour>highThresh and
159  (adcPrev >= theFEDlowThresh) && // both the previous neighbours>lowThresh
160  (adcPrev2 >= theFEDlowThresh)) ||
161  ((adcNext >= theFEDlowThresh) && // OR with both next neighbours>lowThresh and
162  (adcNext2 >= theFEDlowThresh) && // both the previous neighbours>lowThresh
163  (adcPrev >= theFEDlowThresh) && (adcPrev2 >= theFEDlowThresh)))));
164  break;
165  }
166 
167  /*
168  * When a channel satisfying only the lower threshold is at the edge of an
169  * APV or module, the trkFEDclusterizer method assumes that every channel
170  * just outside an APV or module has a hit on it. This is to avoid channel
171  * inefficiencies at the edges of APVs and modules.
172  */
173  if (accept) {
174  selectedSignal[strip] = adc;
175 
176  if (vrb > 0) {
177  std::cout << "selected strips = " << strip << " adc= " << adc << std::endl;
178  }
179  }
180  }
181 
182  if (vrb > 0) {
183  std::cout << "last line of trkFEDclusterizer: return selectedSignal" << std::endl;
184  }
185  return selectedSignal;
186 }

References accept(), ecalLiteDTU::adc(), gather_cfg::cout, mps_fire::i, recoMuon::in, SiStripPI::max, indexGen::s2, AlCaHLTBitMon_QueryRunRegistry::string, digitizers_cfi::strip, theFEDalgorithm, theFEDhighThresh, and theFEDlowThresh.

Referenced by zeroSuppress().

◆ zeroSuppress()

ZSuppressFP420::DigitalMapType ZeroSuppressFP420::zeroSuppress ( const DigitalMapType notZeroSuppressedMap,
int  vrb 
)
overridevirtual

Implements ZSuppressFP420.

Definition at line 66 of file ZeroSuppressFP420.cc.

66  {
67  return trkFEDclusterizer(notZeroSuppressedMap, vrb);
68  if (vrb > 0) {
69  std::cout << "zeroSuppress: return trkFEDclusterizer(notZeroSuppressedMap)" << std::endl;
70  }
71 }

References gather_cfg::cout, and trkFEDclusterizer().

Referenced by FP420DigiMain::run().

Member Data Documentation

◆ algoConf

int ZeroSuppressFP420::algoConf
private

Definition at line 28 of file ZeroSuppressFP420.h.

Referenced by initParams().

◆ conf_

edm::ParameterSet ZeroSuppressFP420::conf_
private

Definition at line 25 of file ZeroSuppressFP420.h.

Referenced by initParams(), and ZeroSuppressFP420().

◆ highthreshConf

double ZeroSuppressFP420::highthreshConf
private

Definition at line 30 of file ZeroSuppressFP420.h.

Referenced by initParams().

◆ lowthreshConf

double ZeroSuppressFP420::lowthreshConf
private

Definition at line 29 of file ZeroSuppressFP420.h.

Referenced by initParams().

◆ noiseInAdc

float ZeroSuppressFP420::noiseInAdc
private

Definition at line 21 of file ZeroSuppressFP420.h.

Referenced by initParams(), and ZeroSuppressFP420().

◆ theFEDalgorithm

short ZeroSuppressFP420::theFEDalgorithm
private

Definition at line 22 of file ZeroSuppressFP420.h.

Referenced by initParams(), and trkFEDclusterizer().

◆ theFEDhighThresh

float ZeroSuppressFP420::theFEDhighThresh
private

Definition at line 24 of file ZeroSuppressFP420.h.

Referenced by initParams(), and trkFEDclusterizer().

◆ theFEDlowThresh

float ZeroSuppressFP420::theFEDlowThresh
private

Definition at line 23 of file ZeroSuppressFP420.h.

Referenced by initParams(), and trkFEDclusterizer().

◆ theNumFEDalgos

short ZeroSuppressFP420::theNumFEDalgos
private

Definition at line 26 of file ZeroSuppressFP420.h.

Referenced by initParams().

◆ verbosity

int ZeroSuppressFP420::verbosity
private

Definition at line 28 of file ZeroSuppressFP420.h.

Referenced by initParams(), and ZeroSuppressFP420().

mps_fire.i
i
Definition: mps_fire.py:428
ZeroSuppressFP420::theNumFEDalgos
short theNumFEDalgos
Definition: ZeroSuppressFP420.h:26
ZeroSuppressFP420::highthreshConf
double highthreshConf
Definition: ZeroSuppressFP420.h:30
ZeroSuppressFP420::theFEDalgorithm
short theFEDalgorithm
Definition: ZeroSuppressFP420.h:22
digitizers_cfi.strip
strip
Definition: digitizers_cfi.py:19
ZSuppressFP420::DigitalMapType
DConverterFP420::DigitalMapType DigitalMapType
Definition: ZSuppressFP420.h:8
gather_cfg.cout
cout
Definition: gather_cfg.py:144
ZeroSuppressFP420::conf_
edm::ParameterSet conf_
Definition: ZeroSuppressFP420.h:25
edm::ParameterSet::getUntrackedParameter
T getUntrackedParameter(std::string const &, T const &) const
indexGen.s2
s2
Definition: indexGen.py:107
ecalLiteDTU::adc
constexpr int adc(sample_type sample)
get the ADC sample (12 bits)
Definition: EcalLiteDTUSample.h:12
accept
bool accept(const edm::Event &event, const edm::TriggerResults &triggerTable, const std::string &triggerPath)
Definition: TopDQMHelpers.h:30
ZeroSuppressFP420::trkFEDclusterizer
ZSuppressFP420::DigitalMapType trkFEDclusterizer(const DigitalMapType &, int)
Definition: ZeroSuppressFP420.cc:74
ZeroSuppressFP420::algoConf
int algoConf
Definition: ZeroSuppressFP420.h:28
ZeroSuppressFP420::noiseInAdc
float noiseInAdc
Definition: ZeroSuppressFP420.h:21
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
SiStripPI::max
Definition: SiStripPayloadInspectorHelper.h:169
recoMuon::in
Definition: RecoMuonEnumerators.h:6
hgcalDigitizer_cfi.noise
noise
Definition: hgcalDigitizer_cfi.py:155
ZeroSuppressFP420::theFEDlowThresh
float theFEDlowThresh
Definition: ZeroSuppressFP420.h:23
ZeroSuppressFP420::theFEDhighThresh
float theFEDhighThresh
Definition: ZeroSuppressFP420.h:24
edm::LogError
Log< level::Error, false > LogError
Definition: MessageLogger.h:123
ZeroSuppressFP420::lowthreshConf
double lowthreshConf
Definition: ZeroSuppressFP420.h:29
ZeroSuppressFP420::verbosity
int verbosity
Definition: ZeroSuppressFP420.h:28
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
beamvalidation.exit
def exit(msg="")
Definition: beamvalidation.py:53
ZeroSuppressFP420::initParams
void initParams(const edm::ParameterSet &conf_)
Definition: ZeroSuppressFP420.cc:26