27 <<
"HcalSeverityLevelComputer: Error: ChannelStatusFlag >>" << mybit
28 <<
"<< unknown. Ignoring.";
96 <<
"HcalSeverityLevelComputer: Error: RecHitFlag >>" << mybit
97 <<
"<< unknown. Ignoring.";
106 typedef std::vector< edm::ParameterSet > myParameters;
110 for ( myParameters::iterator itLevels = myLevels.begin(); itLevels != myLevels.end(); ++itLevels)
116 mydef.
sevLevel = itLevels->getParameter<
int>(
"Level");
119 std::vector<std::string> myRecHitFlags =
120 itLevels->getParameter<std::vector <std::string> > (
"RecHitFlags");
123 std::vector<std::string> myChStatuses =
124 itLevels->getParameter<std::vector <std::string> > (
"ChannelStatus");
128 unsigned int bvalid = 0;
129 unsigned int bnonempty = 0;
131 for (
unsigned k=0;
k < myChStatuses.size();
k++)
133 if (myChStatuses[
k].
empty())
break;
139 for (
unsigned k=0;
k < myRecHitFlags.size();
k++)
141 if (myRecHitFlags[
k].
empty())
break;
150 if ((!bvalid) && (bnonempty))
153 <<
"Warning: level " << mydef.
sevLevel
154 <<
" consists of invalid definitions only: "
156 <<
" Ignoring definition.";
161 std::vector<HcalSeverityDefinition>::iterator it =
SevDef.begin();
165 if (it ==
SevDef.end()) {
SevDef.push_back(mydef);
break; }
170 <<
"HcalSeverityLevelComputer: Warning: level " << mydef.
sevLevel
171 <<
" already defined. Ignoring new definition.";
176 if (( (it+1) ==
SevDef.end()) || ( (it+1)->sevLevel > mydef.
sevLevel ))
178 SevDef.insert(it+1, mydef);
184 while(it !=
SevDef.end());
189 <<
"HcalSeverityLevelComputer - Summary of Severity Levels:" << std::endl;
190 for (std::vector<HcalSeverityDefinition>::iterator it =
SevDef.begin(); it !=
SevDef.end(); it++)
194 << (*it) << std::endl;
200 std::vector<std::string> myRecovered =
201 iConfig.
getParameter<std::vector <std::string> > (
"RecoveredRecHitBits");
203 for (
unsigned k=0;
k < myRecovered.size();
k++)
205 if (myRecovered[
k].
empty())
break;
212 std::vector<std::string> myDrop =
213 iConfig.
getParameter<std::vector <std::string> > (
"DropChannelStatusBits");
215 for (
unsigned k=0;
k < myDrop.size();
k++)
217 if (myDrop[
k].
empty())
break;
222 <<
"HcalSeverityLevelComputer - Summary for Recovered RecHit bits: \n"
223 << (*RecoveredRecHit_) << std::endl
224 <<
"HcalSeverityLevelComputer - Summary for Drop the Channel bits: \n"
225 << (*DropChannel_) << std::endl;
235 const uint32_t& mystatus)
const
237 uint32_t myRecHitMask;
245 for (
size_t j=(
SevDef.size());
j > 0;
j--)
251 myRecHitMask =
SevDef[
i].HBHEFlagMask;
break;
256 default: myRecHitMask = 0;
274 if ( ( ( ( !
SevDef[i].HBHEFlagMask
278 && !
SevDef[i].CalibFlagMask )
279 || (myRecHitMask & myflag) )
280 && ( (!
SevDef[
i].chStatusMask) || (
SevDef[i].chStatusMask & mystatus) ) )
281 || ( (myRecHitMask & myflag) || (
SevDef[i].chStatusMask & mystatus) ) )
291 uint32_t myRecHitMask;
303 default: myRecHitMask = 0;
306 if (myRecHitMask & myflag)
322 uint32_t statadd = 0x1<<(bitnumber);
323 where = where|statadd;
337 s <<
"Hcal Severity Level Definition, Level = " << def.
sevLevel << std::endl;
338 s << std::hex << std::showbase;
339 s <<
" channel status mask = " << def.
chStatusMask << std::endl;
340 s <<
" HBHEFlagMask = " << def.
HBHEFlagMask << std::endl;
341 s <<
" HOFlagMask = " << def.
HOFlagMask << std::endl;
342 s <<
" HFFlagMask = " << def.
HFFlagMask << std::endl;
343 s <<
" ZDCFlagMask = " << def.
ZDCFlagMask << std::endl;
T getParameter(std::string const &) const
HcalSeverityLevelComputer(const edm::ParameterSet &)
std::ostream & operator<<(std::ostream &out, const ALILine &li)
~HcalSeverityLevelComputer()
std::vector< HcalSeverityDefinition > SevDef
bool recoveredRecHit(const DetId &myid, const uint32_t &myflag) const
bool dropChannel(const uint32_t &mystatus) const
HcalSeverityDefinition * RecoveredRecHit_
bool getRecHitFlag(HcalSeverityDefinition &mydef, const std::string &mybit)
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)