ATLAS Offline Software
Loading...
Searching...
No Matches
exampleDriverScript.py
Go to the documentation of this file.
1# Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
2
3#Import the configution-method we want to use (here: Delay and Cali-OFCs)
4from LArCalibProcessing.LArCalib_Delay_OFCCaliConfig import LArDelay_OFCCaliCfg
5
6#Import the MainServices (boilerplate)
7from AthenaConfiguration.MainServicesConfig import MainServicesCfg
8
9#Import the flag-container that is the arguemnt to the configuration methods
10from AthenaConfiguration.AllConfigFlags import initConfigFlags
11flags = initConfigFlags()
12from LArCalibProcessing.LArCalibConfigFlags import addLArCalibFlags
13addLArCalibFlags(flags)
14
15#This allows set flags from the command-line (not strictly required for the AP)
16flags.fillFromArgs()
17
18#Now we set the flags as required for this particular job:
19#The following flags help finding the input bytestream files:
20flags.LArCalib.Input.Dir = "/scratch/wlampl/calib21/HECFCAL_Oct20"
21flags.LArCalib.Input.Type="calibration_LArElec-Delay"
22flags.LArCalib.Input.RunNumbers=[404512,]
23flags.Input.Files=flags.LArCalib.Input.Files
24
25#Set the database (sqlite-file) containing the input conditions that
26#come typcially from the same calibration campaign
27#(in this case, Pedestal and AutoCorr)
28flags.LArCalib.Input.Database="db.sqlite"
29
30#Some configs depend on the sub-calo in question, here HEC
31#(sets also the preselection of LArRawCalibDataReadingAlg)
32flags.LArCalib.Input.SubDet="HEC"
33
34#Configure the Bad-Channel database we are reading
35#(the AP typically uses a snapshot in an sqlite file
36flags.LArCalib.BadChannelDB="BadChannelSnapshot.db"
37flags.LArCalib.BadChannelTag="-RUN2-UPD3-00"
38
39#Set a Geometry version (not really needed, but the job complains otherwise)
40from AthenaConfiguration.TestDefaults import defaultGeometryTags
41flags.GeoModel.AtlasVersion=defaultGeometryTags.RUN3
42
43#Output of this job:
44#ROOT file:
45flags.LArCalib.Output.ROOTFile="ofccali.root"
46
47#POOL file:
48flags.LArCalib.Output.POOLFile="ofccali.pool.root"
49
50#sqlite file (can be the same as the input-sqlite, but slightly different syntax
51flags.IOVDb.DBConnection="sqlite://;schema=db.sqlite;dbname=CONDBR2"
52
53#The global tag we are working with
54flags.IOVDb.GlobalTag="LARCALIB-RUN2-00"
55
56
57#Other potentially useful flags-settings:
58
59#Define the global output Level:
60#from AthenaCommon.Constants import *
61#flags.Exec.OutputLevel=VERBOSE
62
63#Feed-though preselection for bytestream input:
64#flags.LArCalib.Preselection.BEC=[1]
65#flags.LArCalib.Preselection.Side=[0]
66
67#Print the input files we found
68print ("Input files to be processed:")
69for f in flags.Input.Files:
70 print (f)
71
72
73#Lock the flag-container (required)
74flags.lock()
75
76#Get the Main services (EventLoopMgr, StoreGate, ... )
77cfg=MainServicesCfg(flags)
78
79#Merge our own config into it
80cfg.merge(LArDelay_OFCCaliCfg(flags))
81
82
83#At this point we can alter the configuration
84#(should not be necessary!!!)
85#cfg.getEventAlgo("LArCaliWaveBuilder").OutputLevel=VERBOSE
86
87#from AthenaConfiguration.ComponentFactory import CompFactory
88#cfg.addEventAlgo(CompFactory.LArPedestals2Ntuple(ContainerKey = "Pedestal",
89# AddFEBTempInfo = False
90# ))
91
92import sys
93#run the application
94print("Start running...")
95sys.exit(cfg.run().isFailure())
96#For jobs with no bytestream-input the last line is
97#cfg.run(1)
98#to process exactly one 'fake' event as the job does all it's work in stop()
void print(char *figname, TCanvas *c1)