Skip to content

Commit 69fdbb6

Browse files
authored
fix to avoid calling undefined histograms (#6849)
1 parent aaf01c2 commit 69fdbb6

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

PWGUD/Tasks/upcTauCentralBarrelRL.cxx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2206,7 +2206,7 @@ struct UpcTauCentralBarrelRL {
22062206
histos.get<TH2>(HIST("EventTwoTracks/TwoElectrons/PID/hTOFnSigmaVsP"))->Fill(daug[0].P(), trkDaug1.tofNSigmaEl());
22072207
}
22082208
}
2209-
if (countPVGTmuonsSelection == 2) {
2209+
if (countPVGTmuonsSelection == 2 && doMuonStudy) {
22102210
histos.get<TH2>(HIST("EventTwoTracks/MuonsSelection/PID/hTPCsignalVsP"))->Fill(daug[0].P(), trkDaug1.tpcSignal());
22112211
histos.get<TH2>(HIST("EventTwoTracks/MuonsSelection/PID/hTPCnSigmaVsP"))->Fill(daug[0].P(), trkDaug1.tpcNSigmaEl());
22122212
if (trkDaug1.hasTOF()) {
@@ -2254,7 +2254,7 @@ struct UpcTauCentralBarrelRL {
22542254
histos.get<TH2>(HIST("EventTwoTracks/TwoElectrons/PID/hTOFnSigmaVsP"))->Fill(daug[1].P(), trkDaug2.tofNSigmaEl());
22552255
}
22562256
}
2257-
if (countPVGTmuonsSelection == 2) {
2257+
if (countPVGTmuonsSelection == 2 && doMuonStudy) {
22582258
histos.get<TH2>(HIST("EventTwoTracks/MuonsSelection/PID/hTPCsignalVsP"))->Fill(daug[1].P(), trkDaug2.tpcSignal());
22592259
histos.get<TH2>(HIST("EventTwoTracks/MuonsSelection/PID/hTPCnSigmaVsP"))->Fill(daug[1].P(), trkDaug2.tpcNSigmaEl());
22602260
if (trkDaug1.hasTOF()) {
@@ -2319,7 +2319,7 @@ struct UpcTauCentralBarrelRL {
23192319
}
23202320
}
23212321
}
2322-
if (countPVGTmuonsSelection == 2) {
2322+
if (countPVGTmuonsSelection == 2 && doMuonStudy) {
23232323
if (daug[0].P() > daug[1].P()) {
23242324
histos.get<TH2>(HIST("EventTwoTracks/MuonsSelection/PID/hTPCsignalVsLP"))->Fill(daug[0].P(), trkDaug1.tpcSignal());
23252325
histos.get<TH2>(HIST("EventTwoTracks/MuonsSelection/PID/hTPCsignalVsOP"))->Fill(daug[1].P(), trkDaug2.tpcSignal());

0 commit comments

Comments
 (0)