ATLAS Offline Software
CaloCellTimeCorrFiller.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 if len(sys.argv)<2:
15  usage()
16  sys.exit(-1)
17 
18 #parameters:
19 sqliteName=sys.argv[1]
20 folderName="/LAR/TimeCorrectionOfl/CellTimeOffset"
21 foldertag="".join(folderName.split("/")) + "-empty"
22 iovMin = cool.ValidityKeyMin
23 iovMax = cool.ValidityKeyMax
24 filename=None
25 defaultvalue=0.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 
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/utilsproxy/AtlCoolMerge.py ",sqliteName," CONDBR2 ATONR_COOLOFL_GPN ATLAS_COOLOFL_LAR_W <password>")
CaloCellPos2Ntuple.int
int
Definition: CaloCellPos2Ntuple.py:24
CaloCellTimeCorrFiller.usage
def usage()
Definition: CaloCellTimeCorrFiller.py:10
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