Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

QIE10 bug fixes (backport) #13833

Merged
merged 3 commits into from Apr 6, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions CalibFormats/HcalObjects/src/HcalCoderDb.cc
Expand Up @@ -25,6 +25,7 @@ template <> void HcalCoderDb::adc2fC_<QIE10DataFrame> (const QIE10DataFrame& df,
clf=CaloSamples(df.id(),df.samples());
for (int i=0; i<df.samples(); i++) {
clf[i]=mCoder->charge (*mShape, df[i].adc (), df[i].capid ());
if(df[i].soi()) clf.setPresamples(i);
}
}

Expand Down
5 changes: 4 additions & 1 deletion CondFormats/HcalObjects/interface/HcalQIEShape.h
Expand Up @@ -22,7 +22,10 @@ class HcalQIEShape {
float highEdge (unsigned fAdc) const;
float center (unsigned fAdc) const;
bool setLowEdges (unsigned int nVals, const float *fValue);
unsigned range (unsigned fAdc) const {return (fAdc >> 5) & 0x3;}
unsigned range (unsigned fAdc) const {
//6 bit mantissa in QIE10, 5 in QIE8
return (nbins_ == 32) ? (fAdc >> 5) & 0x3 : (fAdc >> 6) & 0x3;
}
unsigned local (unsigned fAdc) const {
unsigned tmp = nbins_ == 32 ? (fAdc & 0x1f) : (fAdc & 0x3f) ;
return tmp;
Expand Down
3 changes: 2 additions & 1 deletion CondFormats/HcalObjects/src/HcalQIEShape.cc
Expand Up @@ -21,7 +21,8 @@ void HcalQIEShape::expand () {
int factor = nbins_ == 32 ? 5 : 8; // QIE8/QIE10 -> 5/8
scale *= factor;
unsigned index = range * nbins_;
mValues [index] = mValues [index - 2]; // link to previous range
unsigned overlap = (nbins_ == 32) ? 2 : 3; // QIE10 -> 3 bin overlap
mValues [index] = mValues [index - overlap]; // link to previous range
for (unsigned i = 1; i < nbins_; i++) {
mValues [index + i] = mValues [index + i - 1] + scale * (mValues [i] - mValues [i - 1]);
}
Expand Down