27 <<
"HcalSeverityLevelComputer: Error: ChannelStatusFlag >>" << mybit
28 <<
"<< unknown. Ignoring.";
65 <<
"HcalSeverityLevelComputer: Error: RecHitFlag >>" << mybit
66 <<
"<< unknown. Ignoring.";
129 <<
"HcalSeverityLevelComputer: Error: RecHitFlag >>" << mybit
130 <<
"<< unknown. Ignoring.";
140 typedef std::vector< edm::ParameterSet > myParameters;
143 unsigned int phase_ = iConfig.
getParameter<
unsigned int>(
"phase");
146 for ( myParameters::iterator itLevels = myLevels.begin(); itLevels != myLevels.end(); ++itLevels)
152 mydef.
sevLevel = itLevels->getParameter<
int>(
"Level");
155 std::vector<std::string> myRecHitFlags =
156 itLevels->getParameter<std::vector <std::string> > (
"RecHitFlags");
159 std::vector<std::string> myChStatuses =
160 itLevels->getParameter<std::vector <std::string> > (
"ChannelStatus");
164 unsigned int bvalid = 0;
165 unsigned int bnonempty = 0;
167 for (
unsigned k=0;
k < myChStatuses.size();
k++)
169 if (myChStatuses[
k].
empty())
break;
175 for (
unsigned k=0;
k < myRecHitFlags.size();
k++)
177 if (myRecHitFlags[
k].
empty())
break;
186 if ((!bvalid) && (bnonempty))
189 <<
"Warning: level " << mydef.
sevLevel 190 <<
" consists of invalid definitions only: " 192 <<
" Ignoring definition.";
197 std::vector<HcalSeverityDefinition>::iterator it =
SevDef.begin();
201 if (it ==
SevDef.end()) {
SevDef.push_back(mydef);
break; }
206 <<
"HcalSeverityLevelComputer: Warning: level " << mydef.
sevLevel 207 <<
" already defined. Ignoring new definition.";
212 if (( (it+1) ==
SevDef.end()) || ( (it+1)->sevLevel > mydef.
sevLevel ))
214 SevDef.insert(it+1, mydef);
220 while(it !=
SevDef.end());
225 <<
"HcalSeverityLevelComputer - Summary of Severity Levels:" << std::endl;
226 for (std::vector<HcalSeverityDefinition>::iterator it =
SevDef.begin(); it !=
SevDef.end(); it++)
230 << (*it) << std::endl;
236 std::vector<std::string> myRecovered =
237 iConfig.
getParameter<std::vector <std::string> > (
"RecoveredRecHitBits");
239 for (
unsigned k=0;
k < myRecovered.size();
k++)
241 if (myRecovered[
k].
empty())
break;
248 std::vector<std::string> myDrop =
249 iConfig.
getParameter<std::vector <std::string> > (
"DropChannelStatusBits");
251 for (
unsigned k=0;
k < myDrop.size();
k++)
253 if (myDrop[
k].
empty())
break;
258 <<
"HcalSeverityLevelComputer - Summary for Recovered RecHit bits: \n" 259 << (*RecoveredRecHit_) << std::endl
260 <<
"HcalSeverityLevelComputer - Summary for Drop the Channel bits: \n" 261 << (*DropChannel_) << std::endl;
275 const uint32_t& mystatus)
const 277 uint32_t myRecHitMask;
285 for (
size_t j=(
SevDef.size()); j > 0; j--)
291 myRecHitMask =
SevDef[
i].HBHEFlagMask;
break;
296 default: myRecHitMask = 0;
314 if ( ( ( ( !
SevDef[i].HBHEFlagMask
318 && !
SevDef[i].CalibFlagMask )
319 || (myRecHitMask & myflag) )
320 && ( (!
SevDef[
i].chStatusMask) || (
SevDef[i].chStatusMask & mystatus) ) )
321 || ( (myRecHitMask & myflag) || (
SevDef[i].chStatusMask & mystatus) ) )
331 uint32_t myRecHitMask;
343 default: myRecHitMask = 0;
346 if (myRecHitMask & myflag)
362 uint32_t statadd = 0x1<<(bitnumber);
363 where = where|statadd;
377 s <<
"Hcal Severity Level Definition, Level = " << def.
sevLevel << std::endl;
378 s << std::hex << std::showbase;
379 s <<
" channel status mask = " << def.
chStatusMask << std::endl;
380 s <<
" HBHEFlagMask = " << def.
HBHEFlagMask << std::endl;
381 s <<
" HOFlagMask = " << def.
HOFlagMask << std::endl;
382 s <<
" HFFlagMask = " << def.
HFFlagMask << std::endl;
383 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)