Skip to content
Snippets Groups Projects
Commit 6fd81fa6 authored by Deion Elgin Fellers's avatar Deion Elgin Fellers
Browse files

setup calo energy calibration for MC

parent 4a503790
No related branches found
No related tags found
No related merge requests found
...@@ -19,12 +19,11 @@ def CalorimeterReconstructionCfg(flags, **kwargs): ...@@ -19,12 +19,11 @@ def CalorimeterReconstructionCfg(flags, **kwargs):
kwargs.setdefault("CaloHitContainerKey", "CaloHits") kwargs.setdefault("CaloHitContainerKey", "CaloHits")
kwargs.setdefault("PreshowerHitContainerKey", "PreshowerHits") kwargs.setdefault("PreshowerHitContainerKey", "PreshowerHits")
recoAlg = CompFactory.CaloRecAlg("CaloRecAlg", **kwargs) acc.merge(CaloRecToolCfg(flags, **kwargs))
acc.addEventAlgo(recoAlg) kwargs.pop("MC_calibTag") # Remove this if it is specified so it does not get pased to CaloRecAlg
dbInstance = kwargs.get("dbInstance", "TRIGGER_OFL") # what should this be set to???
acc.merge(CaloRecToolCfg(flags)) recoAlg = CompFactory.CaloRecAlg("CaloRecAlg", isMC = flags.Input.isMC, **kwargs)
acc.addEventAlgo(recoAlg)
return acc return acc
......
...@@ -91,12 +91,11 @@ StatusCode CaloRecAlg::execute(const EventContext& ctx) const { ...@@ -91,12 +91,11 @@ StatusCode CaloRecAlg::execute(const EventContext& ctx) const {
ATH_MSG_DEBUG("calo_hit filled has charge of " << charge << " pC"); ATH_MSG_DEBUG("calo_hit filled has charge of " << charge << " pC");
float gainRatio = 1.0; float gainRatio = 1.0;
if (m_isMC) { if (!m_isMC) { // MC already has correct MIP charge stored in MIPcharge_ref, so only need to to HV extrapolation with reral data
gainRatio = 1.0; // put dummy value for now, this will end up being ratio of digi scale factors
} else {
gainRatio = extrapolateHVgain(hit->channel()); gainRatio = extrapolateHVgain(hit->channel());
ATH_MSG_DEBUG("HV gain ratio = " << gainRatio );
} }
ATH_MSG_DEBUG("HV gain ratio = " << gainRatio );
float Nmip = (charge * gainRatio) / MIPcharge_ref; float Nmip = (charge * gainRatio) / MIPcharge_ref;
ATH_MSG_DEBUG("Nmip = " << Nmip ); ATH_MSG_DEBUG("Nmip = " << Nmip );
......
...@@ -19,8 +19,15 @@ def CaloRecToolCfg(flags, name="CaloRecTool", **kwargs): ...@@ -19,8 +19,15 @@ def CaloRecToolCfg(flags, name="CaloRecTool", **kwargs):
# Probably need to figure this out! # Probably need to figure this out!
dbInstance = kwargs.get("dbInstance", "TRIGGER_OFL") dbInstance = kwargs.get("dbInstance", "TRIGGER_OFL")
MC_calibTag = kwargs.get("MC_calibTag", "")
# MC calibration db folder MIP_ref has version tags
if len(MC_calibTag) > 0:
acc.merge(addFolders(flags, "/WAVE/Calibration/MIP_ref", dbInstance, className="CondAttrListCollection", tag=MC_calibTag))
else:
acc.merge(addFolders(flags, "/WAVE/Calibration/MIP_ref", dbInstance, className="CondAttrListCollection"))
acc.merge(addFolders(flags, "/WAVE/Calibration/HV", dbInstance, className="CondAttrListCollection")) acc.merge(addFolders(flags, "/WAVE/Calibration/HV", dbInstance, className="CondAttrListCollection"))
acc.merge(addFolders(flags, "/WAVE/Calibration/MIP_ref", dbInstance, className="CondAttrListCollection"))
return acc return acc
......
...@@ -33,6 +33,8 @@ parser.add_argument("-v", "--verbose", action='store_true', ...@@ -33,6 +33,8 @@ parser.add_argument("-v", "--verbose", action='store_true',
help="Turn on DEBUG output") help="Turn on DEBUG output")
parser.add_argument("--isMC", action='store_true', parser.add_argument("--isMC", action='store_true',
help="Running on digitised MC rather than data") help="Running on digitised MC rather than data")
parser.add_argument("--MC_calibTag", default="",
help="Specify tag used to reconstruct MC calo energy: (WAVE-Calibration-01-LG-nofilt, WAVE-Calibration-01-LG, WAVE-Calibration-01-HG-nofilt, or WAVE-Calibration-01-HG) ")
parser.add_argument("--testBeam", action='store_true', parser.add_argument("--testBeam", action='store_true',
help="Set geometry for 2021 test beam") help="Set geometry for 2021 test beam")
...@@ -194,14 +196,10 @@ if useLHC: ...@@ -194,14 +196,10 @@ if useLHC:
from WaveRecAlgs.WaveRecAlgsConfig import WaveformReconstructionCfg from WaveRecAlgs.WaveRecAlgsConfig import WaveformReconstructionCfg
acc.merge(WaveformReconstructionCfg(ConfigFlags)) acc.merge(WaveformReconstructionCfg(ConfigFlags))
# Calorimeter reconstruction # Calorimeter Energy reconstruction
if args.isMC: if useCal:
# Not ready for MC quite yet
pass
elif useCal:
from CaloRecAlgs.CaloRecAlgsConfig import CalorimeterReconstructionCfg from CaloRecAlgs.CaloRecAlgsConfig import CalorimeterReconstructionCfg
acc.merge(CalorimeterReconstructionCfg(ConfigFlags)) acc.merge(CalorimeterReconstructionCfg(ConfigFlags, MC_calibTag=args.MC_calibTag))
# Tracker clusters # Tracker clusters
from TrackerPrepRawDataFormation.TrackerPrepRawDataFormationConfig import FaserSCT_ClusterizationCfg from TrackerPrepRawDataFormation.TrackerPrepRawDataFormationConfig import FaserSCT_ClusterizationCfg
......
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