27 <<
"HcalSeverityLevelComputer: Error: ChannelStatusFlag >>" << mybit
28 <<
"<< unknown. Ignoring.";
94 <<
"HcalSeverityLevelComputer: Error: RecHitFlag >>" << mybit
95 <<
"<< unknown. Ignoring.";
104 typedef std::vector< edm::ParameterSet > myParameters;
108 for ( myParameters::iterator itLevels = myLevels.begin(); itLevels != myLevels.end(); ++itLevels)
114 mydef.
sevLevel = itLevels->getParameter<
int>(
"Level");
117 std::vector<std::string> myRecHitFlags =
118 itLevels->getParameter<std::vector <std::string> > (
"RecHitFlags");
121 std::vector<std::string> myChStatuses =
122 itLevels->getParameter<std::vector <std::string> > (
"ChannelStatus");
126 unsigned int bvalid = 0;
127 unsigned int bnonempty = 0;
129 for (
unsigned k=0;
k < myChStatuses.size();
k++)
131 if (myChStatuses[
k].
empty())
break;
137 for (
unsigned k=0;
k < myRecHitFlags.size();
k++)
139 if (myRecHitFlags[
k].
empty())
break;
148 if ((!bvalid) && (bnonempty))
151 <<
"Warning: level " << mydef.
sevLevel
152 <<
" consists of invalid definitions only: "
154 <<
" Ignoring definition.";
159 std::vector<HcalSeverityDefinition>::iterator it =
SevDef.begin();
163 if (it ==
SevDef.end()) {
SevDef.push_back(mydef);
break; }
168 <<
"HcalSeverityLevelComputer: Warning: level " << mydef.
sevLevel
169 <<
" already defined. Ignoring new definition.";
174 if (( (it+1) ==
SevDef.end()) || ( (it+1)->sevLevel > mydef.
sevLevel ))
176 SevDef.insert(it+1, mydef);
182 while(it !=
SevDef.end());
187 <<
"HcalSeverityLevelComputer - Summary of Severity Levels:" << std::endl;
188 for (std::vector<HcalSeverityDefinition>::iterator it =
SevDef.begin(); it !=
SevDef.end(); it++)
192 << (*it) << std::endl;
198 std::vector<std::string> myRecovered =
199 iConfig.
getParameter<std::vector <std::string> > (
"RecoveredRecHitBits");
201 for (
unsigned k=0;
k < myRecovered.size();
k++)
203 if (myRecovered[
k].
empty())
break;
210 std::vector<std::string> myDrop =
211 iConfig.
getParameter<std::vector <std::string> > (
"DropChannelStatusBits");
213 for (
unsigned k=0;
k < myDrop.size();
k++)
215 if (myDrop[
k].
empty())
break;
220 <<
"HcalSeverityLevelComputer - Summary for Recovered RecHit bits: \n"
221 << (*RecoveredRecHit_) << std::endl
222 <<
"HcalSeverityLevelComputer - Summary for Drop the Channel bits: \n"
223 << (*DropChannel_) << std::endl;
233 const uint32_t& mystatus)
const
235 uint32_t myRecHitMask;
243 for (
size_t j=(
SevDef.size());
j > 0;
j--)
249 myRecHitMask =
SevDef[
i].HBHEFlagMask;
break;
254 default: myRecHitMask = 0;
272 if ( ( ( ( !
SevDef[i].HBHEFlagMask
276 && !
SevDef[i].CalibFlagMask )
277 || (myRecHitMask & myflag) )
278 && ( (!
SevDef[
i].chStatusMask) || (
SevDef[i].chStatusMask & mystatus) ) )
279 || ( (myRecHitMask & myflag) || (
SevDef[i].chStatusMask & mystatus) ) )
289 uint32_t myRecHitMask;
301 default: myRecHitMask = 0;
304 if (myRecHitMask & myflag)
320 uint32_t statadd = 0x1<<(bitnumber);
321 where = where|statadd;
335 s <<
"Hcal Severity Level Definition, Level = " << def.
sevLevel << std::endl;
336 s << std::hex << std::showbase;
337 s <<
" channel status mask = " << def.
chStatusMask << std::endl;
338 s <<
" HBHEFlagMask = " << def.
HBHEFlagMask << std::endl;
339 s <<
" HOFlagMask = " << def.
HOFlagMask << std::endl;
340 s <<
" HFFlagMask = " << def.
HFFlagMask << std::endl;
341 s <<
" ZDCFlagMask = " << def.
ZDCFlagMask << std::endl;
342 s <<
" CalibFlagMask = " << def.
CalibFlagMask << std::dec << std::noshowbase << std::endl;
T getParameter(std::string const &) const
int def(FILE *, FILE *, int)
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)