ATLAS Offline Software
BunchCrossingIntensityCondAlgTest.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.ComponentFactory import CompFactory
4 from LumiBlockComps.BunchCrossingIntensityCondAlgConfig import BunchCrossingIntensityCondAlgCfg
5 from IOVDbSvc.IOVDbSvcConfig import IOVDbSvcCfg
6 from LumiBlockComps.dummyLHCFillDB import createSqliteForInt,fillFolderForInt,createBCMask1,createBCMask2
7 import os
8 
9 
10 
11 #First, create a dummy database to work with:
12 #Delete any previous instance, if there is any:
13 try:
14  os.remove("testInt.db")
15 except OSError:
16  pass
17 
18 
19 db,folder=createSqliteForInt("testInt.db",folderName="/TDAQ/OLC/LHC/BUNCHDATA")
22 
23 onesec=1000000000
24 
25 #Add two dummy masks with iov 2-3 and 3-4
26 fillFolderForInt(folder,d1,iovMin=1*onesec,iovMax=2*onesec)
27 fillFolderForInt(folder,d2,2*onesec,4*onesec)
28 db.closeDatabase()
29 
30 from AthenaConfiguration.AllConfigFlags import initConfigFlags
31 from AthenaConfiguration.MainServicesConfig import MainServicesCfg
32 flags = initConfigFlags()
33 flags.Input.Files=[]
34 flags.Input.isMC=False
35 flags.IOVDb.DatabaseInstance="CONDBR2"
36 flags.IOVDb.GlobalTag="CONDBR2-BLKPA-2017-05"
37 from AthenaConfiguration.TestDefaults import defaultGeometryTags
38 flags.GeoModel.AtlasVersion=defaultGeometryTags.RUN2
39 flags.lock()
40 result=MainServicesCfg(flags)
41 
42 from McEventSelector.McEventSelectorConfig import McEventSelectorCfg
43 result.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 
52 result.merge(BunchCrossingIntensityCondAlgCfg(flags))
53 result.merge(IOVDbSvcCfg(flags))
54 
55 
56 result.getService("IOVDbSvc").Folders=["<db>sqlite://;schema=testInt.db;dbname=CONDBR2</db><tag>HEAD</tag>/TDAQ/OLC/LHC/BUNCHDATA"]
57 result.getCondAlgo("BunchCrossingIntensityCondAlgDefault").OutputLevel=1
58 
59 BunchCrossingIntensityCondTest=CompFactory.BunchCrossingIntensityCondTest
60 result.addEventAlgo(BunchCrossingIntensityCondTest(FileName="BCIntData.txt"))
61 
62 
63 result.run(1)
python.BunchCrossingCondAlgTest.createBCMask1
def createBCMask1()
Definition: BunchCrossingCondAlgTest.py:12
python.BunchCrossingCondAlgTest.createBCMask2
def createBCMask2()
Definition: BunchCrossingCondAlgTest.py:32
python.BunchCrossingIntensityCondAlgConfig.BunchCrossingIntensityCondAlgCfg
def BunchCrossingIntensityCondAlgCfg(configFlags)
Definition: BunchCrossingIntensityCondAlgConfig.py:10
python.MainServicesConfig.MainServicesCfg
def MainServicesCfg(flags, LoopMgr='AthenaEventLoopMgr')
Definition: MainServicesConfig.py:260
python.McEventSelectorConfig.McEventSelectorCfg
def McEventSelectorCfg(flags, **kwargs)
Definition: McEventSelectorConfig.py:5
python.IOVDbSvcConfig.IOVDbSvcCfg
def IOVDbSvcCfg(flags, **kwargs)
Definition: IOVDbSvcConfig.py:19
python.dummyLHCFillDB.fillFolderForInt
def fillFolderForInt(folder, data=[], iovMin=cool.ValidityKeyMin, iovMax=cool.ValidityKeyMax)
Definition: dummyLHCFillDB.py:201
BunchCrossingIntensityCondTest
Definition: BunchCrossingIntensityCondTest.h:18
python.dummyLHCFillDB.createSqliteForInt
def createSqliteForInt(sqliteName, folderName="/TDAQ/OLC/LHC/BUNCHDATA")
Definition: dummyLHCFillDB.py:88
python.AllConfigFlags.initConfigFlags
def initConfigFlags()
Definition: AllConfigFlags.py:19