ATLAS Offline Software
LArCosmicsMonAlg.py
Go to the documentation of this file.
1 
2 #
3 # Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
4 #
5 
6 def LArCosmicsMonConfig(flags):
7  '''Function to configures some algorithms in the monitoring system.'''
8 
9  # The following class will make a sequence, configure algorithms, and link
10  # them to GenericMonitoringTools
11 
12  from AthenaMonitoring.AthMonitorCfgHelper import AthMonitorCfgHelper
13  helper = AthMonitorCfgHelper(flags,'LArCosmicsMonAlgCfg')
14 
15  from AthenaConfiguration.ComponentFactory import CompFactory
16  LArCosmicsMonConfigCore(helper, CompFactory.LArCosmicsMonAlg,flags)
17 
18  return helper.result()
19 
20 
21 def LArCosmicsMonConfigCore(helper, algoinstance,flags):
22 
23 
24  from LArMonitoring.GlobalVariables import lArDQGlobals
25 
26  larCosmicsMonAlg = helper.addAlgorithm(algoinstance,'larCosmicsMonAlg')
27 
28  larCosmicsMonAlg.CosmicsMonGroupName = 'LarCosmicsMonGroup'
29  larCosmicsMonAlg.MuonADCthreshold_EM_barrel = 30
30  larCosmicsMonAlg.MuonADCthreshold_EM_endcap = 40
31  larCosmicsMonAlg.MuonADCthreshold_HEC = 40
32  larCosmicsMonAlg.MuonADCthreshold_FCAL = 40
33  larCosmicsMonAlg.ProblemsToMask=["deadReadout","deadPhys","short","almostDead","highNoiseHG","highNoiseMG","highNoiseLG","sporadicBurstNoise"]
34 
35 
36  #mon group
37  cosmicMonGroup = helper.addGroup(
38  larCosmicsMonAlg,
39  larCosmicsMonAlg.CosmicsMonGroupName,
40  '/LAr/',
41  'run'
42  )
43 
44  cosmic_path="Cosmics/"
45 
46  EM_bins=sorted(list(set(lArDQGlobals.Cell_Variables["etaRange"]["EMEC"]["C"]["2"]+lArDQGlobals.Cell_Variables["etaRange"]["EMB"]["C"]["2"]+lArDQGlobals.Cell_Variables["etaRange"]["EMB"]["A"]["2"]+lArDQGlobals.Cell_Variables["etaRange"]["EMEC"]["A"]["2"])))
47  cosmicMonGroup.defineHistogram('mon_eta_EM,mon_phi;Muon2DHitsECAL',
48  type='TH2F',
49  path=cosmic_path,
50  title='Cosmics Seeds - Digit Max > '+str(int(larCosmicsMonAlg.MuonADCthreshold_EM_barrel))+'/'+str(int(larCosmicsMonAlg.MuonADCthreshold_EM_endcap))+' [ADC] in S2 Barrel/Endcap - EM;#eta cell;#phi cell;Number of Hits',
51  xbins=EM_bins,
52  ybins=lArDQGlobals.Cell_Variables["phiRange"]["EMB"]["A"]["2"])
53 
54  HEC_bins=sorted(list(set(lArDQGlobals.Cell_Variables["etaRange"]["HEC"]["C"]["1"]+lArDQGlobals.Cell_Variables["etaRange"]["HEC"]["A"]["1"])))
55  cosmicMonGroup.defineHistogram('mon_eta_HEC,mon_phi;Muon2DHitsHCAL',
56  type='TH2F',
57  path=cosmic_path,
58  title='Cosmics Seeds - Digit Max > '+str(int(larCosmicsMonAlg.MuonADCthreshold_HEC))+' [ADC] in S1 HEC;#eta cell;#phi cell;Number of Hits',
59  xbins=HEC_bins,
60  ybins=lArDQGlobals.Cell_Variables["phiRange"]["HEC"]["A"]["1"])
61 
62  FCal_bins=sorted(list(set(lArDQGlobals.Cell_Variables["etaRange"]["FCal"]["C"]["2"]+lArDQGlobals.Cell_Variables["etaRange"]["FCal"]["A"]["2"])))
63  cosmicMonGroup.defineHistogram('mon_eta_FCal,mon_phi;Muon2DHitsFCAL',
64  type='TH2F',
65  path=cosmic_path,
66  title='Cosmics Seeds - Digit Max > '+str(int(larCosmicsMonAlg.MuonADCthreshold_FCAL))+' [ADC] in S2 FCal;#eta cell;#phi cell;Number of Hits',
67  xbins=FCal_bins,
68  ybins=lArDQGlobals.Cell_Variables["phiRange"]["FCal"]["A"]["2"])
69 
70 
71 
72 
73 if __name__=='__main__':
74 
75  from AthenaConfiguration.AllConfigFlags import initConfigFlags
76  flags = initConfigFlags()
77 
78  from AthenaCommon.Logging import log
79  from AthenaCommon.Constants import WARNING
80  log.setLevel(WARNING)
81 
82  from LArMonitoring.LArMonConfigFlags import addLArMonFlags
83  flags.addFlagsCategory("LArMon", addLArMonFlags)
84 
85  from AthenaConfiguration.TestDefaults import defaultTestFiles
86  flags.Input.Files = defaultTestFiles.RAW_RUN2
87 
88  flags.Output.HISTFileName = 'LArCosmicsMonOutput.root'
89  flags.DQ.enableLumiAccess = False
90  flags.DQ.useTrigger = False
91  flags.lock()
92 
93  from CaloRec.CaloRecoConfig import CaloRecoCfg
94  cfg=CaloRecoCfg(flags)
95 
96  from LArCellRec.LArNoisyROSummaryConfig import LArNoisyROSummaryCfg
97  cfg.merge(LArNoisyROSummaryCfg(flags))
98 
99  cosm_acc = LArCosmicsMonConfig(flags)
100  cfg.merge(cosm_acc)
101 
102  flags.dump()
103  f=open("LArCosmicsMon.pkl","wb")
104  cfg.store(f)
105  f.close()
106 
107 # cfg.run(10)
108 
109 
110 
111 
112 
113 
114 
python.CaloRecoConfig.CaloRecoCfg
def CaloRecoCfg(flags, clustersname=None)
Definition: CaloRecoConfig.py:9
CaloCellPos2Ntuple.int
int
Definition: CaloCellPos2Ntuple.py:24
LArCosmicsMonAlg.LArCosmicsMonConfig
def LArCosmicsMonConfig(flags)
Definition: LArCosmicsMonAlg.py:6
Constants
some useful constants -------------------------------------------------—
histSizes.list
def list(name, path='/')
Definition: histSizes.py:38
DerivationFramework::TriggerMatchingUtils::sorted
std::vector< typename T::value_type > sorted(T begin, T end)
Helper function to create a sorted vector from an unsorted one.
CxxUtils::set
constexpr std::enable_if_t< is_bitmask_v< E >, E & > set(E &lhs, E rhs)
Convenience function to set bits in a class enum bitmask.
Definition: bitmask.h:232
Trk::open
@ open
Definition: BinningType.h:40
LArNoisyROSummaryConfig.LArNoisyROSummaryCfg
def LArNoisyROSummaryCfg(configFlags, **kwargs)
Definition: LArNoisyROSummaryConfig.py:8
LArCosmicsMonAlg.LArCosmicsMonConfigCore
def LArCosmicsMonConfigCore(helper, algoinstance, flags)
Definition: LArCosmicsMonAlg.py:21
python.AllConfigFlags.initConfigFlags
def initConfigFlags()
Definition: AllConfigFlags.py:19
str
Definition: BTagTrackIpAccessor.cxx:11