From cdce14ba21abe9ee2fe0dfaad8ca5d0f8ccea667 Mon Sep 17 00:00:00 2001 From: Sunanda Date: Mon, 10 Oct 2022 06:42:07 +0200 Subject: [PATCH] Update some of the defaults for Muon analysis code in HCalAlCaRecoProducers and HcalCalibAlgos Code check --- .../plugins/AlCaHcalHBHEMuonProducer.cc | 4 +-- .../HcalCalibAlgos/macros/HBHEMuonHighEta.C | 4 +-- .../plugins/HcalHBHEMuonAnalyzer.cc | 25 +++++++++++-------- .../plugins/HcalHBHEMuonHighEtaAnalyzer.cc | 8 +++--- .../plugins/HcalHBHENewMuonAnalyzer.cc | 4 +-- .../test/HcalHBHEMuonSimAnalyzer.cc | 4 +-- 6 files changed, 26 insertions(+), 23 deletions(-) diff --git a/Calibration/HcalAlCaRecoProducers/plugins/AlCaHcalHBHEMuonProducer.cc b/Calibration/HcalAlCaRecoProducers/plugins/AlCaHcalHBHEMuonProducer.cc index 49a722b5a48aa..e0569a2de5eb1 100644 --- a/Calibration/HcalAlCaRecoProducers/plugins/AlCaHcalHBHEMuonProducer.cc +++ b/Calibration/HcalAlCaRecoProducers/plugins/AlCaHcalHBHEMuonProducer.cc @@ -173,7 +173,7 @@ AlCaHcalHBHEMuonProducer::AlCaHcalHBHEMuonProducer(const edm::ParameterSet& iCon isItPreRecHit_(iConfig.getUntrackedParameter("isItPreRecHit", false)), writeRespCorr_(iConfig.getUntrackedParameter("writeRespCorr", false)), fileInCorr_(iConfig.getUntrackedParameter("fileInCorr", "")), - maxDepth_(iConfig.getUntrackedParameter("maxDepth", 4)), + maxDepth_(iConfig.getUntrackedParameter("maxDepth", 7)), mergedDepth_((!isItPreRecHit_) || (collapseDepth_)), nRun_(0), nAll_(0), @@ -964,7 +964,7 @@ void AlCaHcalHBHEMuonProducer::fillDescriptions(edm::ConfigurationDescriptions& desc.addUntracked("isItPreRecHit", false); desc.addUntracked("writeRespCorr", false); desc.addUntracked("fileInCorr", ""); - desc.addUntracked("maxDepth", 4); + desc.addUntracked("maxDepth", 7); descriptions.add("alcaHcalHBHEMuonProducer", desc); } diff --git a/Calibration/HcalCalibAlgos/macros/HBHEMuonHighEta.C b/Calibration/HcalCalibAlgos/macros/HBHEMuonHighEta.C index d43d9709582a8..c615b56170725 100644 --- a/Calibration/HcalCalibAlgos/macros/HBHEMuonHighEta.C +++ b/Calibration/HcalCalibAlgos/macros/HBHEMuonHighEta.C @@ -50,8 +50,8 @@ private: TTree *fChain; //!pointer to the analyzed TTree or TChain Int_t fCurrent; //!current Tree number in a TChain - static const int maxDepthHB_ = 7; - static const int maxDepthHE_ = 4; + static const int maxDepthHB_ = 4; + static const int maxDepthHE_ = 7; // Fixed size dimensions of array or collections stored in the TTree if any. // Declaration of leaf types diff --git a/Calibration/HcalCalibAlgos/plugins/HcalHBHEMuonAnalyzer.cc b/Calibration/HcalCalibAlgos/plugins/HcalHBHEMuonAnalyzer.cc index 715d5615e4611..c81bffcd8bd83 100644 --- a/Calibration/HcalCalibAlgos/plugins/HcalHBHEMuonAnalyzer.cc +++ b/Calibration/HcalCalibAlgos/plugins/HcalHBHEMuonAnalyzer.cc @@ -95,6 +95,7 @@ class HcalHBHEMuonAnalyzer : public edm::one::EDAnalyzer triggers_; + const double pMinMuon_; const int verbosity_, useRaw_; const bool unCorrect_, collapseDepth_, isItPlan1_; const bool ignoreHECorr_, isItPreRecHit_; @@ -180,6 +181,7 @@ HcalHBHEMuonAnalyzer::HcalHBHEMuonAnalyzer(const edm::ParameterSet& iConfig) labelMuon_(iConfig.getParameter("labelMuon")), fileInCorr_(iConfig.getUntrackedParameter("fileInCorr", "")), triggers_(iConfig.getParameter>("triggers")), + pMinMuon_(iConfig.getParameter("pMinMuon")), verbosity_(iConfig.getUntrackedParameter("verbosity", 0)), useRaw_(iConfig.getParameter("useRaw")), unCorrect_(iConfig.getParameter("unCorrect")), @@ -189,7 +191,7 @@ HcalHBHEMuonAnalyzer::HcalHBHEMuonAnalyzer(const edm::ParameterSet& iConfig) isItPreRecHit_(iConfig.getUntrackedParameter("isItPreRecHit", false)), getCharge_(iConfig.getParameter("getCharge")), writeRespCorr_(iConfig.getUntrackedParameter("writeRespCorr", false)), - maxDepth_(iConfig.getUntrackedParameter("maxDepth", 4)), + maxDepth_(iConfig.getUntrackedParameter("maxDepth", 7)), modnam_(iConfig.getUntrackedParameter("moduleName", "")), procnm_(iConfig.getUntrackedParameter("processName", "")), tok_trigRes_(consumes(hlTriggerResults_)), @@ -246,7 +248,7 @@ HcalHBHEMuonAnalyzer::HcalHBHEMuonAnalyzer(const edm::ParameterSet& iConfig) edm::LogVerbatim("HBHEMuon") << "Flags used: UseRaw " << useRaw_ << " GetCharge " << getCharge_ << " UnCorrect " << unCorrect_ << " IgnoreHECorr " << ignoreHECorr_ << " CollapseDepth " << collapseDepth_ << ":" << mergedDepth_ << " IsItPlan1 " << isItPlan1_ << " IsItPreRecHit " - << isItPreRecHit_ << " UseMyCorr " << useMyCorr_; + << isItPreRecHit_ << " UseMyCorr " << useMyCorr_ << " pMinMuon " << pMinMuon_; } // @@ -296,12 +298,12 @@ void HcalHBHEMuonAnalyzer::analyze(const edm::Event& iEvent, const edm::EventSet edm::LogVerbatim("HBHEMuon") << "Run " << runNumber_ << " Event " << eventNumber_ << " Lumi " << lumiNumber_ << " BX " << bxNumber_ << std::endl; #endif - const edm::Handle _Triggers = iEvent.getHandle(tok_trigRes_); + const edm::Handle& _Triggers = iEvent.getHandle(tok_trigRes_); #ifdef EDM_ML_DEBUG if ((verbosity_ / 10000) % 10 > 0) edm::LogVerbatim("HBHEMuon") << "Size of all triggers " << all_triggers_.size(); #endif - int Ntriggers = all_triggers_.size(); + int Ntriggers = static_cast(all_triggers_.size()); #ifdef EDM_ML_DEBUG if ((verbosity_ / 10000) % 10 > 0) edm::LogVerbatim("HBHEMuon") << "Size of HLT MENU: " << _Triggers->size(); @@ -311,7 +313,7 @@ void HcalHBHEMuonAnalyzer::analyze(const edm::Event& iEvent, const edm::EventSet std::vector index; for (int i = 0; i < Ntriggers; i++) { index.push_back(triggerNames_.triggerIndex(all_triggers_[i])); - int triggerSize = int(_Triggers->size()); + int triggerSize = static_cast(_Triggers->size()); #ifdef EDM_ML_DEBUG if ((verbosity_ / 10000) % 10 > 0) edm::LogVerbatim("HBHEMuon") << "outside loop " << index[i] << "\ntriggerSize " << triggerSize; @@ -339,14 +341,14 @@ void HcalHBHEMuonAnalyzer::analyze(const edm::Event& iEvent, const edm::EventSet const HcalDbService* conditions = &iSetup.getData(tok_dbservice_); // Relevant blocks from iEvent - const edm::Handle vtx = iEvent.getHandle(tok_Vtx_); + const edm::Handle& vtx = iEvent.getHandle(tok_Vtx_); edm::Handle barrelRecHitsHandle = iEvent.getHandle(tok_EB_); edm::Handle endcapRecHitsHandle = iEvent.getHandle(tok_EE_); edm::Handle hbhe = iEvent.getHandle(tok_HBHE_); - const edm::Handle _Muon = iEvent.getHandle(tok_Muon_); + const edm::Handle& _Muon = iEvent.getHandle(tok_Muon_); // require a good vertex math::XYZPoint pvx; @@ -495,7 +497,7 @@ void HcalHBHEMuonAnalyzer::analyze(const edm::Event& iEvent, const edm::EventSet if (RecMuon.innerTrack().isNonnull()) { const reco::Track* pTrack = (RecMuon.innerTrack()).get(); spr::propagatedTrackID trackID = spr::propagateCALO(pTrack, geo_, bField, (((verbosity_ / 100) % 10 > 0))); - if ((RecMuon.p() > 10.0) && (trackID.okHCAL)) + if ((RecMuon.p() > pMinMuon_) && (trackID.okHCAL)) accept = true; ecalDetId.push_back((trackID.detIdECAL)()); @@ -1064,17 +1066,18 @@ void HcalHBHEMuonAnalyzer::fillDescriptions(edm::ConfigurationDescriptions& desc desc.add("labelMuon", "muons"); std::vector trig = {"HLT_IsoMu17", "HLT_IsoMu20", "HLT_IsoMu24", "HLT_IsoMu27", "HLT_Mu45", "HLT_Mu50"}; desc.add>("triggers", trig); + desc.add("pMinMuon", 10.0); desc.addUntracked("verbosity", 0); desc.add("useRaw", 0); - desc.add("unCorrect", false); - desc.add("getCharge", false); + desc.add("unCorrect", true); + desc.add("getCharge", true); desc.add("collapseDepth", false); desc.add("isItPlan1", false); desc.addUntracked("ignoreHECorr", false); desc.addUntracked("isItPreRecHit", false); desc.addUntracked("moduleName", ""); desc.addUntracked("processName", ""); - desc.addUntracked("maxDepth", 4); + desc.addUntracked("maxDepth", 7); desc.addUntracked("fileInCorr", ""); desc.addUntracked("writeRespCorr", false); descriptions.add("hcalHBHEMuon", desc); diff --git a/Calibration/HcalCalibAlgos/plugins/HcalHBHEMuonHighEtaAnalyzer.cc b/Calibration/HcalCalibAlgos/plugins/HcalHBHEMuonHighEtaAnalyzer.cc index 2683004a8b90c..0205f6726b287 100644 --- a/Calibration/HcalCalibAlgos/plugins/HcalHBHEMuonHighEtaAnalyzer.cc +++ b/Calibration/HcalCalibAlgos/plugins/HcalHBHEMuonHighEtaAnalyzer.cc @@ -272,10 +272,10 @@ void HcalHBHEMuonHighEtaAnalyzer::fillDescriptions(edm::ConfigurationDescription desc.add("etaMin", 2.0); desc.add("emaxNearPThreshold", 10.0); desc.add("analyzeMuon", true); - desc.add("unCorrect", false); + desc.add("unCorrect", true); desc.add("collapseDepth", false); desc.add("isItPlan1", false); - desc.add("getCharge", false); + desc.add("getCharge", true); desc.add("useRaw", 0); desc.add("verbosity", 0); desc.addUntracked("fileInCorr", ""); @@ -372,7 +372,7 @@ void HcalHBHEMuonHighEtaAnalyzer::analyze(const edm::Event& iEvent, const edm::E conditions_ = &iSetup.getData(tok_dbservice_); // Relevant blocks from iEvent - const edm::Handle vtx = iEvent.getHandle(tok_Vtx_); + const edm::Handle& vtx = iEvent.getHandle(tok_Vtx_); iEvent.getByToken(tok_EB_, barrelRecHitsHandle_); iEvent.getByToken(tok_EE_, endcapRecHitsHandle_); @@ -495,7 +495,7 @@ void HcalHBHEMuonHighEtaAnalyzer::beginRun(edm::Run const& iRun, edm::EventSetup } bool HcalHBHEMuonHighEtaAnalyzer::analyzeMuon(const edm::Event& iEvent, math::XYZPoint& leadPV) { - const edm::Handle _Muon = iEvent.getHandle(tok_Muon_); + const edm::Handle& _Muon = iEvent.getHandle(tok_Muon_); bool accept = false; if (_Muon.isValid()) { diff --git a/Calibration/HcalCalibAlgos/plugins/HcalHBHENewMuonAnalyzer.cc b/Calibration/HcalCalibAlgos/plugins/HcalHBHENewMuonAnalyzer.cc index 4108f2fdd72a2..b001352d98228 100644 --- a/Calibration/HcalCalibAlgos/plugins/HcalHBHENewMuonAnalyzer.cc +++ b/Calibration/HcalCalibAlgos/plugins/HcalHBHENewMuonAnalyzer.cc @@ -84,7 +84,7 @@ class HcalHBHENewMuonAnalyzer : public edm::one::EDAnalyzer("hbheMuonLabel")), useRaw_(iConfig.getParameter("useRaw")), - maxDepth_(iConfig.getUntrackedParameter("maxDepth", 4)), + maxDepth_(iConfig.getUntrackedParameter("maxDepth", 7)), tokHBHEMuonVar_(consumes(labelHBHEMuonVar_)) { usesResource(TFileService::kSharedResource); //now do what ever initialization is needed @@ -316,7 +316,7 @@ void HcalHBHENewMuonAnalyzer::fillDescriptions(edm::ConfigurationDescriptions& d edm::ParameterSetDescription desc; desc.add("hbheMuonLabel", edm::InputTag("alcaHcalHBHEMuonProducer", "hbheMuon")); desc.add("useRaw", 0); - desc.addUntracked("maxDepth", 4); + desc.addUntracked("maxDepth", 7); descriptions.add("hcalHBHEMuonAnalysis", desc); } diff --git a/Calibration/HcalCalibAlgos/test/HcalHBHEMuonSimAnalyzer.cc b/Calibration/HcalCalibAlgos/test/HcalHBHEMuonSimAnalyzer.cc index 2330628de3f53..d53a9aefed0a0 100644 --- a/Calibration/HcalCalibAlgos/test/HcalHBHEMuonSimAnalyzer.cc +++ b/Calibration/HcalCalibAlgos/test/HcalHBHEMuonSimAnalyzer.cc @@ -97,7 +97,7 @@ HcalHBHEMuonSimAnalyzer::HcalHBHEMuonSimAnalyzer(const edm::ParameterSet& iConfi eeLabel_(iConfig.getParameter("EECollection")), hcLabel_(iConfig.getParameter("HCCollection")), verbosity_(iConfig.getUntrackedParameter("Verbosity", 0)), - maxDepth_(iConfig.getUntrackedParameter("MaxDepth", 4)), + maxDepth_(iConfig.getUntrackedParameter("MaxDepth", 7)), etaMax_(iConfig.getUntrackedParameter("EtaMax", 3.0)), tMinE_(iConfig.getUntrackedParameter("TimeMinCutECAL", -500.)), tMaxE_(iConfig.getUntrackedParameter("TimeMaxCutECAL", 500.)), @@ -401,7 +401,7 @@ void HcalHBHEMuonSimAnalyzer::fillDescriptions(edm::ConfigurationDescriptions& d desc.add("EECollection", "EcalHitsEE"); desc.add("HCCollection", "HcalHits"); desc.addUntracked("Verbosity", 0); - desc.addUntracked("MaxDepth", 4); + desc.addUntracked("MaxDepth", 7); desc.addUntracked("EtaMax", 3.0); desc.addUntracked("TimeMinCutECAL", -500.); desc.addUntracked("TimeMaxCutECAL", 500.);