ATLAS Offline Software
Loading...
Searching...
No Matches
BunchCrossingAverageCondAlgConfig.py
Go to the documentation of this file.
1# Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
2
3from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
4from AthenaConfiguration.ComponentFactory import CompFactory
5from IOVDbSvc.IOVDbSvcConfig import IOVDbSvcCfg
6from 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
32if __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")
49 d1=createBCMask1()
50 d2=createBCMask2()
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)