diff --git a/interface/bbggTools.h b/interface/bbggTools.h index aa3a06b..ec331e9 100644 --- a/interface/bbggTools.h +++ b/interface/bbggTools.h @@ -40,7 +40,7 @@ class bbggTools{ std::vector DiPhotonKinematicSelection(vector diphoCol, bool DoMassCut = 0); std::vector DiPhotonIDSelection( std::vector diphoCol); std::vector GetDiPhotonsInCategory( std::vector > SelectedDiPhotons, int category ); - std::vector > EvaluatePhotonIDs( std::vector diphoCol, unsigned int doCustomID = 0); + std::vector > EvaluatePhotonIDs( std::vector diphoCol, unsigned int doCustomID = 0, unsigned int doTnP = 0); bool passHgg76XPreselection(const flashgg::DiPhotonCandidate * dipho, std::map myTriggersResults); bool passHggPreselection(const flashgg::DiPhotonCandidate * dipho); bool passPreselectionTnP2016(const flashgg::DiPhotonCandidate * dipho, std::map myTriggersResults); diff --git a/plugins/bbggTree.cc b/plugins/bbggTree.cc index b1dccbc..140da93 100644 --- a/plugins/bbggTree.cc +++ b/plugins/bbggTree.cc @@ -404,7 +404,8 @@ inputTagJets_( iConfig.getParameter >( "inputTagJets" phCorrEE = iConfig.getUntrackedParameter >("phCorrEE"); is2016 = iConfig.getUntrackedParameter("is2016", def_is2016); - doTnP = iConfig.getUntrackedParameter("doTnP", def_doTnP); + doTnP = iConfig.getUntrackedParameter("doTnP",def_doTnP); + BenchNum = iConfig.getUntrackedParameter("benchmark", 0); //photon selection parameters @@ -500,6 +501,9 @@ inputTagJets_( iConfig.getParameter >( "inputTagJets" myTriggers = iConfig.getUntrackedParameter >("myTriggers", def_myTriggers); triggerToken_ = consumes( iConfig.getParameter( "triggerTag" ) ); // METToken_ = consumes >(iConfig.getParameter("metTag")); + if (is2016){ + triggerToken_ = consumes( edm::InputTag("TriggerResults", "", "HLT" )) ; + } rhoToken_ = consumes( iConfig.getParameter( "rhoTag" ) ); vertexToken_ = consumes >( iConfig.getParameter ( "VertexTag" ) ); @@ -794,6 +798,7 @@ void Handle > diPhotons; iEvent.getByToken( diPhotonToken_, diPhotons ); + const double rhoFixedGrd = globVar_->valueOf(globVar_->indexOf("rho")); tools_.setRho(rhoFixedGrd); const double nPVs = globVar_->valueOf(globVar_->indexOf("nvtx")); @@ -947,7 +952,7 @@ void if(doTnP && is2016){ Handle trigResults; iEvent.getByToken(triggerToken_, trigResults); - const edm::TriggerNames &names = iEvent.triggerNames(*trigResults); + const edm::TriggerNames &names = iEvent.triggerNames(*trigResults); myTriggerResults = tools_.TriggerSelection(myTriggers, names, trigResults); PreSelDipho = tools_.DiPhotonPreselectionTnP2016( diphotonCollection, myTriggerResults); } @@ -958,13 +963,19 @@ void //Kinematic selection - std::vector KinDiPhoton = tools_.DiPhotonKinematicSelection( PreSelDipho, 1); - if(DEBUG) std::cout << "[bbggTree::analyze] Number of kinematic-selected diphotons: " << KinDiPhoton.size() << std::endl; + std::vector KinDiPhoton; + if(!doTnP) KinDiPhoton = tools_.DiPhotonKinematicSelection( PreSelDipho, 1); + else { + KinDiPhoton = PreSelDipho; + } + // if(DEBUG) if( KinDiPhoton.size() < 1) return; h_Efficiencies->Fill(3, genTotalWeight*gen_NRW); //Evaluate photon IDs - vector > KinDiPhotonWithID = tools_.EvaluatePhotonIDs( KinDiPhoton, doCustomPhotonMVA ); + vector > KinDiPhotonWithID; + if(!doTnP) KinDiPhotonWithID = tools_.EvaluatePhotonIDs( KinDiPhoton, doCustomPhotonMVA ); + else KinDiPhotonWithID = tools_.EvaluatePhotonIDs( KinDiPhoton, doCustomPhotonMVA, 1 ); vector SignalDiPhotons = tools_.GetDiPhotonsInCategory( KinDiPhotonWithID, 2 ); vector CRDiPhotons = tools_.GetDiPhotonsInCategory( KinDiPhotonWithID, 1 ); @@ -1125,7 +1136,8 @@ void leadingPhotonR9full5x5 = diphoCand.leadingPhoton()->full5x5_r9(); subleadingPhotonR9full5x5 = diphoCand.subLeadingPhoton()->full5x5_r9(); - diphotonCandidate = diphoCand.p4(); + // diphotonCandidate = diphoCand.p4(); //this is wrong since diphoton collection is not updated by the smearer + diphotonCandidate = (diphoCand.leadingPhoton()->p4()+diphoCand.subLeadingPhoton()->p4()); leadingPhoton = diphoCand.leadingPhoton()->p4(); subleadingPhoton = diphoCand.subLeadingPhoton()->p4(); diff --git a/python/parameters.py b/python/parameters.py index 575f15e..6033008 100644 --- a/python/parameters.py +++ b/python/parameters.py @@ -8,7 +8,7 @@ _doSelectionTree = cms.untracked.uint32(1) ##Tags and Objects -_triggerTag = cms.InputTag("TriggerResults", "", "HLT2") +_triggerTag = cms.InputTag("TriggerResults", "", "HLT2") #this might be changed into HLT2 if running on 2015 data _myTriggers = cms.untracked.vstring("HLT_Diphoton30_18_R9Id_OR_IsoCaloId_AND_HE_R9Id_Mass90_v") #_DiPhotonTag = cms.untracked.InputTag('flashggDiPhotons') _DiPhotonTag = cms.untracked.InputTag('flashggPreselectedDiPhotons') @@ -96,9 +96,9 @@ _randomLabel = cms.untracked.string("rnd_g_JER") _jetScale = cms.untracked.int32(1) ##Photon corrections/ -_doPhotonScale = cms.untracked.int32(1) #-10: not applied | -1: -1sigma | 0: central | 1: 1sigma +_doPhotonScale = cms.untracked.int32(0) #-10: not applied | -1: -1sigma | 0: central | 1: 1sigma _doPhotonExtraScale = cms.untracked.int32(0) #-10: not applied | -1: -1sigma | 0: central | 1: 1sigma -_doPhotonSmearing = cms.untracked.int32(1) #-10: not applied | -1: -1sigma | 0: central | 1: 1sigma +_doPhotonSmearing = cms.untracked.int32(0) #-10: not applied | -1: -1sigma | 0: central | 1: 1sigma #_PhotonCorrectionFile = cms.untracked.string("EgammaAnalysis/ElectronTools/data/80X_ichepV2_2016_pho") _PhotonCorrectionFile = cms.untracked.string("flashgg/Systematics/data/Moriond17_74x_pho") diff --git a/src/bbggPhotonCorrector.cc b/src/bbggPhotonCorrector.cc index 528d572..b696cbf 100644 --- a/src/bbggPhotonCorrector.cc +++ b/src/bbggPhotonCorrector.cc @@ -28,7 +28,7 @@ void bbggPhotonCorrector::SmearPhotonsInDiPhotons(std::vector bbggTools::TriggerSelection(std::vector m int accepted = 0; for ( unsigned int i = 0; i < triggerBits->size(); i++) { -// if(DEBUG) std::cout << "[bbggTools::TriggerSelection] Trigger name: " << names.triggerName(i) << " \t Decision: " << triggerBits->accept(i) << std::endl; + // if(DEBUG) std::cout << "[bbggTools::TriggerSelection] Trigger name: " << names.triggerName(i) << " \t Decision: " << triggerBits->accept(i) << std::endl; if((names.triggerName(i)).find(myTriggers[j]) != std::string::npos ) { if(triggerBits->accept(i) == 1){ @@ -756,11 +757,10 @@ vector bbggTools::GetDiPhotonsInCategory( vectorfirst); } } - return catDiPhotons; } -vector > bbggTools::EvaluatePhotonIDs( vector diphoCol, unsigned int doCustomID) +vector > bbggTools::EvaluatePhotonIDs( vector diphoCol, unsigned int doCustomID,unsigned int doTnP) { indexSel_=-1; vector > PreselDiPhotons; @@ -794,7 +794,8 @@ vector > bbggTools::EvaluatePhotonIDs( ve for( int whichPho = 0; whichPho < 2; whichPho++) { if( _PhotonDoElectronVeto[whichPho] ) { - pho_ids[whichPho] = pho_elv[whichPho]; + if(!doTnP) pho_ids[whichPho] = pho_elv[whichPho]; + else pho_ids[whichPho] = pho_elv[whichPho] > 0 ? 0:1; } int pho1Index = 0; //Index 0 = barrel, 1 = endcap double pho_eta = (whichPho) ? fabs(pho2_eta) : fabs(pho1_eta); diff --git a/test/RunJobs/MakeTrees_FLASHgg_MC_TnP.py b/test/RunJobs/MakeTrees_FLASHgg_MC_TnP.py new file mode 100644 index 0000000..ab1fb53 --- /dev/null +++ b/test/RunJobs/MakeTrees_FLASHgg_MC_TnP.py @@ -0,0 +1,157 @@ +import FWCore.ParameterSet.Config as cms +from flashgg.bbggTools.pColors import * + +process = cms.Process("bbggtree") +process.load("flashgg.bbggTools.bbggTree_cfi") +process.bbggtree.rho = cms.InputTag('fixedGridRhoAll') +process.bbggtree.vertexes = cms.InputTag("offlineSlimmedPrimaryVertices") +process.bbggtree.puInfo=cms.InputTag("slimmedAddPileupInfo") +process.bbggtree.lumiWeight = cms.double(1.0) +process.bbggtree.intLumi = cms.double(1.0) +process.bbggtree.puReWeight=cms.bool(True) +process.bbggtree.puBins=cms.vdouble() +process.bbggtree.dataPu=cms.vdouble() +process.bbggtree.mcPu=cms.vdouble() +print "I'M HERE 1" + +process.source = cms.Source("PoolSource", + # replace 'myfile.root' with the source file you want to use + fileNames = cms.untracked.vstring("test.root") +) +process.load("FWCore.MessageService.MessageLogger_cfi") +process.maxEvents = cms.untracked.PSet( input = cms.untracked.int32(-1) ) +process.MessageLogger.cerr.FwkReport.reportEvery = cms.untracked.int32( 2000 ) + +# import flashgg customization +from flashgg.MetaData.JobConfig import customize +import FWCore.ParameterSet.VarParsing as VarParsing +# set default options if needed +customize.setDefault("maxEvents",-1) +customize.setDefault("targetLumi",2.58e+3) + +customize.register('doSelection', + False, + VarParsing.VarParsing.multiplicity.singleton, + VarParsing.VarParsing.varType.bool, + 'False: Make tree before selection; True: Make tree after selection') +customize.register('doDoubleCountingMitigation', + False, + VarParsing.VarParsing.multiplicity.singleton, + VarParsing.VarParsing.varType.bool, + 'False: Do not remove double counted photons from QCD/GJet/DiPhotonJets; True: Remove double counted photons from QCD/GJet/DiPhotonJets') +customize.register('nPromptPhotons', + 0, + VarParsing.VarParsing.multiplicity.singleton, + VarParsing.VarParsing.varType.int, + 'Number of prompt photons to be selected - to use this, set doDoubleCountingMitigation=1') +customize.register('PURW', + 1, + VarParsing.VarParsing.multiplicity.singleton, + VarParsing.VarParsing.varType.bool, + "Do PU reweighting? Doesn't work on 76X") + +customize.register('bench', + 0, + VarParsing.VarParsing.multiplicity.singleton, + VarParsing.VarParsing.varType.int, + "Benchmark number for Non-Res weight. SHould be in range 1-12") + + + +# call the customization +customize(process) + +process.bbggtree.puReWeight=cms.bool( bool(customize.PURW) ) +if customize.PURW == False: + process.bbggtree.puTarget = cms.vdouble() +print "I'M HERE 2.0" + + +process.bbggtree.benchmark=cms.untracked.uint32(customize.bench) +if customize.bench>0: + print "I'M HERE 2.1" + process.bbggtree.getNonResGenInfo=cms.untracked.bool(True) + +print "I'M HERE 2.2" + +maxEvents = 5 +if customize.maxEvents: + maxEvents = int(customize.maxEvents) + +inputFile = "/store/user/rateixei/flashgg/RunIISpring15-50ns/Spring15BetaV2/GluGluToRadionToHHTo2B2G_M-650_narrow_13TeV-madgraph/RunIISpring15-50ns-Spring15BetaV2-v0-RunIISpring15DR74-Asympt25ns_MCRUN2_74_V9-v1/150804_164203/0000/myMicroAODOutputFile_1.root" #RadFiles['650'] +if customize.inputFiles: + inputFile = customize.inputFiles + +outputFile = "rest_rad700.root" +if customize.outputFile: + outputFile = customize.outputFile + +print customize.inputFiles, customize.outputFile, customize.maxEvents, customize.doSelection, customize.doDoubleCountingMitigation, customize.nPromptPhotons + +process.bbggtree.OutFileName = cms.untracked.string(outputFile) + +print bcolors.OKBLUE + "########################################################################" + bcolors.ENDC +print bcolors.OKBLUE + "# _ _ _ _ _ _ _____ #" + bcolors.ENDC +print bcolors.OKBLUE + "# | | | || | | || | | | |_ _| #" + bcolors.ENDC +print bcolors.OKBLUE + "# | |_| || |_| || |__ | |__ __ _ __ _ | | _ __ ___ ___ #" + bcolors.ENDC +print bcolors.OKBLUE + "# | _ || _ || '_ \ | '_ \ / _` | / _` | | | | '__| / _ \ / _ \ #" + bcolors.ENDC +print bcolors.OKBLUE + "# | | | || | | || |_) || |_) || (_| || (_| | | | | | | __/| __/ #" + bcolors.ENDC +print bcolors.OKBLUE + "# \_| |_/\_| |_/|_.__/ |_.__/ \__, | \__, | \_/ |_| \___| \___| #" + bcolors.ENDC +print bcolors.OKBLUE + "# __/ | __/ | #" + bcolors.ENDC +print bcolors.OKBLUE + "# |___/ |___/ #" + bcolors.ENDC +print bcolors.OKBLUE + "########################################################################" + bcolors.ENDC +print bcolors.FAIL + "Is it performing the analysis selection?",customize.doSelection, bcolors.ENDC +print bcolors.FAIL + "Is it removing double counted photons from QCD/GJet/DiPhotonJets?",customize.doDoubleCountingMitigation, bcolors.ENDC +if customize.doSelection is True: + process.bbggtree.doSelectionTree = cms.untracked.uint32(1) +if customize.doSelection is False: + process.bbggtree.doSelectionTree = cms.untracked.uint32(0) +if customize.doDoubleCountingMitigation is True: + process.bbggtree.doDoubleCountingMitigation = cms.untracked.uint32(1) + process.bbggtree.nPromptPhotons = cms.untracked.uint32(customize.nPromptPhotons) + print "Number of prompt photons in DiPhotonCandidate:",customize.nPromptPhotons +if customize.doDoubleCountingMitigation is False: + process.bbggtree.doDoubleCountingMitigation = cms.untracked.uint32(0) + +process.bbggtree.doSigmaMdecorr = 1 +process.bbggtree.sigmaMdecorrFile = cms.untracked.FileInPath("flashgg/Taggers/data/diphoMVA_sigmaMoMdecorr_split_Mgg40_180.root") +process.bbggtree.MVAResultTag = cms.InputTag('flashggDiPhotonMVA') + +#set using TnP and ele trigger for 2016 +process.bbggtree.doTnP = cms.untracked.uint32(1) +process.bbggtree.myTriggers = cms.untracked.vstring("HLT_Ele27_WPTight_Gsf_v") +#process.bbggtree.myTriggers = cms.untracked.vstring("HLT_Diphoton30_18_R9Id_OR_IsoCaloId_AND_HE_R9Id_Mass90_v") + +#### 2015 triggers +#process.hltHighLevel= hltHighLevel.clone(HLTPaths = cms.vstring("HLT_Diphoton30_18_R9Id_OR_IsoCaloId_AND_HE_R9Id_Mass95_v*", +# "HLT_Diphoton30PV_18PV_R9Id_AND_IsoCaloId_AND_HE_R9Id_DoublePixelVeto_Mass55_v*", +# "HLT_Diphoton30EB_18EB_R9Id_OR_IsoCaloId_AND_HE_R9Id_DoublePixelVeto_Mass55_v*") ) +#### 2016 trigger +#process.hltHighLevel= hltHighLevel.clone(HLTPaths = cms.vstring("HLT_Diphoton30_18_R9Id_OR_IsoCaloId_AND_HE_R9Id_Mass90_v*", + +import flashgg.Taggers.flashggTags_cff as flashggTags +process.load("flashgg.Taggers.flashggTags_cff") + +import flashgg.Taggers.flashggUpdatedIdMVADiPhotons_cfi as flashggPhotonMVA +flashggPhotonMVA.flashggUpdatedIdMVADiPhotons.reRunRegression = cms.bool(False) +process.load("flashgg.Taggers.flashggUpdatedIdMVADiPhotons_cfi") + +import flashgg.Taggers.flashggPreselectedDiPhotons_cfi as flashggPreSelection +process.load("flashgg.Taggers.flashggPreselectedDiPhotons_cfi") +#invert electron veto for TnP +flashggPreSelection.flashggPreselectedDiPhotons.variables[-1] = "-(passElectronVeto - 1)" + +import flashgg.Taggers.flashggDiPhotonMVA_cfi as flashggDiPhotonMVA +process.load("flashgg.Taggers.flashggDiPhotonMVA_cfi") +flashggDiPhotonMVA.DiPhotonTag = cms.untracked.InputTag('flashggDiPhotons') + + +process.p = cms.Path( flashggPhotonMVA.flashggUpdatedIdMVADiPhotons + * flashggPreSelection.flashggPreselectedDiPhotons + * flashggDiPhotonMVA.flashggDiPhotonMVA + * flashggTags.flashggUnpackedJets + * process.bbggtree ) + +#process.p = cms.Path( flashggPhotonMVA.flashggUpdatedIdMVADiPhotons +# * flashggTags.flashggUnpackedJets +# * process.bbggtree) diff --git a/test/RunJobs/MakeTrees_FLASHgg_data_TnP.py b/test/RunJobs/MakeTrees_FLASHgg_data_TnP.py new file mode 100644 index 0000000..44dbbc9 --- /dev/null +++ b/test/RunJobs/MakeTrees_FLASHgg_data_TnP.py @@ -0,0 +1,153 @@ +import FWCore.ParameterSet.Config as cms +from flashgg.bbggTools.pColors import * +import flashgg.Taggers.flashggTags_cff as flashggTags + +process = cms.Process("bbggtree") +process.load("flashgg.bbggTools.bbggTree_cfi") +process.bbggtree.rho = cms.InputTag('fixedGridRhoAll') +process.bbggtree.vertexes = cms.InputTag("offlineSlimmedPrimaryVertices") +#process.bbggtree.puInfo=cms.InputTag("slimmedAddPileupInfo") +process.bbggtree.lumiWeight = cms.double(1.0) +process.bbggtree.intLumi = cms.double(1.0) +process.bbggtree.puReWeight=cms.bool(False) +#process.bbggtree.puBins=cms.vdouble() +#process.bbggtree.dataPu=cms.vdouble() +#process.bbggtree.mcPu=cms.vdouble() + +process.source = cms.Source("PoolSource", + # replace 'myfile.root' with the source file you want to use + fileNames = cms.untracked.vstring("test.root") +) + +process.load("FWCore.MessageService.MessageLogger_cfi") +process.maxEvents = cms.untracked.PSet( input = cms.untracked.int32(-1) ) +process.MessageLogger.cerr.FwkReport.reportEvery = cms.untracked.int32( 2000 ) + +# import flashgg customization +from flashgg.MetaData.JobConfig import customize +import FWCore.ParameterSet.VarParsing as VarParsing +# set default options if needed +customize.setDefault("maxEvents",-1) +customize.setDefault("targetLumi",2.58e+3) + +customize.register('doSelection', + False, + VarParsing.VarParsing.multiplicity.singleton, + VarParsing.VarParsing.varType.bool, + 'False: Make tree before selection; True: Make tree after selection') +customize.register('doDoubleCountingMitigation', + False, + VarParsing.VarParsing.multiplicity.singleton, + VarParsing.VarParsing.varType.bool, + 'False: Do not remove double counted photons from QCD/GJet/DiPhotonJets; True: Remove double counted photons from QCD/GJet/DiPhotonJets') +customize.register('nPromptPhotons', + 0, + VarParsing.VarParsing.multiplicity.singleton, + VarParsing.VarParsing.varType.int, + 'Number of prompt photons to be selected - to use this, set doDoubleCountingMitigation=1') + +# call the customization +customize(process) + +maxEvents = 5 +if customize.maxEvents: + maxEvents = int(customize.maxEvents) + +inputFile = "/store/user/rateixei/flashgg/RunIISpring15-50ns/Spring15BetaV2/GluGluToRadionToHHTo2B2G_M-650_narrow_13TeV-madgraph/RunIISpring15-50ns-Spring15BetaV2-v0-RunIISpring15DR74-Asympt25ns_MCRUN2_74_V9-v1/150804_164203/0000/myMicroAODOutputFile_1.root" #RadFiles['650'] +if customize.inputFiles: + inputFile = customize.inputFiles + +outputFile = "rest_rad700.root" +if customize.outputFile: + outputFile = customize.outputFile + +print customize.inputFiles, customize.outputFile, customize.maxEvents, customize.doSelection, customize.doDoubleCountingMitigation, customize.nPromptPhotons + +#process.load("flashgg.bbggTools.bbggTree_cfi") +process.load("flashgg.Taggers.flashggTags_cff") +process.bbggtree.OutFileName = cms.untracked.string(outputFile) + +from HLTrigger.HLTfilters.hltHighLevel_cfi import hltHighLevel +#### 2015 triggers +#process.hltHighLevel= hltHighLevel.clone(HLTPaths = cms.vstring("HLT_Diphoton30_18_R9Id_OR_IsoCaloId_AND_HE_R9Id_Mass95_v*", +# "HLT_Diphoton30PV_18PV_R9Id_AND_IsoCaloId_AND_HE_R9Id_DoublePixelVeto_Mass55_v*", +# "HLT_Diphoton30EB_18EB_R9Id_OR_IsoCaloId_AND_HE_R9Id_DoublePixelVeto_Mass55_v*") ) +#### 2016 trigger + + +#process.hltHighLevel= hltHighLevel.clone(HLTPaths = cms.vstring("HLT_Diphoton30_18_R9Id_OR_IsoCaloId_AND_HE_R9Id_Mass90_v*", + +#probably not needed to rerun also the trigger here since for tnp is done internally +process.hltHighLevel= hltHighLevel.clone(HLTPaths = cms.vstring("HLT_Ele27_WPTight_Gsf_v*")) +#set using TnP and ele trigger for 2016 +process.bbggtree.doTnP = cms.untracked.uint32(1) +process.bbggtree.myTriggers = cms.untracked.vstring("HLT_Ele27_WPTight_Gsf_v") + + +process.options = cms.untracked.PSet( wantSummary = cms.untracked.bool(True) ) + +############# Geometry ############### +process.load("Geometry.CMSCommonData.cmsIdealGeometryXML_cfi") +process.load("Geometry.CaloEventSetup.CaloGeometry_cfi") +process.load("Geometry.CaloEventSetup.CaloTopology_cfi") +process.load('RecoMET.METFilters.eeBadScFilter_cfi') +process.load("Configuration.Geometry.GeometryECALHCAL_cff") +process.eeBadScFilter.EERecHitSource = cms.InputTag("reducedEgamma","reducedEERecHits") # Saved MicroAOD Collection (data only) + +process.dataRequirements = cms.Sequence() + +process.dataRequirements += process.hltHighLevel +process.dataRequirements += process.eeBadScFilter + + +print bcolors.OKBLUE + "########################################################################" + bcolors.ENDC +print bcolors.OKBLUE + "# _ _ _ _ _ _ _____ #" + bcolors.ENDC +print bcolors.OKBLUE + "# | | | || | | || | | | |_ _| #" + bcolors.ENDC +print bcolors.OKBLUE + "# | |_| || |_| || |__ | |__ __ _ __ _ | | _ __ ___ ___ #" + bcolors.ENDC +print bcolors.OKBLUE + "# | _ || _ || '_ \ | '_ \ / _` | / _` | | | | '__| / _ \ / _ \ #" + bcolors.ENDC +print bcolors.OKBLUE + "# | | | || | | || |_) || |_) || (_| || (_| | | | | | | __/| __/ #" + bcolors.ENDC +print bcolors.OKBLUE + "# \_| |_/\_| |_/|_.__/ |_.__/ \__, | \__, | \_/ |_| \___| \___| #" + bcolors.ENDC +print bcolors.OKBLUE + "# __/ | __/ | #" + bcolors.ENDC +print bcolors.OKBLUE + "# |___/ |___/ #" + bcolors.ENDC +print bcolors.OKBLUE + "########################################################################" + bcolors.ENDC +print bcolors.FAIL + "Is it performing the analysis selection?",customize.doSelection, bcolors.ENDC +print bcolors.FAIL + "Is it removing double counted photons from QCD/GJet/DiPhotonJets?",customize.doDoubleCountingMitigation, bcolors.ENDC +if customize.doSelection is True: + process.bbggtree.doSelectionTree = cms.untracked.uint32(1) +if customize.doSelection is False: + process.bbggtree.doSelectionTree = cms.untracked.uint32(0) +if customize.doDoubleCountingMitigation is True: + process.bbggtree.doDoubleCountingMitigation = cms.untracked.uint32(1) + process.bbggtree.nPromptPhotons = cms.untracked.uint32(customize.nPromptPhotons) + print "Number of prompt photons in DiPhotonCandidate:",customize.nPromptPhotons +if customize.doDoubleCountingMitigation is False: + process.bbggtree.doDoubleCountingMitigation = cms.untracked.uint32(0) + +process.bbggtree.doSigmaMdecorr = 1 +process.bbggtree.sigmaMdecorrFile = cms.untracked.FileInPath("flashgg/Taggers/data/diphoMVA_sigmaMoMdecorr_split_Mgg40_180.root") +process.bbggtree.MVAResultTag = cms.InputTag('flashggDiPhotonMVA') + +import flashgg.Taggers.flashggUpdatedIdMVADiPhotons_cfi as flashggPhotonMVA +#flashggPhotonMVA.flashggUpdatedIdMVADiPhotons.reRunRegression = cms.bool(False) +process.load("flashgg.Taggers.flashggUpdatedIdMVADiPhotons_cfi") + +import flashgg.Taggers.flashggPreselectedDiPhotons_cfi as flashggPreSelection +process.load("flashgg.Taggers.flashggPreselectedDiPhotons_cfi") +#invert electron veto for TnP +flashggPreSelection.flashggPreselectedDiPhotons.variables[-1] = "-(passElectronVeto - 1)" + + +import flashgg.Taggers.flashggDiPhotonMVA_cfi as flashggDiPhotonMVA +process.load("flashgg.Taggers.flashggDiPhotonMVA_cfi") + +process.p = cms.Path( process.dataRequirements + * flashggPhotonMVA.flashggUpdatedIdMVADiPhotons + * flashggPreSelection.flashggPreselectedDiPhotons + * flashggDiPhotonMVA.flashggDiPhotonMVA + * flashggTags.flashggUnpackedJets + * process.bbggtree ) + +#process.p = cms.Path( process.dataRequirements +# * flashggPhotonMVA.flashggUpdatedIdMVADiPhotons +# * flashggTags.flashggUnpackedJets +# * process.bbggtree)