Skip to content

Commit

Permalink
Merge remote-tracking branch 'Luca/final_all_variables' into 74X-v3.2
Browse files Browse the repository at this point in the history
  • Loading branch information
Hugues committed Oct 24, 2015
2 parents 5ff0696 + f8d4118 commit 40ad82c
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 10 deletions.
10 changes: 5 additions & 5 deletions python/muon/tag_probe_muon_extraIso_cff.py
Original file line number Diff line number Diff line change
@@ -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
)
23 changes: 18 additions & 5 deletions test/zmumu/addEAMiniIso.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand Down

0 comments on commit 40ad82c

Please sign in to comment.