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