From 96bd131e2ab4e695eb6dac3ca85a806022bc5915 Mon Sep 17 00:00:00 2001 From: Sunanda Date: Wed, 15 Sep 2021 13:27:10 +0200 Subject: [PATCH] Bug fix to 2 classes --- .../HcalCalibAlgos/plugins/HOCalibAnalyzer.cc | 17 +++++++++-------- .../plugins/HcalIsoTrkAnalyzer.cc | 13 +++++++------ 2 files changed, 16 insertions(+), 14 deletions(-) diff --git a/Calibration/HcalCalibAlgos/plugins/HOCalibAnalyzer.cc b/Calibration/HcalCalibAlgos/plugins/HOCalibAnalyzer.cc index c444f1fae63de..a96cdc6cfecb2 100644 --- a/Calibration/HcalCalibAlgos/plugins/HOCalibAnalyzer.cc +++ b/Calibration/HcalCalibAlgos/plugins/HOCalibAnalyzer.cc @@ -70,19 +70,20 @@ class HOCalibAnalyzer : public edm::one::EDAnalyzer { void analyze(const edm::Event&, const edm::EventSetup&) override; void endJob() override {} - int getHOieta(int ij) { return (ij < netamx / 2) ? -netamx / 2 + ij : -netamx / 2 + ij + 1; } - int invert_HOieta(int ieta) { return (ieta < 0) ? netamx / 2 + ieta : netamx / 2 + ieta - 1; } - - int mypow_2[31]; - static const int netamx = 30; - static const int nphimx = 72; - static const int ringmx = 5; - static const int ncut = 14; + static constexpr int netamx = 30; + static constexpr int nphimx = 72; + static constexpr int ringmx = 5; + static constexpr int ncut = 14; const char* varcrit[3] = {"All", "steps", "n-1"}; // or opposite const double elosfact = (14.9 + 0.96 * fabs(log(8 * 2.8)) + 0.033 * 8 * (1.0 - pow(8, -0.33))); + int getHOieta(int ij) { return (ij < netamx / 2) ? -netamx / 2 + ij : -netamx / 2 + ij + 1; } + int invert_HOieta(int ieta) { return (ieta < 0) ? netamx / 2 + ieta : netamx / 2 + ieta - 1; } + + int mypow_2[31]; + bool m_cosmic; bool m_zeroField; int m_bins; diff --git a/Calibration/HcalCalibAlgos/plugins/HcalIsoTrkAnalyzer.cc b/Calibration/HcalCalibAlgos/plugins/HcalIsoTrkAnalyzer.cc index 3e344c698b64b..7c7912a00a3e4 100644 --- a/Calibration/HcalCalibAlgos/plugins/HcalIsoTrkAnalyzer.cc +++ b/Calibration/HcalCalibAlgos/plugins/HcalIsoTrkAnalyzer.cc @@ -937,9 +937,13 @@ std::array HcalIsoTrkAnalyzer::fillTree(std::vectortrkItr)); math::XYZTLorentzVector v4(pTrack->px(), pTrack->py(), pTrack->pz(), pTrack->p()); + t_p = pTrack->p(); + t_pt = pTrack->pt(); + t_phi = pTrack->phi(); + #ifdef EDM_ML_DEBUG - edm::LogVerbatim("HcalIsoTrack") << "This track : " << nTracks << " (pt|eta|phi|p) :" << pTrack->pt() << "|" - << pTrack->eta() << "|" << pTrack->phi() << "|" << pTrack->p(); + edm::LogVerbatim("HcalIsoTrack") << "This track : " << nTracks << " (pt|eta|phi|p) :" << t_pt << "|" + << pTrack->eta() << "|" << t_phi << "|" << t_p; #endif t_mindR2 = 999; for (unsigned int k = 0; k < vecL3.size(); ++k) { @@ -952,6 +956,7 @@ std::array HcalIsoTrkAnalyzer::fillTree(std::vectorokHCAL) { HcalDetId detId = (HcalDetId)(trkDetItr->detIdHCAL); @@ -1207,10 +1212,6 @@ std::array HcalIsoTrkAnalyzer::fillTree(std::vectorp(); - t_pt = pTrack->pt(); - t_phi = pTrack->phi(); - #ifdef EDM_ML_DEBUG edm::LogVerbatim("HcalIsoTrack") << "This track : " << nTracks << " (pt|eta|phi|p) :" << t_pt << "|" << pTrack->eta() << "|" << t_phi << "|" << t_p << " Generator Level p "