diff --git a/python/muon/tag_probe_muon_extraIso_cff.py b/python/muon/tag_probe_muon_extraIso_cff.py index 911f9ab7f07..c52dd871093 100644 --- a/python/muon/tag_probe_muon_extraIso_cff.py +++ b/python/muon/tag_probe_muon_extraIso_cff.py @@ -1,9 +1,9 @@ import FWCore.ParameterSet.Config as cms ExtraIsolationVariables = cms.PSet( - kt6RhoAll = cms.InputTag("computeCorrectedIso", "fixedGridRhoFastjetAll"), # was RhoAll - kt6RhoAllCalo = cms.InputTag("computeCorrectedIso", "fixedGridRhoFastjetAllCalo"), # was RhoAllCalo - kt6RhoPU = cms.InputTag("computeCorrectedIso", "fixedGridRhoFastjetCentralChargedPileUp"), # was RhoPU - kt6RhoNeu05 = cms.InputTag("computeCorrectedIso", "fixedGridRhoFastjetCentralNeutral"), # was RhoNeu05 - kt6RhoCentralCalo = cms.InputTag("computeCorrectedIso", "fixedGridRhoFastjetCentralCalo"), # was RhoCentralCalo + fixedGridRhoFastjetAll = cms.InputTag("computeCorrectedIso", "fixedGridRhoFastjetAll"), # was RhoAll / kt6RhoAll + fixedGridRhoFastjetAllCalo = cms.InputTag("computeCorrectedIso", "fixedGridRhoFastjetAllCalo"), # was RhoAllCalo / kt6RhoAllCalo + fixedGridRhoFastjetCentralChargedPileUp = cms.InputTag("computeCorrectedIso", "fixedGridRhoFastjetCentralChargedPileUp"), # was RhoPU / kt6RhoPU + fixedGridRhoFastjetCentralNeutral = cms.InputTag("computeCorrectedIso", "fixedGridRhoFastjetCentralNeutral"), # was RhoNeu05 / kt6RhoNeu05 + fixedGridRhoFastjetCentralCalo = cms.InputTag("computeCorrectedIso", "fixedGridRhoFastjetCentralCalo"), # was RhoCentralCalo / kt6RhoCentralCalo ) diff --git a/test/zmumu/addEAMiniIso.cxx b/test/zmumu/addEAMiniIso.cxx index 3806e2bccfc..fba5f75d318 100644 --- a/test/zmumu/addEAMiniIso.cxx +++ b/test/zmumu/addEAMiniIso.cxx @@ -5,20 +5,26 @@ void addEAMiniIso() { TTree *tIn = (TTree *) gFile->Get("tpTree/fitter_tree"); - Float_t pt, eta, chHad, nHad, phot, rho; + Float_t pt, eta, chHad, nHad, phot, rho, activity_chHad, activity_PUchHad, activity_nHad, activity_phot; tIn->SetBranchAddress("pt", &pt); tIn->SetBranchAddress("eta", &eta); tIn->SetBranchAddress("miniIsoCharged", &chHad); tIn->SetBranchAddress("miniIsoNeutrals", &nHad); tIn->SetBranchAddress("miniIsoPhotons", &phot); + tIn->SetBranchAddress("activity_miniIsoCharged", &activity_chHad); + tIn->SetBranchAddress("activity_miniIsoPUCharged", &activity_PUchHad); + tIn->SetBranchAddress("activity_miniIsoNeutrals", &activity_nHad); + tIn->SetBranchAddress("activity_miniIsoPhotons", &activity_phot); tIn->SetBranchAddress("fixedGridRhoFastjetCentralNeutral", &rho); TFile *fOut = new TFile("tnpZ_withEAMiniIso.root", "RECREATE"); fOut->mkdir("tpTree")->cd(); TTree *tOut = tIn->CloneTree(0); - Float_t pfCombRelMiniIsoEACorr,pfCombAbsMiniIsoEACorr; + Float_t pfCombRelMiniIsoEACorr,pfCombAbsMiniIsoEACorr,pfCombRelActivitydBCorr,pfCombAbsActivitydBCorr; tOut->Branch("pfCombAbsMiniIsoEACorr", &pfCombAbsMiniIsoEACorr, "pfCombAbsMiniIsoEACorr/F"); tOut->Branch("pfCombRelMiniIsoEACorr", &pfCombRelMiniIsoEACorr, "pfCombRelMiniIsoEACorr/F"); + tOut->Branch("pfCombRelActivitydBCorr", &pfCombRelActivitydBCorr, "pfCombRelActivitydBCorr/F"); + tOut->Branch("pfCombAbsActivitydBCorr", &pfCombAbsActivitydBCorr, "pfCombAbsActivitydBCorr/F"); MuonEffectiveArea::MuonEffectiveAreaTarget effAreaTarget = MuonEffectiveArea::kMuEASpring15_25ns; // new 2015 MuonEffectiveArea::MuonEffectiveAreaType effAreaType = MuonEffectiveArea::kMuMiniIso03; @@ -30,14 +36,21 @@ void addEAMiniIso() { tIn->GetEntry(i); Float_t ea_tot = MuonEffectiveArea::GetMuonEffectiveArea(effAreaType, fabs(eta), effAreaTarget); - pfCombAbsMiniIsoEACorr = (chHad + max(0.0, nHad - rho * ea_tot * ((10.0/min(max(pt, 50),200))/0.3)**2) + pfCombAbsMiniIsoEACorr = (chHad + max(0.0, nHad - rho * ea_tot * pow((10.0/min(max((double) pt, 50.),200.))/0.3,2))); pfCombRelMiniIsoEACorr = pfCombAbsMiniIsoEACorr/pt; + + pfCombAbsActivitydBCorr = (activity_chHad + max( (double) (activity_nHad + activity_phot - activity_PUchHad/2) , 0.0)); + pfCombRelActivitydBCorr = pfCombAbsActivitydBCorr/pt; + if (i < 20) { printf("muon with pt = %.2f, eta = %+5.2f:", pt, eta); printf(" charged hadrons %6.3f, neutral hadrons %6.3f, photons %6.3f ", chHad, nHad, phot); printf(" rho %6.3f, ea %6.3f", rho, ea_tot); - printf(" pfCombAbsIsoEAcorr %6.3f\n", pfCombAbsMiniIsoEACorr); - printf(" pfCombRelIsoEAcorr %6.3f\n", pfCombRelMiniIsoEACorr); + printf(" pfCombAbsMiniIsoEAcorr %6.3f\n", pfCombAbsMiniIsoEACorr); + printf(" pfCombRelMiniIsoEAcorr %6.3f\n", pfCombRelMiniIsoEACorr); + printf(" activity charged hadrons %6.3f, PU charged hadrons %6.3f, neutral hadrons %6.3f, photons %6.3f ", activity_chHad, activity_PUchHad, activity_nHad, activity_phot); + printf(" pfCombAbsActivitydBCorr %6.3f\n", pfCombAbsActivitydBCorr); + printf(" pfCombRelActivitydBCorr %6.3f\n", pfCombRelActivitydBCorr); } tOut->Fill(); //if (i > 10000) break;