Skip to content
Snippets Groups Projects
Commit e0d8f34b authored by Luca Martinelli's avatar Luca Martinelli Committed by Frank Winklmeier
Browse files

MuonCalibTool: making calibMode configurable and change default value

MuonCalibTool: making calibMode configurable and change default value
parent ba60521b
No related branches found
No related tags found
No related merge requests found
......@@ -33,9 +33,23 @@ class MuonCalibrationConfig (ConfigBlock):
self.addOption ('excludeNSWFromPrecisionLayers', False, type=bool,
info="only for testing purposes, turn on to ignore NSW hits and "
"fix a crash with older derivations (p-tag <p5834)")
self.addOption ('calibMode', 'correctData_CB', type=str, info='calibration mode of the MuonCalibTool needed to turn on the sagitta bias corrections and to select the muon track calibration type (CB or ID+MS)')
def makeAlgs (self, config) :
#make sure that this is sync with
#PhysicsAnalysis/MuonID/MuonIDAnalysis/MuonMomentumCorrections/MuonMomentumCorrections/MuonCalibTool.h#L31-37
if self.calibMode == 'correctData_CB':
calibMode = 0
elif self.calibMode == 'correctData_IDMS':
calibMode = 1
elif self.calibMode == 'notCorrectData_IDMS':
calibMode = 2
elif self.calibMode == 'notCorrectData_CB':
calibMode = 3
else :
raise ValueError ("invalid calibMode: \"" + self.calibMode + "\". Allowed values are correctData_CB, correctData_IDMS, notCorrectData_IDMS, notCorrectData_CB")
if config.isPhyslite() :
config.setSourceName (self.containerName, "AnalysisMuons")
else :
......@@ -73,8 +87,9 @@ class MuonCalibrationConfig (ConfigBlock):
'MuonCalibrationAndSmearingAlg' + self.postfix )
config.addPrivateTool( 'calibrationAndSmearingTool',
'CP::MuonCalibTool' )
alg.calibrationAndSmearingTool.IsRun3Geo = config.geometry() >= LHCPeriod.Run3
alg.calibrationAndSmearingTool.calibMode = 2 # choose ID+MS with no sagitta bias
alg.calibrationAndSmearingTool.calibMode = calibMode
# To be used in MetAnalysisConfig
config._muonCalibMode = alg.calibrationAndSmearingTool.calibMode
alg.calibrationAndSmearingTool.ExcludeNSWFromPrecisionLayers = self.excludeNSWFromPrecisionLayers and (config.geometry() >= LHCPeriod.Run3)
......
......@@ -29,7 +29,8 @@ namespace CP {
public:
enum CalibMode {
noOption = -1, // <--- default
//this should be sync with PhysicsAnalysis/Algorithms/MuonAnalysisAlgorithms/python/MuonAnalysisConfig.py
noOption = -1, // <--- default
correctData_CB = 0,
correctData_IDMS = 1,
notCorrectData_IDMS = 2,
......
......@@ -30,13 +30,13 @@ references_map = {
"q454": "v13",
# Derivations
"data_PHYS_Run2": "v18",
"data_PHYSLITE_Run2": "v1",
"data_PHYSLITE_Run2": "v2",
"data_PHYS_Run3": "v17",
"data_PHYSLITE_Run3": "v1",
"data_PHYSLITE_Run3": "v2",
"mc_PHYS_Run2": "v22",
"mc_PHYSLITE_Run2": "v1",
"mc_PHYSLITE_Run2": "v2",
"mc_PHYS_Run3": "v22",
"mc_PHYSLITE_Run3": "v1",
"mc_PHYSLITE_Run3": "v2",
"af3_PHYS_Run3": "v3",
"af3_PHYSLITE_Run3": "v1",
"af3_PHYSLITE_Run3": "v2",
}
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