ATLAS Offline Software
BunchCrossingAverageCondAlgConfig.py
Go to the documentation of this file.
1 # Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
2 
3 from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
4 from AthenaConfiguration.ComponentFactory import CompFactory
5 from IOVDbSvc.IOVDbSvcConfig import IOVDbSvcCfg
6 from LumiBlockComps.dummyLHCFillDB import createSqliteForAvg,fillFolderForAvg,createBCMask1,createBCMask2
7 
8 
10 
11  result=ComponentAccumulator()
12  run1=(flags.IOVDb.DatabaseInstance=='COMP200')
13  from IOVDbSvc.IOVDbSvcConfig import addFolders
14 
15  Mode = 0
16  folder = '/TDAQ/OLC/LHC/LBDATA3'
17  result.merge(addFolders(flags,folder,'TDAQ',className = 'CondAttrListCollection',tag='HEAD'))
18 
19 
20 
21  alg = CompFactory.BunchCrossingAverageCondAlg('BunchCrossingAverageCondAlgDefault',
22  Run1=run1,
23  FillParamsFolderKey =folder,
24  Mode=Mode )
25 
26 
27  result.addCondAlgo(alg)
28  return result
29 
30 
31 
32 if __name__=="__main__":
33  from AthenaConfiguration.AllConfigFlags import initConfigFlags
34  flags = initConfigFlags()
35  flags.Input.Files = []
36  flags.Input.isMC=False
37  flags.IOVDb.DatabaseInstance="CONDBR2"
38  flags.IOVDb.GlobalTag="CONDBR2-BLKPA-2017-05"
39  flags.lock()
40 
41  from AthenaConfiguration.MainServicesConfig import MainServicesCfg
42  result=MainServicesCfg(flags)
43  from McEventSelector.McEventSelectorConfig import McEventSelectorCfg
44 
45 
46 
47 
48  db,folder=createSqliteForAvg("testAVG.db",folderName="/TDAQ/OLC/LHC/LBDATA3")
51 
52  onesec=1000000000
53 
54 
55  #Add two dummy masks with iov 2-3 and 3-4
56  fillFolderForAvg(folder,d1,iovMin=1*onesec,iovMax=2*onesec)
57  fillFolderForAvg(folder,d2,2*onesec,4*onesec)
58 
59  db.closeDatabase()
60  #The time stamp correspond to: Wednesday 10 August 2024 22:26:00 (Run 430897)
61  result.merge(McEventSelectorCfg(flags,
62  RunNumber=430897,
63  EventsPerRun=1,
64  FirstEvent=1183722158,
65  FirstLB=310,
66  EventsPerLB=1,
67  InitialTimeStamp=1,
68  TimeStampInterval=1))
69 
70  result.merge(BunchCrossingAverageCondAlgCfg(flags))
71  result.merge(IOVDbSvcCfg(flags))
72  result.getService("IOVDbSvc").Folders=["<db>sqlite://;schema=testAVG.db;dbname=CONDBR2</db><tag>HEAD</tag>/TDAQ/OLC/LHC/LBDATA3"]
73  BunchCrossingAverageCondTest=CompFactory.BunchCrossingAverageCondTest
74  result.addEventAlgo(BunchCrossingAverageCondTest(FileName="BCAvgData1.txt"))
75 
76  result.run(1)
python.JetAnalysisCommon.ComponentAccumulator
ComponentAccumulator
Definition: JetAnalysisCommon.py:302
python.BunchCrossingCondAlgTest.createBCMask1
def createBCMask1()
Definition: BunchCrossingCondAlgTest.py:12
python.BunchCrossingAverageCondAlgConfig.BunchCrossingAverageCondAlgCfg
def BunchCrossingAverageCondAlgCfg(flags)
Definition: BunchCrossingAverageCondAlgConfig.py:9
python.BunchCrossingCondAlgTest.createBCMask2
def createBCMask2()
Definition: BunchCrossingCondAlgTest.py:32
python.MainServicesConfig.MainServicesCfg
def MainServicesCfg(flags, LoopMgr='AthenaEventLoopMgr')
Definition: MainServicesConfig.py:260
python.McEventSelectorConfig.McEventSelectorCfg
def McEventSelectorCfg(flags, **kwargs)
Definition: McEventSelectorConfig.py:5
python.dummyLHCFillDB.fillFolderForAvg
def fillFolderForAvg(folder, data=[], iovMin=cool.ValidityKeyMin, iovMax=cool.ValidityKeyMax)
Definition: dummyLHCFillDB.py:164
python.dummyLHCFillDB.createSqliteForAvg
def createSqliteForAvg(sqliteName, folderName="/TDAQ/OLC/LHC/LBDATA3")
Definition: dummyLHCFillDB.py:43
python.IOVDbSvcConfig.addFolders
def addFolders(flags, folderStrings, detDb=None, className=None, extensible=False, tag=None, db=None, modifiers='')
Definition: IOVDbSvcConfig.py:81
python.IOVDbSvcConfig.IOVDbSvcCfg
def IOVDbSvcCfg(flags, **kwargs)
Definition: IOVDbSvcConfig.py:28
python.AllConfigFlags.initConfigFlags
def initConfigFlags()
Definition: AllConfigFlags.py:19
BunchCrossingAverageCondTest
Definition: BunchCrossingAverageCondTest.h:18