Skip to content

Commit

Permalink
Merge pull request cms-sw#128 from jbsauvan/fix-frontend-calib-bc
Browse files Browse the repository at this point in the history
Add missing energy equalization in BestChoice codec
  • Loading branch information
jbsauvan committed Jul 13, 2017
2 parents 72ba167 + 2efc0f3 commit c9f647c
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
Expand Up @@ -70,6 +70,7 @@ class HGCalTriggerCellBestChoiceCodecImpl
double tdcLSB_;
uint32_t triggerCellTruncationBits_;
uint32_t triggerCellSaturationBits_;
std::vector<double> thickness_corrections_;

};

Expand Down
Expand Up @@ -13,7 +13,8 @@ HGCalTriggerCellBestChoiceCodecImpl(const edm::ParameterSet& conf) :
tdcsaturation_(conf.getParameter<double>("tdcsaturation")),
tdcnBits_(conf.getParameter<uint32_t>("tdcnBits")),
tdcOnsetfC_(conf.getParameter<double>("tdcOnsetfC")),
triggerCellTruncationBits_(conf.getParameter<uint32_t>("triggerCellTruncationBits"))
triggerCellTruncationBits_(conf.getParameter<uint32_t>("triggerCellTruncationBits")),
thickness_corrections_(conf.getParameter<std::vector<double>>("ThicknessCorrections"))
{
// Cannot have more selected cells than the max number of cells
if(nData_>nCellsInModule_) nData_ = nCellsInModule_;
Expand Down Expand Up @@ -181,6 +182,21 @@ triggerCellSums(const HGCalTriggerGeometryBase& geometry, const std::vector<std
HGCalDetId triggercellid( tcid );
payload.insert( std::make_pair(triggercellid, 0) ); // do nothing if key exists already
uint32_t value = frame.second;
// equalize value among cell thicknesses
int thickness = 0;
switch(cellid.subdetId())
{
case ForwardSubdetector::HGCEE:
thickness = geometry.cellInfo().topo_ee->dddConstants().waferTypeL(cellid.wafer())-1;
break;
case ForwardSubdetector::HGCHEF:
thickness = geometry.cellInfo().topo_fh->dddConstants().waferTypeL(cellid.wafer())-1;
break;
default:
break;
};
double thickness_correction = thickness_corrections_.at(thickness);
value = (double)value*thickness_correction;
payload[triggercellid] += value; // 32 bits integer should be largely enough

}
Expand Down

0 comments on commit c9f647c

Please sign in to comment.