5 '''@file PhysValMonitoringConfig.py
8 @brief Main CA-based python configuration for PhysValMonitoring
11 from AthenaConfiguration.ComponentAccumulator
import ComponentAccumulator
12 from AthenaConfiguration.ComponentFactory
import CompFactory
13 from AthenaCommon.CFElements
import seqAND
15 from AthenaCommon.Logging
import logging
16 logger = logging.getLogger(
"PhysValMonitoringConfig")
23 kwargs.setdefault(
"EnableLumi",
False)
24 kwargs.setdefault(
"OutputLevel", WARNING)
25 kwargs.setdefault(
"DetailLevel", 10)
26 kwargs.setdefault(
"TauContainerName",
"TauJets")
27 kwargs.setdefault(
"PhotonContainerName",
"Photons")
28 kwargs.setdefault(
"ElectronContainerName",
"Electrons")
31 kwargs.setdefault(
"DoExBtag",
False)
32 kwargs.setdefault(
"DoExMET",
False)
33 kwargs.setdefault(
"DoExJet", flags.PhysVal.doJet)
34 kwargs.setdefault(
"METContainerName",
"")
36 acc.setPrivateTools(CompFactory.PhysVal.PhysValExample(**kwargs))
41 from GoodRunsLists.GoodRunsListsDictionary
import getGoodRunsLists
43 all_grl_flattened = [grl
for grls
in all_grls.values()
for grl
in grls]
47 if isinstance(grls, str):
48 raise TypeError(
"grls must be an iterable of GRLs, e.g. [%s]" % grls)
52 if grl.endswith(
".xml"):
53 if grl
not in all_grl_flattened:
54 logger.warning(
"GRL '%s' is not in the reccomended GRLs, using it as is.", grl)
55 resolved_grls.append(grl)
58 resolved_grls.extend(all_grls[grl])
60 raise ValueError(f
"GRL name '{grl}' not found in the available GRLs. Available GRL names: %s" % all_grls.keys())
62 tool = CompFactory.GoodRunsListSelectionTool(name=
"GoodRunsListSelectionTool",
63 GoodRunsListVec=resolved_grls,
66 acc.setPrivateTools(tool)
72 kwargs.setdefault(
'GoodRunsListSelectionTool', acc.popToolsAndMerge(
75 alg = CompFactory.GRLSelectorAlg(
76 'GRLSelectorAlg', Tool=kwargs[
'GoodRunsListSelectionTool'], grlKey=
"EventInfo.passGRL")
87 kwargs.setdefault(
"FileKey",
"PhysVal")
88 kwargs.setdefault(
"Environment",
"altprod")
89 kwargs.setdefault(
"ManualDataTypeSetup",
True)
90 kwargs.setdefault(
"DataType",
"monteCarlo")
91 kwargs.setdefault(
"ManualRunLBSetup",
True)
92 kwargs.setdefault(
"Run", 1)
93 kwargs.setdefault(
"LumiBlock", 1)
95 if flags.PhysVal.doExample:
97 if flags.PhysVal.doInDet:
98 from InDetPhysValMonitoring.InDetPhysValMonitoringConfig
import InDetPhysValMonitoringToolCfg
100 if flags.PhysVal.doInDetLargeD0:
101 from InDetPhysValMonitoring.InDetPhysValMonitoringConfig
import InDetLargeD0PhysValMonitoringToolCfg
103 if flags.PhysVal.doBtag:
104 from JetTagDQA.JetTagDQAConfig
import PhysValBTagCfg
106 if flags.PhysVal.doMET:
107 from MissingEtDQA.MissingEtDQAConfig
import PhysValMETCfg
109 if flags.PhysVal.doEgamma:
110 from EgammaPhysValMonitoring.EgammaPhysValMonitoringConfig
import EgammaPhysValMonitoringToolCfg
112 if flags.PhysVal.doTau:
113 from TauDQA.TauDQAConfig
import PhysValTauCfg
115 if flags.PhysVal.doJet:
116 from JetValidation.JetValidationConfig
import PhysValJetCfg
118 if flags.PhysVal.doTopoCluster:
119 from PFODQA.ClusterDQAConfig
import PhysValClusterCfg
121 if flags.PhysVal.doZee:
122 from ZeeValidation.ZeeValidationMonToolConfig
import PhysValZeeCfg
124 if flags.PhysVal.doPFlow:
125 from PFODQA.PFPhysValConfig
import PhysValPFOCfg
127 if flags.PhysVal.doMuon:
128 from MuonPhysValMonitoring.MuonPhysValConfig
import PhysValMuonCfg
130 if flags.PhysVal.doLRTMuon:
131 from MuonPhysValMonitoring.MuonPhysValConfig
import PhysValLRTMuonCfg
133 if flags.PhysVal.IDPVM.doActs:
134 from ActsConfig.ActsAnalysisConfig
import PhysValActsCfg
136 if flags.PhysVal.doLLPSecVtx:
137 from InDetSecVertexValidation.InDetSecVertexValidationConfig
import PhysValSecVtxCfg
140 kwargs.setdefault(
"AthenaMonTools", tools)
143 acc.addSequence(
seqAND(
"PhysValSequence"))
145 if flags.PhysVal.applyAllDataCleaning
or flags.PhysVal.applyGRL:
146 if (flags.Input.isMC):
147 raise ValueError(
"applyGRL (or applyAllDataCleaning) is not supported for MC data, please disable it.")
149 sequenceName=
"PhysValSequence")
150 if flags.PhysVal.applyAllDataCleaning
or flags.PhysVal.applyEventStatusSelection:
151 if (flags.Input.isMC):
152 raise ValueError(
"applyEventStatusSelection (or applyAllDataCleaning) is not supported for MC data, please disable it.")
153 acc.addEventAlgo(CompFactory.CP.EventStatusSelectionAlg(
"EventStatusSelectionAlg", FilterKey=
"EventErrorState",
154 FilterDescription=
"selecting events without any error state set"), sequenceName=
"PhysValSequence")
157 acc.addEventAlgo(CompFactory.AthenaMonManager(
158 name, **kwargs), sequenceName=
"PhysValSequence")
159 acc.addService(CompFactory.THistSvc(
160 Output=[f
"PhysVal DATAFILE='{flags.PhysVal.OutputFileName}' OPT='RECREATE'"]))