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