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

[14_1_X] ZDC Reconstruction Bug Fixes #46431

Merged
merged 1 commit into from
Oct 19, 2024
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions RecoLocalCalo/HcalRecAlgos/src/ZdcSimpleRecAlgo_Run3.cc
Original file line number Diff line number Diff line change
Expand Up @@ -231,22 +231,23 @@ ZDCRecHit ZdcSimpleRecAlgo_Run3::reco0(const QIE10DataFrame& digi,
ta *= calibs.respcorrgain(capid); // fC --> GeV
if (ta > 0) {
tmp_energy += ta;
tmp_TSWeightedEnergy += (ts + 1) * ta;
tmp_TSWeightedEnergy += (ts)*ta;
}
}

if (tmp_energy > 0)
chargeWeightedTime = (tmp_TSWeightedEnergy / tmp_energy - 1) * 25.0;
chargeWeightedTime = (tmp_TSWeightedEnergy / tmp_energy) * 25.0;
auto rh = ZDCRecHit(digi.id(), ampl, time, -99);
rh.setEnergySOIp1(energySOIp1);

if (maxI >= 0 && maxI < tool.size()) {
float tmp_tdctime = 0;
int le_tdc = digi[maxI].le_tdc();
// TDC error codes will be 60=-1, 61 = -2, 62 = -3, 63 = -4
if (digi[maxI].le_tdc() >= 60)
tmp_tdctime = -1 * (digi[maxI].le_tdc() - 59);
if (le_tdc >= 60)
tmp_tdctime = -1 * (le_tdc - 59);
else
tmp_tdctime = maxI * 25. + (digi[maxI].le_tdc() / 2);
tmp_tdctime = maxI * 25. + (le_tdc / 2.0);
rh.setTDCtime(tmp_tdctime);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,9 @@

#include <vector>
namespace zdchelper {
void setZDCSaturation(ZDCRecHit rh, QIE10DataFrame& digi, int maxValue) {
for (auto it = digi.begin(); it != digi.end(); it++) {
QIE10DataFrame::Sample sample = QIE10DataFrame::Sample(*it);
if (sample.adc() >= maxValue) {
void setZDCSaturation(ZDCRecHit& rh, QIE10DataFrame& digi, int maxValue) {
for (int i = 0; i < digi.samples(); i++) {
if (digi[i].adc() >= maxValue) {
rh.setFlagField(1, HcalCaloFlagLabels::ADCSaturationBit);
break;
}
Expand All @@ -30,7 +29,6 @@ namespace zdchelper {

} // namespace zdchelper

/* Zdc Hit reconstructor allows for CaloRecHits with status words */
ZdcHitReconstructor_Run3::ZdcHitReconstructor_Run3(edm::ParameterSet const& conf)

: reco_(conf.getParameter<int>("recoMethod")),
Expand Down Expand Up @@ -227,7 +225,7 @@ void ZdcHitReconstructor_Run3::fillDescriptions(edm::ConfigurationDescriptions&
{
1,
});
desc.add<bool>("setSaturationFlags", false);
desc.add<bool>("setSaturationFlags", true);
{
edm::ParameterSetDescription psd0;
psd0.add<int>("maxADCvalue", 255);
Expand Down