ATLAS Offline Software
Functions | Variables
lumiFormat Namespace Reference

Functions

def perdelta (start, end, delta)
 
def checkDates (datesFileName)
 

Variables

string outPath = "/eos/atlas/user/j/jdickins/Pixel/LeakageCurrent/IBLData/processedData/Lumi/"
 
string outputName = outPath + "/runData.txt"
 
string outputSummary = outPath + "/runs.txt"
 
string inPath = "/eos/atlas/user/j/jdickins/Pixel/LeakageCurrent/IBLData/rawData/Lumi/"
 
 currentDay = datetime.date(2018,11,7)
 
 firstDay = startDates[0].date()
 
 days
 
 s_str = str(s).replace('-','_')
 
 e_str = str(e).replace('-','_')
 
string filename = inPath + s_str + "-" + e_str + ".txt"
 
int i = -1
 
 array = line.rstrip().split()
 
 startDateTime = array[0].split('/UTC')[0].split('[')[1]
 
 startDate = startDateTime.split('-')
 
 startTime = startDateTime.split(':')
 
 start = datetime.datetime(int(startDate[0]),int(startDate[1]),int(startDate[2].split(':')[0]),int(startTime[1]),int(startTime[2]),int(startTime[3]))
 
 endDateTime = array[1].split('/UTC')[0]
 
 endDate = startDateTime.split('-')
 
 endTime = startDateTime.split(':')
 
 end = datetime.datetime(int(endDate[0]),int(endDate[1]),int(endDate[2].split(':')[0]),int(endTime[1]),int(endTime[2]),int(endTime[3]))
 
 fill = int(array[3])
 
 length = float(array[6])
 
 lumi = float(array[10])
 
 intlumi = length*lumi
 

Function Documentation

◆ checkDates()

def lumiFormat.checkDates (   datesFileName)

Definition at line 14 of file lumiFormat.py.

14 def checkDates(datesFileName):
15  #placeholder declarations
16  tempRun = 0
17 
18  startingDates=[]
19  endDates=[]
20 
21  #if no file containing previously used dates, create one with default values.
22  #"No any file found!" is what my motherboard says whilst booting my home PC, I found it funny and copied it over here
23  if not os.path.exists(datesFileName):
24  print("No any file found! at " + datesFileName + ". Making default values")
25 
26  with open(datesFileName,'w') as datesFile:
27  firstTempDate = datetime.datetime(2015,4,2,1,1,1,1)
28  lastTempDate = datetime.datetime(2015,4,2,1,1,1)
29 
30  datesFile.write(str(tempRun) + " " + str(firstTempDate) + " " + str(lastTempDate) +"\n")
31  startingDates.append(firstTempDate)
32  endDates.append(lastTempDate)
33 
34  #if dates file exists, read from it
35  else:
36  print("Found " + datesFileName)
37  with open(datesFileName,'r') as datesFile:
38 
39  for dateLine in datesFile:
40  tempDatesLine = dateLine.split()
41  firstTemp = tempDatesLine[1].split('-')
42  lastTemp = tempDatesLine[3].split('-')
43 
44  firstTempTime = tempDatesLine[2].split(':')
45  lastTempTime = tempDatesLine[4].split(':')
46 
47  firstTempTimes = firstTempTime[2].split('.')
48  lastTempTimes = lastTempTime[2].split('.')
49 
50  if len(firstTempTimes)<2:
51  firstTempTimes.append(0)
52  if len(lastTempTimes)<2:
53  lastTempTimes.append(0)
54 
55  firstTempDate = datetime.datetime(int(firstTemp[0]), int(firstTemp[1]), int(firstTemp[2]), int(firstTempTime[0]),int(firstTempTime[1]), int(firstTempTimes[0]), int(firstTempTimes[1]))
56  lastTempDate = datetime.datetime(int(lastTemp[0]), int(lastTemp[1]), int(lastTemp[2]), int(lastTempTime[0]), int(lastTempTimes[0]),int(lastTempTimes[0]), int(lastTempTimes[1]))
57 
58  startingDates.append(firstTempDate)
59  endDates.append(lastTempDate)
60 
61  datesList=[startingDates,endDates]
62  return datesList
63 

◆ perdelta()

def lumiFormat.perdelta (   start,
  end,
  delta 
)

Definition at line 7 of file lumiFormat.py.

7 def perdelta(start, end, delta):
8  curr = start
9  while curr < end:
10  yield curr, min(curr + delta, end)
11  curr += delta
12 
13 # Function to return required dates

Variable Documentation

◆ array

lumiFormat.array = line.rstrip().split()

Definition at line 91 of file lumiFormat.py.

◆ currentDay

lumiFormat.currentDay = datetime.date(2018,11,7)

Definition at line 72 of file lumiFormat.py.

◆ days

lumiFormat.days

Definition at line 77 of file lumiFormat.py.

◆ e_str

lumiFormat.e_str = str(e).replace('-','_')

Definition at line 81 of file lumiFormat.py.

◆ end

lumiFormat.end = datetime.datetime(int(endDate[0]),int(endDate[1]),int(endDate[2].split(':')[0]),int(endTime[1]),int(endTime[2]),int(endTime[3]))

Definition at line 101 of file lumiFormat.py.

◆ endDate

lumiFormat.endDate = startDateTime.split('-')

Definition at line 99 of file lumiFormat.py.

◆ endDateTime

lumiFormat.endDateTime = array[1].split('/UTC')[0]

Definition at line 98 of file lumiFormat.py.

◆ endTime

lumiFormat.endTime = startDateTime.split(':')

Definition at line 100 of file lumiFormat.py.

◆ filename

string lumiFormat.filename = inPath + s_str + "-" + e_str + ".txt"

Definition at line 83 of file lumiFormat.py.

◆ fill

lumiFormat.fill = int(array[3])

Definition at line 104 of file lumiFormat.py.

◆ firstDay

lumiFormat.firstDay = startDates[0].date()

Definition at line 73 of file lumiFormat.py.

◆ i

int lumiFormat.i = -1

Definition at line 85 of file lumiFormat.py.

◆ inPath

string lumiFormat.inPath = "/eos/atlas/user/j/jdickins/Pixel/LeakageCurrent/IBLData/rawData/Lumi/"

Definition at line 68 of file lumiFormat.py.

◆ intlumi

lumiFormat.intlumi = length*lumi

Definition at line 107 of file lumiFormat.py.

◆ length

lumiFormat.length = float(array[6])

Definition at line 105 of file lumiFormat.py.

◆ lumi

lumiFormat.lumi = float(array[10])

Definition at line 106 of file lumiFormat.py.

◆ outPath

string lumiFormat.outPath = "/eos/atlas/user/j/jdickins/Pixel/LeakageCurrent/IBLData/processedData/Lumi/"

Definition at line 64 of file lumiFormat.py.

◆ outputName

string lumiFormat.outputName = outPath + "/runData.txt"

Definition at line 65 of file lumiFormat.py.

◆ outputSummary

string lumiFormat.outputSummary = outPath + "/runs.txt"

Definition at line 66 of file lumiFormat.py.

◆ s_str

lumiFormat.s_str = str(s).replace('-','_')

Definition at line 80 of file lumiFormat.py.

◆ start

lumiFormat.start = datetime.datetime(int(startDate[0]),int(startDate[1]),int(startDate[2].split(':')[0]),int(startTime[1]),int(startTime[2]),int(startTime[3]))

Definition at line 96 of file lumiFormat.py.

◆ startDate

lumiFormat.startDate = startDateTime.split('-')

Definition at line 94 of file lumiFormat.py.

◆ startDateTime

lumiFormat.startDateTime = array[0].split('/UTC')[0].split('[')[1]

Definition at line 93 of file lumiFormat.py.

◆ startTime

lumiFormat.startTime = startDateTime.split(':')

Definition at line 95 of file lumiFormat.py.

lumiFormat.perdelta
def perdelta(start, end, delta)
Definition: lumiFormat.py:7
CaloCellPos2Ntuple.int
int
Definition: CaloCellPos2Ntuple.py:24
min
constexpr double min()
Definition: ap_fixedTest.cxx:26
lumiFormat.checkDates
def checkDates(datesFileName)
Definition: lumiFormat.py:14
print
void print(char *figname, TCanvas *c1)
Definition: TRTCalib_StrawStatusPlots.cxx:25
Trk::open
@ open
Definition: BinningType.h:40
str
Definition: BTagTrackIpAccessor.cxx:11
Trk::split
@ split
Definition: LayerMaterialProperties.h:38