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

use QIEType instead of old transient qieIndex #13004

Merged
merged 1 commit into from Jan 27, 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
4 changes: 0 additions & 4 deletions CalibCalorimetry/HcalAlgos/src/HcalDbASCIIIO.cc
Expand Up @@ -1194,8 +1194,6 @@ bool HcalDbASCIIIO::getObject (std::istream& fInput, HcalQIEData* fObject) {
coder.setSlope (capid, range, atof (items [index++].c_str ()));
}
}
if (items.size()>36)
coder.setQIEIndex(atoi(items[index++].c_str()));

fObject->addCoder (coder);
// }
Expand Down Expand Up @@ -1234,8 +1232,6 @@ bool HcalDbASCIIIO::dumpObject (std::ostream& fOutput, const HcalQIEData& fObjec
fOutput << buffer;
}
}
sprintf (buffer, " %2d", coder->qieIndex());
fOutput << buffer;
fOutput << std::endl;
}
return true;
Expand Down
4 changes: 1 addition & 3 deletions CalibCalorimetry/HcalAlgos/src/HcalDbHardcode.cc
Expand Up @@ -551,10 +551,8 @@ HcalQIECoder HcalDbHardcode::makeQIECoder (HcalGenericDetId fId) {

// qie8/qie10 attribution - 0/1
if (fId.genericSubdet() == HcalGenericDetId::HcalGenOuter) {
result.setQIEIndex(0);
slope = 1.0;
} else
result.setQIEIndex(1);
}

for (unsigned range = 0; range < 4; range++) {
for (unsigned capid = 0; capid < 4; capid++) {
Expand Down
15 changes: 8 additions & 7 deletions CalibFormats/HcalObjects/src/HcalDbService.cc
Expand Up @@ -232,20 +232,21 @@ const HcalQIECoder* HcalDbService::getHcalCoder (const HcalGenericDetId& fId) co
}

const HcalQIEShape* HcalDbService::getHcalShape (const HcalGenericDetId& fId) const {
if (mQIEData) {
return &mQIEData->getShape (fId);
if (mQIEData && mQIETypes) {
//currently 3 types of QIEs exist: QIE8, QIE10, QIE11
int qieType = mQIETypes->getValues(fId)->getValue();
//QIE10 and QIE11 have same shape (ADC ladder)
if(qieType>0) qieType = 1;
return &mQIEData->getShape(qieType);
}
return 0;
}

const HcalQIEShape* HcalDbService::getHcalShape (const HcalQIECoder *coder) const {
if (mQIEData) {
return &mQIEData->getShape(coder);
}
return 0;
HcalGenericDetId fId(coder->rawId());
return getHcalShape(fId);
}


const HcalElectronicsMap* HcalDbService::getHcalMapping () const {
return mElectronicsMap;
}
Expand Down
6 changes: 1 addition & 5 deletions CondFormats/HcalObjects/interface/HcalQIECoder.h
Expand Up @@ -20,7 +20,7 @@ class HcalQIEShape;

class HcalQIECoder {
public:
HcalQIECoder (unsigned long fId = 0) : mId (fId), mQIEIndex(0) {}
HcalQIECoder (unsigned long fId = 0) : mId (fId) {}

/// ADC [0..127] + capid [0..3] -> fC conversion
float charge (const HcalQIEShape& fShape, unsigned fAdc, unsigned fCapId) const;
Expand All @@ -36,9 +36,6 @@ class HcalQIECoder {

uint32_t rawId () const {return mId;}

uint32_t qieIndex() const {return mQIEIndex;}
void setQIEIndex(uint32_t v) { mQIEIndex=v;}

private:
uint32_t mId;
float mOffset00;
Expand Down Expand Up @@ -73,7 +70,6 @@ class HcalQIECoder {
float mSlope31;
float mSlope32;
float mSlope33;
unsigned int mQIEIndex COND_TRANSIENT;

COND_SERIALIZABLE;
};
Expand Down
3 changes: 1 addition & 2 deletions CondFormats/HcalObjects/interface/HcalQIEData.h
Expand Up @@ -34,8 +34,7 @@ class HcalQIEData: public HcalCondObjectContainer<HcalQIECoder>
void setupShape();
/// get basic shape
// const HcalQIEShape& getShape () const {return mShape;}
const HcalQIEShape& getShape (DetId fId) const { return mShape[getCoder(fId)->qieIndex()];}
const HcalQIEShape& getShape (const HcalQIECoder* coder) const { return mShape[coder->qieIndex()];}
const HcalQIEShape& getShape (int qieType) const { return mShape[qieType];}
/// get QIE parameters
const HcalQIECoder* getCoder (DetId fId) const { return getValues(fId); }
// check if data are sorted - remove in the next version
Expand Down
1 change: 1 addition & 0 deletions CondFormats/HcalObjects/interface/HcalQIEShape.h
Expand Up @@ -27,6 +27,7 @@ class HcalQIEShape {
unsigned tmp = nbins_ == 32 ? (fAdc & 0x1f) : (fAdc & 0x3f) ;
return tmp;
}
unsigned nbins() const { return nbins_; }

protected:
private:
Expand Down
2 changes: 1 addition & 1 deletion CondFormats/HcalObjects/src/HcalQIECoder.cc
Expand Up @@ -28,7 +28,7 @@ unsigned HcalQIECoder::adc (const HcalQIEShape& fShape, float fCharge, unsigned
// search for the range
for (unsigned range = 0; range < 4; range++) {
float qieCharge = fCharge * slope (fCapId, range) + offset (fCapId, range);
unsigned nbin = 32 * (mQIEIndex+1); // it's just 64 = 2*32 !
unsigned nbin = fShape.nbins(); // it's just 64 = 2*32 ! (for QIE10)
unsigned minBin = nbin * range;
unsigned maxBin = minBin + nbin - 1;
float qieChargeMax = fShape.highEdge (maxBin);
Expand Down