27 <<
"HcalSeverityLevelComputer: Error: ChannelStatusFlag >>" << mybit
28 <<
"<< unknown. Ignoring.";
66 <<
"HcalSeverityLevelComputer: Error: RecHitFlag >>" << mybit
67 <<
"<< unknown. Ignoring.";
130 <<
"HcalSeverityLevelComputer: Error: RecHitFlag >>" << mybit
131 <<
"<< unknown. Ignoring.";
141 typedef std::vector< edm::ParameterSet > myParameters;
144 unsigned int phase_ = iConfig.
getParameter<
unsigned int>(
"phase");
147 for ( myParameters::iterator itLevels = myLevels.begin(); itLevels != myLevels.end(); ++itLevels)
153 mydef.
sevLevel = itLevels->getParameter<
int>(
"Level");
156 std::vector<std::string> myRecHitFlags =
157 itLevels->getParameter<std::vector <std::string> > (
"RecHitFlags");
160 std::vector<std::string> myChStatuses =
161 itLevels->getParameter<std::vector <std::string> > (
"ChannelStatus");
165 unsigned int bvalid = 0;
166 unsigned int bnonempty = 0;
168 for (
unsigned k=0;
k < myChStatuses.size();
k++)
170 if (myChStatuses[
k].
empty())
break;
176 for (
unsigned k=0;
k < myRecHitFlags.size();
k++)
178 if (myRecHitFlags[
k].
empty())
break;
187 if ((!bvalid) && (bnonempty))
190 <<
"Warning: level " << mydef.
sevLevel 191 <<
" consists of invalid definitions only: " 193 <<
" Ignoring definition.";
198 std::vector<HcalSeverityDefinition>::iterator it =
SevDef.begin();
202 if (it ==
SevDef.end()) {
SevDef.push_back(mydef);
break; }
207 <<
"HcalSeverityLevelComputer: Warning: level " << mydef.
sevLevel 208 <<
" already defined. Ignoring new definition.";
213 if (( (it+1) ==
SevDef.end()) || ( (it+1)->sevLevel > mydef.
sevLevel ))
215 SevDef.insert(it+1, mydef);
221 while(it !=
SevDef.end());
226 <<
"HcalSeverityLevelComputer - Summary of Severity Levels:" << std::endl;
227 for (std::vector<HcalSeverityDefinition>::iterator it =
SevDef.begin(); it !=
SevDef.end(); it++)
231 << (*it) << std::endl;
237 std::vector<std::string> myRecovered =
238 iConfig.
getParameter<std::vector <std::string> > (
"RecoveredRecHitBits");
240 for (
unsigned k=0;
k < myRecovered.size();
k++)
242 if (myRecovered[
k].
empty())
break;
249 std::vector<std::string> myDrop =
250 iConfig.
getParameter<std::vector <std::string> > (
"DropChannelStatusBits");
252 for (
unsigned k=0;
k < myDrop.size();
k++)
254 if (myDrop[
k].
empty())
break;
259 <<
"HcalSeverityLevelComputer - Summary for Recovered RecHit bits: \n" 260 << (*RecoveredRecHit_) << std::endl
261 <<
"HcalSeverityLevelComputer - Summary for Drop the Channel bits: \n" 262 << (*DropChannel_) << std::endl;
276 const uint32_t& mystatus)
const 278 uint32_t myRecHitMask;
286 for (
size_t j=(
SevDef.size()); j > 0; j--)
292 myRecHitMask =
SevDef[
i].HBHEFlagMask;
break;
297 default: myRecHitMask = 0;
315 if ( ( ( ( !
SevDef[i].HBHEFlagMask
319 && !
SevDef[i].CalibFlagMask )
320 || (myRecHitMask & myflag) )
321 && ( (!
SevDef[
i].chStatusMask) || (
SevDef[i].chStatusMask & mystatus) ) )
322 || ( (myRecHitMask & myflag) || (
SevDef[i].chStatusMask & mystatus) ) )
332 uint32_t myRecHitMask;
344 default: myRecHitMask = 0;
347 if (myRecHitMask & myflag)
363 uint32_t statadd = 0x1<<(bitnumber);
364 where = where|statadd;
378 s <<
"Hcal Severity Level Definition, Level = " << def.
sevLevel << std::endl;
379 s << std::hex << std::showbase;
380 s <<
" channel status mask = " << def.
chStatusMask << std::endl;
381 s <<
" HBHEFlagMask = " << def.
HBHEFlagMask << std::endl;
382 s <<
" HOFlagMask = " << def.
HOFlagMask << std::endl;
383 s <<
" HFFlagMask = " << def.
HFFlagMask << std::endl;
384 s <<
" ZDCFlagMask = " << def.
ZDCFlagMask << std::endl;
T getParameter(std::string const &) const
HcalSeverityLevelComputer(const edm::ParameterSet &)
bool getRecHitFlag(HcalSeverityDefinition &mydef, const std::string &mybit, int phase_)
friend std::ostream & operator<<(std::ostream &s, const HcalSeverityLevelComputer::HcalSeverityDefinition &def)
~HcalSeverityLevelComputer()
std::vector< HcalSeverityDefinition > SevDef
bool recoveredRecHit(const DetId &myid, const uint32_t &myflag) const
bool dropChannel(const uint32_t &mystatus) const
HcalSeverityDefinition * RecoveredRecHit_
int getSeverityLevel(const DetId &myid, const uint32_t &myflag, const uint32_t &mystatus) const
void setBit(const unsigned bitnumber, uint32_t &where)
HcalSeverityDefinition * DropChannel_
HcalGenericSubdetector genericSubdet() const
void setAllRHMasks(const unsigned bitnumber, HcalSeverityDefinition &mydef)
bool getChStBit(HcalSeverityDefinition &mydef, const std::string &mybit)