From ad9c2b81fcf6944aeeb811459a3fa9cca9742712 Mon Sep 17 00:00:00 2001 From: franzoni <> Date: Wed, 1 Jun 2011 00:49:43 +0000 Subject: [PATCH] - import usage of new functionalities of EnergySmearer (listed below) at this stage only partial; final logic of which and how to use efficiency ratios =>to be re-iterate ++++++++ new functionalities of EnergySmearer +++++++++++++++++++++++++++++++++++++++++++++++++++++ - implement modification of photon weight in EnergySmearer according to efficiency ratios - efficiency ratios + their errors are provided as TGraphAsymmErrors (one per efficiency and per photon category) --- PhotonAnalysis/interface/StatAnalysis.h | 4 +-- PhotonAnalysis/src/StatAnalysis.cc | 41 +++++++++++++++++++++++-- 2 files changed, 40 insertions(+), 5 deletions(-) diff --git a/PhotonAnalysis/interface/StatAnalysis.h b/PhotonAnalysis/interface/StatAnalysis.h index 2b051294..3365c9ee 100644 --- a/PhotonAnalysis/interface/StatAnalysis.h +++ b/PhotonAnalysis/interface/StatAnalysis.h @@ -30,7 +30,7 @@ class StatAnalysis : public PhotonAnalysis // Options EnergySmearer::energySmearingParameters eSmearPars; - bool doEscaleSyst, doEresolSyst; + bool doEscaleSyst, doEresolSyst, doPhotonIdEffSyst, doVtxEffSyst; float systRange; int nSystSteps; int nCategories; @@ -42,7 +42,7 @@ class StatAnalysis : public PhotonAnalysis std::vector systPhotonSmearers_; std::vector diPhotonSmearers_; - EnergySmearer *eScaleSmearer, *eResolSmearer; + EnergySmearer *eScaleSmearer, *eResolSmearer, *idEffSmearer, *vtxEffSmearer, *hltEffSmearer ; std::string name_; diff --git a/PhotonAnalysis/src/StatAnalysis.cc b/PhotonAnalysis/src/StatAnalysis.cc index eb93e48c..07a3a03d 100644 --- a/PhotonAnalysis/src/StatAnalysis.cc +++ b/PhotonAnalysis/src/StatAnalysis.cc @@ -65,6 +65,8 @@ void StatAnalysis::Init(LoopAll& l) // FIXME: move to config file doEscaleSyst = true; doEresolSyst = true; + doPhotonIdEffSyst = false; + doVtxEffSyst = true; nCategories = 4; eSmearPars.categoryType = "2CatR9_EBEE"; @@ -94,16 +96,37 @@ void StatAnalysis::Init(LoopAll& l) eSmearPars.smearing_sigma_error["EEHighR9"] = 2e-3; eSmearPars.smearing_sigma_error["EELowR9"] = 2e-3; + eSmearPars.efficiency_file = std::string("/afs/cern.ch/user/f/franzoni/public/globe/effReweight_tgraph.root"); + eScaleSmearer = new EnergySmearer( eSmearPars ); eScaleSmearer->name("E_scale"); + eScaleSmearer->doEnergy(true); eScaleSmearer->scaleOrSmear(true); eResolSmearer = new EnergySmearer( eSmearPars ); eResolSmearer->name("E_res"); + eResolSmearer->doEnergy(false); eResolSmearer->scaleOrSmear(false); - + + idEffSmearer = new EnergySmearer( eSmearPars ); + idEffSmearer->name("idEff"); + idEffSmearer->doEfficiencies(true); + idEffSmearer->setEffName("ratioTP"); + idEffSmearer->initEfficiency(); + + vtxEffSmearer = new EnergySmearer( eSmearPars ); // triplicate TF1's here + vtxEffSmearer->name("vtxEff"); + vtxEffSmearer->doEfficiencies(true); + vtxEffSmearer->setEffName("ratioVertex"); + vtxEffSmearer->initEfficiency(); + + photonSmearers_.push_back(eScaleSmearer); photonSmearers_.push_back(eResolSmearer); + photonSmearers_.push_back(idEffSmearer); + photonSmearers_.push_back(vtxEffSmearer); + + /* // r = new TRandom3(); if (icat == 0) {escale = 0.39; eres = 1.58;} // EB high r9 @@ -146,6 +169,18 @@ void StatAnalysis::Init(LoopAll& l) std::vector sys_t(1,-1); // -1 for signal, 1 for background 0 for both l.rooContainer->MakeSystematicStudy(sys,sys_t); } + if( doPhotonIdEffSyst ) {//GF this is here as a test, for the moment - there are other efficiencies too (VTX, trigger etc) + systPhotonSmearers_.push_back( idEffSmearer ); + std::vector sys(1,idEffSmearer->name()); + std::vector sys_t(1,-1); // -1 for signal, 1 for background 0 for both + l.rooContainer->MakeSystematicStudy(sys,sys_t); + }//GF + if( doVtxEffSyst ) {//GF this is here as a test, for the moment - there are other efficiencies too (VTX, trigger etc) + systPhotonSmearers_.push_back( vtxEffSmearer ); + std::vector sys(1,vtxEffSmearer->name()); + std::vector sys_t(1,-1); // -1 for signal, 1 for background 0 for both + l.rooContainer->MakeSystematicStudy(sys,sys_t); + }//GF // ---------------------------------------------------- // Create observables for shape-analysis with ranges @@ -374,7 +409,7 @@ void StatAnalysis::Analysis(LoopAll& l, Int_t jentry) std::vector categories; // loop over syst shift - for(float syst_shift=-systRange; syst_shift<=systRange; syst_shift+=systRange ) { + for(float syst_shift=(-1*systRange); syst_shift<=systRange; syst_shift+=systRange ) { // skip the central value if( syst_shift == 0. ) { continue; } @@ -386,7 +421,7 @@ void StatAnalysis::Analysis(LoopAll& l, Int_t jentry) // move the smearer under study by syst_shift (*si)->smearPhoton(phoInfo,weight,syst_shift); - + // for the other use the nominal points for(std::vector::iterator sj=photonSmearers_.begin(); sj!= photonSmearers_.end(); ++sj ) { if( *si == *sj ) { continue; }