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;
239 const uint32_t& mystatus)
const 241 uint32_t myRecHitMask;
249 for (
size_t j=(
SevDef.size()); j > 0; j--)
255 myRecHitMask =
SevDef[
i].HBHEFlagMask;
break;
260 default: myRecHitMask = 0;
278 if ( ( ( ( !
SevDef[i].HBHEFlagMask
282 && !
SevDef[i].CalibFlagMask )
283 || (myRecHitMask & myflag) )
284 && ( (!
SevDef[
i].chStatusMask) || (
SevDef[i].chStatusMask & mystatus) ) )
285 || ( (myRecHitMask & myflag) || (
SevDef[i].chStatusMask & mystatus) ) )
295 uint32_t myRecHitMask;
307 default: myRecHitMask = 0;
310 if (myRecHitMask & myflag)
326 uint32_t statadd = 0x1<<(bitnumber);
327 where = where|statadd;
341 s <<
"Hcal Severity Level Definition, Level = " << def.
sevLevel << std::endl;
342 s << std::hex << std::showbase;
343 s <<
" channel status mask = " << def.
chStatusMask << std::endl;
344 s <<
" HBHEFlagMask = " << def.
HBHEFlagMask << std::endl;
345 s <<
" HOFlagMask = " << def.
HOFlagMask << std::endl;
346 s <<
" HFFlagMask = " << def.
HFFlagMask << std::endl;
347 s <<
" ZDCFlagMask = " << def.
ZDCFlagMask << std::endl;
T getParameter(std::string const &) const
HcalSeverityLevelComputer(const edm::ParameterSet &)
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_
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)