#Import tool that creates the cut sequence from UWAnalysis.Configuration.tools.CutSequenceProducer import * ######################__________________________________MMMT_____________________________________############################## MMMTanalysisConfigurator = CutSequenceProducer(initialCounter = 'initialEventsMMMT', pyModuleName = __name__, pyNameSpace = locals()) #nSVfitTrackService = cms.Service("NSVfitTrackService") #Add smearing MMMTanalysisConfigurator.addSmearing('patOverloadedTaus','patMuonsForAnalysis','convRejElectrons','selectedPatJets') MMMTanalysisConfigurator.addDiCandidateModule('MMMTdiMuons','PATMuPairProducer', 'smearedMuons','smearedMuons','smearedMET','smearedJets',1,genParticles='genDaughters') MMMTanalysisConfigurator.addSelector('MMMTosDiMuons','PATMuPairSelector','charge==0&&leg1.isGlobalMuon()&&leg2.isGlobalMuon()&& mass>40 && abs(leg1.eta())<2.4 && abs(leg2.eta())<2.4','MMMTDiMuonCreation',1) MMMTanalysisConfigurator.addDiCandidateModule('MMMTmuTau','PATMuTauPairProducer', 'smearedMuons','smearedTaus','smearedMET','smearedJets',1,9999,text = 'MMMTAtLeastOneMuTau',leadingObjectsOnly = False,dR = 0.3,recoMode = "",genParticles='genDaughters') MMMTanalysisConfigurator.addDiCandidateModule('MMMTzzCands','PATMuMuMuTauQuadProducer','MMMTosDiMuons','MMMTmuTau','smearedMET','smearedJets',1,9999,text='MMMTAtLeastOneZZ',leadingObjectsOnly = False,dR = 0.01,recoMode ="",genParticles='genDaughters') MMMTanalysisConfigurator.addCrossCleanerModule('MMMTzzCleanedCands','PATMuMuMuTauQuadCrossCleaner',1,9999,text='MMMTAtLeastOneZZCleanedCandidate',dR = 0.1) MMMTanalysisConfigurator.addSelector('MMMTzzMuID','PATMuMuMuTauQuadSelector','leg1.leg1.isGlobalMuon()&&leg1.leg1.isTrackerMuon()&&leg1.leg2.isTrackerMuon()&&leg1.leg2.isTrackerMuon()','MMMTLeadingZMuID') MMMTanalysisConfigurator.addSelector('MMMTzzMuIso','PATMuMuMuTauQuadSelector','(leg1.leg1.chargedHadronIso()+max(leg1.leg1.photonIso()+leg1.leg1.neutralHadronIso()-0.5*leg1.leg1.userIso(0),0.0))/leg1.leg1.pt()<0.25&&(leg1.leg2.chargedHadronIso()+max(leg1.leg2.photonIso()+leg1.leg2.neutralHadronIso()-0.5*leg1.leg2.userIso(0),0.0))/leg1.leg2.pt()<0.25','MMMTLeadingZMuIso') MMMTanalysisConfigurator.addSelector('MMMTzzMuID2','PATMuMuMuTauQuadSelector','leg2.leg1.isGlobalMuon()&&leg2.leg1.isTrackerMuon()','MMMTSecondZMuID') MMMTanalysisConfigurator.addSelector('MMMTzzTauID','PATMuMuMuTauQuadSelector','leg2.leg2.tauID("decayModeFinding")','MMMTTauDecayModeFinding') MMMTanalysisConfigurator.addSelector('MMMTzzTauDiscr','PATMuMuMuTauQuadSelector','leg2.leg2.tauID("againstElectronLoose")&&leg2.leg2.tauID("againstMuonTight")','MMMTTauLeptonDiscrimantor') MMMTanalysisConfigurator.addSelector('MMMTzzMuIso2','PATMuMuMuTauQuadSelector','(leg2.leg1.chargedHadronIso()+max(leg2.leg1.photonIso()+leg2.leg1.neutralHadronIso()-0.5*leg2.leg1.userIso(0),0.0))/leg2.leg1.pt()<0.15','MMMTSecondZMuIso') MMMTanalysisConfigurator.addSelector('MMMTzzTauIso','PATMuMuMuTauQuadSelector','leg2.leg2.tauID("byLooseCombinedIsolationDeltaBetaCorr")','MMMTTauLooseIsolation') MMMTanalysisConfigurator.addSorter('MMMTzzCleanedCandsSortedByZMass','PATMuMuMuTauQuadSorterByZMass') MMMTanalysisConfigurator.addSelector('MMMTzzCleanedCandsAboveThreshold','PATMuMuMuTauQuadSelector','leg1().leg1().pt()>20 && leg1().leg2().pt()>10 && leg2().leg1().pt()>10 &&leg2().leg2().pt()>20 && abs(leg2.leg1.eta())<2.4 && abs(leg2.leg2.eta())<2.3','MMMTAtLeastOneZZCandOverThresholds') MMMTanalysisConfigurator.addSelector('MMMTzzCleanedCandsMuTauQ','PATMuMuMuTauQuadSelector','leg2.charge()==0','MMMTMuTauCharge') MMMTanalysisConfigurator.addSelector('MMMTzzCleanedCandsMMMass','PATMuMuMuTauQuadSelector','leg1.mass()>60&&leg1.mass()<120','MMMTMMMass') MMMTanalysisConfigurator.addSorter('MMMTFinalSel','PATMuMuMuTauQuadSorterByZMass') MMMTanalysisConfigurator.addSelector('MMMTzzCleanedCandsMTMass','PATMuMuMuTauQuadSelector','leg2.mass()>30&&leg2.mass()<80','MMMTMTMass') #MMMTanalysisConfigurator.addMuMuMuTauNSVFit('muMuMuTauNSVFit') #create the sequence
pyNameSpace = locals()) ZEE.addDiCandidateModule('ZEEInit','PATElePairProducer', 'looseElectrons','looseElectrons','systematicsMET','selectedPatJets',1,genParticles='genDaughters') ZEE.addSelector('ZEESel','PATElePairSelector','mass>40&&charge==0&&leg1.userFloat("mvaNonTrigV0Pass")>0 && leg1.gsfTrack().trackerExpectedHitsInner().numberOfHits()<2 && leg1.pt()>7 && abs(leg1.eta())<2.5 && abs(leg1.userFloat("ip3DS"))<4 && abs(leg1.userFloat("ipDXY"))<0.5 && abs(leg1.userFloat("dz"))<1.0 && leg2.userFloat("mvaNonTrigV0Pass")>0 && leg2.gsfTrack().trackerExpectedHitsInner().numberOfHits()<2 && leg2.pt()>7 && abs(leg2.eta())<2.5 && abs(leg2.userFloat("ip3DS"))<4 && abs(leg2.userFloat("ipDXY"))<0.5 && abs(leg2.userFloat("dz"))<1.0','one Z1 eem',1) ZEE.addSelector('ZEEIso','PATElePairSelector','(leg1.chargedHadronIso()+max(0.0,leg1.neutralHadronIso()+leg1.photonIso()-leg1.userFloat("zzRho2012")*leg1.userFloat("effArea")))/leg1.pt<0.40 && (leg2.chargedHadronIso()+max(0.0,leg2.neutralHadronIso()+leg2.photonIso()-leg2.userFloat("zzRho2012")*leg2.userFloat("effArea")))/leg2.pt<0.40','EEMLeadingZMuIso') ZEE.addSorter('ZEEFinal',"PATElePairSorter") ZEESeq = ZEE.returnSequence() #MMM tri MMMtri = CutSequenceProducer(initialCounter = 'initialEventsMMM', pyModuleName = __name__, pyNameSpace = locals()) MMMtri.addHLTFilter("MMMHLT",DATAMC2012TriggerPaths,"MMM HLT_req") MMMtri.addDiCandidateModule('triMMMdiMuons','PATMuPairProducer', 'looseMuons','looseMuons','systematicsMET','selectedPatJets',1,genParticles='genDaughters') MMMtri.addSelector('triMMMosDiMuons','PATMuPairSelector','mass>40&&charge==0&&leg1.pfCandidateRef().isNonnull()&&(leg1.isGlobalMuon()||leg1.isTrackerMuon())&&abs(leg1.eta())<2.4 && leg1.pt()>5 && abs(leg1.userFloat("ip3DS"))<4 && abs(leg1.userFloat("ipDXY"))<0.5 && abs(leg1.userFloat("dz"))<1.0&&leg2.pfCandidateRef().isNonnull()&&(leg2.isGlobalMuon()||leg2.isTrackerMuon())&&abs(leg2.eta())<2.4 && leg2.pt()>5 && abs(leg2.userFloat("ip3DS"))<4 && abs(leg2.userFloat("ipDXY"))<0.5 && abs(leg2.userFloat("dz"))<1.0 ','one Z1 MMM',1) MMMtri.addDiCandidateModule('triMMMzzCands','PATMuMuMuTriProducer','triMMMosDiMuons','looseMuons','systematicsMET','selectedPatJets',1,9999,text='MMMAtLeastOneZZ',leadingObjectsOnly = False,dR = 0.01,recoMode ="",genParticles='genDaughters') MMMtri.addCrossCleanerModule('triMMMzzCleanedCands','PATMuMuMuTriCrossCleaner',1,9999,text='MMMAtLeastOneZZCleanedCandidate',dR = 0.02) MMMtri.addSelector('triMMMzzMuIso','PATMuMuMuTriSelector','(leg1.leg1.chargedHadronIso()+max(0.0,leg1.leg1.neutralHadronIso()+leg1.leg1.photonIso()-leg1.leg1.userFloat("zzRho2012")*leg1.leg1.userFloat("effArea")))/leg1.leg1.pt<0.40 && (leg1.leg2.chargedHadronIso()+max(0.0,leg1.leg2.neutralHadronIso()+leg1.leg2.photonIso()-leg1.leg2.userFloat("zzRho2012")*leg1.leg2.userFloat("effArea")))/leg1.leg2.pt<0.40 ','MMMLeadingZMuIso') MMMtri.addSelector('triMMMthirdMuID','PATMuMuMuTriSelector','leg2.pt()>5 && abs(leg2.eta())<2.4 && abs(leg2.userFloat("ipDXY"))<0.5 && abs(leg2.userFloat("dz"))<1.0 && (leg2.isGlobalMuon() || leg2.isTrackerMuon())','MMMthirdMuID') MMMSeq = MMMtri.returnSequence() #MME tri MMEtri = CutSequenceProducer(initialCounter = 'initialEventsMME', pyModuleName = __name__, pyNameSpace = locals()) MMEtri.addHLTFilter("MMEHLT",DATAMC2012TriggerPaths,"MME HLT_req") MMEtri.addDiCandidateModule('triMMEdiMuons','PATMuPairProducer', 'looseMuons','looseMuons','systematicsMET','selectedPatJets',1,genParticles='genDaughters') MMEtri.addSelector('MMEosDiMuons','PATMuPairSelector','mass>40&&charge==0&&leg1.pfCandidateRef().isNonnull()&&(leg1.isGlobalMuon()||leg1.isTrackerMuon())&&abs(leg1.eta())<2.4 && leg1.pt()>5 && abs(leg1.userFloat("ip3DS"))<4 && abs(leg1.userFloat("ipDXY"))<0.5 && abs(leg1.userFloat("dz"))<1.0 && leg2.pfCandidateRef().isNonnull()&&(leg2.isGlobalMuon()||leg2.isTrackerMuon())&&abs(leg2.eta())<2.4 && leg2.pt()>5 && abs(leg2.userFloat("ip3DS"))<4 && abs(leg2.userFloat("ipDXY"))<0.5 && abs(leg2.userFloat("dz"))<1.0 ','one Z1 MME',1) MMEtri.addDiCandidateModule('triMMEzzCands','PATMuMuEleTriProducer','MMEosDiMuons','looseElectrons','systematicsMET','selectedPatJets',1,9999,text='MMEAtLeastOneZZ',leadingObjectsOnly = False,dR = 0.01,recoMode ="",genParticles='genDaughters') MMEtri.addCrossCleanerModule('triMMEzzCleanedCands','PATMuMuEleTriCrossCleaner',1,9999,text='MMEAtLeastOneZZCleanedCandidate',dR = 0.02) MMEtri.addSelector('triMMEzzMuIso','PATMuMuEleTriSelector','(leg1.leg1.chargedHadronIso()+max(0.0,leg1.leg1.neutralHadronIso()+leg1.leg1.photonIso()-leg1.leg1.userFloat("zzRho2012")*leg1.leg1.userFloat("effArea")))/leg1.leg1.pt<0.40 && (leg1.leg2.chargedHadronIso()+max(0.0,leg1.leg2.neutralHadronIso()+leg1.leg2.photonIso()-leg1.leg2.userFloat("zzRho2012")*leg1.leg2.userFloat("effArea")))/leg1.leg2.pt<0.40 ','MMELeadingZMuIso') MMEtri.addSelector('triMMEthirdEleID','PATMuMuEleTriSelector','leg2.pt()>7 && abs(leg2.eta())<2.5 && abs(leg2.userFloat("ipDXY"))<0.5 && abs(leg2.userFloat("dz"))<1.0 && leg2.gsfTrack.trackerExpectedHitsInner.numberOfHits()<2','MMEthirdMuID')
#Import tool that creates the cut sequence from UWAnalysis.Configuration.tools.CutSequenceProducer import * analysisConfigurator = CutSequenceProducer(initialCounter = 'initialEvents', pyModuleName = __name__, pyNameSpace = locals()) #analysisConfigurator.addSmearing('patOverloadedTaus','cleanPatMuons','cleanPatElectrons','cleanPatJets','systematicsMET') analysisConfigurator.addDiCandidateModule('BASECandidates','PATMuPairProducer', 'cleanPatMuons','cleanPatMuons','systematicsMET','patOverloadedJets',0,9999,text = '',leadingObjectsOnly = False,dR = 0.15,recoMode = "") analysisConfigurator.addSorter('BASECandidatesSorted','PATMuPairSorter') analysisConfigurator.addSelector('BASECandidatesID','PATMuPairSelector','leg1.userFloat("isWWMuon")&&leg2.userFloat("isWWMuon")&&leg1.pt()>15&&leg2.pt()>15&&abs(leg1.eta)<2.5&&abs(leg2.eta)<2.5','ZMuMuID') analysisConfigurator.addDiCandidateModule('zJJCandidates','PATJetPairProducer', 'patOverloadedJets','patOverloadedJets','patMETs','patOverloadedJets',0,9999,text = '',leadingObjectsOnly = False,dR = 0.15,recoMode = "") analysisConfigurator.addSorter('zJJCandidatesSorted','PATJetPairSorter') analysisConfigurator.addSelector('zJJCandidatesID','PATJetPairSelector','leg1.pt()>25&&leg2.pt()>25&&abs(leg1.eta)<3&&abs(leg2.eta)<3','ZJJID') analysisConfigurator.addDiCandidateModule('zBASEJJ','PATMuMuJJQuadProducer','BASECandidatesID','zJJCandidatesID','patMETs','patOverloadedJets',1,9999,text='MuMuJJAtLeastOneZZ',leadingObjectsOnly = False,dR = 0.5,recoMode ="",genParticles='genDaughters') analysisConfigurator.addCrossCleanerModule('BASEJJCleanedCands','PATMuMuJJQuadCrossCleaner',1,9999,text='MMJJAtLeastOneZZCleanedCandidate',dR = 0.5) selectionSequence =analysisConfigurator.returnSequence()
analysisConfigurator = CutSequenceProducer(initialCounter = 'initialEvents', pyModuleName = __name__, pyNameSpace = locals()) #Add smearing analysisConfigurator.addSmearing('patOverloadedTaus','patMuonsForAnalysis','convRejElectrons','selectedPatJets') #Create di muon OS pairs analysisConfigurator.addDiCandidateModule('diMuons','PATMuPairProducer', 'smearedMuons','smearedMuons','smearedMET','smearedJets',1) #Require they are OS and at least Global muons analysisConfigurator.addSelector('osDiMuons','PATMuPairSelector','charge==0&&leg1.isGlobalMuon&&leg2.isGlobalMuon&& mass>60','DiMuonCreation',1) #Make DiTaus analysisConfigurator.addDiCandidateModule('diTaus','PATDiTauPairProducer','smearedTaus','smearedTaus','smearedMET','smearedJets',1,9999,text='AtLeastOneDiTau',leadingObjectsOnly = False,dR = 0.5,recoMode ="",genParticles='genDaughters') #Combine and create zz candidates analysisConfigurator.addDiCandidateModule('zzCands','PATMuMuTauTauQuadProducer','osDiMuons','diTaus','smearedMET','smearedJets',1,9999,text='AtLeastOneZZ',leadingObjectsOnly = False,dR = 0.5,recoMode ="",genParticles='genDaughters') #cross clean the legs of the ZZ (i.e the two Zs by product ID and DeltaR analysisConfigurator.addCrossCleanerModule('zzCleanedCands','PATMuMuTauTauQuadCrossCleaner',1,9999,text='AtLeastOneZZCleanedCandidate',dR = 0.1) analysisConfigurator.addSelector('zzCleanedMuID','PATMuMuTauTauQuadSelector','leg1.leg1.userFloat("isWWMuon")&&leg1.leg2.userFloat("isWWMuon")','WWMuonID') analysisConfigurator.addSelector('zzCleanedMuIso','PATMuMuTauTauQuadSelector','(leg1.leg1.isolationR03.sumPt+leg1.leg1.isolationR03.emEt+leg1.leg1.isolationR03.hadEt)/leg1.leg1.pt()<0.2&&(leg1.leg2.isolationR03.sumPt+leg1.leg2.isolationR03.emEt+leg1.leg2.isolationR03.hadEt)/leg1.leg2.pt()<0.2','LooseMuIso') #Sort your ZZ candidates by higher Z1 Pt + Z2 Pt analysisConfigurator.addSorter('zzCleanedCandsSorted','PATMuMuTauTauQuadSorter') #JustIllustrate a selector (i.e require that pt of all legs is above a threshold analysisConfigurator.addSelector('zzCleanedCandsAboveThreshold','PATMuMuTauTauQuadSelector','leg1().leg1().pt()>10 && leg1().leg2().pt()>10 && leg2().leg1().pt()>10 &&leg2().leg2().pt()>10','AtLeastOneZZCandOverThresholds') #Apply loose tau ID analysisConfigurator.addSelector('zzCleanedCandsTauID','PATMuMuTauTauQuadSelector','leg2.leg1.tauID("decayModeFinding")&&leg2.leg2.tauID("decayModeFinding")','DecayModeFinding') analysisConfigurator.addSelector('zzCleanedCandsTauIso','PATMuMuTauTauQuadSelector','leg2.leg1.tauID("byVLooseIsolation")&&leg2.leg2.tauID("byVLooseIsolation")','TauIsolation') analysisConfigurator.addSelector('zzCleanedCandsMuRej','PATMuMuTauTauQuadSelector','leg2.leg1.tauID("againstMuonLoose")&&leg2.leg2.tauID("againstMuonLoose")','TauMuRejection') analysisConfigurator.addSelector('zzCleanedCandsEleRej','PATMuMuTauTauQuadSelector','leg2.leg1.tauID("againstElectronLoose")&&leg2.leg2.tauID("againstElectronLoose")','TauEleRejection') analysisConfigurator.addSelector('zzCleanedCandsTauTauQ','PATMuMuTauTauQuadSelector','leg2.charge()==0','TauTauCharge') #create the sequence