From 7344e0152c5a4e33c3d615882baae6e1101ce12d Mon Sep 17 00:00:00 2001
From: rlongo <riccardo.longo@cern.ch>
Date: Thu, 11 Jun 2020 15:44:25 -0500
Subject: [PATCH] Constituent Modifier Tool called w/ the flag for origin
 correction now

---
 Reconstruction/HeavyIonRec/HIJetRec/python/HIJetRecUtils.py | 4 ++++
 .../HeavyIonRec/HIJetRec/share/HIJetRec_jobOptions.py       | 6 +++---
 2 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/Reconstruction/HeavyIonRec/HIJetRec/python/HIJetRecUtils.py b/Reconstruction/HeavyIonRec/HIJetRec/python/HIJetRecUtils.py
index 766ee681ccbd..f5b8cc7c53cb 100644
--- a/Reconstruction/HeavyIonRec/HIJetRec/python/HIJetRecUtils.py
+++ b/Reconstruction/HeavyIonRec/HIJetRec/python/HIJetRecUtils.py
@@ -222,6 +222,9 @@ def GetConstituentsModifierTool(**kwargs) :
     if 'cluster_key' in kwargs.keys() : cluster_key=kwargs['cluster_key']
     else : cluster_key=HIJetFlags.HIClusterKey()
 
+    if 'apply_origin_correction' in kwargs.keys() : apply_origin_correction=kwargs['apply_origin_correction']
+    else : apply_origin_correction=HIJetFlags.ApplyOriginCorrection()
+
     HIJetConstituentModifierTool=CompFactory.HIJetConstituentModifierTool
     toolName='HIJetConstituentModifierTool'
     if 'name' in kwargs.keys() : toolName = kwargs['name']
@@ -229,6 +232,7 @@ def GetConstituentsModifierTool(**kwargs) :
     cmod=HIJetConstituentModifierTool(toolName)
     cmod.ClusterKey=cluster_key
     cmod.Subtractor=GetSubtractorTool(**kwargs)
+    cmod.ApplyOriginCorrection=apply_origin_correction
 
     jtm.add(cmod)
     return cmod
diff --git a/Reconstruction/HeavyIonRec/HIJetRec/share/HIJetRec_jobOptions.py b/Reconstruction/HeavyIonRec/HIJetRec/share/HIJetRec_jobOptions.py
index c213a76f6f07..112118118917 100644
--- a/Reconstruction/HeavyIonRec/HIJetRec/share/HIJetRec_jobOptions.py
+++ b/Reconstruction/HeavyIonRec/HIJetRec/share/HIJetRec_jobOptions.py
@@ -174,15 +174,15 @@ if not HIJetFlags.DoCellBasedSubtraction():
 
 cluster_key_eGamma_deep=ClusterKey+"_eGamma_deep"
 cluster_key_final_deep=cluster_key_eGamma_deep+"_Cluster_deep"
-#Subtraction for egamma and to get layers
+#Subtraction for egamma and to get layers - here no origin correction yet (done in the next stage)
 ApplySubtractionToClusters(name="HIClusterSubtraction_egamma", event_shape_key=cell_level_shape_key, cluster_key=ClusterKey, output_cluster_key=cluster_key_eGamma_deep, modulator=modulator1, CalculateMoments=True, useClusters=False, apply_origin_correction=False)
 #Cluster subtraction for jets
-ApplySubtractionToClusters(event_shape_key=HIJetFlags.IteratedEventShapeKey(), cluster_key=cluster_key_eGamma_deep, output_cluster_key=cluster_key_final_deep, modulator=modulator1, CalculateMoments=False, useClusters=True, apply_origin_correction=True)
+ApplySubtractionToClusters(event_shape_key=HIJetFlags.IteratedEventShapeKey(), cluster_key=cluster_key_eGamma_deep, output_cluster_key=cluster_key_final_deep, modulator=modulator1, CalculateMoments=False, useClusters=True, apply_origin_correction=HIJetFlags.ApplyOriginCorrection())
 
 #put subtraction tool at the FRONT of the jet modifiers list
 hi_tools=[subtr1,subtr2]
 hi_tools+=GetFlowMomentTools(iter1.OutputEventShapeKey,iter1.ModulationEventShapeKey)
-hi_tools+=[GetConstituentsModifierTool(name="HIJetConstituentModifierTool", cluster_key=cluster_key_final_deep)]
+hi_tools+=[GetConstituentsModifierTool(name="HIJetConstituentModifierTool", cluster_key=cluster_key_final_deep, apply_origin_correction=HIJetFlags.ApplyOriginCorrection())]
 
 ###
 #subtracted algorithms
-- 
GitLab