Skip to content
Snippets Groups Projects
Commit 76fdaf86 authored by James Beacham's avatar James Beacham
Browse files

Merge branch 'apply-P1-protection-to-ditigization-imports' into '21.0'

Fix ATR-17597 by catching exceptions from the import of Digitization.DigitizationFlags

See merge request atlas/athena!7892

Former-commit-id: c55365f0d150da3ec4cc711c6214faf30c5b9dd3
parents 6fb51569 462c04af
No related branches found
No related tags found
No related merge requests found
#************** ESD list ************************************************
from AthenaCommon.JobProperties import jobproperties
from AthenaCommon.Logging import logging
CaloESDList = []
......@@ -108,33 +109,37 @@ AODMoments=[#"LATERAL"
,"BadChannelList"
,#"LATERAL"
]
from Digitization.DigitizationFlags import digitizationFlags
if digitizationFlags.doDigiTruth():
AODMoments+=["SECOND_R_Truth"
,"SECOND_LAMBDA_Truth"
,"CENTER_MAG_Truth"
,"CENTER_LAMBDA_Truth"
,"FIRST_ENG_DENS_Truth"
,"ENG_FRAC_MAX_Truth"
,"ISOLATION_Truth"
,"ENG_BAD_CELLS_Truth"
,"N_BAD_CELLS_Truth"
,"BADLARQ_FRAC_Truth"
#,"ENG_BAD_HV_CELLS_Truth"
#,"N_BAD_HV_CELLS_Truth"
,"ENG_POS_Truth"
#,"SIGNIFICANCE_Truth"
#,"CELL_SIGNIFICANCE_Truth"
#,"CELL_SIG_SAMPLING_Truth"
,"AVG_LAR_Q_Truth"
,"AVG_TILE_Q_Truth"
,"EM_PROBABILITY_Truth"
#,"PTD_Truth"
,"ENERGY_Truth"
,"ETA_Truth"
,"PHI_Truth"
]
try:
from Digitization.DigitizationFlags import digitizationFlags
if digitizationFlags.doDigiTruth():
AODMoments+=["SECOND_R_Truth"
,"SECOND_LAMBDA_Truth"
,"CENTER_MAG_Truth"
,"CENTER_LAMBDA_Truth"
,"FIRST_ENG_DENS_Truth"
,"ENG_FRAC_MAX_Truth"
,"ISOLATION_Truth"
,"ENG_BAD_CELLS_Truth"
,"N_BAD_CELLS_Truth"
,"BADLARQ_FRAC_Truth"
#,"ENG_BAD_HV_CELLS_Truth"
#,"N_BAD_HV_CELLS_Truth"
,"ENG_POS_Truth"
#,"SIGNIFICANCE_Truth"
#,"CELL_SIGNIFICANCE_Truth"
#,"CELL_SIG_SAMPLING_Truth"
,"AVG_LAR_Q_Truth"
,"AVG_TILE_Q_Truth"
,"EM_PROBABILITY_Truth"
#,"PTD_Truth"
,"ENERGY_Truth"
,"ETA_Truth"
,"PHI_Truth"
]
except:
log = logging.getLogger('CaloRecOutputItemList')
log.info('Unable to import DigitizationFlags in CaloRecOutputItemList_jobOptions. Expected in AthenaP1')
CaloAODList = []
......
......@@ -243,10 +243,15 @@ class CaloClusterTopoGetter ( Configured ) :
,"EM_PROBABILITY"
]
from Digitization.DigitizationFlags import digitizationFlags
if digitizationFlags.doDigiTruth():
doDigiTruthFlag = False
try:
from Digitization.DigitizationFlags import digitizationFlags
doDigiTruthFlag = digitizationFlags.doDigiTruth()
except:
log = logging.getLogger('CaloClusterTopoGetter')
log.info('Unable to import DigitizationFlags in CaloClusterTopoGetter. Expected in AthenaP1')
if doDigiTruthFlag:
TopoMoments_Truth = CaloClusterMomentsMaker_DigiHSTruth ("TopoMoments_Truth")
TopoMoments_Truth.WeightingOfNegClusters = jobproperties.CaloTopoClusterFlags.doTreatEnergyCutAsAbsolute()
TopoMoments_Truth.MaxAxisAngle = 20*deg
......@@ -435,8 +440,7 @@ class CaloClusterTopoGetter ( Configured ) :
CaloTopoCluster.ClusterCorrectionTools += [TopoMoments]
from Digitization.DigitizationFlags import digitizationFlags
if digitizationFlags.doDigiTruth():
if doDigiTruthFlag:
CaloTopoCluster.ClusterCorrectionTools += [TopoMoments_Truth]
CaloTopoCluster += TopoMaker
......@@ -444,7 +448,7 @@ class CaloClusterTopoGetter ( Configured ) :
CaloTopoCluster += BadChannelListCorr
CaloTopoCluster += TopoMoments
from RecExConfig.RecFlags import rec
if digitizationFlags.doDigiTruth():
if doDigiTruthFlag:
CaloTopoCluster += TopoMoments_Truth
if jobproperties.CaloTopoClusterFlags.doClusterVertexFraction():
......
......@@ -8,6 +8,8 @@ from AthenaCommon.GlobalFlags import globalflags
from AthenaCommon.DetFlags import DetFlags
from AthenaCommon.Logging import logging
if globalflags.DataSource()=='data':
if rec.projectName()=="data09_calophys":
# for data09_calophys project, force to use DSP output for the cell energy, perform reco like DSP, no dead cell correction
......@@ -165,8 +167,15 @@ if DetFlags.makeRIO.Calo_on() and not rec.doWriteBS() :
DetFlags.makeRIO.Calo_setOff()
# CaloCellGetter_DigiHSTruth
from Digitization.DigitizationFlags import digitizationFlags
if digitizationFlags.doDigiTruth():
doDigiTruthFlag = False
try:
from Digitization.DigitizationFlags import digitizationFlags
doDigiTruthFlag = digitizationFlags.doDigiTruth()
except:
log = logging.getLogger('CaloRec')
log.info('Unable to import DigitizationFlags in CaloRec_jobOptions. Expected in AthenaP1')
if doDigiTruthFlag:
try:
from CaloRec.CaloCellGetter_DigiHSTruth import CaloCellGetter_DigiHSTruth
CaloCellGetter_DigiHSTruth()
......
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