ATLAS Offline Software
CaloEnergyScaleCorrFiller.py
Go to the documentation of this file.
1 #!/bin/env python
2 # Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3 
4 from __future__ import print_function
5 
6 import os,sys
7 from PyCool import cool
8 from CaloCondPhysAlgs.CaloBlobWriter import createSqlite
9 
10 def usage():
11  print ("Syntax")
12  print (sys.argv[0],"<sqlitename> {<textfile> <Run1> <LB1> <Run2> <LB2>}")
13 
14 
15 if len(sys.argv)<2:
16  usage()
17  sys.exit(-1)
18 
19 #parameters:
20 sqliteName=sys.argv[1]
21 folderName="/LAR/CellCorrOfl/EnergyCorr"
22 foldertag="".join(folderName.split("/")) + "-RUN2-UPD4-03"
23 iovMin = cool.ValidityKeyMin
24 iovMax = cool.ValidityKeyMax
25 filename=None
26 defaultvalue=1.0
27 
28 if len(sys.argv)>2:
29  filename=sys.argv[2]
30  if not os.access(filename,os.R_OK):
31  print ("ERROR Can't read input file %s" % filename)
32  sys.exit(-1)
33  print ("Input text file:",filename )
34  pass
35 
36 if len(sys.argv)>4:
37  run=int(sys.argv[3])
38  LB=int(sys.argv[4])
39  iovMin=run <<32 | (LB & 0xFFFFFFFF)
40  print ("IOV-from run ",run,"LB",LB)
41  pass
42 
43 if len(sys.argv)>6:
44  run=int(sys.argv[5])
45  LB=int(sys.argv[6])
46  iovMax=run <<32 | (LB & 0xFFFFFFFF)
47  print ("IOV-until run ",run,"LB",LB)
48  pass
49 
50 print ("Default value",defaultvalue)
51 createSqlite(sqliteName,folderName,foldertag,iovMin,iovMax,filename,defaultvalue)
52 
53 print ("To upload:")
54 print ("export COOL_FLASK=https://cool-proxy-app.cern.ch")
55 print ("/afs/cern.ch/user/a/atlcond/utils22/AtlCoolMerge.py",sqliteName,"CONDRB2 ATONR_COOLOFL_GPN ATLAS_COOLOFL_LAR_W <password>")
CaloCellPos2Ntuple.int
int
Definition: CaloCellPos2Ntuple.py:24
TCS::join
std::string join(const std::vector< std::string > &v, const char c=',')
Definition: Trigger/TrigT1/L1Topo/L1TopoCommon/Root/StringUtils.cxx:10
python.CaloBlobWriter.createSqlite
def createSqlite(sqliteName, folderName, foldertag, iovMin=cool.ValidityKeyMin, iovMax=cool.ValidityKeyMax, inputFileName=None, defaultvalue=1.0)
Definition: CaloBlobWriter.py:96
CaloEnergyScaleCorrFiller.usage
def usage()
Definition: CaloEnergyScaleCorrFiller.py:10