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 ( const edm::ParameterSet conf,
float  noise 
)

Definition at line 10 of file ZeroSuppressFP420.cc.

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

10  : conf_(conf), theNumFEDalgos(4)
11 {
12  noiseInAdc=noise;
14  verbosity = conf_.getUntrackedParameter<int>("VerbosityLevel");
15  //initParams();
16  if(verbosity>0) {
17  std::cout << "ZeroSuppressFP420: constructor: noiseInAdc= " << noiseInAdc << std::endl;
18  }
19 }
T getUntrackedParameter(std::string const &, T const &) const
edm::ParameterSet conf_
void initParams(const edm::ParameterSet &conf_)
ZeroSuppressFP420::~ZeroSuppressFP420 ( )
inlineoverride

Definition at line 12 of file ZeroSuppressFP420.h.

References conf_, initParams(), trkFEDclusterizer(), and zeroSuppress().

12 {}

Member Function Documentation

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

Definition at line 27 of file ZeroSuppressFP420.cc.

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

Referenced by ZeroSuppressFP420(), and ~ZeroSuppressFP420().

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

Definition at line 73 of file ZeroSuppressFP420.cc.

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

Referenced by zeroSuppress(), and ~ZeroSuppressFP420().

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

Implements ZSuppressFP420.

Definition at line 64 of file ZeroSuppressFP420.cc.

References gather_cfg::cout, and trkFEDclusterizer().

Referenced by FP420DigiMain::run(), and ~ZeroSuppressFP420().

65 {
66  return trkFEDclusterizer(notZeroSuppressedMap, vrb);
67  if(vrb>0) {
68  std::cout << "zeroSuppress: return trkFEDclusterizer(notZeroSuppressedMap)" << std::endl;
69  }
70 }
ZSuppressFP420::DigitalMapType trkFEDclusterizer(const DigitalMapType &, int)

Member Data Documentation

int ZeroSuppressFP420::algoConf
private

Definition at line 29 of file ZeroSuppressFP420.h.

Referenced by initParams().

edm::ParameterSet ZeroSuppressFP420::conf_
private

Definition at line 26 of file ZeroSuppressFP420.h.

Referenced by ZeroSuppressFP420(), and ~ZeroSuppressFP420().

double ZeroSuppressFP420::highthreshConf
private

Definition at line 31 of file ZeroSuppressFP420.h.

Referenced by initParams().

double ZeroSuppressFP420::lowthreshConf
private

Definition at line 30 of file ZeroSuppressFP420.h.

Referenced by initParams().

float ZeroSuppressFP420::noiseInAdc
private

Definition at line 22 of file ZeroSuppressFP420.h.

Referenced by initParams(), and ZeroSuppressFP420().

short ZeroSuppressFP420::theFEDalgorithm
private

Definition at line 23 of file ZeroSuppressFP420.h.

Referenced by initParams(), and trkFEDclusterizer().

float ZeroSuppressFP420::theFEDhighThresh
private

Definition at line 25 of file ZeroSuppressFP420.h.

Referenced by initParams(), and trkFEDclusterizer().

float ZeroSuppressFP420::theFEDlowThresh
private

Definition at line 24 of file ZeroSuppressFP420.h.

Referenced by initParams(), and trkFEDclusterizer().

short ZeroSuppressFP420::theNumFEDalgos
private

Definition at line 27 of file ZeroSuppressFP420.h.

Referenced by initParams().

int ZeroSuppressFP420::verbosity
private

Definition at line 29 of file ZeroSuppressFP420.h.

Referenced by initParams(), and ZeroSuppressFP420().