class JetResolution(EventFilter): """ This class applies the jet smearing in MonteCarlo samples. It needs to be called after the JetCalibration since a shallow copy is needed to apply the ASG tool. """ def __init__(self, passthrough=False, **kwargs): super(JetResolution, self).__init__(passthrough=passthrough, **kwargs) if not passthrough: from ROOT import JERTool, JERSmearingTool self.jer_tool = JERTool('JERTool') self.jer_tool.setProperty('std::string')( "PlotFileName", "JetResolution/JERProviderPlots_2012.root") self.jer_tool.setProperty('std::string')("CollectionName", "AntiKt4LCTopoJets") self.jer_tool.setProperty('std::string')("BeamEnergy", "8TeV") self.jer_tool.setProperty('std::string')("SimulationType", "FullSim") self.jer_tool.initialize() self.jer_smearing_tool = JERSmearingTool('JERSmearingTool') self.jer_smearing_tool.setProperty('std::string')('JERToolName', 'JERTool') self.jer_smearing_tool.setJERTool(self.jer_tool) self.jer_smearing_tool.setNominalSmearing(True) self.jer_smearing_tool.initialize() def passes(self, event): for jet in event.jets: self.jer_smearing_tool.applyCorrection(jet) return True
class JetResolution(EventFilter): """ This class applies the jet smearing in MonteCarlo samples. It needs to be called after the JetCalibration since a shallow copy is needed to apply the ASG tool. """ def __init__(self, passthrough=False, **kwargs): super(JetResolution, self).__init__( passthrough=passthrough, **kwargs) if not passthrough: from ROOT import JERTool, JERSmearingTool self.jer_tool = JERTool('JERTool') self.jer_tool.setProperty('std::string')("PlotFileName", "JetResolution/JERProviderPlots_2012.root") self.jer_tool.setProperty('std::string')("CollectionName", "AntiKt4LCTopoJets") self.jer_tool.setProperty('std::string')("BeamEnergy", "8TeV") self.jer_tool.setProperty('std::string')("SimulationType", "FullSim") self.jer_tool.initialize() self.jer_smearing_tool = JERSmearingTool('JERSmearingTool') self.jer_smearing_tool.setProperty('std::string')('JERToolName', 'JERTool') self.jer_smearing_tool.setJERTool(self.jer_tool) self.jer_smearing_tool.setNominalSmearing(True) self.jer_smearing_tool.initialize() def passes(self, event): for jet in event.jets.collection: self.jer_smearing_tool.applyCorrection(jet) return True
def __init__(self, passthrough=False, **kwargs): super(JetResolution, self).__init__(passthrough=passthrough, **kwargs) if not passthrough: from ROOT import JERTool, JERSmearingTool self.jer_tool = JERTool('JERTool') self.jer_tool.setProperty('std::string')( "PlotFileName", "JetResolution/JERProviderPlots_2012.root") self.jer_tool.setProperty('std::string')("CollectionName", "AntiKt4LCTopoJets") self.jer_tool.setProperty('std::string')("BeamEnergy", "8TeV") self.jer_tool.setProperty('std::string')("SimulationType", "FullSim") self.jer_tool.initialize() self.jer_smearing_tool = JERSmearingTool('JERSmearingTool') self.jer_smearing_tool.setProperty('std::string')('JERToolName', 'JERTool') self.jer_smearing_tool.setJERTool(self.jer_tool) self.jer_smearing_tool.setNominalSmearing(True) self.jer_smearing_tool.initialize()
def __init__(self, passthrough=False, **kwargs): super(JetResolution, self).__init__( passthrough=passthrough, **kwargs) if not passthrough: from ROOT import JERTool, JERSmearingTool self.jer_tool = JERTool('JERTool') self.jer_tool.setProperty('std::string')("PlotFileName", "JetResolution/JERProviderPlots_2012.root") self.jer_tool.setProperty('std::string')("CollectionName", "AntiKt4LCTopoJets") self.jer_tool.setProperty('std::string')("BeamEnergy", "8TeV") self.jer_tool.setProperty('std::string')("SimulationType", "FullSim") self.jer_tool.initialize() self.jer_smearing_tool = JERSmearingTool('JERSmearingTool') self.jer_smearing_tool.setProperty('std::string')('JERToolName', 'JERTool') self.jer_smearing_tool.setJERTool(self.jer_tool) self.jer_smearing_tool.setNominalSmearing(True) self.jer_smearing_tool.initialize()
# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration # Test the reflex dictionary usage in PyROOT to # instantiate and configure the JER tools. import sys # Setup libs from ROOT import gROOT gROOT.SetBatch() gROOT.Macro('$ROOTCOREDIR/scripts/load_packages.C') # Import using the PyROOT bindings and reflex dictionary from ROOT import xAOD from ROOT import JERTool, JERSmearingTool evt = xAOD.TEvent() # Configure the tools jerTool = JERTool('JERTool') smearTool = JERSmearingTool('JERSmearingTool') if smearTool.setProperty('JERToolName', jerTool.name()).isFailure(): sys.exit(1) # Initialize the tools if jerTool.initialize().isFailure(): sys.exit(1) if smearTool.initialize().isFailure(): sys.exit(1)