Skip to content

Commit 616db1d

Browse files
committed
ZDC: swap radius and angle bin when accessing light table
Solving a problem where negative light yield was observed
1 parent 8a4dfa3 commit 616db1d

1 file changed

Lines changed: 6 additions & 7 deletions

File tree

Detectors/ZDC/simulation/src/Detector.cxx

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -276,16 +276,15 @@ Bool_t Detector::ProcessHits(FairVolume* v)
276276
charge = TMath::Abs(pdgCode / 10000 - 100000);
277277
//look into the light tables
278278
if (mZDCdetectorID == 1 || mZDCdetectorID == 4) {
279-
if (iradius > Geometry::ZNFIBREDIAMETER)
280-
iradius = Geometry::ZNFIBREDIAMETER;
281-
lightoutput = charge * charge * mLightTableZN[ibeta][iangle][iradius];
279+
iradius = std::min((int)Geometry::ZNFIBREDIAMETER, iradius);
280+
lightoutput = charge * charge * mLightTableZN[ibeta][iradius][iangle];
282281
} else {
283-
if (iradius > Geometry::ZPFIBREDIAMETER)
284-
iradius = Geometry::ZPFIBREDIAMETER;
285-
lightoutput = charge * charge * mLightTableZP[ibeta][iangle][iradius];
282+
iradius = std::min((int)Geometry::ZPFIBREDIAMETER, iradius);
283+
lightoutput = charge * charge * mLightTableZP[ibeta][iradius][iangle];
286284
}
287-
if (lightoutput > 0)
285+
if (lightoutput > 0) {
288286
nphe = gRandom->Poisson(lightoutput);
287+
}
289288
}
290289
}
291290

0 commit comments

Comments
 (0)