2 Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
14 from AthenaCommon.AthArgumentParser
import AthArgumentParser
15 susyArgsParser = AthArgumentParser()
16 susyArgsParser.add_argument(
"--testCampaign",action=
"store",default=
None,choices=[
"mc20e",
"mc23a",
"mc23d",
"data23",
"data22",
"data18"],help=
"Specify to select a test campaign")
17 susyArgsParser.add_argument(
"--testFormat",action=
"store",default=
"PHYS",choices=[
"PHYS",
"PHYSLITE"],help=
"Specify to select a test format")
18 susyArgsParser.add_argument(
"--accessMode",action=
"store",choices=[
"POOLAccess",
"ClassAccess"],default=
"POOLAccess",help=
"xAOD read mode - Class is faster, POOL is more robust")
19 susyArgsParser.add_argument(
"--configFile",action=
"store",default=
None,help=
"Name of the SUSYTools config file, leave blank for auto-config")
20 susyArgsParser.add_argument(
"--prwFiles",action=
"store",nargs=
"+",default=
None,help=
"Name of prw files")
21 susyArgsParser.add_argument(
"--lumicalcFiles",action=
"store",nargs=
"+",default=
None,help=
"Name of lumicalc files")
22 susyArgsParser.add_argument(
"--noSyst",action=
"store_true",help=
"include to disable systematics")
23 susyArgsParser.add_argument(
"--fileOutput",default=
None,help=
"Name of output file")
25 susyArgs = susyArgsParser.parse_args()
27 if susyArgs.testCampaign:
28 pTag =
'p6269' if (
'data2' in susyArgs.testCampaign)
else 'p6266'
29 inputDir =
'/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/SUSYTools'
31 inputFiles[
'data18'] = f
'data18_13TeV.39757132_{pTag}.{susyArgs.testFormat}.pool.root'
32 inputFiles[
'data22'] = f
'data22_13p6TeV.39672246_{pTag}.{susyArgs.testFormat}.pool.root'
33 inputFiles[
'data23'] = f
'data23_13p6TeV.39756993_{pTag}.{susyArgs.testFormat}.pool.root'
34 inputFiles[
'mc20e'] = f
'DAOD_{susyArgs.testFormat}.mc20_13TeV.410470.FS_mc20e_{pTag}.{susyArgs.testFormat}.pool.root'
35 inputFiles[
'mc23a'] = f
'mc23_13p6TeV.601229.FS_mc23a_{pTag}.{susyArgs.testFormat}.pool.root'
36 inputFiles[
'mc23d'] = f
'mc23_13p6TeV.601229.FS_mc23d_{pTag}.{susyArgs.testFormat}.pool.root'
37 jps.AthenaCommonFlags.FilesInput = [f
'{inputDir}/{inputFiles[susyArgs.testCampaign]}']
38 if susyArgs.fileOutput
is None:
39 susyArgs.fileOutput = f
"hist-Ath_{susyArgs.testCampaign}_DAOD_{susyArgs.testFormat}.root"
42 jps.AthenaCommonFlags.AccessMode = susyArgs.accessMode
44 if susyArgs.fileOutput: jps.AthenaCommonFlags.HistOutputs = [f
"ANALYSIS:{susyArgs.fileOutput}"]
46 print(
"INFO: Processing:",jps.AthenaCommonFlags.FilesInput())
47 print(
"INFO: Outputting:",jps.AthenaCommonFlags.HistOutputs())
50 from PyUtils.MetaReader
import read_metadata
51 inp_filename = jps.AthenaCommonFlags.FilesInput()[0]
53 isMC =
'IS_SIMULATION' in metadata[
'eventTypes']
54 isFastSim = isMC
and (
'ATLFASTII' in metadata[
'SimulationFlavour'].
upper())
55 print(
"INFO: Format: ",
" isMC: ",isMC,
" isFastSim: ",isFastSim)
57 MCCampaign = metadata[
"mc_campaign"]
60 susyAlg = CfgMgr.SUSYToolsAlg(DoSyst = isMC
and not susyArgs.noSyst)
62 if susyArgs.configFile:
63 susyAlg.SUSYTools.ConfigFile = susyArgs.configFile
66 if (isMC
and ((MCCampaign
in [
"mc23a"])
or (MCCampaign
in [
"mc23d"]) ))
or (
not isMC
and metadata[
"runNumbers"][0]>400000):
67 susyAlg.SUSYTools.ConfigFile =
"SUSYTools/SUSYTools_Default_Run3.conf"
69 susyAlg.SUSYTools.ConfigFile =
"SUSYTools/SUSYTools_Default.conf"
70 if susyArgs.testFormat ==
"PHYSLITE":
71 STconfig_lite =
str(susyAlg.SUSYTools.ConfigFile).
replace(
".conf",
"_LITE.conf")
72 susyAlg.SUSYTools.ConfigFile = STconfig_lite
73 susyAlg.SUSYTools.IsPHYSLITE =
True
75 print(
"INFO: Configuration file:",susyAlg.SUSYTools.ConfigFile)
77 susyAlg.SUSYTools.DataSource = 0
if not isMC
else (1
if not isFastSim
else 2)
79 print(
"INFO: Configuration SUSYTools.DataSource: ",susyAlg.SUSYTools.DataSource)
83 susyAlg.SUSYTools.PRWConfigFiles = susyArgs.prwFiles
85 susyAlg.SUSYTools.AutoconfigurePRWTool =
True
86 susyAlg.SUSYTools.PRWUseCommonMCFiles =
True
88 if susyArgs.lumicalcFiles:
89 susyAlg.SUSYTools.PRWLumiCalcFiles = susyArgs.lumicalcFiles
92 PRWLumiCalc[
'mc20a'] = [
'/cvmfs/atlas.cern.ch/repo/sw/database/GroupData/GoodRunsLists/data16_13TeV/20180129/PHYS_StandardGRL_All_Good_25ns_297730-311481_OflLumi-13TeV-009.root',
93 '/cvmfs/atlas.cern.ch/repo/sw/database/GroupData/GoodRunsLists/data15_13TeV/20170619/PHYS_StandardGRL_All_Good_25ns_276262-284484_OflLumi-13TeV-008.root']
94 PRWLumiCalc[
'mc20d'] = [
'/cvmfs/atlas.cern.ch/repo/sw/database/GroupData/GoodRunsLists/data17_13TeV/20180619/physics_25ns_Triggerno17e33prim.lumicalc.OflLumi-13TeV-010.root']
95 PRWLumiCalc[
'mc20e'] = [
'/cvmfs/atlas.cern.ch/repo/sw/database/GroupData/GoodRunsLists/data18_13TeV/20190318/ilumicalc_histograms_None_348885-364292_OflLumi-13TeV-010.root']
96 PRWLumiCalc[
'mc23a'] = [
'/cvmfs/atlas.cern.ch/repo/sw/database/GroupData/GoodRunsLists/data22_13p6TeV/20230207/ilumicalc_histograms_None_431810-440613_OflLumi-Run3-003.root']
97 PRWLumiCalc[
'mc23d'] = [
'/cvmfs/atlas.cern.ch/repo/sw/database/GroupData/GoodRunsLists/data23_13p6TeV/20230828/ilumicalc_histograms_None_451587-456749_OflLumi-Run3-003.root']
99 susyAlg.SUSYTools.PRWLumiCalcFiles = PRWLumiCalc[MCCampaign]
105 include(
"AthAnalysisBaseComps/SuppressLogging.py")
106 svcMgr+=CfgMgr.AthenaEventLoopMgr(IntervalInSeconds = 10,OutputLevel=INFO)
107 svcMgr.MessageSvc.Format =
"% F%50W%S%7W%R%T %0W%M"