from CMGTools.XZZ2l2nu.RootTools import * from PhysicsTools.HeppyCore.framework.heppy_loop import getHeppyOption #Load all common analyzers from CMGTools.XZZ2l2nu.analyzers.coreXZZ_cff import * from CMGTools.XZZ2l2nu.analyzers.XZZMuonEffTree import * #-------- SAMPLES AND TRIGGERS ----------- from CMGTools.XZZ2l2nu.samples.loadSamples76x import * #-------- Analyzer from CMGTools.XZZ2l2nu.analyzers.treeXZZ_cff import * meffAna = cfg.Analyzer(XZZMuonEffTree, name='mEffTree', genfilter=False, pfbkg=True, checktag=True, muHLT="HLT_IsoMu20_v") lepeffTreeProducer.globalVariables.extend([ NTupleVariable( "nHadron", lambda ev: len(ev.selectedhadrons) if hasattr(ev, "selectedhadrons") else 0, int), NTupleVariable( "nMuontagged", lambda ev: len(ev.selectedMuonstagged) if hasattr(ev, "selectedMuonstagged") else 0, int), ]) lepAna.applyIso = False lepAna.applyID = False vertexAna.keepFailingEvents = True
#-------- Analyzer from CMGTools.XZZ2l2nu.analyzers.treeXZZ_cff import * leptonicVAna.selectMuMuPair = (lambda x: ((x.leg1.pt() > 35 or x.leg2.pt() > 35))) leptonicVAna.selectElElPair = ( lambda x: x.leg1.pt() > 50.0 or x.leg2.pt() > 50.0) leptonicVAna.selectVBoson = (lambda x: x.mass() > 50.0 and x.mass() < 180.0) multiStateAna.selectPairLLNuNu = ( lambda x: x.leg1.mass() > 50.0 and x.leg1.mass() < 180.0) jetAna.smearJets = False #-------- SEQUENCE #sequence = cfg.Sequence(coreSequence+[vvSkimmer,vvTreeProducer]) trgEffAna = cfg.Analyzer(XZZTrgEff, name="TriggerEfficiencyAnalyzer", eleHLT='HLT_Ele105_CaloIdVT_GsfTrkIdT', muHLT='HLT_Mu45_eta2p1') coreSequence = [ skimAnalyzer, genAna, jsonAna, triggerAna, pileUpAna, vertexAna, lepAna, jetAna, metAna, leptonicVAna, multiStateAna, eventFlagsAna,
coreSequence = [ skimAnalyzer, genAna, jsonAna, triggerAna, pileUpAna, vertexAna, lepAna, metAna, leptonicVAna, multiStateAna, triggerFlagsAna, ] #sequence = cfg.Sequence(coreSequence) sequence = cfg.Sequence(coreSequence + [vvSkimmer, vvTreeProducer]) #-------- HOW TO RUN test = 1 if test == 1: # test a single component, using a single thread. selectedComponents = dataSamples #selectedComponents = [SingleMuon_Run2015D_05Oct] #selectedComponents = mcSamples #selectedComponents = [SingleMuon_Run2015D_Promptv4,SingleElectron_Run2015D_Promptv4] #[SingleElectron_Run2015D_Promptv4,SingleElectron_Run2015D_05Oct] #selectedComponents = [RSGravToZZToZZinv_narrow_800] #selectedComponents = [BulkGravToZZ_narrow_800] #selectedComponents = [BulkGravToZZToZlepZhad_narrow_800] for c in selectedComponents: #c.files = c.files[0]
from CMGTools.XZZ2l2nu.analyzers.AutoFillTreeProducer import * from CMGTools.XZZ2l2nu.analyzers.XZZTypes import * from CMGTools.XZZ2l2nu.analyzers.XZZGenLep import * from CMGTools.XZZ2l2nu.samples.loadSamples76x import * from CMGTools.XZZ2l2nu.analyzers.coreXZZ_cff import * #-------- SEQUENCE vertexAna.keepFailingEvents=True genLep=cfg.Analyzer( XZZGenLep, name="genleptoneffAnalyzer", muons='slimmedMuons', electrons='slimmedElectrons', packedCandidates = 'packedPFCandidates', rhoMuon= 'fixedGridRhoFastjetCentralNeutral', rhoElectron = 'fixedGridRhoFastjetCentralNeutral', # rhoElectron = 'fixedGridRhoFastjetAll', mu_isoCorr = "rhoArea" , ele_isoCorr = "rhoArea" , mu_effectiveAreas = "Spring15_25ns_v1", ele_effectiveAreas = "Spring15_25ns_v1", miniIsolationPUCorr = None, # Allowed options: 'rhoArea' (EAs for 03 cone scaled by R^2), 'deltaBeta', # 'raw' (uncorrected), 'weights' (delta beta weights; not validated) # Choose None to just use the individual object's PU correction ) leptonType = NTupleObjectType("lepton", baseObjectTypes = [ particleType ], variables = [ NTupleVariable("charge", lambda x : x.charge(), int), NTupleVariable("hasgen", lambda x : getattr(x,"hasgen",-1), help="has gen particle"), # Impact parameter NTupleVariable("dxy", lambda x : x.dxy(), help="d_{xy} with respect to PV, in cm (with sign)"), NTupleVariable("dz", lambda x : x.dz() , help="d_{z} with respect to PV, in cm (with sign)"),