ATLAS Offline Software
Functions | Variables
GetNextRunList Namespace Reference

Functions

list[int] get_runs_since (int run_number)
 
def main ()
 

Variables

 SCRIPTDIR = os.path.dirname(os.path.realpath(__file__))
 
 DATADIR = os.environ.get('DCSC_DATADIR', SCRIPTDIR)
 

Function Documentation

◆ get_runs_since()

list[int] GetNextRunList.get_runs_since ( int  run_number)
Get runs that occured since `run_number`, excluding it.

Definition at line 11 of file GetNextRunList.py.

11 def get_runs_since(run_number: int) -> list[int]:
12  """
13  Get runs that occured since `run_number`, excluding it.
14  """
15  s = ServerProxy('http://atlasdqm.cern.ch:8080')
16  run_list: list[int] = s.get_completed_runs({'low_run': run_number}) # type: ignore
17  if run_number in run_list:
18  run_list.remove(run_number)
19  return run_list
20 

◆ main()

def GetNextRunList.main ( )
Read the lastRunNumber file, find runs which happened since it.
Then create a runList file containing these runs, and overwrite lastRunNumber.

Definition at line 21 of file GetNextRunList.py.

21 def main():
22  """
23  Read the lastRunNumber file, find runs which happened since it.
24  Then create a runList file containing these runs, and overwrite lastRunNumber.
25  """
26  try:
27  last_run = int(open(os.path.join(DATADIR, "lastRunNumber"), 'r+').read())
28  except Exception:
29  last_run = 450000
30  new_runs = get_runs_since(last_run)
31 
32  open(os.path.join(DATADIR, "runList"), "w").write("\n".join(map(str, new_runs)))
33 
34  if not new_runs:
35  print(strftime("%d/%m/%Y %H:%M:%S"), "Nothing to do")
36  return
37 
38  last_run = new_runs[-1]
39  open(os.path.join(DATADIR, "lastRunNumber"), "w").write(str(last_run)+"\n")
40  print(strftime("%d/%m/%Y %H:%M:%S"), "Wrote new runList. Last run is", last_run, new_runs)
41 

Variable Documentation

◆ DATADIR

GetNextRunList.DATADIR = os.environ.get('DCSC_DATADIR', SCRIPTDIR)

Definition at line 5 of file GetNextRunList.py.

◆ SCRIPTDIR

GetNextRunList.SCRIPTDIR = os.path.dirname(os.path.realpath(__file__))

Definition at line 4 of file GetNextRunList.py.

read
IovVectorMap_t read(const Folder &theFolder, const SelectionCriterion &choice, const unsigned int limit=10)
Definition: openCoraCool.cxx:569
CaloCellPos2Ntuple.int
int
Definition: CaloCellPos2Ntuple.py:24
GetNextRunList.get_runs_since
list[int] get_runs_since(int run_number)
Definition: GetNextRunList.py:11
python.ByteStreamConfig.write
def write
Definition: Event/ByteStreamCnvSvc/python/ByteStreamConfig.py:248
GetNextRunList.main
def main()
Definition: GetNextRunList.py:21
TCS::join
std::string join(const std::vector< std::string > &v, const char c=',')
Definition: Trigger/TrigT1/L1Topo/L1TopoCommon/Root/StringUtils.cxx:10
Trk::open
@ open
Definition: BinningType.h:40
Muon::print
std::string print(const MuPatSegment &)
Definition: MuonTrackSteering.cxx:28
str
Definition: BTagTrackIpAccessor.cxx:11