5 '''@file JetMonitoringExample.py
8 @brief Main python configuration for the Run III Jet Monitoring
10 from AthenaMonitoring.DQConfigFlags
import DQDataType
11 from JetMonitoring.JetMonitoringConfig
import JetMonAlgSpec, HistoSpec, EventHistoSpec, SelectSpec, VarSpec
31 "FracSamplingMaxIndex",
44 "JetConstitScaleMomentum_pt",
"JetEMScaleMomentum_pt",
"JetPileupScaleMomentum_pt",
"JetEtaJESScaleMomentum_pt",
45 "JetConstitScaleMomentum_eta",
"JetEMScaleMomentum_eta",
"JetPileupScaleMomentum_eta",
"JetEtaJESScaleMomentum_eta",
46 "JetConstitScaleMomentum_phi",
"JetEMScaleMomentum_phi",
"JetPileupScaleMomentum_phi",
"JetEtaJESScaleMomentum_phi",
51 EventHistoSpec(
'njets',(100,0.,100.),title=
"Number of Jets;Njets;"),
52 EventHistoSpec(
'njetsPt20',(100,0.,100.),title=
"Number of Jets pT>20 GeV;Njets;"),
53 EventHistoSpec(
'njetsPt200',(800,0.,8000.),title=
"Number of Jets pT>200 GeV;Njets;"),
70 SelectSpec(
'central',
73 FillerTools = [
"pt",
"m",
"eta",
"phi",
"EMFrac",
"Tile0Frac",
"LArQuality",
"nconstit",
"N90Constituents",
74 "JetConstitScaleMomentum_pt",
"JetEMScaleMomentum_pt",
"JetPileupScaleMomentum_pt",
"JetEtaJESScaleMomentum_pt",
75 "JetConstitScaleMomentum_eta",
"JetEMScaleMomentum_eta",
"JetPileupScaleMomentum_eta",
"JetEtaJESScaleMomentum_eta",
76 "JetConstitScaleMomentum_phi",
"JetEMScaleMomentum_phi",
"JetPileupScaleMomentum_phi",
"JetEtaJESScaleMomentum_phi",
79 SelectSpec(
'tilegap3',
82 FillerTools = [
"pt",
"m",
"eta",
"phi",
"EMFrac",
"Tile0Frac",
"HECFrac",
"LArQuality",
"nconstit",
"N90Constituents",
86 SelectSpec(
'leading',
90 FillerTools = [
"pt",
"m",
"eta",
"phi",
"EMFrac",
"Tile0Frac",
"HECFrac",
"LArQuality",
"nconstit",
"N90Constituents",
91 "JetConstitScaleMomentum_pt",
"JetEMScaleMomentum_pt",
"JetPileupScaleMomentum_pt",
"JetEtaJESScaleMomentum_pt",
92 "JetConstitScaleMomentum_eta",
"JetEMScaleMomentum_eta",
"JetPileupScaleMomentum_eta",
"JetEtaJESScaleMomentum_eta",
93 "JetConstitScaleMomentum_phi",
"JetEMScaleMomentum_phi",
"JetPileupScaleMomentum_phi",
"JetEtaJESScaleMomentum_phi",
97 SelectSpec(
'subleading',
100 path=
'SubleadingJets',
101 FillerTools = [
"pt",
"m",
"eta",
"phi",
"EMFrac",
"Tile0Frac",
"HECFrac",
"LArQuality",
"nconstit",
"N90Constituents",
102 "JetConstitScaleMomentum_pt",
"JetEMScaleMomentum_pt",
"JetPileupScaleMomentum_pt",
"JetEtaJESScaleMomentum_pt",
103 "JetConstitScaleMomentum_eta",
"JetEMScaleMomentum_eta",
"JetPileupScaleMomentum_eta",
"JetEtaJESScaleMomentum_eta",
104 "JetConstitScaleMomentum_phi",
"JetEMScaleMomentum_phi",
"JetPileupScaleMomentum_phi",
"JetEtaJESScaleMomentum_phi",
108 SelectSpec(
'highptrange2TeVto8TeV',
'2000<pt:GeV<8000',path=
'highptrange2TeVto8TeV',FillerTools = [
"highpt",
"m",
"eta",
"phi",
"eta;phi",] ),
109 SelectSpec(
'highptrange1TeVto2TeV',
'1000<pt:GeV<2000',path=
'highptrange1TeVto2TeV',FillerTools = [
"highpt",
"m",
"eta",
"phi",
"eta;phi",] ),
110 SelectSpec(
'highptrange500GeVto1TeV',
'500<pt:GeV<1000',path=
'highptrange500GeVto1TeV',FillerTools = [
"highpt",
"m",
"eta",
"phi",
"eta;phi",] ),
111 SelectSpec(
'highptrange200GeVto500GeV',
'200<pt:GeV<500',path=
'highptrange200GeVto500GeV',FillerTools = [
"highpt",
"m",
"eta",
"phi",
"eta;phi",] ),
114 SelectSpec(
'LooseBadFailedJets',
'LooseBad', InverseJetSel=
True,
115 FillerTools = [
"pt",
"phi",
"eta",
"m",
"EMFrac",
"LArQuality",
"Tile0Frac",
"HECFrac",
"nconstit",
"N90Constituents",
116 "phi;eta",
"phi;eta;e",
"phi;eta;pt",
120 SelectSpec(
'LooseBadJets',
122 FillerTools = [
"pt",
"eta",
"phi",
"m",
"EMFrac",
"LArQuality",
"Tile0Frac",
"HECFrac",
"nconstit",
"N90Constituents",
123 "phi;eta",
"phi;eta;e",
"phi;eta;pt",
129 SelectSpec(
'highJVF',
131 FillerTools = [
"pt",
"m",
"eta",
"phi",
137 HistoSpec(
"PreSamplerB",(100,0.,200.),title=
"Energy in PreSamplerB;E;Entries",xvar=VarSpec(
'EnergyPerSampling[0]')),
138 HistoSpec(
"EMB1",(100,0.,200.),title=
"Energy in EMB1;E;Entries",xvar=VarSpec(
'EnergyPerSampling[1]')),
139 HistoSpec(
"EMB2",(100,0.,200.),title=
"Energy in EMB2;E;Entries",xvar=VarSpec(
'EnergyPerSampling[2]')),
140 HistoSpec(
"EMB3",(100,0.,200.),title=
"Energy in EMB3;E;Entries",xvar=VarSpec(
'EnergyPerSampling[3]')),
141 HistoSpec(
"PreSamplerE",(100,0.,200.),title=
"Energy in PreSamplerE;E;Entries",xvar=VarSpec(
'EnergyPerSampling[4]')),
142 HistoSpec(
"EME1",(100,0.,200.),title=
"Energy in EME2;E;Entries",xvar=VarSpec(
'EnergyPerSampling[5]')),
143 HistoSpec(
"EME2",(100,0.,200.),title=
"Energy in EME2;E;Entries",xvar=VarSpec(
'EnergyPerSampling[6]')),
144 HistoSpec(
"EME3",(100,0.,200.),title=
"Energy in EME3;E;Entries",xvar=VarSpec(
'EnergyPerSampling[7]')),
145 HistoSpec(
"HEC0",(100,0.,200.),title=
"Energy in HEC0;E;Entries",xvar=VarSpec(
'EnergyPerSampling[8]')),
146 HistoSpec(
"HEC1",(100,0.,200.),title=
"Energy in HEC1;E;Entries",xvar=VarSpec(
'EnergyPerSampling[9]')),
147 HistoSpec(
"HEC2",(100,0.,200.),title=
"Energy in HEC2;E;Entries",xvar=VarSpec(
'EnergyPerSampling[10]')),
148 HistoSpec(
"HEC3",(100,0.,200.),title=
"Energy in HEC3;E;Entries",xvar=VarSpec(
'EnergyPerSampling[11]')),
149 HistoSpec(
"TileBar0",(100,0.,200.),title=
"Energy in TileBar0;E;Entries",xvar=VarSpec(
'EnergyPerSampling[12]')),
150 HistoSpec(
"TileBar1",(100,0.,200.),title=
"Energy in TileBar1;E;Entries",xvar=VarSpec(
'EnergyPerSampling[13]')),
151 HistoSpec(
"TileBar2",(100,0.,200.),title=
"Energy in TileBar1;E;Entries",xvar=VarSpec(
'EnergyPerSampling[14]')),
152 HistoSpec(
"TileGap1",(100,0.,200.),title=
"Energy in TileGap1;E;Entries",xvar=VarSpec(
'EnergyPerSampling[15]')),
153 HistoSpec(
"TileGap2",(100,0.,200.),title=
"Energy in TileGap2;E;Entries",xvar=VarSpec(
'EnergyPerSampling[16]')),
154 HistoSpec(
"TileGap3",(100,0.,200.),title=
"Energy in TileGap3;E;Entries",xvar=VarSpec(
'EnergyPerSampling[17]')),
155 HistoSpec(
"TileExt0",(100,0.,200.),title=
"Energy in TileExt0;E;Entries",xvar=VarSpec(
'EnergyPerSampling[18]')),
156 HistoSpec(
"TileExt1",(100,0.,200.),title=
"Energy in TileExt1;E;Entries",xvar=VarSpec(
'EnergyPerSampling[19]')),
157 HistoSpec(
"TileExt2",(100,0.,200.),title=
"Energy in TileExt2;E;Entries",xvar=VarSpec(
'EnergyPerSampling[20]')),
158 HistoSpec(
"FCAL0",(100,0.,200.),title=
"Energy in FCAL0;E;Entries",xvar=VarSpec(
'EnergyPerSampling[21]')),
159 HistoSpec(
"FCAL1",(100,0.,200.),title=
"Energy in FCAL1;E;Entries",xvar=VarSpec(
'EnergyPerSampling[22]')),
160 HistoSpec(
"FCAL2",(100,0.,200.),title=
"Energy in FCAL2;E;Entries",xvar=VarSpec(
'EnergyPerSampling[23]')),
165 "SumPtChargedPFOPt500[0]",
175 """returns a specification of a JetMonitoringAlg (in the form of a JetMonAlgSpec dictionnary).
179 jetAlgConfig = JetMonAlgSpec(
181 JetContainerName = jetName,
182 TriggerChain = trigger ,
189 histoSpecs += commonHistoSpecs
191 if inputFlags.DQ.DataType
is not DQDataType.Cosmics:
192 histoSpecs += jvfHistosSpec
194 if 'Topo' in jetName:
195 histoSpecs += topoHistosSpec
196 if 'PFlow' in jetName:
197 histoSpecs += pflowHistosSpec
200 if truthJetName !=
"" :
202 from JetMonitoring.JetStandardHistoSpecs
import responseAndEffSpecMap
203 if truthJetName
not in responseAndEffSpecMap:
204 print(
"ERROR !! can't schedule a JetHistoResponseAndEff for truth container : ",truthJetName,
". No specification available" )
207 histoSpecs +=[ responseAndEffSpecMap[truthJetName] ]
210 jetAlgConfig.appendHistos( * histoSpecs)
217 """Standard jet monitoring function to be inserted from top-level algs.
218 returns an a component accumulator as given by AthMonitorCfgHelper.result()
219 Details of what goes into jet monitoring is implemented by dedicated functions such as jetMonAlgConfig().
222 from AthenaConfiguration.ComponentAccumulator
import ComponentAccumulator
226 if inputFlags.DQ.Environment ==
'tier0Raw':
229 from AthenaMonitoring
import AthMonitorCfgHelper
230 helper = AthMonitorCfgHelper(inputFlags,
'JetMonitoring')
235 if inputFlags.Reco.EnableHI:
236 if inputFlags.Tracking.doUPC:
248 from AthenaMonitoring.EventFlagFilterToolConfig
import EventFlagFilterToolCfg
250 from AthenaMonitoring.BadLBFilterToolConfig
import LArBadLBFilterToolCfg
254 for conf
in jetAlgConfs:
255 alg = conf.toAlg(helper)
258 rv.merge(helper.result())