Skip to content

Commit

Permalink
Merge pull request #46296 from matt2275/Fix_ZdcRecAlgo_CMSSW_14_1_X
Browse files Browse the repository at this point in the history
[14_1_X] Update ZdcSimpleRecAlgo_Run3.cc
  • Loading branch information
cmsbuild authored Oct 9, 2024
2 parents ee94214 + f787df2 commit 4bb35a4
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions RecoLocalCalo/HcalRecAlgos/src/ZdcSimpleRecAlgo_Run3.cc
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ ZDCRecHit ZdcSimpleRecAlgo_Run3::reco0(const QIE10DataFrame& digi,
double ta = 0;
double energySOIp1 = 0;
double ratioSOIp1 = -1.0;
double chargeWeightedTime = 0;
double chargeWeightedTime = -99.0;

double Allnoise = 0;
int noiseslices = 0;
Expand Down Expand Up @@ -223,9 +223,7 @@ ZDCRecHit ZdcSimpleRecAlgo_Run3::reco0(const QIE10DataFrame& digi,

double tmp_energy = 0;
double tmp_TSWeightedEnergy = 0;
for (int ts = 0; ts < nTs_; ++ts) {
if (CurrentTS >= digi_size)
continue;
for (int ts = 0; ts < digi_size; ++ts) {
int capid = digi[ts].capid();

// max sure there are no negative values in time calculation
Expand All @@ -237,7 +235,8 @@ ZDCRecHit ZdcSimpleRecAlgo_Run3::reco0(const QIE10DataFrame& digi,
}
}

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

Expand Down

0 comments on commit 4bb35a4

Please sign in to comment.