CMS 3D CMS Logo

List of all members | Public Member Functions
SelectRuns.SelectRuns Class Reference

Public Member Functions

def makeList (self)
 

Detailed Description

Definition at line 3 of file SelectRuns.py.

Member Function Documentation

def SelectRuns.SelectRuns.makeList (   self)

Definition at line 13 of file SelectRuns.py.

References HDQMDatabaseProducerConfiguration.HDQMDatabaseProducerConfiguration.BaseDir, HDQMDatabaseProducerConfiguration.HDQMDatabaseProducerConfiguration.FirstRun, HDQMDatabaseProducerConfiguration.HDQMDatabaseProducerConfiguration.Group, HDQMDatabaseProducerConfiguration.HDQMDatabaseProducerConfiguration.QualityFlag, and python.rootplot.root2matplotlib.replace().

13  def makeList(self):
14  # Save the old run list file
15  os.system("mv "+self.FileName+" "+self.FileName+".old")
16 
17  # Create the cfg for the run registry script
18  inputFile = open(self.BaseDir+"/runreg_template.cfg", "r")
19  # print "OutputFileName = ", self.FileName
20  outputFileContent = inputFile.read().replace("GROUP", self.Group).replace("FIRSTRUN", self.FirstRun).replace("OUTPUTFILENAME", self.FileName).replace("HLTNAMEFILTER", self.HLTNameFilter).replace("QUALITYFLAG", self.QualityFlag)
21  outputFile = open(self.BaseDir+"/runreg.cfg", "w")
22  outputFile.write(outputFileContent)
23  outputFile.close()
24 
25  # Produce the new run list file
26  os.system("source /afs/cern.ch/cms/ccs/wm/scripts/Crab/crab.sh; python "+self.BaseDir+"/runregparse.py")
27 
28  # Check if the file changed
29  import filecmp
30  if os.path.isfile(self.FileName+".old"):
31  if filecmp.cmp(self.FileName, self.FileName+".old"):
32  # They are equal
33  return 1
34  return 0
35 
def replace(string, replacements)