CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | Static Private Attributes
EcalSelectiveReadoutSuppressor Class Reference

#include <EcalSelectiveReadoutSuppressor.h>

Public Types

enum  { BARREL, ENDCAP }
 

Public Member Functions

 EcalSelectiveReadoutSuppressor (const edm::ParameterSet &params, edm::ConsumesCollector iC)
 
EcalSelectiveReadoutgetEcalSelectiveReadout ()
 
void printTTFlags (std::ostream &os, int iEvent=-1, bool withHeader=true) const
 
void run (const edm::EventSetup &eventSetup, const EcalTrigPrimDigiCollection &trigPrims, EBDigiCollection &barrelDigis, EEDigiCollection &endcapDigis)
 
void run (const edm::EventSetup &eventSetup, const EcalTrigPrimDigiCollection &trigPrims, const EBDigiCollection &barrelDigis, const EEDigiCollection &endcapDigis, EBDigiCollection *selectedBarrelDigis, EEDigiCollection *selectedEndcapDigis, EBSrFlagCollection *ebSrFlags, EESrFlagCollection *eeSrFlags)
 
void setElecMap (const EcalElectronicsMapping *map)
 
void setGeometry (const CaloGeometry *caloGeometry)
 
void setSettings (const EcalSRSettings *settings)
 
void setTriggerMap (const EcalTrigTowerConstituentsMap *map)
 

Static Public Member Functions

static int getFIRTapCount ()
 

Private Member Functions

bool accept (const edm::DataFrame &frame, int thr)
 
template<class T >
double frame2Energy (const T &frame, int timeOffset=0) const
 
std::vector< int > getFIRWeigths ()
 
int iEta2cIndex (int iEta) const
 
void initCellThresholds (double barrelLowInterest, double endcapLowInterest, double barrelHighInterest, double endcapHighInterest)
 helpers for constructors More...
 
int internalThreshold (double thresholdInGeV, int iSubDet) const
 
int iPhi2cIndex (int iPhi) const
 
int iTTEta2cIndex (int iEta) const
 
int iTTPhi2cIndex (int iPhi) const
 
void setTtFlags (const edm::EventSetup &eventSetup, const EBDigiCollection &ebDigis, const EEDigiCollection &eeDigis)
 
void setTtFlags (const EcalTrigPrimDigiCollection &trigPrims)
 

Private Attributes

std::vector< int > actions_
 
EcalSelectiveReadout::ttFlag_t defaultTtf_
 
std::unique_ptr< EcalSelectiveReadoutecalSelectiveReadout
 
int firstFIRSample
 
std::vector< int > firWeights
 
edm::ESGetToken< CaloGeometry, CaloGeometryRecordgeoToken_
 
int ievt_
 
int srFlags [2][8]
 
bool symetricZS
 
const EcalTrigTowerConstituentsMaptheTriggerMap
 
double thrUnit [2]
 
bool trigPrimBypass_
 
double trigPrimBypassHTH_
 
double trigPrimBypassLTH_
 
int trigPrimBypassMode_
 
bool trigPrimBypassWithPeakFinder_
 
EcalSelectiveReadout::ttFlag_t ttFlags [nTriggerTowersInEta][nTriggerTowersInPhi]
 
bool ttThresOnCompressedEt_
 
std::vector< float > weights
 
int zsThreshold [2][8]
 

Static Private Attributes

static const size_t nBarrelTriggerTowersInEta = 34
 
static const size_t nEndcaps = 2
 
static const size_t nEndcapTriggerTowersInEta = 11
 
static const int nFIRTaps = 6
 
static const size_t nTriggerTowersInEta = 2 * nEndcapTriggerTowersInEta + nBarrelTriggerTowersInEta
 
static const size_t nTriggerTowersInPhi = 72
 

Detailed Description

Definition at line 20 of file EcalSelectiveReadoutSuppressor.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum

Constructor & Destructor Documentation

◆ EcalSelectiveReadoutSuppressor()

EcalSelectiveReadoutSuppressor::EcalSelectiveReadoutSuppressor ( const edm::ParameterSet params,
edm::ConsumesCollector  iC 
)

Construtor.

Parameters
paramsconfiguration from python file
settingsconfiguration from condition DB

Definition at line 29 of file EcalSelectiveReadoutSuppressor.cc.

References defaultTtf_, Exception, submitPVValidationJobs::params, trigPrimBypass_, trigPrimBypassHTH_, trigPrimBypassLTH_, trigPrimBypassMode_, trigPrimBypassWithPeakFinder_, and ttThresOnCompressedEt_.

31  : ttThresOnCompressedEt_(false), ievt_(0), geoToken_(iC.esConsumes()) {
32  int defTtf = params.getParameter<int>("defaultTtf");
33  if (defTtf < 0 || defTtf > 7) {
34  throw cms::Exception("InvalidParameter") << "Value of EcalSelectiveReadoutProducer module parameter defaultTtf, "
35  << defaultTtf_ << ", is out of the valid range 0..7\n";
36  } else {
38  }
39 
40  trigPrimBypass_ = params.getParameter<bool>("trigPrimBypass");
41  trigPrimBypassMode_ = params.getParameter<int>("trigPrimBypassMode");
42  trigPrimBypassWithPeakFinder_ = params.getParameter<bool>("trigPrimBypassWithPeakFinder");
43  trigPrimBypassLTH_ = params.getParameter<double>("trigPrimBypassLTH");
44  trigPrimBypassHTH_ = params.getParameter<double>("trigPrimBypassHTH");
45  if (trigPrimBypass_) {
46  edm::LogWarning("Digitization") << "Beware a simplified trigger primitive "
47  "computation is used for the ECAL selective readout";
48  if (trigPrimBypassMode_ != 0 && trigPrimBypassMode_ != 1) {
49  throw cms::Exception("InvalidParameter")
50  << "Invalid value for EcalSelectiveReadoutProducer parameter 'trigPrimBypassMode_'."
51  " Valid values are 0 and 1.\n";
52  }
54  }
55 }
EcalSelectiveReadout::ttFlag_t defaultTtf_
edm::ESGetToken< CaloGeometry, CaloGeometryRecord > geoToken_
Log< level::Warning, false > LogWarning

Member Function Documentation

◆ accept()

bool EcalSelectiveReadoutSuppressor::accept ( const edm::DataFrame frame,
int  thr 
)
private

Returns true if a digi passes the zero suppression.

Parameters
frame,dataframe (aka digi).
thrzero suppression threshold in thrUnit.
Returns
true if passed ZS filter, false if failed

Definition at line 209 of file EcalSelectiveReadoutSuppressor.cc.

References firstFIRSample, getFIRWeigths(), nFIRTaps, mps_fire::result, ecalGpuTask_cfi::sample, symetricZS, and w().

Referenced by esMonitoring.FDJsonServer::handle_accept(), and run().

209  {
210  //FIR filter weights:
211  const vector<int>& w = getFIRWeigths();
212 
213  //accumulator used to compute weighted sum of samples
214  int acc = 0;
215  bool gain12saturated = false;
216  const int gain12 = 0x01;
217  const int lastFIRSample = firstFIRSample + nFIRTaps - 1;
218  //LogDebug("DccFir") << "DCC FIR operation: ";
219  int iWeight = 0;
220  for (int iSample = firstFIRSample - 1; iSample < lastFIRSample; ++iSample, ++iWeight) {
221  if (iSample >= 0 && iSample < (int)frame.size()) {
222  EcalMGPASample sample(frame[iSample]);
223  if (sample.gainId() != gain12)
224  gain12saturated = true;
225  //LogTrace("DccFir") << (iSample>=firstFIRSample?"+":"") << sample.adc()
226  // << "*(" << w[iWeight] << ")";
227  acc += sample.adc() * w[iWeight];
228  } else {
229  edm::LogWarning("DccFir") << __FILE__ << ":" << __LINE__
230  << ": Not enough samples in data frame or 'ecalDccZs1stSample' module "
231  "parameter is not valid...";
232  }
233  }
234 
235  if (symetricZS) { //cut on absolute value
236  if (acc < 0)
237  acc = -acc;
238  }
239 
240  //LogTrace("DccFir") << "\n";
241  //discards the 8 LSBs
242  //(result of shift operator on negative numbers depends on compiler
243  //implementation, therefore the value is offset to make sure it is positive
244  //before performing the bit shift).
245  acc = ((acc + (1 << 30)) >> 8) - (1 << (30 - 8));
246 
247  //ZS passed if weigthed sum acc above ZS threshold or if
248  //one sample has a lower gain than gain 12 (that is gain 12 output
249  //is saturated)
250 
251  const bool result = (acc >= thr) || gain12saturated;
252 
253  //LogTrace("DccFir") << "acc: " << acc << "\n"
254  // << "threshold: " << thr << " ("
255  // << thr*thrUnit[((EcalDataFrame&)frame).id().subdetId()==EcalBarrel?0:1]
256  // << "GeV)\n"
257  // << "saturated: " << (gain12saturated?"yes":"no") << "\n"
258  // << "ZS passed: " << (result?"yes":"no")
259  // << (symetricZS?" (symetric cut)":"") << "\n";
260 
261  return result;
262 }
T w() const
Log< level::Warning, false > LogWarning

◆ frame2Energy()

template<class T >
double EcalSelectiveReadoutSuppressor::frame2Energy ( const T frame,
int  timeOffset = 0 
) const
private

Definition at line 534 of file EcalSelectiveReadoutSuppressor.cc.

References DMR_cfg::cerr, mps_fire::i, dqmiodumpmetadata::n, hltrates_dqm_sourceclient-live_cfg::offset, and weights.

Referenced by setTtFlags().

534  {
535  //we have to start by 0 in order to handle offset=-1
536  //(however Fenix FIR has AFAK only 5 taps)
537  double weights[] = {0., -1 / 3., -1 / 3., -1 / 3., 0., 1.};
538 
539  double adc2GeV = 0.;
540  if (typeid(frame) == typeid(EBDataFrame)) {
541  adc2GeV = 0.035;
542  } else if (typeid(frame) == typeid(EEDataFrame)) {
543  adc2GeV = 0.060;
544  } else { //T is an invalid type!
545  //TODO: replace message by a cms exception
546  cerr << "Severe error. " << __FILE__ << ":" << __LINE__ << ": "
547  << "this is a bug. Please report it.\n";
548  }
549 
550  double acc = 0;
551 
552  const int n = min<int>(frame.size(), sizeof(weights) / sizeof(weights[0]));
553 
554  double gainInv[] = {12., 1., 6., 12.};
555 
556  //cout << __PRETTY_FUNCTION__ << ": ";
557  for (int i = offset; i < n; ++i) {
558  int iframe = i + offset;
559  if (iframe >= 0 && iframe < frame.size()) {
560  acc += weights[i] * frame[iframe].adc() * gainInv[frame[iframe].gainId()] * adc2GeV;
561  //cout << (iframe>offset?"+":"")
562  // << frame[iframe].adc() << "*" << gainInv[frame[iframe].gainId()]
563  // << "*" << adc2GeV << "*(" << weights[i] << ")";
564  }
565  }
566  //cout << "\n";
567  return acc;
568 }

◆ getEcalSelectiveReadout()

EcalSelectiveReadout* EcalSelectiveReadoutSuppressor::getEcalSelectiveReadout ( )
inline

For debugging purposes.

Definition at line 88 of file EcalSelectiveReadoutSuppressor.h.

References ecalSelectiveReadout.

Referenced by EcalSelectiveReadoutProducer::produce().

88 { return ecalSelectiveReadout.get(); }
std::unique_ptr< EcalSelectiveReadout > ecalSelectiveReadout

◆ getFIRTapCount()

static int EcalSelectiveReadoutSuppressor::getFIRTapCount ( )
inlinestatic

Gets number of weights supported by the zero suppression filter

Returns
number of weights

Definition at line 35 of file EcalSelectiveReadoutSuppressor.h.

References nFIRTaps.

Referenced by EcalSelectiveReadoutProducer::checkWeights().

◆ getFIRWeigths()

vector< int > EcalSelectiveReadoutSuppressor::getFIRWeigths ( )
private

Gets the integer weights used by the zero suppression FIR filter.

<U>Weight definitions:</U>

  • Uncalibrated normalized weights are defined as such that when applied to the average pulse with the highest sample normalized to 1, the result is 1.
  • Calibrated weights are defined for each crystal, as uncalibrated normalized weights multiplied by an intercalibration constant which is expected to be between 0.6 and 1.4
  • FIR weights are defined for each crystal as the closest signed integers to 2**10 times the calibrated weigths. The absolute value of these weights should not be greater than (2**12-1).

If a FIR weights exceeds the (2**12-1) absolute value limit, its absolute value is replaced by (2**12-1).

Definition at line 422 of file EcalSelectiveReadoutSuppressor.cc.

References funct::abs(), firWeights, mps_fire::i, SiStripPI::min, nFIRTaps, and weights.

Referenced by accept().

422  {
423  if (firWeights.empty()) {
424  firWeights = vector<int>(nFIRTaps, 0); //default weight: 0;
425  const static int maxWeight = 0xEFF; //weights coded on 11+1 signed bits
426  for (unsigned i = 0; i < min((size_t)nFIRTaps, weights.size()); ++i) {
427  firWeights[i] = lround(weights[i] * (1 << 10));
428  if (abs(firWeights[i]) > maxWeight) { //overflow
429  firWeights[i] = firWeights[i] < 0 ? -maxWeight : maxWeight;
430  }
431  }
432  }
433  return firWeights;
434 }
Abs< T >::type abs(const T &t)
Definition: Abs.h:22

◆ iEta2cIndex()

int EcalSelectiveReadoutSuppressor::iEta2cIndex ( int  iEta) const
inlineprivate

Transforms CMSSW eta ECAL crystal indices to indices starting at 0 to use for c-array or vector.

Parameters
iEtaCMSSW eta index (numbering -85...-1,1...85)
Returns
index in numbering from 0 to 169

Definition at line 147 of file EcalSelectiveReadoutSuppressor.h.

References l1tPhase2CaloJetEmulator_cfi::iEta.

147 { return (iEta < 0) ? iEta + 85 : iEta + 84; }

◆ initCellThresholds()

void EcalSelectiveReadoutSuppressor::initCellThresholds ( double  barrelLowInterest,
double  endcapLowInterest,
double  barrelHighInterest,
double  endcapHighInterest 
)
private

helpers for constructors

Initializes ZS threshold and SR classificion to SR ("action") flags

Definition at line 112 of file EcalSelectiveReadoutSuppressor.cc.

References actions_, BARREL, ENDCAP, EcalSelectiveReadout::FORCED_MASK, mps_fire::i, internalThreshold(), SiStripPI::max, SiStripPI::min, srFlags, and zsThreshold.

Referenced by setSettings().

115  {
116  //center, neighbour and single RUs are grouped into a single
117  //'high interest' group
118  int lowInterestThr[2]; //index for BARREL/ENDCAP
119  // int lowInterestSrFlag[2];
120  int highInterestThr[2];
121  // int highInterestSrFlag[2];
122 
123  lowInterestThr[BARREL] = internalThreshold(barrelLowInterest, BARREL);
124  // lowInterestSrFlag[BARREL] = thr2Srf(lowInterestThr[BARREL],
125  // EcalSrFlag::SRF_ZS1);
126 
127  highInterestThr[BARREL] = internalThreshold(barrelHighInterest, BARREL);
128  // highInterestSrFlag[BARREL] = thr2Srf(highInterestThr[BARREL],
129  // EcalSrFlag::SRF_ZS2);
130 
131  lowInterestThr[ENDCAP] = internalThreshold(endcapLowInterest, ENDCAP);
132  //lowInterestSrFlag[ENDCAP] = thr2Srf(lowInterestThr[ENDCAP],
133  // EcalSrFlag::SRF_ZS1);
134 
135  highInterestThr[ENDCAP] = internalThreshold(endcapHighInterest, ENDCAP);
136  // highInterestSrFlag[ENDCAP] = thr2Srf(highInterestThr[ENDCAP],
137  // EcalSrFlag::SRF_ZS2);
138 
139  const int FORCED_MASK = EcalSelectiveReadout::FORCED_MASK;
140 
141  for (int iSubDet = 0; iSubDet < 2; ++iSubDet) {
142  //low interest
143  //zsThreshold[iSubDet][0] = lowInterestThr[iSubDet];
144  //srFlags[iSubDet][0] = lowInterestSrFlag[iSubDet];
145  //srFlags[iSubDet][0 + FORCED_MASK] = FORCED_MASK | lowInterestSrFlag[iSubDet];
146 
147  //single->high interest
148  //zsThreshold[iSubDet][1] = highInterestThr[iSubDet];
149  //srFlags[iSubDet][1] = highInterestSrFlag[iSubDet];
150  //srFlags[iSubDet][1 + FORCED_MASK] = FORCED_MASK | highInterestSrFlag[iSubDet];
151 
152  //neighbour->high interest
153  //zsThreshold[iSubDet][2] = highInterestThr[iSubDet];
154  //srFlags[iSubDet][2] = highInterestSrFlag[iSubDet];
155  //srFlags[iSubDet][2 + FORCED_MASK] = FORCED_MASK | highInterestSrFlag[iSubDet];
156 
157  //center->high interest
158  //zsThreshold[iSubDet][3] = highInterestThr[iSubDet];
159  //srFlags[iSubDet][3] = highInterestSrFlag[iSubDet];
160  //srFlags[iSubDet][3 + FORCED_MASK] = FORCED_MASK | highInterestSrFlag[iSubDet];
161  for (size_t i = 0; i < 8; ++i) {
162  srFlags[iSubDet][i] = actions_[i];
163  if ((actions_[i] & ~FORCED_MASK) == 0)
164  zsThreshold[iSubDet][i] = numeric_limits<int>::max();
165  else if ((actions_[i] & ~FORCED_MASK) == 1)
166  zsThreshold[iSubDet][i] = lowInterestThr[iSubDet];
167  else if ((actions_[i] & ~FORCED_MASK) == 2)
168  zsThreshold[iSubDet][i] = highInterestThr[iSubDet];
169  else
170  zsThreshold[iSubDet][i] = numeric_limits<int>::min();
171  }
172 
173  // for(size_t i = 0; i < 8; ++i){
174  // cout << "zsThreshold[" << iSubDet << "][" << i << "] = " << zsThreshold[iSubDet][i] << endl;
175  // }
176  }
177 }
static const int FORCED_MASK
int internalThreshold(double thresholdInGeV, int iSubDet) const

◆ internalThreshold()

int EcalSelectiveReadoutSuppressor::internalThreshold ( double  thresholdInGeV,
int  iSubDet 
) const
private

Converts threshold in GeV to threshold in internal unit used by the ZS FIR.

Parameters
thresholdInGeVthe theshold in GeV
iSubDet0 for barrel, 1 for endcap
Returns
threshold in thrUnit unit. INT_MAX means complete suppression, INT_MIN means no zero suppression.

Definition at line 189 of file EcalSelectiveReadoutSuppressor.cc.

References SiStripPI::max, SiStripPI::min, and thrUnit.

Referenced by initCellThresholds().

189  {
190  double thr_ = thresholdInGeV / thrUnit[iSubDet];
191  //treating over- and underflows, threshold is coded on 11+1 signed bits
192  //an underflow threshold is considered here as if NoRO DCC switch is on
193  //an overflow threshold is considered here as if ForcedRO DCC switch in on
194  //Beware that conparison must be done on a double type, because conversion
195  //cast to an int of a double higher than MAX_INT is undefined.
196  int thr;
197  if (thr_ >= 0x7FF + .5) {
198  thr = numeric_limits<int>::max();
199  } else if (thr_ <= -0x7FF - .5) {
200  thr = numeric_limits<int>::min();
201  } else {
202  thr = lround(thr_);
203  }
204  return thr;
205 }

◆ iPhi2cIndex()

int EcalSelectiveReadoutSuppressor::iPhi2cIndex ( int  iPhi) const
inlineprivate

Transforms CMSSW phi ECAL crystal indices to indices starting at 0 to use for c-array or vector.

Parameters
iPhiCMSSW phi index (numbering 1...360)
Returns
index in numbering 0...359

Definition at line 154 of file EcalSelectiveReadoutSuppressor.h.

154 { return iPhi - 1; }

◆ iTTEta2cIndex()

int EcalSelectiveReadoutSuppressor::iTTEta2cIndex ( int  iEta) const
inlineprivate

Transforms CMSSW eta ECAL TT indices to indices starting at 0 to use for c-array or vector.

Parameters
iEtaCMSSW eta index (numbering -28...-1,28...56)
Returns
index in numbering from 0 to 55

Definition at line 161 of file EcalSelectiveReadoutSuppressor.h.

References l1tPhase2CaloJetEmulator_cfi::iEta.

Referenced by setTtFlags().

161 { return (iEta < 0) ? iEta + 28 : iEta + 27; }

◆ iTTPhi2cIndex()

int EcalSelectiveReadoutSuppressor::iTTPhi2cIndex ( int  iPhi) const
inlineprivate

Transforms CMSSW phi ECAL crystal indices to indices starting at 0 to use for c-array or vector.

Parameters
iPhiCMSSW phi index (numbering 1...72)
Returns
index in numbering 0...71

Definition at line 168 of file EcalSelectiveReadoutSuppressor.h.

Referenced by setTtFlags().

168 { return iPhi - 1; }

◆ printTTFlags()

void EcalSelectiveReadoutSuppressor::printTTFlags ( std::ostream &  os,
int  iEvent = -1,
bool  withHeader = true 
) const

Writes out TT flags. On of the 'run' method must be called beforehand. Beware this method might be removed in future.

Parameters
osstream to write to
iEventevent index. Ignored if <0.
withHeader.If true writes out a header with the legend.

Definition at line 570 of file EcalSelectiveReadoutSuppressor.cc.

References l1tPhase2CaloJetEmulator_cfi::iEta, iEvent, HLT_2023v12_cff::nEta, HLT_2023v12_cff::nPhi, EcalSelectiveReadout::nTriggerTowersInEta, EcalSelectiveReadout::nTriggerTowersInPhi, tccFlagMarker, and ttFlags.

Referenced by EcalSelectiveReadoutProducer::produce().

570  {
571  const char tccFlagMarker[] = {'?', '.', 'S', '?', 'C', 'E', 'E', 'E', 'E'};
574 
575  if (withHeader) {
576  os << "# TCC flag map\n#\n"
577  "# +-->Phi "
578  << tccFlagMarker[1 + 0]
579  << ": 000 (low interest)\n"
580  "# | "
581  << tccFlagMarker[1 + 1]
582  << ": 001 (mid interest)\n"
583  "# | "
584  << tccFlagMarker[1 + 2]
585  << ": 010 (not valid)\n"
586  "# V Eta "
587  << tccFlagMarker[1 + 3]
588  << ": 011 (high interest)\n"
589  "# "
590  << tccFlagMarker[1 + 4] << ": 1xx forced readout (Hw error)\n";
591  }
592 
593  if (iEvent >= 0) {
594  os << "#\n#Event " << iEvent << "\n";
595  }
596 
597  for (int iEta = 0; iEta < nEta; ++iEta) {
598  for (int iPhi = 0; iPhi < nPhi; ++iPhi) {
599  os << tccFlagMarker[ttFlags[iEta][iPhi] + 1];
600  }
601  os << "\n";
602  }
603 }
const char tccFlagMarker[]
Definition: GenABIO.cc:164
EcalSelectiveReadout::ttFlag_t ttFlags[nTriggerTowersInEta][nTriggerTowersInPhi]
int iEvent
Definition: GenABIO.cc:224
static const size_t nTriggerTowersInEta
static const size_t nTriggerTowersInPhi

◆ run() [1/2]

void EcalSelectiveReadoutSuppressor::run ( const edm::EventSetup eventSetup,
const EcalTrigPrimDigiCollection trigPrims,
EBDigiCollection barrelDigis,
EEDigiCollection endcapDigis 
)

Runs the selective readout(SR) algorithm.

Parameters
eventSetupevent conditions
trigPrimsthe ECAL trigger primitives used as input to the SR.
barrelDigis[in,out] the EB digi collection to filter
endcapDigis[in,out] the EE digi collection to filter

Definition at line 264 of file EcalSelectiveReadoutSuppressor.cc.

References mtdUncalibratedRecHits_cfi::barrelDigis, mtdUncalibratedRecHits_cfi::endcapDigis, and options_cfi::eventSetup.

Referenced by EcalSelectiveReadoutProducer::produce().

267  {
268  EBDigiCollection selectedBarrelDigis;
269  EEDigiCollection selectedEndcapDigis;
270 
271  run(eventSetup, trigPrims, barrelDigis, endcapDigis, &selectedBarrelDigis, &selectedEndcapDigis, nullptr, nullptr);
272 
273  //replaces the input with the suppressed version
274  barrelDigis.swap(selectedBarrelDigis);
275  endcapDigis.swap(selectedEndcapDigis);
276 }
void run(const edm::EventSetup &eventSetup, const EcalTrigPrimDigiCollection &trigPrims, EBDigiCollection &barrelDigis, EEDigiCollection &endcapDigis)

◆ run() [2/2]

void EcalSelectiveReadoutSuppressor::run ( const edm::EventSetup eventSetup,
const EcalTrigPrimDigiCollection trigPrims,
const EBDigiCollection barrelDigis,
const EEDigiCollection endcapDigis,
EBDigiCollection selectedBarrelDigis,
EEDigiCollection selectedEndcapDigis,
EBSrFlagCollection ebSrFlags,
EESrFlagCollection eeSrFlags 
)

Runs the selective readout (SR) algorithm.

Parameters
eventSetupevent conditions
trigPrimsthe ECAL trigger primitives used as input to the SR.
barrelDigisthe input EB digi collection
endcapDigisthe input EE digi collection
selectedBarrelDigis[out] the EB digi passing the SR. Pointer to the collection to fill. If null, no collection is filled.
selectedEndcapDigis[out] the EE digi passing the SR. Pointer to the collection to fill. If null, no collection is filled.
ebSrFlags[out] the computed SR flags for EB. Pointer to the collection to fill. If null, no collection is filled.
eeSrFlags[out] the computed SR flags for EE. Pointer to the collection to fill. If null, no collection is filled.

Definition at line 278 of file EcalSelectiveReadoutSuppressor.cc.

References accept(), BARREL, mtdUncalibratedRecHits_cfi::barrelDigis, CollectionTags_cfi::EBSrFlag, EcalBarrel, ecalSelectiveReadout, CollectionTags_cfi::EESrFlag, ENDCAP, mtdUncalibratedRecHits_cfi::endcapDigis, options_cfi::eventSetup, Exception, RemoveAddSevLevel::flag, l1ctLayer2EG_cff::id, l1tPhase2CaloJetEmulator_cfi::iEta, ievt_, LogDebug, nBarrelTriggerTowersInEta, nTriggerTowersInPhi, EBDigiCollection::push_back(), EEDigiCollection::push_back(), edm::SortedCollection< T, SORT >::push_back(), edm::DataFrameContainer::reserve(), edm::SortedCollection< T, SORT >::reserve(), setTtFlags(), edm::DataFrameContainer::size(), srFlags, trigPrimBypass_, ttFlags, ttThresOnCompressedEt_, EcalScDetId::validDetId(), and zsThreshold.

285  {
286  ++ievt_;
287  if (!trigPrimBypass_ || ttThresOnCompressedEt_) { //uses output of TPG emulator
288  setTtFlags(trigPrims);
289  } else { //debug mode, run w/o TP digis
291  }
292 
293  ecalSelectiveReadout->runSelectiveReadout0(ttFlags);
294 
295  if (selectedBarrelDigis) {
296  selectedBarrelDigis->reserve(barrelDigis.size() / 20);
297 
298  // do barrel first
299  for (EBDigiCollection::const_iterator digiItr = barrelDigis.begin(); digiItr != barrelDigis.end(); ++digiItr) {
300  int interestLevel = ecalSelectiveReadout->getCrystalInterest(EBDigiCollection::DetId(digiItr->id())) &
301  ~EcalSelectiveReadout::FORCED_MASK;
302  if (accept(*digiItr, zsThreshold[BARREL][interestLevel])) {
303  selectedBarrelDigis->push_back(digiItr->id(), digiItr->begin());
304  }
305  }
306  }
307 
308  // and endcaps
309  if (selectedEndcapDigis) {
310  selectedEndcapDigis->reserve(endcapDigis.size() / 20);
311  for (EEDigiCollection::const_iterator digiItr = endcapDigis.begin(); digiItr != endcapDigis.end(); ++digiItr) {
312  int interestLevel = ecalSelectiveReadout->getCrystalInterest(EEDigiCollection::DetId(digiItr->id())) &
313  ~EcalSelectiveReadout::FORCED_MASK;
314  if (accept(*digiItr, zsThreshold[ENDCAP][interestLevel])) {
315  selectedEndcapDigis->push_back(digiItr->id(), digiItr->begin());
316  }
317  }
318  }
319 
320  if (ievt_ <= 10) {
321  int neb = (selectedBarrelDigis ? selectedBarrelDigis->size() : 0);
322  if (selectedEndcapDigis)
323  LogDebug("EcalSelectiveReadout")
324  // << __FILE__ << ":" << __LINE__ << ": "
325  << "Number of EB digis passing the SR: " << neb << " / " << barrelDigis.size() << "\n";
326  if (selectedEndcapDigis)
327  LogDebug("EcalSelectiveReadout")
328  // << __FILE__ << ":" << __LINE__ << ": "
329  << "\nNumber of EE digis passing the SR: " << selectedEndcapDigis->size() << " / " << endcapDigis.size()
330  << "\n";
331  }
332 
333  if (ebSrFlags)
334  ebSrFlags->reserve(34 * 72);
335  if (eeSrFlags)
336  eeSrFlags->reserve(624);
337  //SR flags:
338  for (int iZ = -1; iZ <= 1; iZ += 2) { //-1=>EE-, EB-, +1=>EE+, EB+
339  //barrel:
340  for (unsigned iEta = 1; iEta <= nBarrelTriggerTowersInEta / 2; ++iEta) {
341  for (unsigned iPhi = 1; iPhi <= nTriggerTowersInPhi; ++iPhi) {
342  const EcalTrigTowerDetId id(iZ, EcalBarrel, iEta, iPhi);
343  EcalSelectiveReadout::towerInterest_t interest = ecalSelectiveReadout->getTowerInterest(id);
344  if (interest < 0) {
345  throw cms::Exception("EcalSelectiveReadout") << __FILE__ << ":" << __LINE__ << ": "
346  << "unknown SR flag. for "
347  << " TT " << id << ". Most probably a bug.";
348  }
349  int flag;
350  // if(interest==EcalSelectiveReadout::FORCED_RO){
351  // flag = EcalSrFlag::SRF_FORCED_MASK | EcalSrFlag::SRF_FULL;
352  //} else{
353  flag = srFlags[BARREL][interest];
354  //}
355  if (ebSrFlags)
356  ebSrFlags->push_back(EBSrFlag(id, flag));
357  } //next iPhi
358  } //next barrel iEta
359 
360  //endcap:
361  EcalScDetId id;
362  for (int iX = 1; iX <= 20; ++iX) {
363  for (int iY = 1; iY <= 20; ++iY) {
364  if (EcalScDetId::validDetId(iX, iY, iZ))
365  id = EcalScDetId(iX, iY, iZ);
366  else
367  continue;
368 
369  EcalSelectiveReadout::towerInterest_t interest = ecalSelectiveReadout->getSuperCrystalInterest(id);
370 
371  if (interest >= 0) { //negative no SC at (iX,iY) coordinates
372  int flag;
373  // if(interest==EcalSelectiveReadout::FORCED_RO){
374  // flag = EcalSrFlag::SRF_FORCED_MASK | EcalSrFlag::SRF_FULL;
375  //} else{
376  flag = srFlags[ENDCAP][interest];
377  //}
378  if (eeSrFlags)
379  eeSrFlags->push_back(EESrFlag(id, flag));
380  } else if (iX < 9 || iX > 12 || iY < 9 || iY > 12) { //not an inner partial SC
381  edm::LogError("EcalSelectiveReadout") << __FILE__ << ":" << __LINE__ << ": "
382  << "negative interest in EE for SC " << id << "\n";
383  }
384  } //next iY
385  } //next iX
386  }
387 }
void push_back(const Digi &digi)
static bool validDetId(int ix, int iy, int iz)
Definition: EcalScDetId.cc:59
void push_back(T const &t)
Log< level::Error, false > LogError
std::unique_ptr< EcalSelectiveReadout > ecalSelectiveReadout
EcalSelectiveReadout::ttFlag_t ttFlags[nTriggerTowersInEta][nTriggerTowersInPhi]
void reserve(size_t isize)
boost::transform_iterator< IterHelp, boost::counting_iterator< int > > const_iterator
bool accept(const edm::DataFrame &frame, int thr)
void push_back(const Digi &digi)
void setTtFlags(const edm::EventSetup &eventSetup, const EBDigiCollection &ebDigis, const EEDigiCollection &eeDigis)
void reserve(size_type n)
#define LogDebug(id)

◆ setElecMap()

void EcalSelectiveReadoutSuppressor::setElecMap ( const EcalElectronicsMapping map)

Set the ECAL electronics mapping

Parameters
mapthe ECAL electronics map

Definition at line 102 of file EcalSelectiveReadoutSuppressor.cc.

References ecalSelectiveReadout, and genParticles_cff::map.

Referenced by EcalSelectiveReadoutProducer::checkElecMap().

102  {
103  ecalSelectiveReadout->setElecMap(map);
104 }
std::unique_ptr< EcalSelectiveReadout > ecalSelectiveReadout

◆ setGeometry()

void EcalSelectiveReadoutSuppressor::setGeometry ( const CaloGeometry caloGeometry)

Sets the geometry of the calorimeters

Definition at line 106 of file EcalSelectiveReadoutSuppressor.cc.

References ecalSelectiveReadout.

Referenced by EcalSelectiveReadoutProducer::checkGeometry().

106  {
107 #ifndef ECALSELECTIVEREADOUT_NOGEOM
108  ecalSelectiveReadout->setGeometry(caloGeometry);
109 #endif
110 }
std::unique_ptr< EcalSelectiveReadout > ecalSelectiveReadout

◆ setSettings()

void EcalSelectiveReadoutSuppressor::setSettings ( const EcalSRSettings settings)

Definition at line 57 of file EcalSelectiveReadoutSuppressor.cc.

References EcalSRSettings::actions_, actions_, BARREL, EcalSRSettings::dccNormalizedWeights_, EcalSRSettings::deltaEta_, EcalSRSettings::deltaPhi_, EcalSRSettings::ebDccAdcToGeV_, EcalSRSettings::ecalDccZs1stSample_, ecalSelectiveReadout, EcalSRSettings::eeDccAdcToGeV_, ENDCAP, Exception, firstFIRSample, mps_fire::i, initCellThresholds(), EcalSRSettings::srpHighInterestChannelZS_, EcalSRSettings::srpLowInterestChannelZS_, symetricZS, EcalSRSettings::symetricZS_, thrUnit, and weights.

Referenced by EcalSelectiveReadoutProducer::produce().

57  {
58  firstFIRSample = settings->ecalDccZs1stSample_[0];
59  weights = settings->dccNormalizedWeights_[0];
60  symetricZS = settings->symetricZS_[0];
61  actions_ = settings->actions_;
62 
63  //online configuration has only 4 actions flags, the 4 'forced' flags being the same with the force
64  //bit set to 1. Extends the actions vector for case of online-type configuration:
65  if (actions_.size() == 4) {
66  for (int i = 0; i < 4; ++i) {
67  actions_.push_back(actions_[i] | 0x4);
68  }
69  }
70 
71  bool actionValid = actions_.size() == 8;
72  for (size_t i = 0; i < actions_.size(); ++i) {
73  if (actions_[i] < 0 || actions_[i] > 7)
74  actionValid = false;
75  }
76 
77  if (!actionValid) {
78  throw cms::Exception("InvalidParameter")
79  << "EcalSelectiveReadoutProducer module parameter 'actions' is "
80  "not valid. It must be a vector of 8 integer values comprised between 0 and 7\n";
81  }
82 
83  double adcToGeV = settings->ebDccAdcToGeV_;
84  thrUnit[BARREL] = adcToGeV / 4.; //unit=1/4th ADC count
85 
86  adcToGeV = settings->eeDccAdcToGeV_;
87  thrUnit[ENDCAP] = adcToGeV / 4.; //unit=1/4th ADC count
88  ecalSelectiveReadout = std::make_unique<EcalSelectiveReadout>(settings->deltaEta_[0], settings->deltaPhi_[0]);
89  const int eb = 0;
90  const int ee = 1;
92  settings->srpLowInterestChannelZS_[ee],
93  settings->srpHighInterestChannelZS_[eb],
94  settings->srpHighInterestChannelZS_[ee]);
95 }
void initCellThresholds(double barrelLowInterest, double endcapLowInterest, double barrelHighInterest, double endcapHighInterest)
helpers for constructors
std::vector< std::vector< float > > dccNormalizedWeights_
std::vector< float > srpHighInterestChannelZS_
std::unique_ptr< EcalSelectiveReadout > ecalSelectiveReadout
std::vector< int > actions_
std::vector< int > ecalDccZs1stSample_
std::vector< int > deltaPhi_
std::vector< int > symetricZS_
float ebDccAdcToGeV_
ADC to GeV conversion factor used in ZS filter for EB.
std::vector< float > srpLowInterestChannelZS_
std::vector< int > deltaEta_
float eeDccAdcToGeV_
ADC to GeV conversion factor used in ZS filter for EE.

◆ setTriggerMap()

void EcalSelectiveReadoutSuppressor::setTriggerMap ( const EcalTrigTowerConstituentsMap map)

Set the mapping of which cell goes with which trigger tower

Parameters
mapthe trigger tower map

Definition at line 97 of file EcalSelectiveReadoutSuppressor.cc.

References ecalSelectiveReadout, genParticles_cff::map, and theTriggerMap.

Referenced by EcalSelectiveReadoutProducer::checkTriggerMap().

97  {
99  ecalSelectiveReadout->setTriggerMap(map);
100 }
std::unique_ptr< EcalSelectiveReadout > ecalSelectiveReadout
const EcalTrigTowerConstituentsMap * theTriggerMap

◆ setTtFlags() [1/2]

void EcalSelectiveReadoutSuppressor::setTtFlags ( const edm::EventSetup eventSetup,
const EBDigiCollection ebDigis,
const EEDigiCollection eeDigis 
)
private

Help function to set the srFlags field. Used in TrigPrimByPass mode

Parameters
eventSetupthe EDM event setup
ebDigithe ECAL barrel APD digis
eeDigithe ECAL endcap VPT digis

Definition at line 436 of file EcalSelectiveReadoutSuppressor.cc.

References edm::DataFrameContainer::begin(), MillePedeFileConverter_cfg::e, DetId::Ecal, EcalBarrel, EcalEndcap, SimL1EmulatorDM_cff::eeDigis, edm::DataFrameContainer::end(), EgHLTOffHistBins_cfi::et, amptDefault_cfi::frame, frame2Energy(), geoToken_, edm::EventSetup::getData(), CaloSubdetectorGeometry::getGeometry(), ALPAKA_ACCELERATOR_NAMESPACE::vertexFinder::it, iTTEta2cIndex(), iTTPhi2cIndex(), nTriggerTowersInEta, nTriggerTowersInPhi, funct::sin(), theta(), theTriggerMap, EcalTrigTowerConstituentsMap::towerOf(), trigPrimBypassHTH_, trigPrimBypassLTH_, trigPrimBypassWithPeakFinder_, EcalSelectiveReadout::TTF_HIGH_INTEREST, EcalSelectiveReadout::TTF_LOW_INTEREST, EcalSelectiveReadout::TTF_MID_INTEREST, ttFlags, and ecaldqm::ttId().

Referenced by run().

438  {
439  double trigPrim[nTriggerTowersInEta][nTriggerTowersInPhi];
440 
441  //ecal geometry:
442  // static const CaloSubdetectorGeometry* eeGeometry = 0;
443  // static const CaloSubdetectorGeometry* ebGeometry = 0;
444  const CaloSubdetectorGeometry* eeGeometry = nullptr;
445  const CaloSubdetectorGeometry* ebGeometry = nullptr;
446  // if(eeGeometry==0 || ebGeometry==0){
447  auto const& geo = es.getData(geoToken_);
448  eeGeometry = geo.getSubdetectorGeometry(DetId::Ecal, EcalEndcap);
449  ebGeometry = geo.getSubdetectorGeometry(DetId::Ecal, EcalBarrel);
450  // }
451 
452  //init trigPrim array:
453  bzero(trigPrim, sizeof(trigPrim));
454 
455  for (EBDigiCollection::const_iterator it = ebDigis.begin(); it != ebDigis.end(); ++it) {
456  EBDataFrame frame(*it);
458  // edm:::LogDebug("TT") << __FILE__ << ":" << __LINE__ << ": "
459  // << ((EBDetId&)frame.id()).ieta()
460  // << "," << ((EBDetId&)frame.id()).iphi()
461  // << " -> " << ttId.ieta() << "," << ttId.iphi() << "\n";
462  const int iTTEta0 = iTTEta2cIndex(ttId.ieta());
463  const int iTTPhi0 = iTTPhi2cIndex(ttId.iphi());
464  double theta = ebGeometry->getGeometry(frame.id())->getPosition().theta();
465  double e = frame2Energy(frame);
466  if (!trigPrimBypassWithPeakFinder_ || ((frame2Energy(frame, -1) < e) && (frame2Energy(frame, 1) < e))) {
467  trigPrim[iTTEta0][iTTPhi0] += e * sin(theta);
468  }
469  }
470 
471  for (EEDigiCollection::const_iterator it = eeDigis.begin(); it != eeDigis.end(); ++it) {
472  EEDataFrame frame(*it);
474  const int iTTEta0 = iTTEta2cIndex(ttId.ieta());
475  const int iTTPhi0 = iTTPhi2cIndex(ttId.iphi());
476  // cout << __FILE__ << ":" << __LINE__ << ": EE xtal->TT "
477  // << ((EEDetId&)frame.id()).ix()
478  // << "," << ((EEDetId&)frame.id()).iy()
479  // << " -> " << ttId.ieta() << "," << ttId.iphi() << "\n";
480  double theta = eeGeometry->getGeometry(frame.id())->getPosition().theta();
481  double e = frame2Energy(frame);
482  if (!trigPrimBypassWithPeakFinder_ || ((frame2Energy(frame, -1) < e) && (frame2Energy(frame, 1) < e))) {
483  trigPrim[iTTEta0][iTTPhi0] += e * sin(theta);
484  }
485  }
486 
487  //dealing with pseudo-TT in two inner EE eta-ring:
488  int innerTTEtas[] = {0, 1, 54, 55};
489  for (unsigned iRing = 0; iRing < sizeof(innerTTEtas) / sizeof(innerTTEtas[0]); ++iRing) {
490  int iTTEta0 = innerTTEtas[iRing];
491  //this detector eta-section is divided in only 36 phi bins
492  //For this eta regions,
493  //current tower eta numbering scheme is inconsistent. For geometry
494  //version 133:
495  //- TT are numbered from 0 to 72 for 36 bins
496  //- some TT have an even index, some an odd index
497  //For geometry version 125, there are 72 phi bins.
498  //The code below should handle both geometry definition.
499  //If there are 72 input trigger primitives for each inner eta-ring,
500  //then the average of the trigger primitive of the two pseudo-TT of
501  //a pair (nEta, nEta+1) is taken as Et of both pseudo TTs.
502  //If there are only 36 input TTs for each inner eta ring, then half
503  //of the present primitive of a pseudo TT pair is used as Et of both
504  //pseudo TTs.
505 
506  for (unsigned iTTPhi0 = 0; iTTPhi0 < nTriggerTowersInPhi - 1; iTTPhi0 += 2) {
507  double et = .5 * (trigPrim[iTTEta0][iTTPhi0] + trigPrim[iTTEta0][iTTPhi0 + 1]);
508  //divides the TT into 2 phi bins in order to match with 72 phi-bins SRP
509  //scheme or average the Et on the two pseudo TTs if the TT is already
510  //divided into two trigger primitives.
511  trigPrim[iTTEta0][iTTPhi0] = et;
512  trigPrim[iTTEta0][iTTPhi0 + 1] = et;
513  }
514  }
515 
516  for (unsigned iTTEta0 = 0; iTTEta0 < nTriggerTowersInEta; ++iTTEta0) {
517  for (unsigned iTTPhi0 = 0; iTTPhi0 < nTriggerTowersInPhi; ++iTTPhi0) {
518  if (trigPrim[iTTEta0][iTTPhi0] > trigPrimBypassHTH_) {
520  } else if (trigPrim[iTTEta0][iTTPhi0] > trigPrimBypassLTH_) {
522  } else {
524  }
525 
526  // cout /*LogDebug("TT")*/
527  // << "ttFlags[" << iTTEta0 << "][" << iTTPhi0 << "] = "
528  // << ttFlags[iTTEta0][iTTPhi0] << "\n";
529  }
530  }
531 }
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
unsigned ttId(DetId const &, EcalElectronicsMapping const *)
EcalTrigTowerDetId towerOf(const DetId &id) const
Get the tower id for this det id (or null if not known)
EcalSelectiveReadout::ttFlag_t ttFlags[nTriggerTowersInEta][nTriggerTowersInPhi]
virtual std::shared_ptr< const CaloCellGeometry > getGeometry(const DetId &id) const
Get the cell geometry of a given detector id. Should return false if not found.
const_iterator end() const
edm::ESGetToken< CaloGeometry, CaloGeometryRecord > geoToken_
double frame2Energy(const T &frame, int timeOffset=0) const
const_iterator begin() const
The iterator returned can not safely be used across threads.
boost::transform_iterator< IterHelp, boost::counting_iterator< int > > const_iterator
const EcalTrigTowerConstituentsMap * theTriggerMap
Geom::Theta< T > theta() const

◆ setTtFlags() [2/2]

void EcalSelectiveReadoutSuppressor::setTtFlags ( const EcalTrigPrimDigiCollection trigPrims)
private

Help function to set the srFlags field.

Parameters
trigPrimthe trigger primitive digi collection

Definition at line 389 of file EcalSelectiveReadoutSuppressor.cc.

References edm::SortedCollection< T, SORT >::begin(), defaultTtf_, edm::SortedCollection< T, SORT >::end(), l1tPhase2CaloJetEmulator_cfi::iEta, nTriggerTowersInEta, nTriggerTowersInPhi, trigPrimBypassHTH_, trigPrimBypassLTH_, EcalSelectiveReadout::TTF_HIGH_INTEREST, EcalSelectiveReadout::TTF_LOW_INTEREST, EcalSelectiveReadout::TTF_MID_INTEREST, ttFlags, and ttThresOnCompressedEt_.

389  {
390  for (size_t iEta0 = 0; iEta0 < nTriggerTowersInEta; ++iEta0) {
391  for (size_t iPhi0 = 0; iPhi0 < nTriggerTowersInPhi; ++iPhi0) {
392  ttFlags[iEta0][iPhi0] = defaultTtf_;
393  }
394  }
395  for (EcalTrigPrimDigiCollection::const_iterator trigPrim = trigPrims.begin(); trigPrim != trigPrims.end();
396  ++trigPrim) {
397  int iEta = trigPrim->id().ieta();
398  unsigned int iEta0;
399  if (iEta < 0) { //z- half ECAL: transforming ranges -28;-1 => 0;27
400  iEta0 = iEta + nTriggerTowersInEta / 2;
401  } else { //z+ halfECAL: transforming ranges 1;28 => 28;55
402  iEta0 = iEta + nTriggerTowersInEta / 2 - 1;
403  }
404 
405  unsigned int iPhi0 = trigPrim->id().iphi() - 1;
406 
407  if (!ttThresOnCompressedEt_) {
408  ttFlags[iEta0][iPhi0] = (EcalSelectiveReadout::ttFlag_t)trigPrim->ttFlag();
409  } else {
410  int compressedEt = trigPrim->compressedEt();
411  if (compressedEt < trigPrimBypassLTH_) {
413  } else if (compressedEt < trigPrimBypassHTH_) {
415  } else {
417  }
418  }
419  }
420 }
std::vector< T >::const_iterator const_iterator
EcalSelectiveReadout::ttFlag_t ttFlags[nTriggerTowersInEta][nTriggerTowersInPhi]
EcalSelectiveReadout::ttFlag_t defaultTtf_
const_iterator begin() const
const_iterator end() const

Member Data Documentation

◆ actions_

std::vector<int> EcalSelectiveReadoutSuppressor::actions_
private

SR flag (low interest/single/neighbor/center) to action flag (suppress, ZS1, ZS2, FRO) map.

Definition at line 274 of file EcalSelectiveReadoutSuppressor.h.

Referenced by initCellThresholds(), and setSettings().

◆ defaultTtf_

EcalSelectiveReadout::ttFlag_t EcalSelectiveReadoutSuppressor::defaultTtf_
private

Default TTF to substitute if absent from the trigger primitive collection

Definition at line 307 of file EcalSelectiveReadoutSuppressor.h.

Referenced by EcalSelectiveReadoutSuppressor(), and setTtFlags().

◆ ecalSelectiveReadout

std::unique_ptr<EcalSelectiveReadout> EcalSelectiveReadoutSuppressor::ecalSelectiveReadout
private

Help class to comput selective readout flags.

Definition at line 216 of file EcalSelectiveReadoutSuppressor.h.

Referenced by getEcalSelectiveReadout(), run(), setElecMap(), setGeometry(), setSettings(), and setTriggerMap().

◆ firstFIRSample

int EcalSelectiveReadoutSuppressor::firstFIRSample
private

Time position of the first sample to use in zero suppession FIR filter. Numbering starts at 0.

Definition at line 227 of file EcalSelectiveReadoutSuppressor.h.

Referenced by accept(), and setSettings().

◆ firWeights

std::vector<int> EcalSelectiveReadoutSuppressor::firWeights
private

Weights of zero suppression FIR filter

Definition at line 231 of file EcalSelectiveReadoutSuppressor.h.

Referenced by getFIRWeigths().

◆ geoToken_

edm::ESGetToken<CaloGeometry, CaloGeometryRecord> EcalSelectiveReadoutSuppressor::geoToken_
private

Definition at line 313 of file EcalSelectiveReadoutSuppressor.h.

Referenced by setTtFlags().

◆ ievt_

int EcalSelectiveReadoutSuppressor::ievt_
private

Number of produced events

Definition at line 311 of file EcalSelectiveReadoutSuppressor.h.

Referenced by run().

◆ nBarrelTriggerTowersInEta

const size_t EcalSelectiveReadoutSuppressor::nBarrelTriggerTowersInEta = 34
staticprivate

Number of eta trigger tower divisions in the barrel.

Definition at line 204 of file EcalSelectiveReadoutSuppressor.h.

Referenced by run().

◆ nEndcaps

const size_t EcalSelectiveReadoutSuppressor::nEndcaps = 2
staticprivate

Help function to get SR flag from ZS threshold using min/max convention for SUPPRESS and FULL_READOUT: see zsThreshold.

Parameters
thrZS threshold in thrUnit
flagfor Zero suppression: EcalSrFlag::SRF_ZS1 or EcalSrFlag::SRF_ZS2
Returns
the SR flagNumber of endcap, obviously two.

Definition at line 196 of file EcalSelectiveReadoutSuppressor.h.

◆ nEndcapTriggerTowersInEta

const size_t EcalSelectiveReadoutSuppressor::nEndcapTriggerTowersInEta = 11
staticprivate

Number of eta trigger tower divisions in one endcap.

Definition at line 200 of file EcalSelectiveReadoutSuppressor.h.

◆ nFIRTaps

const int EcalSelectiveReadoutSuppressor::nFIRTaps = 6
staticprivate

Depth of DCC zero suppression FIR filter (number of taps), in principal 6.

Definition at line 236 of file EcalSelectiveReadoutSuppressor.h.

Referenced by accept(), getFIRTapCount(), and getFIRWeigths().

◆ nTriggerTowersInEta

const size_t EcalSelectiveReadoutSuppressor::nTriggerTowersInEta = 2 * nEndcapTriggerTowersInEta + nBarrelTriggerTowersInEta
staticprivate

Number of eta divisions in trigger towers for the whole ECAL

Definition at line 208 of file EcalSelectiveReadoutSuppressor.h.

Referenced by setTtFlags().

◆ nTriggerTowersInPhi

const size_t EcalSelectiveReadoutSuppressor::nTriggerTowersInPhi = 72
staticprivate

Number of phi divisions in trigger towers.

Definition at line 212 of file EcalSelectiveReadoutSuppressor.h.

Referenced by run(), and setTtFlags().

◆ srFlags

int EcalSelectiveReadoutSuppressor::srFlags[2][8]
private

Maps RU interest flag (low interest, single neighbour, center) to Selective readout action flag (type of readout). 1st index: 0 for barrel, 1 for endcap 2nd index: RU interest (low, single, neighbour, center, forced low, forced single...)

Definition at line 303 of file EcalSelectiveReadoutSuppressor.h.

Referenced by initCellThresholds(), and run().

◆ symetricZS

bool EcalSelectiveReadoutSuppressor::symetricZS
private

Flag to use a symetric zero suppression (cut on absolute value)

Definition at line 244 of file EcalSelectiveReadoutSuppressor.h.

Referenced by accept(), and setSettings().

◆ theTriggerMap

const EcalTrigTowerConstituentsMap* EcalSelectiveReadoutSuppressor::theTriggerMap
private

Definition at line 218 of file EcalSelectiveReadoutSuppressor.h.

Referenced by setTriggerMap(), and setTtFlags().

◆ thrUnit

double EcalSelectiveReadoutSuppressor::thrUnit[2]
private

Internal unit for Zero Suppression threshold (1/4th ADC count) used by the FIR. Index: 0 for barrel, 1 for endcap

Definition at line 258 of file EcalSelectiveReadoutSuppressor.h.

Referenced by internalThreshold(), and setSettings().

◆ trigPrimBypass_

bool EcalSelectiveReadoutSuppressor::trigPrimBypass_
private

Switch for trigger primitive simulation module bypass debug mode.

Definition at line 262 of file EcalSelectiveReadoutSuppressor.h.

Referenced by EcalSelectiveReadoutSuppressor(), and run().

◆ trigPrimBypassHTH_

double EcalSelectiveReadoutSuppressor::trigPrimBypassHTH_
private

Low TT Et threshold for trigger primitive simulation module bypass debug mode.

Definition at line 295 of file EcalSelectiveReadoutSuppressor.h.

Referenced by EcalSelectiveReadoutSuppressor(), and setTtFlags().

◆ trigPrimBypassLTH_

double EcalSelectiveReadoutSuppressor::trigPrimBypassLTH_
private

Low TT Et threshold for trigger primitive simulation module bypass debug mode.

Definition at line 290 of file EcalSelectiveReadoutSuppressor.h.

Referenced by EcalSelectiveReadoutSuppressor(), and setTtFlags().

◆ trigPrimBypassMode_

int EcalSelectiveReadoutSuppressor::trigPrimBypassMode_
private

Mode selection for "Trig bypass" mode 0: TT thresholds applied on sum of crystal Et's 1: TT thresholds applies on compressed Et from Trigger primitive

See also
trigPrimByPass_ switch

Definition at line 269 of file EcalSelectiveReadoutSuppressor.h.

Referenced by EcalSelectiveReadoutSuppressor().

◆ trigPrimBypassWithPeakFinder_

bool EcalSelectiveReadoutSuppressor::trigPrimBypassWithPeakFinder_
private

When in trigger primitive simulation module bypass debug mode, switch to enable Peak finder effect simulation

Definition at line 285 of file EcalSelectiveReadoutSuppressor.h.

Referenced by EcalSelectiveReadoutSuppressor(), and setTtFlags().

◆ ttFlags

EcalSelectiveReadout::ttFlag_t EcalSelectiveReadoutSuppressor::ttFlags[nTriggerTowersInEta][nTriggerTowersInPhi]
private

Trigger tower flags: see setTtFlags()

Definition at line 222 of file EcalSelectiveReadoutSuppressor.h.

Referenced by printTTFlags(), run(), and setTtFlags().

◆ ttThresOnCompressedEt_

bool EcalSelectiveReadoutSuppressor::ttThresOnCompressedEt_
private

Switch to applies trigPrimBypassLTH_ and trigPrimBypassHTH_ thresholds on TPG compressed ET instead of using flags from TPG: trig prim bypass mode 1.

Definition at line 280 of file EcalSelectiveReadoutSuppressor.h.

Referenced by EcalSelectiveReadoutSuppressor(), run(), and setTtFlags().

◆ weights

std::vector<float> EcalSelectiveReadoutSuppressor::weights
private

DCC zero suppression FIR filter uncalibrated normalized weigths

Definition at line 240 of file EcalSelectiveReadoutSuppressor.h.

Referenced by frame2Energy(), getFIRWeigths(), and setSettings().

◆ zsThreshold

int EcalSelectiveReadoutSuppressor::zsThreshold[2][8]
private

Zero suppresion threshold for the ECAL expressed in ebThrUnit and eeThrUnit. Set to numeric_limits<int>::min() for FULL READOUT and to numeric_limits<int>::max() for SUPPRESS. First index: 0 for barrel, 1 for endcap 2nd index: channel interest (see EcalSelectiveReadout::towerInterest_t

Definition at line 252 of file EcalSelectiveReadoutSuppressor.h.

Referenced by initCellThresholds(), and run().