Skip to content

Commit

Permalink
Merge pull request #16011 from matz-e/hcal-tp-2017-hardcode
Browse files Browse the repository at this point in the history
Update hardcoded LutMetadata for HCAL TP
  • Loading branch information
davidlange6 committed Oct 6, 2016
2 parents 451d32d + 7ac719b commit f3a1e12
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 15 deletions.
2 changes: 1 addition & 1 deletion CalibCalorimetry/HcalAlgos/src/HcalDbHardcode.cc
Expand Up @@ -611,5 +611,5 @@ void HcalDbHardcode::makeHardcodeTPParameters (HcalTPParameters& tppar) {
// Parameters for a given TP algorithm:
// FineGrain Algorithm Version for HBHE, ADC threshold fof TDC mask of HF,
// TDC mask for HF, Self Trigger bits, auxiliary words
tppar.loadObject(0,0,0xFFFFFFFFFFFFFFF,0,0,0);
tppar.loadObject(0,0,0xFFFFFFFFFFFFFFFF,0,0,0);
}
50 changes: 36 additions & 14 deletions CalibCalorimetry/HcalPlugins/src/HcalHardcodeCalibrations.cc
Expand Up @@ -593,22 +593,44 @@ std::unique_ptr<HcalLutMetadata> HcalHardcodeCalibrations::produceLutMetadata (c
auto result = std::make_unique<HcalLutMetadata>(topo);

result->setRctLsb( 0.5 );
result->setNominalGain(0.003333); // for HBHE SiPMs
result->setNominalGain(0.177); // for HBHE SiPMs

std::vector <HcalGenericDetId> cells = allCells(*topo);
for (std::vector <HcalGenericDetId>::const_iterator cell = cells.begin (); cell != cells.end (); ++cell) {

/*
if (cell->isHcalTrigTowerDetId()) {
HcalTrigTowerDetId ht = HcalTrigTowerDetId(*cell);
int ieta = ht.ieta();
int iphi = ht.iphi();
std::cout << " HcalTrigTower cell (ieta,iphi) = "
<< ieta << ", " << iphi << std::endl;
}
*/

HcalLutMetadatum item(cell->rawId(),1.0,1,1);
for (const auto& cell: cells) {
float rcalib = 1.;
int granularity = 1;
int threshold = 1;

if (dbHardcode.useHEUpgrade() or dbHardcode.useHFUpgrade()) {
// Use values from 2016 as starting conditions for 2017+. These are
// averaged over the subdetectors, with the last two HE towers split
// off due to diverging correction values.
switch (cell.genericSubdet()) {
case HcalGenericDetId::HcalGenBarrel:
rcalib = 1.128;
break;
case HcalGenericDetId::HcalGenEndcap:
{
HcalDetId id(cell);
if (id.ietaAbs() >= 28)
rcalib = 1.188;
else
rcalib = 1.117;
}
break;
case HcalGenericDetId::HcalGenForward:
rcalib = 1.02;
break;
default:
break;
}

if (cell.isHcalTrigTowerDetId()) {
rcalib = 0.;
}
}

HcalLutMetadatum item(cell.rawId(), rcalib, granularity, threshold);
result->addValues(item);
}

Expand Down

0 comments on commit f3a1e12

Please sign in to comment.