diff --git a/Reconstruction/Jet/JetCalibTools/JetCalibTools/CalibrationMethods/GlobalSequentialCorrection.h b/Reconstruction/Jet/JetCalibTools/JetCalibTools/CalibrationMethods/GlobalSequentialCorrection.h index 7d631372f22494fec7607568b6c0bb5a4287960f..33b8d47ec92c076e43de1f9ffc6001427c8024b9 100644 --- a/Reconstruction/Jet/JetCalibTools/JetCalibTools/CalibrationMethods/GlobalSequentialCorrection.h +++ b/Reconstruction/Jet/JetCalibTools/JetCalibTools/CalibrationMethods/GlobalSequentialCorrection.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ #ifndef JETCALIBTOOLS_GLOBALSEQUENTIALCORRECTION_H @@ -31,7 +31,7 @@ class GlobalSequentialCorrection GlobalSequentialCorrection(); GlobalSequentialCorrection(const std::string& name); - GlobalSequentialCorrection(const std::string& name, TEnv * config, TString jetAlgo, TString calibAreaTag, bool dev); //Apply the full GS calibration by default + GlobalSequentialCorrection(const std::string& name, TEnv * config, TString jetAlgo, std::string depth, TString calibAreaTag, bool dev); //Apply the full GS calibration by default virtual ~GlobalSequentialCorrection(); virtual StatusCode initializeTool(const std::string& name); diff --git a/Reconstruction/Jet/JetCalibTools/JetCalibTools/JetCalibrationTool.h b/Reconstruction/Jet/JetCalibTools/JetCalibTools/JetCalibrationTool.h index 700ac0ef2748f18fa2eb6906dab50d2a559753ed..884b02f389549eab083c5d46e97c5d1d87356ff3 100644 --- a/Reconstruction/Jet/JetCalibTools/JetCalibTools/JetCalibrationTool.h +++ b/Reconstruction/Jet/JetCalibTools/JetCalibTools/JetCalibrationTool.h @@ -1,7 +1,7 @@ ///////////////////////// -*- C++ -*- ///////////////////////////// /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ // JetCalibrationTool.h @@ -120,6 +120,8 @@ private: bool m_doOrigin; bool m_doGSC; + std::string m_gscDepth; // if not set then use the one defined in the config + // vector with pTmax of each in situ correction VecD m_relInsituPtMax, m_absInsituPtMax; diff --git a/Reconstruction/Jet/JetCalibTools/Root/GlobalSequentialCorrection.cxx b/Reconstruction/Jet/JetCalibTools/Root/GlobalSequentialCorrection.cxx index c8c38df555282e066a8c77855b83a6342ded6f5b..56291bce0387ee1d2f6b58132b9eba40f9c13a10 100644 --- a/Reconstruction/Jet/JetCalibTools/Root/GlobalSequentialCorrection.cxx +++ b/Reconstruction/Jet/JetCalibTools/Root/GlobalSequentialCorrection.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ /* @@ -28,7 +28,7 @@ GlobalSequentialCorrection::GlobalSequentialCorrection() : JetCalibrationToolBase::JetCalibrationToolBase("GlobalSequentialCorrection::GlobalSequentialCorrection"), - m_config(NULL), m_jetAlgo(""), m_calibAreaTag(""), m_dev(false), + m_config(NULL), m_jetAlgo(""), m_depthString("auto"), m_calibAreaTag(""), m_dev(false), m_binSize(0.1), m_depth(0), m_trackWIDTHMaxEtaBin(25), m_nTrkMaxEtaBin(25), m_Tile0MaxEtaBin(17), m_EM3MaxEtaBin(35), m_chargedFractionMaxEtaBin(27), m_caloWIDTHMaxEtaBin(35), m_N90ConstituentsMaxEtaBin(35), m_punchThroughMinPt(50) @@ -37,16 +37,16 @@ GlobalSequentialCorrection::GlobalSequentialCorrection() GlobalSequentialCorrection::GlobalSequentialCorrection(const std::string& name) : JetCalibrationToolBase::JetCalibrationToolBase( name ), - m_config(NULL), m_jetAlgo(""), m_calibAreaTag(""), m_dev(false), + m_config(NULL), m_jetAlgo(""), m_depthString("auto"), m_calibAreaTag(""), m_dev(false), m_binSize(0.1), m_depth(0), m_trackWIDTHMaxEtaBin(25), m_nTrkMaxEtaBin(25), m_Tile0MaxEtaBin(17), m_EM3MaxEtaBin(35), m_chargedFractionMaxEtaBin(27), m_caloWIDTHMaxEtaBin(35), m_N90ConstituentsMaxEtaBin(35), m_punchThroughMinPt(50) { } -GlobalSequentialCorrection::GlobalSequentialCorrection(const std::string& name, TEnv * config, TString jetAlgo, TString calibAreaTag, bool dev) +GlobalSequentialCorrection::GlobalSequentialCorrection(const std::string& name, TEnv * config, TString jetAlgo, std::string depth, TString calibAreaTag, bool dev) : JetCalibrationToolBase::JetCalibrationToolBase( name ), - m_config(config), m_jetAlgo(jetAlgo), m_calibAreaTag(calibAreaTag), m_dev(dev), + m_config(config), m_jetAlgo(jetAlgo), m_depthString(depth), m_calibAreaTag(calibAreaTag), m_dev(dev), m_binSize(0.1), m_depth(0), m_trackWIDTHMaxEtaBin(25), m_nTrkMaxEtaBin(25), m_Tile0MaxEtaBin(17), m_EM3MaxEtaBin(35), m_chargedFractionMaxEtaBin(27), m_caloWIDTHMaxEtaBin(35), m_N90ConstituentsMaxEtaBin(35), m_punchThroughMinPt(50) @@ -102,7 +102,9 @@ StatusCode GlobalSequentialCorrection::initializeTool(const std::string&) { return StatusCode::FAILURE; } - TString depthString = m_config->GetValue("GSCDepth","Full"); + TString depthString = ""; + if ( m_depthString != "auto" ) depthString = m_depthString; + else depthString = m_config->GetValue("GSCDepth","Full"); if ( !depthString.Contains("ChargedFraction") && !depthString.Contains("Tile0") && !depthString.Contains("EM3") && !depthString.Contains("nTrk") && !depthString.Contains("trackWIDTH") && !depthString.Contains("PunchThrough") && !depthString.Contains("N90Constituents") && !depthString.Contains("N90Constituents") && !depthString.Contains("caloWIDTH") && !depthString.Contains("Full") ) { ATH_MSG_FATAL("depthString flag not properly set, please check your config file."); return StatusCode::FAILURE; diff --git a/Reconstruction/Jet/JetCalibTools/Root/JetCalibrationTool.cxx b/Reconstruction/Jet/JetCalibTools/Root/JetCalibrationTool.cxx index 1aca44b6908fa6284ef4216cd3a83f0830373375..3b8d9d6acc7ba69cca24881a573d35910b5673d3 100644 --- a/Reconstruction/Jet/JetCalibTools/Root/JetCalibrationTool.cxx +++ b/Reconstruction/Jet/JetCalibTools/Root/JetCalibrationTool.cxx @@ -23,7 +23,7 @@ JetCalibrationTool::JetCalibrationTool(const std::string& name) m_rhkRhoKey(""), m_rhkPV("PrimaryVertices"), m_jetAlgo(""), m_config(""), m_calibSeq(""), m_calibAreaTag(""), m_originScale(""), m_devMode(false), m_isData(true), m_timeDependentCalib(false), m_rhoKey("auto"), m_dir(""), m_eInfoName(""), m_globalConfig(NULL), - m_doJetArea(true), m_doResidual(true), m_doOrigin(true), m_doGSC(true), + m_doJetArea(true), m_doResidual(true), m_doOrigin(true), m_doGSC(true), m_gscDepth("auto"), m_jetPileupCorr(NULL), m_etaJESCorr(NULL), m_globalSequentialCorr(NULL), m_insituDataCorr(NULL), m_jetMassCorr(NULL), m_jetSmearCorr(NULL) { @@ -38,6 +38,7 @@ JetCalibrationTool::JetCalibrationTool(const std::string& name) declareProperty( "OriginScale", m_originScale = "JetOriginConstitScaleMomentum"); declareProperty( "CalibArea", m_calibAreaTag = "00-04-82"); declareProperty( "rhkRhoKey", m_rhkRhoKey); + declareProperty( "GSCDepth", m_gscDepth); } @@ -251,7 +252,7 @@ StatusCode JetCalibrationTool::getCalibClass(const std::string&name, TString cal ATH_MSG_INFO("Initializing GSC correction."); suffix="_GSC"; if(m_devMode) suffix+="_DEV"; - m_globalSequentialCorr = new GlobalSequentialCorrection(name+suffix,m_globalConfig,jetAlgo,calibPath,m_devMode); + m_globalSequentialCorr = new GlobalSequentialCorrection(name+suffix,m_globalConfig,jetAlgo,m_gscDepth,calibPath,m_devMode); m_globalSequentialCorr->msg().setLevel( this->msg().level() ); if ( m_globalSequentialCorr->initializeTool(name+suffix).isFailure() ) { ATH_MSG_FATAL("Couldn't initialize the Global Sequential Calibration. Aborting"); diff --git a/Reconstruction/Jet/JetCalibTools/python/JetCalibToolsConfig.py b/Reconstruction/Jet/JetCalibTools/python/JetCalibToolsConfig.py index e3eb808a1e26c8bf2260fabbf96056630e71183d..f85a90b9e5ae64d6536c3414c00f7ce404190f60 100644 --- a/Reconstruction/Jet/JetCalibTools/python/JetCalibToolsConfig.py +++ b/Reconstruction/Jet/JetCalibTools/python/JetCalibToolsConfig.py @@ -82,7 +82,7 @@ hasInSitu = ["AntiKt4LCTopo", "AntiKt4EMTopo", "AntiKt4EMPFlow", "TrigAntiKt4EMT # added to the tool name to ensure uniqueness. # Due to the hackiness of DualUseConfig public tool handling, we need to pass # an AlgSequence... -def getJetCalibTool(jetcollection, context, data_type, calibseq = "", rhoname = ""): +def getJetCalibTool(jetcollection, context, data_type, calibseq = "", rhoname = "", gscdepth = "auto"): # In principle we could autoconfigure if not data_type in ['data','mc','afii']: jetcaliblog.error("JetCalibConfig accepts data_type values: 'data', 'mc', 'afii'") @@ -117,7 +117,7 @@ def getJetCalibTool(jetcollection, context, data_type, calibseq = "", rhoname = # We should revert this later on, set up now for validation purposes if context == "T0": _data_type = "data" - return defineJetCalibTool(jetcollection, _configfile, calibarea, _calibseq, _data_type, rhoname) + return defineJetCalibTool(jetcollection, _configfile, calibarea, _calibseq, _data_type, rhoname, gscdepth) except KeyError as e: jetcaliblog.error("Context '{0}' not found for jet collection '{1}'".format(context,jetcollection)) jetcaliblog.error("Options are '{0}".format(','.join(jetcontexts.keys()))) @@ -125,7 +125,7 @@ def getJetCalibTool(jetcollection, context, data_type, calibseq = "", rhoname = return None # This method actually sets up the tool -def defineJetCalibTool(jetcollection, configfile, calibarea, calibseq, data_type, rhoname): +def defineJetCalibTool(jetcollection, configfile, calibarea, calibseq, data_type, rhoname, gscdepth): # Abbreviate the calib sequence calibseqshort = ''.join([ step[0] for step in calibseq.split('_') ]) toolname = "jetcalib_{0}_{1}".format(jetcollection,calibseqshort) @@ -136,14 +136,15 @@ def defineJetCalibTool(jetcollection, configfile, calibarea, calibseq, data_type CalibArea = calibarea, CalibSequence = calibseq, IsData = (data_type == "data"), - RhoKey = rhoname + RhoKey = rhoname, + GSCDepth = gscdepth ) return jct # This method extends the basic config getter to specify the requisite jet # moments or other inputs def getJetCalibToolPrereqs(modspec,jetdef): - calibcontext, data_type, calibseq, rhoname = getCalibSpecsFromString(modspec) + calibcontext, data_type, calibseq, rhoname, gscdepth = getCalibSpecsFromString(modspec) if calibseq=="": cfg, calibarea, calibseq = calibcontexts[jetdef.basename][calibcontext] # For now, only dependent on calibseq -- can ignore Insitu, which is @@ -164,14 +165,16 @@ def getJetCalibToolPrereqs(modspec,jetdef): def getCalibSpecsFromString(modspec): calibseq = "" rhoname = "auto" + gscdepth = "auto" calibspecs = modspec.split(':') # Probably want data_type to come from elsewhere calibcontext, data_type = calibspecs[:2] if len(calibspecs)>2: calibseq = calibspecs[2] if len(calibspecs)>3: rhoname = calibspecs[3] - return calibcontext, data_type, calibseq, rhoname + if len(calibspecs)>4: gscdepth = calibspecs[4] + return calibcontext, data_type, calibseq, rhoname, gscdepth # This method instantiates the JetCalibTool given the input mod specification def getJetCalibToolFromString(modspec,jetdef): - calibcontext, data_type, calibseq, rhoname = getCalibSpecsFromString(modspec) - return getJetCalibTool(jetdef.basename,calibcontext,data_type,calibseq,rhoname) + calibcontext, data_type, calibseq, rhoname, gscdepth = getCalibSpecsFromString(modspec) + return getJetCalibTool(jetdef.basename,calibcontext,data_type,calibseq,rhoname,gscdepth) diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Jet/JetRecoConfiguration.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Jet/JetRecoConfiguration.py index 505b7a09dd4184ef6549ada2ca0d3a39055eae6e..5dce2d46d8b3859709de1cb3d6f631254caeec8b 100644 --- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Jet/JetRecoConfiguration.py +++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Jet/JetRecoConfiguration.py @@ -101,7 +101,11 @@ def defineCalibFilterMods(jetRecoDict,dataSource,rhoKey="auto"): ("a10t","jes"): ("TrigTrimmed","EtaJES_JMS"), }[(jetRecoDict["recoAlg"],jetRecoDict["jetCalib"])] - calibSpec = ":".join( [calibContext, dataSource, calibSeq, rhoKey] ) + gscDepth = "auto" + if "gsc" in jetRecoDict["jetCalib"]: + gscDepth = "trackWIDTH" + + calibSpec = ":".join( [calibContext, dataSource, calibSeq, rhoKey, gscDepth] ) from TriggerJetMods import ConstitFourMom_copy if jetalg=="a4": calibMods = [(ConstitFourMom_copy,""),