CMS 3D CMS Logo

List of all members | Classes | Public Member Functions | Private Member Functions | Private Attributes | Friends
HcalSeverityLevelComputer Class Reference

#include <HcalSeverityLevelComputer.h>

Classes

class  HcalSeverityDefinition
 

Public Member Functions

bool dropChannel (const uint32_t &mystatus) const
 
int getSeverityLevel (const DetId &myid, const uint32_t &myflag, const uint32_t &mystatus) const
 
 HcalSeverityLevelComputer (const edm::ParameterSet &)
 
bool recoveredRecHit (const DetId &myid, const uint32_t &myflag) const
 
 ~HcalSeverityLevelComputer ()
 

Private Member Functions

bool getChStBit (HcalSeverityDefinition &mydef, const std::string &mybit)
 
bool getRecHitFlag (HcalSeverityDefinition &mydef, const std::string &mybit, int phase_)
 
void setAllRHMasks (const unsigned bitnumber, HcalSeverityDefinition &mydef)
 
void setBit (const unsigned bitnumber, uint32_t &where)
 

Private Attributes

HcalSeverityDefinitionDropChannel_
 
HcalSeverityDefinitionRecoveredRecHit_
 
std::vector< HcalSeverityDefinitionSevDef
 

Friends

std::ostream & operator<< (std::ostream &s, const HcalSeverityLevelComputer::HcalSeverityDefinition &def)
 

Detailed Description

Definition at line 24 of file HcalSeverityLevelComputer.h.

Constructor & Destructor Documentation

◆ HcalSeverityLevelComputer()

HcalSeverityLevelComputer::HcalSeverityLevelComputer ( const edm::ParameterSet iConfig)

Definition at line 185 of file HcalSeverityLevelComputer.cc.

References DropChannel_, relativeConstraints::empty, getChStBit(), edm::ParameterSet::getParameter(), getRecHitFlag(), ALPAKA_ACCELERATOR_NAMESPACE::vertexFinder::it, isotrackApplyRegressor::k, hydjet2DefaultParameters_cff::myParameters, RecoveredRecHit_, SevDef, HcalSeverityLevelComputer::HcalSeverityDefinition::sevLevel, and AlCaHLTBitMon_QueryRunRegistry::string.

185  {
186  // initialize: get the levels and masks from the cfg:
187  typedef std::vector<edm::ParameterSet> myParameters;
188  myParameters myLevels = iConfig.getParameter<myParameters>((std::string) "SeverityLevels");
189 
190  unsigned int phase_ = iConfig.getParameter<unsigned int>("phase");
191 
192  // now run through the parameter set vector:
193  for (myParameters::iterator itLevels = myLevels.begin(); itLevels != myLevels.end(); ++itLevels) {
194  // create the basic object
195  HcalSeverityDefinition mydef;
196 
197  // get the level:
198  mydef.sevLevel = itLevels->getParameter<int>("Level");
199 
200  // get the RecHitFlags:
201  std::vector<std::string> myRecHitFlags = itLevels->getParameter<std::vector<std::string> >("RecHitFlags");
202 
203  // get channel statuses:
204  std::vector<std::string> myChStatuses = itLevels->getParameter<std::vector<std::string> >("ChannelStatus");
205 
206  // now translate the RecHitFlags and the ChannelStatuses into a mask each:
207  // create counters for invalid flags to be able to catch cases where a definition consists only of invalid bit names:
208  unsigned int bvalid = 0;
209  unsigned int bnonempty = 0;
210  // channel status:
211  for (unsigned k = 0; k < myChStatuses.size(); k++) {
212  if (myChStatuses[k].empty())
213  break; // empty string
214  bnonempty++;
215  bvalid += getChStBit(mydef, myChStatuses[k]);
216  }
217  // RecHitFlag:
218  // HBHEStatusFlag, HOStatusFlag, HFStatusFlag, ZDCStatusFlag, CalibrationFlag
219  for (unsigned k = 0; k < myRecHitFlags.size(); k++) {
220  if (myRecHitFlags[k].empty())
221  break; // empty string
222  bnonempty++;
223  bvalid += getRecHitFlag(mydef, myRecHitFlags[k], phase_);
224  }
225 
226  // std::cout << "Made Severity Level:" << std::endl;
227  // std::cout << mydef << std::endl;
228 
229  // case where definition is made entirely out of invalid flags but not empty strings
230  if ((!bvalid) && (bnonempty)) {
231  edm::LogWarning("HcalSeverityLevelComputer") << "Warning: level " << mydef.sevLevel
232  << " consists of invalid definitions only: "
233  // << myRecHitFlags << "; " << myChStatuses
234  << " Ignoring definition.";
235  continue;
236  }
237 
238  // finally, append the masks to the mask vectors, sorting them according to level
239  std::vector<HcalSeverityDefinition>::iterator it = SevDef.begin();
240 
241  do {
242  if (it == SevDef.end()) {
243  SevDef.push_back(mydef);
244  break;
245  }
246 
247  if (it->sevLevel == mydef.sevLevel) {
248  edm::LogWarning("HcalSeverityLevelComputer") << "HcalSeverityLevelComputer: Warning: level " << mydef.sevLevel
249  << " already defined. Ignoring new definition.";
250  break;
251  }
252 
253  if (it->sevLevel < mydef.sevLevel)
254  if (((it + 1) == SevDef.end()) || ((it + 1)->sevLevel > mydef.sevLevel)) {
255  SevDef.insert(it + 1, mydef);
256  break;
257  }
258 
259  it++;
260  } while (it != SevDef.end());
261 
262  } //for (myParameters::iterator itLevels=myLevels.begin(); itLevels != myLevels.end(); ++itLevels)
263 
264  edm::LogInfo("HcalSeverityLevelComputer") << "HcalSeverityLevelComputer - Summary of Severity Levels:" << std::endl;
265  for (std::vector<HcalSeverityDefinition>::iterator it = SevDef.begin(); it != SevDef.end(); it++) {
266  // debug: write the levels definitions on screen:
267  edm::LogInfo("HcalSeverityLevelComputer") << (*it) << std::endl;
268  }
269 
270  //
271  // Now make the definition for recoveredRecHit
272  //
273  std::vector<std::string> myRecovered = iConfig.getParameter<std::vector<std::string> >("RecoveredRecHitBits");
274  RecoveredRecHit_ = new HcalSeverityDefinition();
275  for (unsigned k = 0; k < myRecovered.size(); k++) {
276  if (myRecovered[k].empty())
277  break;
278  getRecHitFlag((*RecoveredRecHit_), myRecovered[k], phase_);
279  }
280 
281  //
282  // Now make the definition for dropChannel
283  //
284  std::vector<std::string> myDrop = iConfig.getParameter<std::vector<std::string> >("DropChannelStatusBits");
285  DropChannel_ = new HcalSeverityDefinition();
286  for (unsigned k = 0; k < myDrop.size(); k++) {
287  if (myDrop[k].empty())
288  break;
289  getChStBit((*DropChannel_), myDrop[k]);
290  }
291 
292  edm::LogInfo("HcalSeverityLevelComputer") << "HcalSeverityLevelComputer - Summary for Recovered RecHit bits: \n"
293  << (*RecoveredRecHit_) << std::endl
294  << "HcalSeverityLevelComputer - Summary for Drop the Channel bits: \n"
295  << (*DropChannel_) << std::endl;
296 
297 } // HcalSeverityLevelComputer::HcalSeverityLevelComputer
T getParameter(std::string const &) const
Definition: ParameterSet.h:307
bool getRecHitFlag(HcalSeverityDefinition &mydef, const std::string &mybit, int phase_)
std::vector< HcalSeverityDefinition > SevDef
HcalSeverityDefinition * RecoveredRecHit_
Log< level::Info, false > LogInfo
HcalSeverityDefinition * DropChannel_
Log< level::Warning, false > LogWarning
bool getChStBit(HcalSeverityDefinition &mydef, const std::string &mybit)

◆ ~HcalSeverityLevelComputer()

HcalSeverityLevelComputer::~HcalSeverityLevelComputer ( )

Definition at line 299 of file HcalSeverityLevelComputer.cc.

References DropChannel_, and RecoveredRecHit_.

299  {
300  delete DropChannel_;
301  delete RecoveredRecHit_;
302 }
HcalSeverityDefinition * RecoveredRecHit_
HcalSeverityDefinition * DropChannel_

Member Function Documentation

◆ dropChannel()

bool HcalSeverityLevelComputer::dropChannel ( const uint32_t &  mystatus) const

◆ getChStBit()

bool HcalSeverityLevelComputer::getChStBit ( HcalSeverityDefinition mydef,
const std::string &  mybit 
)
private

Definition at line 9 of file HcalSeverityLevelComputer.cc.

References HcalSeverityLevelComputer::HcalSeverityDefinition::chStatusMask, HcalChannelStatus::HcalBadLaserSignal, HcalChannelStatus::HcalCellCaloTowerMask, HcalChannelStatus::HcalCellCaloTowerProb, HcalChannelStatus::HcalCellDead, HcalChannelStatus::HcalCellExcludeFromHBHENoiseSummary, HcalChannelStatus::HcalCellExcludeFromHBHENoiseSummaryR45, HcalChannelStatus::HcalCellHot, HcalChannelStatus::HcalCellMask, HcalChannelStatus::HcalCellOff, HcalChannelStatus::HcalCellStabErr, HcalChannelStatus::HcalCellTimErr, HcalChannelStatus::HcalCellTrigMask, and setBit().

Referenced by HcalSeverityLevelComputer().

9  {
10  if (mybit == "HcalCellOff")
11  setBit(HcalChannelStatus::HcalCellOff, mydef.chStatusMask);
12  else if (mybit == "HcalCellMask")
13  setBit(HcalChannelStatus::HcalCellMask, mydef.chStatusMask);
14  else if (mybit == "HcalCellDead")
15  setBit(HcalChannelStatus::HcalCellDead, mydef.chStatusMask);
16  else if (mybit == "HcalCellHot")
17  setBit(HcalChannelStatus::HcalCellHot, mydef.chStatusMask);
18  else if (mybit == "HcalCellStabErr")
19  setBit(HcalChannelStatus::HcalCellStabErr, mydef.chStatusMask);
20  else if (mybit == "HcalCellTimErr")
21  setBit(HcalChannelStatus::HcalCellTimErr, mydef.chStatusMask);
22  else if (mybit == "HcalCellTrigMask")
23  setBit(HcalChannelStatus::HcalCellTrigMask, mydef.chStatusMask);
24  else if (mybit == "HcalCellCaloTowerMask")
26  else if (mybit == "HcalCellCaloTowerProb")
28  else if (mybit == "HcalCellExcludeFromHBHENoiseSummary")
30  else if (mybit == "HcalCellExcludeFromHBHENoiseSummaryR45")
32  else if (mybit == "HcalBadLaserSignal")
33  setBit(HcalChannelStatus::HcalBadLaserSignal, mydef.chStatusMask);
34  else { // error: unrecognized channel status name
35  edm::LogWarning("HcalSeverityLevelComputer")
36  << "HcalSeverityLevelComputer: Error: ChannelStatusFlag >>" << mybit << "<< unknown. Ignoring.";
37  return false;
38  }
39  return true;
40 }
void setBit(const unsigned bitnumber, uint32_t &where)
Log< level::Warning, false > LogWarning

◆ getRecHitFlag()

bool HcalSeverityLevelComputer::getRecHitFlag ( HcalSeverityDefinition mydef,
const std::string &  mybit,
int  phase_ 
)
private

Definition at line 42 of file HcalSeverityLevelComputer.cc.

References HcalCaloFlagLabels::ADCSaturationBit, HcalCaloFlagLabels::AddedSimHcalNoise, HcalSeverityLevelComputer::HcalSeverityDefinition::CalibFlagMask, HcalCaloFlagLabels::CalibrationBit, HcalCaloFlagLabels::Fraction2TS, HcalSeverityLevelComputer::HcalSeverityDefinition::HBHEFlagMask, HcalPhase1FlagLabels::HBHEFlatNoise, HcalCaloFlagLabels::HBHEFlatNoise, HcalPhase1FlagLabels::HBHEHpdHitMultiplicity, HcalCaloFlagLabels::HBHEHpdHitMultiplicity, HcalPhase1FlagLabels::HBHEIsolatedNoise, HcalCaloFlagLabels::HBHEIsolatedNoise, HcalPhase1FlagLabels::HBHENegativeNoise, HcalCaloFlagLabels::HBHENegativeNoise, HcalPhase1FlagLabels::HBHEOOTPU, HcalCaloFlagLabels::HBHEOOTPU, HcalPhase1FlagLabels::HBHEPulseFitBit, HcalCaloFlagLabels::HBHEPulseFitBit, HcalCaloFlagLabels::HBHEPulseShape, HcalPhase1FlagLabels::HBHESpikeNoise, HcalCaloFlagLabels::HBHESpikeNoise, HcalCaloFlagLabels::HBHETimingShapedCutsBits, HcalCaloFlagLabels::HBHETimingTrustBits, HcalCaloFlagLabels::HBHETriangleNoise, HcalPhase1FlagLabels::HBHETS4TS5Noise, HcalCaloFlagLabels::HBHETS4TS5Noise, HcalPhase1FlagLabels::HFAnomalousHit, HcalCaloFlagLabels::HFDigiTime, HcalSeverityLevelComputer::HcalSeverityDefinition::HFFlagMask, HcalCaloFlagLabels::HFInTimeWindow, HcalPhase1FlagLabels::HFLongShort, HcalCaloFlagLabels::HFLongShort, HcalPhase1FlagLabels::HFPET, HcalCaloFlagLabels::HFPET, HcalPhase1FlagLabels::HFS8S1Ratio, HcalCaloFlagLabels::HFS8S1Ratio, HcalPhase1FlagLabels::HFSignalAsymmetry, HcalCaloFlagLabels::HFTimingTrustBits, HcalCaloFlagLabels::HOBit, HcalSeverityLevelComputer::HcalSeverityDefinition::HOFlagMask, HcalCaloFlagLabels::HSCP_ExpFit, HcalCaloFlagLabels::HSCP_FracLeader, HcalCaloFlagLabels::HSCP_OuterEnergy, HcalCaloFlagLabels::HSCP_R1R2, HcalCaloFlagLabels::PresampleADC, setAllRHMasks(), setBit(), HcalCaloFlagLabels::TimingAddedBit, HcalCaloFlagLabels::TimingErrorBit, HcalPhase1FlagLabels::TimingFromTDC, HcalCaloFlagLabels::TimingSubtractedBit, HcalPhase1FlagLabels::UserDefinedBit0, HcalCaloFlagLabels::UserDefinedBit0, HcalCaloFlagLabels::ZDCBit, and HcalSeverityLevelComputer::HcalSeverityDefinition::ZDCFlagMask.

Referenced by HcalSeverityLevelComputer().

42  {
43  if (phase == 1) // Phase 1 Rechit flags
44  {
45  // HB, HE ++++++++++++++++++++
46  if (mybit == "HBHEHpdHitMultiplicity")
48  else if (mybit == "HBHEIsolatedNoise")
50  else if (mybit == "HBHEFlatNoise")
51  setBit(HcalPhase1FlagLabels::HBHEFlatNoise, mydef.HBHEFlagMask);
52  else if (mybit == "HBHESpikeNoise")
53  setBit(HcalPhase1FlagLabels::HBHESpikeNoise, mydef.HBHEFlagMask);
54  else if (mybit == "HBHETS4TS5Noise")
55  setBit(HcalPhase1FlagLabels::HBHETS4TS5Noise, mydef.HBHEFlagMask);
56  else if (mybit == "HBHENegativeNoise")
58  else if (mybit == "HBHEPulseFitBit")
59  setBit(HcalPhase1FlagLabels::HBHEPulseFitBit, mydef.HBHEFlagMask);
60  else if (mybit == "HBHEOOTPU")
61  setBit(HcalPhase1FlagLabels::HBHEOOTPU, mydef.HBHEFlagMask);
62 
63  // HF ++++++++++++++++++++
64  else if (mybit == "HFLongShort")
65  setBit(HcalPhase1FlagLabels::HFLongShort, mydef.HFFlagMask);
66  else if (mybit == "HFS8S1Ratio")
67  setBit(HcalPhase1FlagLabels::HFS8S1Ratio, mydef.HFFlagMask);
68  else if (mybit == "HFPET")
69  setBit(HcalPhase1FlagLabels::HFPET, mydef.HFFlagMask);
70  else if (mybit == "HFSignalAsymmetry")
72  else if (mybit == "HFAnomalousHit")
74 
75  // Common subdetector bits ++++++++++++++++++++++
76  else if (mybit == "TimingFromTDC")
78  else if (mybit == "UserDefinedBit0")
80 
81  // unknown -------------------
82  else {
83  // error: unrecognized flag name
84  edm::LogWarning("HcalSeverityLevelComputer")
85  << "HcalSeverityLevelComputer: Error: RecHitFlag >>" << mybit << "<< unknown. Ignoring.";
86  return false;
87  }
88  } else // Phase 0 Rechit flags
89  {
90  // HB, HE ++++++++++++++++++++
91  if (mybit == "HBHEHpdHitMultiplicity")
93  else if (mybit == "HBHEPulseShape")
94  setBit(HcalCaloFlagLabels::HBHEPulseShape, mydef.HBHEFlagMask);
95  else if (mybit == "HSCP_R1R2")
96  setBit(HcalCaloFlagLabels::HSCP_R1R2, mydef.HBHEFlagMask);
97  else if (mybit == "HSCP_FracLeader")
98  setBit(HcalCaloFlagLabels::HSCP_FracLeader, mydef.HBHEFlagMask);
99  else if (mybit == "HSCP_OuterEnergy")
100  setBit(HcalCaloFlagLabels::HSCP_OuterEnergy, mydef.HBHEFlagMask);
101  else if (mybit == "HSCP_ExpFit")
102  setBit(HcalCaloFlagLabels::HSCP_ExpFit, mydef.HBHEFlagMask);
103  else if (mybit == "HBHEFlatNoise")
104  setBit(HcalCaloFlagLabels::HBHEFlatNoise, mydef.HBHEFlagMask);
105  else if (mybit == "HBHESpikeNoise")
106  setBit(HcalCaloFlagLabels::HBHESpikeNoise, mydef.HBHEFlagMask);
107  else if (mybit == "HBHETriangleNoise")
108  setBit(HcalCaloFlagLabels::HBHETriangleNoise, mydef.HBHEFlagMask);
109  else if (mybit == "HBHETS4TS5Noise")
110  setBit(HcalCaloFlagLabels::HBHETS4TS5Noise, mydef.HBHEFlagMask);
111  else if (mybit == "HBHENegativeNoise")
112  setBit(HcalCaloFlagLabels::HBHENegativeNoise, mydef.HBHEFlagMask);
113  else if (mybit == "HBHEPulseFitBit")
114  setBit(HcalCaloFlagLabels::HBHEPulseFitBit, mydef.HBHEFlagMask);
115  else if (mybit == "HBHEOOTPU")
116  setBit(HcalCaloFlagLabels::HBHEOOTPU, mydef.HBHEFlagMask);
117 
118  // These are multi-bit counters; we may have to revisit how to set them in the SLComputer in the future
119  else if (mybit == "HBHETimingTrustBits")
120  setBit(HcalCaloFlagLabels::HBHETimingTrustBits, mydef.HBHEFlagMask);
121  else if (mybit == "HBHETimingShapedCutsBits")
123  else if (mybit == "HBHEIsolatedNoise")
124  setBit(HcalCaloFlagLabels::HBHEIsolatedNoise, mydef.HBHEFlagMask);
125 
126  // HO ++++++++++++++++++++
127  else if (mybit == "HOBit")
128  setBit(HcalCaloFlagLabels::HOBit, mydef.HOFlagMask);
129 
130  // HF ++++++++++++++++++++
131  else if (mybit == "HFLongShort")
132  setBit(HcalCaloFlagLabels::HFLongShort, mydef.HFFlagMask);
133  else if (mybit == "HFDigiTime")
134  setBit(HcalCaloFlagLabels::HFDigiTime, mydef.HFFlagMask);
135  else if (mybit == "HFInTimeWindow")
136  setBit(HcalCaloFlagLabels::HFInTimeWindow, mydef.HFFlagMask);
137  else if (mybit == "HFS8S1Ratio")
138  setBit(HcalCaloFlagLabels::HFS8S1Ratio, mydef.HFFlagMask);
139  else if (mybit == "HFPET")
140  setBit(HcalCaloFlagLabels::HFPET, mydef.HFFlagMask);
141  else if (mybit == "HFTimingTrustBits")
142  setBit(HcalCaloFlagLabels::HFTimingTrustBits, mydef.HFFlagMask); // multi-bit counter
143 
144  // ZDC ++++++++++++++++++++
145  else if (mybit == "ZDCBit")
146  setBit(HcalCaloFlagLabels::ZDCBit, mydef.ZDCFlagMask);
147 
148  // Calib ++++++++++++++++++++
149  else if (mybit == "CalibrationBit")
150  setBit(HcalCaloFlagLabels::CalibrationBit, mydef.CalibFlagMask);
151 
152  // Common subdetector bits ++++++++++++++++++++++
153  else if (mybit == "TimingSubtractedBit")
155  else if (mybit == "TimingAddedBit")
157  else if (mybit == "TimingErrorBit")
159  else if (mybit == "ADCSaturationBit")
161  else if (mybit == "AddedSimHcalNoise")
163 
164  else if (mybit == "UserDefinedBit0")
166 
167  // additional defined diagnostic bits; not currently used for rejection
168  else if (mybit == "PresampleADC")
170  else if (mybit == "Fraction2TS")
172  mydef); // should deprecate this at some point; it's been replaced by PresampleADC
173 
174  // unknown -------------------
175  else {
176  // error: unrecognized flag name
177  edm::LogWarning("HcalSeverityLevelComputer")
178  << "HcalSeverityLevelComputer: Error: RecHitFlag >>" << mybit << "<< unknown. Ignoring.";
179  return false;
180  }
181  }
182  return true;
183 }
void setBit(const unsigned bitnumber, uint32_t &where)
Log< level::Warning, false > LogWarning
void setAllRHMasks(const unsigned bitnumber, HcalSeverityDefinition &mydef)

◆ getSeverityLevel()

int HcalSeverityLevelComputer::getSeverityLevel ( const DetId myid,
const uint32_t &  myflag,
const uint32_t &  mystatus 
) const

Definition at line 304 of file HcalSeverityLevelComputer.cc.

References HcalGenericDetId::genericSubdet(), HcalGenericDetId::HcalGenBarrel, HcalGenericDetId::HcalGenCalibration, HcalGenericDetId::HcalGenEndcap, HcalGenericDetId::HcalGenForward, HcalGenericDetId::HcalGenOuter, HcalGenericDetId::HcalGenZDC, mps_fire::i, dqmiolumiharvest::j, and SevDef.

Referenced by muonisolation::CaloExtractorByAssociator::deposits(), AlCaHOCalibProducer::fillHOStore(), reco::HcalNoiseInfoProducer::fillrechits(), EgammaHcalIsolation::goodHitEnergy(), CaloTowersCreationAlgo::hcalChanStatusForCaloTower(), HcalRecHitsAnalyzer::hcalSevLvl(), HcalHF_PETalgorithm::HFSetFlagFromPET(), HcalHF_S9S1algorithm::HFSetFlagFromS9S1(), HcalHitSelection::skim(), PFRecHitQTestHCALChannel::test(), and ObjectValidator::validHit().

306  {
307  uint32_t myRecHitMask;
308  HcalGenericDetId myId(myid);
309  HcalGenericDetId::HcalGenericSubdetector mysubdet = myId.genericSubdet();
310 
311  // for (unsigned i=(SevDef.size()-1); i >= 0; i--) // Wrong
312  // Since i is unsigned, i >= 0 is always true,
313  // and the loop termination condition is never reached.
314  // We offset the loop index by one to fix this.
315  for (size_t j = (SevDef.size()); j > 0; j--) {
316  size_t i = j - 1;
317  switch (mysubdet) {
320  myRecHitMask = SevDef[i].HBHEFlagMask;
321  break;
323  myRecHitMask = SevDef[i].HOFlagMask;
324  break;
326  myRecHitMask = SevDef[i].HFFlagMask;
327  break;
329  myRecHitMask = SevDef[i].ZDCFlagMask;
330  break;
332  myRecHitMask = SevDef[i].CalibFlagMask;
333  break;
334  default:
335  myRecHitMask = 0;
336  }
337 
338  // for debugging:
339  // std::cout << std::hex << " SLD: RHMask 0x" << myRecHitMask
340  // << " chstmask 0x" << SevDef[i].chStatusMask
341  // << " RHmask & myflag 0x" << (myRecHitMask&myflag)
342  // << " chstmask & mystatus 0x" << (SevDef[i].chStatusMask&mystatus)
343  // << std::dec << " level = " << SevDef[i].sevLevel << std::endl;
344 
345  // true if:
346  // rechitmask empty and chstatusmask empty
347  // rechitmask empty and chstatusmask&mychstat true
348  // chstatusmask empty and rechitmask&myflag true
349  // rechitmask&myflag true OR chstatusmask&mychstat true
350 
351  // if ( ( ( (!myRecHitMask) || (myRecHitMask & myflag) ) &&
352  if ((((!SevDef[i].HBHEFlagMask && !SevDef[i].HOFlagMask && !SevDef[i].HFFlagMask && !SevDef[i].ZDCFlagMask &&
353  !SevDef[i].CalibFlagMask) ||
354  (myRecHitMask & myflag)) &&
355  ((!SevDef[i].chStatusMask) || (SevDef[i].chStatusMask & mystatus))) ||
356  ((myRecHitMask & myflag) || (SevDef[i].chStatusMask & mystatus)))
357  return SevDef[i].sevLevel;
358  }
359 
360  return -100; // default value, if no definition applies
361 }
std::vector< HcalSeverityDefinition > SevDef

◆ recoveredRecHit()

bool HcalSeverityLevelComputer::recoveredRecHit ( const DetId myid,
const uint32_t &  myflag 
) const

Definition at line 363 of file HcalSeverityLevelComputer.cc.

References HcalSeverityLevelComputer::HcalSeverityDefinition::CalibFlagMask, HcalGenericDetId::genericSubdet(), HcalSeverityLevelComputer::HcalSeverityDefinition::HBHEFlagMask, HcalGenericDetId::HcalGenBarrel, HcalGenericDetId::HcalGenCalibration, HcalGenericDetId::HcalGenEndcap, HcalGenericDetId::HcalGenForward, HcalGenericDetId::HcalGenOuter, HcalGenericDetId::HcalGenZDC, HcalSeverityLevelComputer::HcalSeverityDefinition::HFFlagMask, HcalSeverityLevelComputer::HcalSeverityDefinition::HOFlagMask, RecoveredRecHit_, and HcalSeverityLevelComputer::HcalSeverityDefinition::ZDCFlagMask.

Referenced by muonisolation::CaloExtractorByAssociator::deposits(), reco::HcalNoiseInfoProducer::fillrechits(), EgammaHcalIsolation::goodHitEnergy(), CaloTowersCreationAlgo::hcalChanStatusForCaloTower(), and ObjectValidator::validHit().

363  {
364  uint32_t myRecHitMask;
365  HcalGenericDetId myId(myid);
366  HcalGenericDetId::HcalGenericSubdetector mysubdet = myId.genericSubdet();
367 
368  switch (mysubdet) {
371  myRecHitMask = RecoveredRecHit_->HBHEFlagMask;
372  break;
374  myRecHitMask = RecoveredRecHit_->HOFlagMask;
375  break;
377  myRecHitMask = RecoveredRecHit_->HFFlagMask;
378  break;
380  myRecHitMask = RecoveredRecHit_->ZDCFlagMask;
381  break;
383  myRecHitMask = RecoveredRecHit_->CalibFlagMask;
384  break;
385  default:
386  myRecHitMask = 0;
387  }
388 
389  if (myRecHitMask & myflag)
390  return true;
391 
392  return false;
393 }
HcalSeverityDefinition * RecoveredRecHit_

◆ setAllRHMasks()

void HcalSeverityLevelComputer::setAllRHMasks ( const unsigned  bitnumber,
HcalSeverityDefinition mydef 
)
private

Definition at line 407 of file HcalSeverityLevelComputer.cc.

References HcalSeverityLevelComputer::HcalSeverityDefinition::CalibFlagMask, HcalSeverityLevelComputer::HcalSeverityDefinition::HBHEFlagMask, HcalSeverityLevelComputer::HcalSeverityDefinition::HFFlagMask, HcalSeverityLevelComputer::HcalSeverityDefinition::HOFlagMask, setBit(), and HcalSeverityLevelComputer::HcalSeverityDefinition::ZDCFlagMask.

Referenced by getRecHitFlag().

407  {
408  setBit(bitnumber, mydef.HBHEFlagMask);
409  setBit(bitnumber, mydef.HOFlagMask);
410  setBit(bitnumber, mydef.HFFlagMask);
411  setBit(bitnumber, mydef.ZDCFlagMask);
412  setBit(bitnumber, mydef.CalibFlagMask);
413 }
void setBit(const unsigned bitnumber, uint32_t &where)

◆ setBit()

void HcalSeverityLevelComputer::setBit ( const unsigned  bitnumber,
uint32_t &  where 
)
private

Definition at line 402 of file HcalSeverityLevelComputer.cc.

Referenced by getChStBit(), getRecHitFlag(), and setAllRHMasks().

402  {
403  uint32_t statadd = 0x1 << (bitnumber);
404  where = where | statadd;
405 }

Friends And Related Function Documentation

◆ operator<<

std::ostream& operator<< ( std::ostream &  s,
const HcalSeverityLevelComputer::HcalSeverityDefinition def 
)
friend

Definition at line 415 of file HcalSeverityLevelComputer.cc.

415  {
416  s << "Hcal Severity Level Definition, Level = " << def.sevLevel << std::endl;
417  s << std::hex << std::showbase;
418  s << " channel status mask = " << def.chStatusMask << std::endl;
419  s << " HBHEFlagMask = " << def.HBHEFlagMask << std::endl;
420  s << " HOFlagMask = " << def.HOFlagMask << std::endl;
421  s << " HFFlagMask = " << def.HFFlagMask << std::endl;
422  s << " ZDCFlagMask = " << def.ZDCFlagMask << std::endl;
423  s << " CalibFlagMask = " << def.CalibFlagMask << std::dec << std::noshowbase << std::endl;
424  return s;
425 }
int def(FILE *, FILE *, int)

Member Data Documentation

◆ DropChannel_

HcalSeverityDefinition* HcalSeverityLevelComputer::DropChannel_
private

◆ RecoveredRecHit_

HcalSeverityDefinition* HcalSeverityLevelComputer::RecoveredRecHit_
private

◆ SevDef

std::vector<HcalSeverityDefinition> HcalSeverityLevelComputer::SevDef
private

Definition at line 54 of file HcalSeverityLevelComputer.h.

Referenced by getSeverityLevel(), and HcalSeverityLevelComputer().