ATLAS Offline Software
Loading...
Searching...
No Matches
BunchCrossingIntensityCondAlgTest.py
Go to the documentation of this file.
1# Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
2
3from AthenaConfiguration.ComponentFactory import CompFactory
4from LumiBlockComps.BunchCrossingIntensityCondAlgConfig import BunchCrossingIntensityCondAlgCfg
5from IOVDbSvc.IOVDbSvcConfig import IOVDbSvcCfg
6from LumiBlockComps.dummyLHCFillDB import createSqliteForInt,fillFolderForInt,createBCMask1,createBCMask2
7import os
8
9
10
11#First, create a dummy database to work with:
12#Delete any previous instance, if there is any:
13try:
14 os.remove("testInt.db")
15except OSError:
16 pass
17
18
19db,folder=createSqliteForInt("testInt.db",folderName="/TDAQ/OLC/LHC/BUNCHDATA")
20d1=createBCMask1()
21d2=createBCMask2()
22
23onesec=1000000000
24
25#Add two dummy masks with iov 2-3 and 3-4
26fillFolderForInt(folder,d1,iovMin=1*onesec,iovMax=2*onesec)
27fillFolderForInt(folder,d2,2*onesec,4*onesec)
28db.closeDatabase()
29
30from AthenaConfiguration.AllConfigFlags import initConfigFlags
31from AthenaConfiguration.MainServicesConfig import MainServicesCfg
32flags = initConfigFlags()
33flags.Input.Files=[]
34flags.Input.isMC=False
35flags.IOVDb.DatabaseInstance="CONDBR2"
36flags.IOVDb.GlobalTag="CONDBR2-BLKPA-2017-05"
37from AthenaConfiguration.TestDefaults import defaultGeometryTags
38flags.GeoModel.AtlasVersion=defaultGeometryTags.RUN2
39flags.lock()
40result=MainServicesCfg(flags)
41
42from McEventSelector.McEventSelectorConfig import McEventSelectorCfg
43result.merge(McEventSelectorCfg(flags,
44 RunNumber=430897,
45 EventsPerRun=1,
46 FirstEvent=1183722158,
47 FirstLB=310,
48 EventsPerLB=1,
49 InitialTimeStamp=1,
50 TimeStampInterval=1))
51
52result.merge(BunchCrossingIntensityCondAlgCfg(flags))
53result.merge(IOVDbSvcCfg(flags))
54
55
56result.getService("IOVDbSvc").Folders=["<db>sqlite://;schema=testInt.db;dbname=CONDBR2</db><tag>HEAD</tag>/TDAQ/OLC/LHC/BUNCHDATA"]
57result.getCondAlgo("BunchCrossingIntensityCondAlgDefault").OutputLevel=1
58
59BunchCrossingIntensityCondTest=CompFactory.BunchCrossingIntensityCondTest
60result.addEventAlgo(BunchCrossingIntensityCondTest(FileName="BCIntData.txt"))
61
62
63result.run(1)