Skip to content
Snippets Groups Projects
Commit 0db604f9 authored by Martin Rybar's avatar Martin Rybar
Browse files

Moving eta-phi correction for HIJetRec to calibration area (ATLHI-233 and ATLINFR-2834)

- moving eta-phi correction to cvmfs area
- adding a flag to explicitly enable/disable the correction
- disable the correction for HIP mode (pp and pPb)
- no changes in jet performance reconstruction
parent ceb24b05
No related branches found
No related tags found
No related merge requests found
......@@ -46,6 +46,7 @@ class HITowerWeightTool : virtual public asg::AsgTool, virtual public IHITowerWe
virtual float getWeightMag(float eta, float phi, int sampling) const;
private:
bool m_applycorrection;
std::string m_input_file;
std::string m_config_dir;
bool m_init;
......
......@@ -23,10 +23,9 @@ HITowerWeightTool::HITowerWeightTool(const std::string& n) : asg::AsgTool(n),
m_run_index(0)
{
declareProperty("InputFile",m_input_file="cluster.geo.root","File containing cluster geometric moments.");
declareProperty("ConfigDir",m_config_dir="HIEventUtils/","Directory containing configuration file.");
if(initialize().isFailure()) ATH_MSG_WARNING("Initial configuration of tool failed");
declareProperty("ApplyCorrection",m_applycorrection=true,"If false unit weigts are applied");
declareProperty("InputFile",m_input_file="cluster.geo.HIJING_2018.root","File containing cluster geometric moments.");
declareProperty("ConfigDir",m_config_dir="HIJetCorrection/","Directory containing configuration file.");
}
......@@ -67,6 +66,12 @@ float HITowerWeightTool::getEtaPhiOffset(float eta, float phi) const
StatusCode HITowerWeightTool::configureEvent()
{
if (!m_applycorrection){
m_run_index=0;
ATH_MSG_DEBUG("Using unit weights and doing no eta-phi correction.");
return StatusCode::SUCCESS;
}
const xAOD::EventInfo* ei=nullptr;
if(evtStore()->retrieve(ei,"EventInfo").isFailure())
{
......@@ -74,6 +79,7 @@ StatusCode HITowerWeightTool::configureEvent()
return StatusCode::FAILURE;
}
unsigned int run_number=ei->runNumber();
if(m_run_number!=run_number)
{
auto itr=m_run_map.find(run_number);
......@@ -102,6 +108,7 @@ StatusCode HITowerWeightTool::initialize()
if(m_init) return StatusCode::SUCCESS;
std::string local_path=m_config_dir+m_input_file;
std::string full_path=PathResolverFindCalibFile(local_path);
ATH_MSG_INFO("Reading input file "<< m_input_file << " from " << full_path);
TFile* f=TFile::Open(full_path.c_str());
if(f==nullptr)
{
......
......@@ -13,6 +13,7 @@ def SetHIPMode() :
HIJetFlags.SeedPtMin.set_Value_and_Lock(8*Units.GeV)
HIJetFlags.RecoOutputPtMin.set_Value_and_Lock(8*Units.GeV)
HIJetFlags.TrackJetPtMin.set_Value_and_Lock(4*Units.GeV)
HIJetFlags.ApplyTowerEtaPhiCorrection.set_Value_and_Lock(False)
def SetDebugMode():
print 'Setting HIJetRec in DEBUG mode'
......
......@@ -68,6 +68,13 @@ class ApplyEtaJESCalibration(JobProperty):
allowedTypes = ['bool']
StoredValue = True
class ApplyTowerEtaPhiCorrection(JobProperty):
""" Option to apply MC-derived calibration
"""
statusOn = True
allowedTypes = ['bool']
StoredValue = True
class DCutMaxOverMean(JobProperty):
""" Cut for first step in seed finding: max/mean of constituent ET's must be > that this.
"""
......@@ -241,7 +248,7 @@ class TWConfigFile(JobProperty):
"""
statusOn = True
allowedTypes = ['str']
StoredValue = 'cluster.geo.root'
StoredValue = 'cluster.geo.HIJING_2018.root'
# add the flags container to the top container
jobproperties.add_Container(HIJetRecFlags)
......@@ -278,7 +285,8 @@ list_jobproperties = [UnsubtractedSuffix,
WriteSeeds,
UseHITracks,
MomentsSkipped,
TWConfigFile
TWConfigFile,
ApplyTowerEtaPhiCorrection
]
for i in list_jobproperties:
......
......@@ -53,7 +53,9 @@ ESFiller.UseClusters=True
from HIEventUtils.HIEventUtilsConf import HITowerWeightTool
TWTool=HITowerWeightTool()
TWTool.ConfigDir='HIEventUtils/'
TWTool.ApplyCorrection=HIJetFlags.ApplyTowerEtaPhiCorrection()
TWTool.ConfigDir='HIJetCorrection/'
TWTool.InputFile=HIJetFlags.TWConfigFile()
from AthenaCommon.AppMgr import ToolSvc
ToolSvc += HITowerWeightTool()
ESFiller.TowerWeightTool=TWTool
......
......@@ -84,7 +84,8 @@ if not HIJetFlags.DoCellBasedSubtraction():
#Add weight tool to filler tool
from HIEventUtils.HIEventUtilsConf import HITowerWeightTool
TWTool=HITowerWeightTool()
TWTool.ConfigDir='HIEventUtils/'
TWTool.ApplyCorrection=HIJetFlags.ApplyTowerEtaPhiCorrection()
TWTool.ConfigDir='HIJetCorrection/'
TWTool.InputFile=HIJetFlags.TWConfigFile()
from AthenaCommon.AppMgr import ToolSvc
ToolSvc += HITowerWeightTool()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment