def makeSatelliteJets(self, cands): toolbox = PyJetToolbox(cands) toolbox.setInterface(True, self.cfg_ana.ktPower, self.cfg_ana.r) toolbox.setMassDrop(False) toolbox.setSubjets(False, 'inc', 2) toolbox.setPruning(False) toolbox.setNtau(False) toolbox.setSoftDrop(False) unfiltered = toolbox.inclusiveJets(30.0, False) if self.attachBTag: for j in unfiltered: for standard in self.handles['jets'].product(): if deltaR(j.eta(), j.phi(), standard.eta(), standard.phi()) < 0.1: j.btag = standard.bDiscriminator( self.btagDiscriminator) break if self.jetReCalibrator is not None: self.jetReCalibrator.correctAll(unfiltered, self.rho, self.shiftJEC, True, False, [0., 0.], [0., 0., 0.]) for p in unfiltered: p.setRawFactor(1.0 / p.corr) filtered = filter(lambda x: x.pt() > 30, unfiltered) return filtered else: return unfiltered
def makeFatJets(self, cands): toolboxFat = PyJetToolbox(cands) toolboxFat.setInterface(True, self.cfg_ana.ktPowerFat, self.cfg_ana.rFat) toolboxFat.setMassDrop(self.cfg_ana.massdrop) toolboxFat.setSubjets(True, 'inc', self.cfg_ana.subjets) toolboxFat.setPruning(self.cfg_ana.prunning) toolboxFat.setNtau(True) if hasattr(self.cfg_ana, 'softdrop_beta'): toolboxFat.setSoftDrop(self.cfg_ana.softdrop, self.cfg_ana.softdrop_beta, self.cfg_ana.softdrop_zeta) else: toolboxFat.setSoftDrop(self.cfg_ana.softdrop) # Lets cluster !! Fat jets first fatJets = toolboxFat.inclusiveJets(200.0, True) filtered = filter(self.selectFat, fatJets) ##Apply JECS in original,SoftDrop and pruned: if self.jetReCalibratorFAT is not None: prunedJets = [] for j in fatJets: prunedJets.append(j) prunedJets.append(j.softDropJet) prunedJets.append(j.prunedJet) #do not apply L1 corrections:rho=0.0 self.jetReCalibratorFAT.correctAll(prunedJets, 0.0, self.shiftJEC, True, False, [0., 0.], [0., 0., 0.]) # self.jetReCalibratorFAT.correctAll(originalJets, self.rho, self.shiftJEC,True,False,[0.,0.],[0.,0.,0.]) for p in prunedJets: p.setRawFactor(1.0 / p.corr) standardFatJets = self.handles['fatjets'].product() if self.attachBTag: for fat in filtered: for standardFat in standardFatJets: fat.btag = standardFat.bDiscriminator( self.btagDiscriminator) for j in fat.subjets_SD + fat.subjets: for standard in self.handles['subjets'].product(): if deltaR(j.eta(), j.phi(), standard.eta(), standard.phi()) < 0.1: j.btag = standard.bDiscriminator( self.btagDiscriminator) break return filtered
def makeSatelliteJets(self,cands): toolbox = PyJetToolbox(cands) toolbox.setInterface(True,self.cfg_ana.ktPower,self.cfg_ana.r) toolbox.setMassDrop(False) toolbox.setSubjets(False,'inc',2) toolbox.setPruning(False) toolbox.setNtau(False) toolbox.setSoftDrop(False) unfiltered = toolbox.inclusiveJets(30.0,False) if self.attachBTag: for j in unfiltered: for standard in self.handles['jets'].product(): if deltaR(j.eta(),j.phi(),standard.eta(),standard.phi())<0.1: j.btag = standard.bDiscriminator(self.btagDiscriminator) break if self.jetReCalibrator is not None: self.jetReCalibrator.correctAll(unfiltered, self.rho, self.shiftJEC,True,False,[0.,0.],[0.,0.,0.]) for p in unfiltered: p.setRawFactor(1.0/p.corr) filtered=filter(lambda x: x.pt()>30, unfiltered) return filtered else: return unfiltered
def makeFatJets(self,cands): toolboxFat = PyJetToolbox(cands) toolboxFat.setInterface(True,self.cfg_ana.ktPowerFat,self.cfg_ana.rFat) toolboxFat.setMassDrop(self.cfg_ana.massdrop) toolboxFat.setSubjets(True,'inc',self.cfg_ana.subjets) toolboxFat.setPruning(self.cfg_ana.prunning) toolboxFat.setNtau(True) if hasattr(self.cfg_ana,'softdrop_beta'): toolboxFat.setSoftDrop(self.cfg_ana.softdrop,self.cfg_ana.softdrop_beta,self.cfg_ana.softdrop_zeta) else: toolboxFat.setSoftDrop(self.cfg_ana.softdrop) # Lets cluster !! Fat jets first fatJets=toolboxFat.inclusiveJets(200.0,True) filtered = filter(self.selectFat,fatJets) ##Apply JECS in SoftDrop and Pruned: if self.jetReCalibratorFAT is not None: prunedJets=[] for j in fatJets: prunedJets.append(j.softDropJet) prunedJets.append(j.prunedJet) self.jetReCalibratorFAT.correctAll(prunedJets, self.rho, self.shiftJEC,True,False,[0.,0.],[0.,0.,0.]) for p in prunedJets: p.setRawFactor(1.0/p.corr) standardFatJets = self.handles['fatjets'].product() if self.attachBTag: for fat in filtered: for standardFat in standardFatJets: fat.btag = standardFat.bDiscriminator(self.btagDiscriminator) for j in fat.subjets_SD+fat.subjets: for standard in self.handles['subjets'].product(): if deltaR(j.eta(),j.phi(),standard.eta(),standard.phi())<0.1: j.btag = standard.bDiscriminator(self.btagDiscriminator) break return filtered
def makeSatelliteJets(self,cands): toolbox = PyJetToolbox(cands) toolbox.setInterface(True,self.cfg_ana.ktPower,self.cfg_ana.r) toolbox.setMassDrop(False) toolbox.setSubjets(False,'inc',2) toolbox.setPruning(False) toolbox.setNtau(False) toolbox.setSoftDrop(False) return toolbox.inclusiveJets(30.0,False)
def makeFatJets(self,cands): toolboxFat = PyJetToolbox(cands) toolboxFat.setInterface(True,self.cfg_ana.ktPowerFat,self.cfg_ana.rFat) toolboxFat.setMassDrop(self.cfg_ana.massdrop) toolboxFat.setSubjets(True,'inc',self.cfg_ana.subjets) toolboxFat.setPruning(self.cfg_ana.prunning) toolboxFat.setNtau(True) toolboxFat.setSoftDrop(self.cfg_ana.softdrop) # Lets cluster !! Fat jets first fatJets=toolboxFat.inclusiveJets(100.0,True) return filter(self.selectFat,fatJets)