From 0a6df5ecff4bbf68c113ea1cad2e51297516ba3e Mon Sep 17 00:00:00 2001 From: mmasciov Date: Tue, 6 Oct 2015 17:41:15 +0200 Subject: [PATCH] Heppy: adding rl_* control variables (only MT2 related) --- .../analyzers/eventtopology/MT2Analyzer.py | 54 +++++++++++++++++++ 1 file changed, 54 insertions(+) diff --git a/PhysicsTools/Heppy/python/analyzers/eventtopology/MT2Analyzer.py b/PhysicsTools/Heppy/python/analyzers/eventtopology/MT2Analyzer.py index 6b478f5363b44..e9e36faa3718e 100644 --- a/PhysicsTools/Heppy/python/analyzers/eventtopology/MT2Analyzer.py +++ b/PhysicsTools/Heppy/python/analyzers/eventtopology/MT2Analyzer.py @@ -318,6 +318,60 @@ def makeMT2(self, event): self.zll_mt2_Xj = self.getMT2Hemi(event,objectsXjc,event.zll_met,self.cfg_ana.collectionPostFix,"_Xj_zll") +## ===> rl_MT2 + + setattr(event, "mt2"+self.cfg_ana.collectionPostFix+"_rl", -999) + setattr(event, "pseudoJet1"+self.cfg_ana.collectionPostFix+"_rl", ROOT.reco.Particle.LorentzVector( 0, 0, 0, 0 )) + setattr(event, "pseudoJet2"+self.cfg_ana.collectionPostFix+"_rl", ROOT.reco.Particle.LorentzVector( 0, 0, 0, 0 )) + + if hasattr(event, 'rl_met'): + + csLeptons = [ l for l in event.selectedLeptons if l.pt() > 10 and abs(l.eta()) < 2.5 ] + + if len(csLeptons)==1 and len(objects40jc)>=2: + + self.rl_mt2 = self.getMT2Hemi(event,objects40jc,event.rl_met,self.cfg_ana.collectionPostFix,"_rl") + + setattr(event, "mt2"+self.cfg_ana.collectionPostFix+"_Xj_rl", -999) + setattr(event, "pseudoJet1"+self.cfg_ana.collectionPostFix+"_Xj_rl", ROOT.reco.Particle.LorentzVector( 0, 0, 0, 0 )) + setattr(event, "pseudoJet2"+self.cfg_ana.collectionPostFix+"_Xj_rl", ROOT.reco.Particle.LorentzVector( 0, 0, 0, 0 )) + + if hasattr(event, 'rl_met'): + + csLeptons = [ l for l in event.selectedLeptons if l.pt() > 10 and abs(l.eta()) < 2.5 ] + + if len(csLeptons)==1 and len(objectsXjc)>=2: + + self.rl_mt2_Xj = self.getMT2Hemi(event,objectsXjc,event.rl_met,self.cfg_ana.collectionPostFix,"_Xj_rl") + + +## ===> zllmt_MT2 + + setattr(event, "mt2"+self.cfg_ana.collectionPostFix+"_zllmt", -999) + setattr(event, "pseudoJet1"+self.cfg_ana.collectionPostFix+"_zllmt", ROOT.reco.Particle.LorentzVector( 0, 0, 0, 0 )) + setattr(event, "pseudoJet2"+self.cfg_ana.collectionPostFix+"_zllmt", ROOT.reco.Particle.LorentzVector( 0, 0, 0, 0 )) + + if hasattr(event, 'zllmt_met'): + + csLeptons = [ l for l in event.selectedLeptons if l.pt() > 10 and abs(l.eta()) < 2.5 ] + + if len(csLeptons)==2 and len(objects40jc)>=2: + + self.zllmt_mt2 = self.getMT2Hemi(event,objects40jc,event.zllmt_met,self.cfg_ana.collectionPostFix,"_zllmt") + + setattr(event, "mt2"+self.cfg_ana.collectionPostFix+"_Xj_zllmt", -999) + setattr(event, "pseudoJet1"+self.cfg_ana.collectionPostFix+"_Xj_zllmt", ROOT.reco.Particle.LorentzVector( 0, 0, 0, 0 )) + setattr(event, "pseudoJet2"+self.cfg_ana.collectionPostFix+"_Xj_zllmt", ROOT.reco.Particle.LorentzVector( 0, 0, 0, 0 )) + + if hasattr(event, 'zllmt_met'): + + csLeptons = [ l for l in event.selectedLeptons if l.pt() > 10 and abs(l.eta()) < 2.5 ] + + if len(csLeptons)==2 and len(objectsXjc)>=2: + + self.zllmt_mt2_Xj = self.getMT2Hemi(event,objectsXjc,event.zllmt_met,self.cfg_ana.collectionPostFix,"_Xj_zllmt") + + #### do the mt2 with one or two b jets (medium CSV) if len(event.bjetsMedium)>=2: