ATLAS Offline Software
Functions
CreateTrfArgs Namespace Reference

Functions

def fileExists (fp)
 
def getPickle (fp)
 
def correctPath (myPickle)
 
def writeNewPickle (newPickleName, data)
 
def swapFiles (originalFile, newFile)
 
def main ()
 

Function Documentation

◆ correctPath()

def CreateTrfArgs.correctPath (   myPickle)

Definition at line 13 of file CreateTrfArgs.py.

13 def correctPath(myPickle):
14  thisPath=os.getcwd()
15  #find the variable which gives the SCTCalibConfig path
16  SCTCalibConfigFile=myPickle['SCTCalibConfig']
17  fileName='SCTCalibConfig.py'
18  dissectedPath=thisPath.split('/')
19  dissectedPath[-1]='share'
20  sharePath='/'.join(dissectedPath)
21  newFileName=sharePath+'/'+fileName
22  myPickle['SCTcalibConfig']=newFileName
23 

◆ fileExists()

def CreateTrfArgs.fileExists (   fp)

Definition at line 4 of file CreateTrfArgs.py.

4 def fileExists(fp):
5  #caveats : http://stackoverflow.com/questions/82831/how-do-i-check-if-a-file-exists-using-python
6  return os.path.isfile(fp)
7 

◆ getPickle()

def CreateTrfArgs.getPickle (   fp)

Definition at line 8 of file CreateTrfArgs.py.

8 def getPickle(fp):
9  f=open(fp,'r')
10  d=pickle.load(f)
11  return d
12 

◆ main()

def CreateTrfArgs.main ( )

Definition at line 34 of file CreateTrfArgs.py.

34 def main():
35  existingPickleFilename='./newargdict.gpickle'
36  newPickleFileName='mynewpickle.gpickle'
37  data=getPickle(existingPickleFilename)
38  correctPath(data)
39  writeNewPickle(newPickleFileName,data)
40  swapFiles(existingPickleFilename,newPickleFileName)
41 
42 

◆ swapFiles()

def CreateTrfArgs.swapFiles (   originalFile,
  newFile 
)

Definition at line 28 of file CreateTrfArgs.py.

28 def swapFiles(originalFile,newFile):
29  os.remove(originalFile)
30  os.rename(newFile,originalFile)
31 
32 
33 

◆ writeNewPickle()

def CreateTrfArgs.writeNewPickle (   newPickleName,
  data 
)

Definition at line 24 of file CreateTrfArgs.py.

24 def writeNewPickle(newPickleName, data):
25  pickleFile=open(newPickleName,'w')
26  pickle.dump(data, pickleFile)
27 
CreateTrfArgs.main
def main()
Definition: CreateTrfArgs.py:34
CreateTrfArgs.swapFiles
def swapFiles(originalFile, newFile)
Definition: CreateTrfArgs.py:28
CreateTrfArgs.correctPath
def correctPath(myPickle)
Definition: CreateTrfArgs.py:13
CreateTrfArgs.fileExists
def fileExists(fp)
Definition: CreateTrfArgs.py:4
CreateTrfArgs.getPickle
def getPickle(fp)
Definition: CreateTrfArgs.py:8
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
CreateTrfArgs.writeNewPickle
def writeNewPickle(newPickleName, data)
Definition: CreateTrfArgs.py:24