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] Update ZdcSimpleRecAlgo_Run3.cc #46296

Merged
merged 1 commit into from
Oct 9, 2024
Merged
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
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