ATLAS Offline Software
Functions
GfexMonitorAlgorithm Namespace Reference

Functions

def GfexMonitoringConfig (flags)
 

Function Documentation

◆ GfexMonitoringConfig()

def GfexMonitorAlgorithm.GfexMonitoringConfig (   flags)
Function to configure LVL1 Gfex algorithm in the monitoring system.

Definition at line 4 of file GfexMonitorAlgorithm.py.

4 def GfexMonitoringConfig(flags):
5  '''Function to configure LVL1 Gfex algorithm in the monitoring system.'''
6  import math
7  # get the component factory - used for merging the algorithm results
8  from AthenaConfiguration.ComponentFactory import CompFactory
9  from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
10  result = ComponentAccumulator()
11  #inputFlags.dump() # print all the configs
12 
13  # use L1Calo's special MonitoringCfgHelper
14  from TrigT1CaloMonitoring.LVL1CaloMonitoringConfig import L1CaloMonitorCfgHelper
15  helper = L1CaloMonitorCfgHelper(flags,CompFactory.GfexMonitorAlgorithm,'GfexMonAlg')
16  GfexMonAlg = helper.alg
17 
18  # add any steering
19  groupName = 'GfexMonitor' # the monitoring group name is also used for the package name
20  GfexMonAlg.PackageName = groupName
21 
22  GfexMonAlg.gFexJetTobKeyList = ["L1_gFexLRJetRoI", "L1_gFexSRJetRoI"]
23  GfexMonAlg.gFexRhoTobKeyList = ["L1_gFexRhoRoI"]
24  GfexMonAlg.gFexGlobalTobKeyList = ["L1_gScalarEJwoj", "L1_gMETComponentsJwoj", "L1_gMHTComponentsJwoj", "L1_gMSTComponentsJwoj", "L1_gMETComponentsNoiseCut", "L1_gMETComponentsRms", "L1_gScalarENoiseCut", "L1_gScalarERms"]
25 
26  # Define various quantities
27  trigPath = 'Developer/Gfex/'
28  globTobVarDict = {"gScalarEJwoj":["gFexMet", "gFexSumEt"], "gMETComponentsJwoj":["METx", "METy"], "gMHTComponentsJwoj":["MHTx", "MHTy"], "gMSTComponentsJwoj":["MSTx", "MSTy"], "gMETComponentsNoiseCut":["METx_NoiseCut", "METy_NoiseCut"], "gMETComponentsRms":["METx_Rms", "METy_Rms"], "gScalarENoiseCut":["gFexMet_NoiseCut", "gFexSumEt_NoiseCut"], "gScalarERms":["gFexMet_Rms", "gFexSumEt_Rms"]}
29  keyDirPathMap = {"gFexMet":"gXE/", "gFexSumEt":"gTE/", "METx":"gXE/", "METy":"gXE/", "MHTx":"gMHT/", "MHTy":"gMHT/", "MSTx":"gMST/", "MSTy":"gMST/", "METx_NoiseCut":"gXE_NoiseCut/", "METy_NoiseCut":"gXE_NoiseCut/", "METx_Rms":"gXE_RMS/", "METy_Rms":"gXE_RMS/", "gFexMet_NoiseCut":"gXE_NoiseCut/", "gFexSumEt_NoiseCut":"gTE_NoiseCut/", "gFexMet_Rms":"gTE_RMS/", "gFexSumEt_Rms":"gTE_RMS/"}
30  globTobRangeDict = {"gFexMet":[0, 6e5], "gFexSumEt":[0, 5e6], "METx":[-3e5, 3e5], "METy":[-3e5, 3e5], "MHTx":[-3e5, 3e5], "MHTy":[-3e5, 3e5], "MSTx":[-2e5, 2e5], "MSTy":[-2e5, 2e5], "METx_NoiseCut":[-6e5, 6e5], "METy_NoiseCut":[-6e5, 6e5], "METx_Rms":[-6e5, 6e5], "METy_Rms":[-6e5, 6e5], "gFexMet_NoiseCut":[-1e4, 1e6], "gFexSumEt_NoiseCut":[0, 2.5e6], "gFexMet_Rms":[-1e5, 1e6], "gFexSumEt_Rms":[0, 2e6]}
31 
32  # Define gfex histograms
33  ptCutValues = GfexMonAlg.ptCutValues
34  gFexJetTobKeyList = GfexMonAlg.gFexJetTobKeyList
35  gFexRhoTobKeyList = GfexMonAlg.gFexRhoTobKeyList
36  gFexGlobalTobKeyList = GfexMonAlg.gFexGlobalTobKeyList
37 
38  # Jet TOB list
39  for containerKey in gFexJetTobKeyList:
40  for ptCut in ptCutValues:
41  for pFPGA in ["", "FPGAa", "FPGAb", "FPGAc"]:# Empty str for inclusive
42 
43  ptCutString = "_CutPt{:.0f}".format(ptCut) if (ptCut != -1) else ""
44  containerKey = containerKey.split("+")[-1] # Needed to remove storeGate prefix if gFexJetTobKeyList is not set above
45 
46  # 1D histograms
47  histKey = containerKey + "{}" + ptCutString
48  histKey += ";h_" + containerKey + "{}" + ptCutString
49  tobTypeStr = "gFex SRJet" if "SRJet" in containerKey else "gFex LRJet"
50  ptStrTitle = " - tobEt [200 MeV Scale]>{:.0f}".format(ptCut) if ptCut != -1 else ""
51  jPath = "gFexSRJets" if "SRJet" in containerKey else "gFexLRJets"
52  jPath += ptCutString
53 
54  helper.defineHistogram(histKey.format("Eta{}".format(pFPGA), "Eta{}".format(pFPGA)), title="{} {} #eta{}; #eta; counts".format(tobTypeStr, pFPGA, ptStrTitle), type='TH1F', fillGroup=groupName, path=trigPath+"{}/".format(jPath), xbins=32,xmin=-3.3,xmax=3.3)
55  helper.defineHistogram(histKey.format("Phi{}".format(pFPGA), "Phi{}".format(pFPGA)), title="{} {} #phi{}; #phi; counts".format(tobTypeStr, pFPGA, ptStrTitle), type='TH1F', fillGroup=groupName, path=trigPath+"{}/".format(jPath), xbins=32,xmin=-math.pi,xmax=math.pi)
56  helper.defineHistogram(histKey.format("Pt{}".format(pFPGA), "Pt{}".format(pFPGA)) , title="{} {} #Pt{} ; #Pt ; counts".format(tobTypeStr, pFPGA, ptStrTitle), type='TH1F', fillGroup=groupName, path=trigPath+"{}/".format(jPath), xbins=100,xmin=-1,xmax=4096)
57 
58  # 2D histograms
59  histKey = containerKey + "{}" + ptCutString
60  etaKey = histKey.format("Eta{}".format(pFPGA))
61  phiKey = histKey.format("Phi{}".format(pFPGA))
62  helper.defineHistogram('{},{};h_{}{}'.format(etaKey, phiKey, etaKey, phiKey), title="{} {} #eta vs #phi {}; #eta; #phi".format(tobTypeStr, pFPGA, ptStrTitle), type='TH2F',fillGroup=groupName, path=trigPath+"{}/".format(jPath), xbins=32,xmin=-3.3,xmax=3.3,ybins=32,ymin=-math.pi,ymax=math.pi)
63 
64  # Rho TOB list
65  for containerKey in gFexRhoTobKeyList:
66  helper.defineHistogram("{};h_{}".format(containerKey, containerKey), title="{}; gFexRho Et [MeV]; counts".format(containerKey), fillGroup=groupName, type="TH1F", path=trigPath+"gRHO", xbins=100,xmin=-300000,xmax=300000)
67 
68  # Global TOB list
69  for containerKey in gFexGlobalTobKeyList:
70  for key, dictVal in globTobVarDict.items():
71  if key in containerKey:
72  varOne, varTwo = dictVal
73  break
74 
75  xminOne, xmaxOne = globTobRangeDict.get(varOne, [0,1e6])
76  xminTwo, xmaxTwo = globTobRangeDict.get(varTwo, [0,1e6])
77 
78  helper.defineHistogram("{};h_{}".format(varOne, varOne), title="{}; {} [MeV]; counts".format(varOne, varOne), type="TH1F", fillGroup=groupName, path=trigPath+keyDirPathMap.get(varOne, "gFexGlob/"), xbins=100,xmin=xminOne,xmax=xmaxOne)
79  helper.defineHistogram("{};h_{}".format(varTwo, varTwo), title="{}; {} [MeV]; counts".format(varTwo, varTwo), type="TH1F", fillGroup=groupName, path=trigPath+keyDirPathMap.get(varTwo, "gFexGlob/"), xbins=100,xmin=xminTwo,xmax=xmaxTwo)
80 
81  acc = helper.result()
82  result.merge(acc)
83  return result
84 
python.JetAnalysisCommon.ComponentAccumulator
ComponentAccumulator
Definition: JetAnalysisCommon.py:302
vtune_athena.format
format
Definition: vtune_athena.py:14
GfexMonitorAlgorithm.GfexMonitoringConfig
def GfexMonitoringConfig(flags)
Definition: GfexMonitorAlgorithm.py:4