ATLAS Offline Software
Loading...
Searching...
No Matches
BunchCrossingIntensityCondAlgConfig.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 createSqliteForInt,fillFolderForInt,createBCMask1,createBCMask2
7
8
9
11
12 result=ComponentAccumulator()
13 run1=(configFlags.IOVDb.DatabaseInstance=='COMP200')
14 from IOVDbSvc.IOVDbSvcConfig import addFolders
15
16 Mode = 0
17 folder = '/TDAQ/OLC/LHC/BUNCHDATA'
18 result.merge(addFolders(configFlags,folder,'TDAQ',className = 'CondAttrListCollection',tag='HEAD'))
19 alg = CompFactory.BunchCrossingIntensityCondAlg('BunchCrossingIntensityCondAlgDefault',
20 Run1=run1,
21 FillParamsFolderKey =folder,
22 Mode=Mode )
23
24 result.addCondAlgo(alg)
25
26 return result
27
28
29
30if __name__=="__main__":
31 from AthenaConfiguration.AllConfigFlags import initConfigFlags
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 flags.lock()
38
39 from AthenaConfiguration.MainServicesConfig import MainServicesCfg
40 result=MainServicesCfg(flags)
41
42 from McEventSelector.McEventSelectorConfig import McEventSelectorCfg
43
44
45
46
47 db,folder=createSqliteForInt("testInt.db",folderName="/TDAQ/OLC/LHC/BUNCHDATA")
48 d1=createBCMask1()
49 d2=createBCMask2()
50
51 onesec=1000000000
52
53
54 #Add two dummy masks with iov 2-3 and 3-4
55 fillFolderForInt(folder,d1,iovMin=1*onesec,iovMax=2*onesec)
56 fillFolderForInt(folder,d2,2*onesec,4*onesec)
57
58 db.closeDatabase()
59 #The time stamp correspond to: Wednesday 10 August 2024 22:26:00 (Run 430897)
60 result.merge(McEventSelectorCfg(flags,
61 RunNumber=430897,
62 EventsPerRun=1,
63 FirstEvent=1183722158,
64 FirstLB=310,
65 EventsPerLB=1,
66 InitialTimeStamp=1,
67 TimeStampInterval=1))
68
69
70
71 result.merge(BunchCrossingIntensityCondAlgCfg(flags))
72 result.merge(IOVDbSvcCfg(flags))
73 result.getService("IOVDbSvc").Folders=["<db>sqlite://;schema=testInt.db;dbname=CONDBR2</db><tag>HEAD</tag>/TDAQ/OLC/LHC/BUNCHDATA"]
74 BunchCrossingIntensityCondTest=CompFactory.BunchCrossingIntensityCondTest
75 result.addEventAlgo(BunchCrossingIntensityCondTest(FileName="BCIntData1.txt"))
76
77 result.run(1)