CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
Functions | Variables
createPayload Namespace Reference

Functions

def copyToWorkflowdir
 
def mkWorkflowdir
 

Variables

string allbeam_file = workflowdirArchive+"AllIOVs/"
 
tuple allfile = open( allbeam_file, 'a')
 
tuple alllines = mergedfile.readlines()
 
tuple alumi = line.split()
 
string alumis = ''
 
string arun = ''
 
tuple atime = line.split()
 
list beam_file = sortedlist[key]
 WRITE sqlite file. More...
 
list beam_file_tmp = workflowdirTmp+beam_file[beam_file.rfind('/')+1:]
 
list block = alllines[i * 23: (i+1)*23]
 
 checkType = tagType
 
string destDB = 'oracle://cms_orcon_prod/CMS_COND_31X_BEAMSPOT'
 
tuple dfile = open(metadata_file,'w')
 
string dropbox = "/DropBox"
 
string final_sqlite_file_name = tagname+'@'
 
string iov_comment = 'Beam spot position'
 
string iov_since = '1'
 
string iov_since_first = '1'
 
string iov_till = ''
 
string IOVbase = 'runbase'
 
tuple keys = sortedlist.keys()
 
list line = block[0]
 
tuple listoffiles = copyToWorkflowdir(option.data)
 
tuple mergedfile = open(beam_file)
 
string metadata_file = workflowdirTmp+sqlite_file_name+'.txt'
 
tuple newtmpfile = open(beam_file_tmp,"w")
 
int nfile = 0
 
tuple npayloads = len(alllines)
 
string optionstring = ''
 
tuple readdb_template = os.getenv("CMSSW_BASE")
 
 skip = False
 
dictionary sortedlist = {}
 
string sqlite_file = workflowdirTmp+sqlite_file_name+'.db'
 READ and check sqlite file. More...
 
 sqlite_file_name = tagname+suffix
 
string suffix = "_"
 
string tagname = ''
 
string tagType = ''
 
string timetype = 'runnumber'
 
string tmp_datafilename = workflowdirTmp+"tmp_datafile.txt"
 
string tmp_lumi_since = ""
 
string tmp_lumi_till = ""
 
string tmp_run = ""
 
tuple tmpfile = open(beam_file)
 
tuple total_files = len(keys)
 
tuple uuid = commands.getstatusoutput('uuidgen -t')
 
string workflowdir = 'test/workflow/'
 3 More...
 
string workflowdirArchive = workflowdir+'archive/'
 
string workflowdirLastPayloads = workflowdir+'lastPayloads/'
 
string workflowdirTmp = workflowdir+'tmp/'
 
tuple writedb_template = os.getenv("CMSSW_BASE")
 

Function Documentation

def createPayload.copyToWorkflowdir (   path)

Definition at line 51 of file createPayload.py.

References cmsRelvalreport.exit, spr.find(), and split.

Referenced by mkWorkflowdir().

51 
52 def copyToWorkflowdir(path):
53  global workflowdirArchive
54  lsCommand = ''
55  cpCommand = ''
56  listoffiles = []
57  tmplistoffiles = []
58  if path.find('castor') != -1:
59  print "Getting files from castor ..."
60  lsCommand = 'ns'
61  cpCommand = 'rf'
62  elif not os.path.exists(path):
63  exit("ERROR: File or directory " + path + " doesn't exist")
64 
65  if path[len(path)-4:len(path)] != '.txt':
66  if path[len(path)-1] != '/':
67  path = path + '/'
68 
69  aCommand = lsCommand + 'ls '+ path + " | grep .txt"
70 
71  tmpstatus = commands.getstatusoutput( aCommand )
72  tmplistoffiles = tmpstatus[1].split('\n')
73  if len(tmplistoffiles) == 1:
74  if tmplistoffiles[0] == '':
75  exit('ERROR: No files found in directory ' + path)
76  if tmplistoffiles[0].find('No such file or directory') != -1:
77  exit("ERROR: File or directory " + path + " doesn't exist")
78 
79  else:
80  tmplistoffiles.append(path[path.rfind('/')+1:len(path)])
81  path = path[0:path.rfind('/')+1]
82 
83 
84  archiveName = path
85  if path == './':
86  archiveName = os.getcwd() + '/'
87  archiveName = archiveName[archiveName[:len(archiveName)-1].rfind('/')+1:len(archiveName)]
88  if path[:len(path)-1].rfind('/') != -1:
89  archiveName = path[path[:len(path)-1].rfind('/')+1:len(path)]
90 
91  workflowdirArchive = workflowdirArchive + archiveName
92  if tagType != '' :
93  workflowdirArchive = workflowdirArchive[:len(workflowdirArchive)-1] + '_' + tagType + '/'
94  if not os.path.isdir(workflowdirArchive):
95  os.mkdir(workflowdirArchive)
96  elif(option.newarchive):
97 # tmpTime = str(datetime.datetime.now())
98 # tmpTime = tmpTime.replace(' ','-')
99 # tmpTime = tmpTime.replace('.','-')
100 # workflowdirArchive = workflowdirArchive[:len(workflowdirArchive)-1] + '_' + tmpTime + '/'
101 # os.mkdir(workflowdirArchive)
102  for n in range(1,100000):
103  tryDir = workflowdirArchive[:len(workflowdirArchive)-1] + '_' + str(n) + '/'
104  if not os.path.isdir(tryDir):
105  workflowdirArchive = tryDir
106  os.mkdir(workflowdirArchive)
107  break
108  elif n == 100000-1:
109  exit('ERROR: Unbelievable! do you ever clean ' + workflowdir + '?. I think you have to remove some directories!')
110 
111  for ifile in tmplistoffiles:
112  if ifile.find('.txt') != -1:
113  if os.path.isfile(workflowdirArchive+"/"+ifile):
114  if option.overwrite:
115  print "File " + ifile + " already exists in destination. We will overwrite it."
116  else:
117  print "File " + ifile + " already exists in destination. Keep original file."
118  listoffiles.append( workflowdirArchive + ifile )
119  continue
120  listoffiles.append( workflowdirArchive + ifile )
121  # copy to local disk
122  aCommand = cpCommand + 'cp '+ path + ifile + " " + workflowdirArchive
123  print " >> " + aCommand
124  tmpstatus = commands.getstatusoutput( aCommand )
125  return listoffiles
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:7
double split
Definition: MVATrainer.cc:139
def createPayload.mkWorkflowdir ( )

Definition at line 126 of file createPayload.py.

References copyToWorkflowdir(), cmsRelvalreport.exit, and triggerExpression.parse().

127 def mkWorkflowdir():
128  global workflowdir
129  global workflowdirLastPayloads
130  global workflowdirTmp
131  global workflowdirArchive
132  if not os.path.isdir(workflowdir):
133  print "Making " + workflowdir + " directory..."
134  os.mkdir(workflowdir)
135 
136  if not os.path.isdir(workflowdirLastPayloads):
137  os.mkdir(workflowdirLastPayloads)
138  else:
139  os.system("rm -f "+ workflowdirLastPayloads + "*")
140 
141  if not os.path.isdir(workflowdirTmp):
142  os.mkdir(workflowdirTmp)
143  else:
144  os.system("rm -f "+ workflowdirTmp + "*")
145 
146  if not os.path.isdir(workflowdirArchive):
147  os.mkdir(workflowdirArchive)

Variable Documentation

string createPayload.allbeam_file = workflowdirArchive+"AllIOVs/"

Definition at line 255 of file createPayload.py.

tuple createPayload.allfile = open( allbeam_file, 'a')

Definition at line 258 of file createPayload.py.

tuple createPayload.alllines = mergedfile.readlines()

Definition at line 216 of file createPayload.py.

tuple createPayload.alumi = line.split()

Definition at line 238 of file createPayload.py.

string createPayload.alumis = ''

Definition at line 230 of file createPayload.py.

tuple createPayload.arun = ''

Definition at line 229 of file createPayload.py.

tuple createPayload.atime = line.split()

Definition at line 223 of file createPayload.py.

createPayload.beam_file = sortedlist[key]

WRITE sqlite file.

Definition at line 290 of file createPayload.py.

list createPayload.beam_file_tmp = workflowdirTmp+beam_file[beam_file.rfind('/')+1:]

Definition at line 300 of file createPayload.py.

list createPayload.block = alllines[i * 23: (i+1)*23]

Definition at line 219 of file createPayload.py.

string createPayload.checkType = tagType

Definition at line 382 of file createPayload.py.

Referenced by edm.checkDictionaries().

string createPayload.destDB = 'oracle://cms_orcon_prod/CMS_COND_31X_BEAMSPOT'

Definition at line 270 of file createPayload.py.

tuple createPayload.dfile = open(metadata_file,'w')

Definition at line 371 of file createPayload.py.

string createPayload.dropbox = "/DropBox"

Definition at line 406 of file createPayload.py.

string createPayload.final_sqlite_file_name = tagname+'@'

Definition at line 391 of file createPayload.py.

string createPayload.iov_comment = 'Beam spot position'

Definition at line 274 of file createPayload.py.

tuple createPayload.iov_since = '1'

Definition at line 277 of file createPayload.py.

createPayload.iov_since_first = '1'

Definition at line 267 of file createPayload.py.

tuple createPayload.iov_till = ''

Definition at line 278 of file createPayload.py.

createPayload.IOVbase = 'runbase'

Definition at line 200 of file createPayload.py.

tuple createPayload.keys = sortedlist.keys()

Definition at line 249 of file createPayload.py.

string createPayload.line = block[0]

Definition at line 222 of file createPayload.py.

tuple createPayload.listoffiles = copyToWorkflowdir(option.data)

Definition at line 208 of file createPayload.py.

tuple createPayload.mergedfile = open(beam_file)

Definition at line 215 of file createPayload.py.

string createPayload.metadata_file = workflowdirTmp+sqlite_file_name+'.txt'

Definition at line 285 of file createPayload.py.

tuple createPayload.newtmpfile = open(beam_file_tmp,"w")

Definition at line 301 of file createPayload.py.

int createPayload.nfile = 0

Definition at line 266 of file createPayload.py.

tuple createPayload.npayloads = len(alllines)

Definition at line 217 of file createPayload.py.

string createPayload.optionstring = ''

Definition at line 48 of file createPayload.py.

tuple createPayload.readdb_template = os.getenv("CMSSW_BASE")

Definition at line 282 of file createPayload.py.

createPayload.skip = False

Definition at line 231 of file createPayload.py.

Referenced by ParticleDecayDrawer.analyze(), EcalDCCHeaderDisplay.analyze(), ExternalLHEProducer.beginRun(), PFAlgo.checkCleaning(), DDExpandedViewDump(), ParticleDecayDrawer.decay(), PFFilter.filter(), PFMETFilter.filter(), ConfigurableAnalysis.filter(), SiStripPedestals.get10bits(), SiStripNoises.get9bits(), HLTmmkFilter.hltFilter(), HLTmmkkFilter.hltFilter(), MeasurementTrackerImpl.MeasurementTrackerImpl(), PFAlgo.postCleaning(), PFAlgo.processBlock(), DQMStore.readDirectory(), and TkPixelMeasurementDet.setClusterToSkip().

dictionary createPayload.sortedlist = {}

Definition at line 210 of file createPayload.py.

string createPayload.sqlite_file = workflowdirTmp+sqlite_file_name+'.db'

READ and check sqlite file.

Merge sqlite files CREATE payload for merged output

Definition at line 284 of file createPayload.py.

createPayload.sqlite_file_name = tagname+suffix

Definition at line 283 of file createPayload.py.

string createPayload.suffix = "_"

Definition at line 280 of file createPayload.py.

Referenced by DQMFileSaver.analyze(), HLTMuonMatchAndPlot.analyze(), HLTMuonMatchAndPlot.beginRun(), edm::PoolOutputModule.doOpenFile(), DQMFileSaver.endLuminosityBlock(), DQMFileSaver.endRun(), ZIterativeAlgorithmWithFit.gausfit(), PrimaryVertexAnalyzer.getSimPVs(), edm::InputSource.issueReports(), RFIOStorageMaker.normalise(), L1GtPsbSetupConfigOnlineProd.numberedColumnName(), evf::iDie.perLumiFileSaver(), evf::iDie.perTimeFileSaver(), edm::service::RandomNumberGeneratorService.postForkReacquireResources(), and DQMFileSaver.saveForOffline().

createPayload.tagname = ''

Definition at line 181 of file createPayload.py.

Referenced by cond::TagCollectionRetriever.getTagCollection().

string createPayload.tagType = ''

Definition at line 49 of file createPayload.py.

string createPayload.timetype = 'runnumber'

Definition at line 201 of file createPayload.py.

string createPayload.tmp_datafilename = workflowdirTmp+"tmp_datafile.txt"

Definition at line 291 of file createPayload.py.

tuple createPayload.tmp_lumi_since = ""

Definition at line 303 of file createPayload.py.

tuple createPayload.tmp_lumi_till = ""

Definition at line 304 of file createPayload.py.

tuple createPayload.tmp_run = ""

Definition at line 302 of file createPayload.py.

tuple createPayload.tmpfile = open(beam_file)

Definition at line 227 of file createPayload.py.

Referenced by HybridNew.evalWithFork(), and BeamMonitor.FitAndFill().

tuple createPayload.total_files = len(keys)

Definition at line 268 of file createPayload.py.

tuple createPayload.uuid = commands.getstatusoutput('uuidgen -t')

Definition at line 390 of file createPayload.py.

string createPayload.workflowdir = 'test/workflow/'

3

Definition at line 44 of file createPayload.py.

string createPayload.workflowdirArchive = workflowdir+'archive/'

Definition at line 47 of file createPayload.py.

string createPayload.workflowdirLastPayloads = workflowdir+'lastPayloads/'

Definition at line 45 of file createPayload.py.

string createPayload.workflowdirTmp = workflowdir+'tmp/'

Definition at line 46 of file createPayload.py.

tuple createPayload.writedb_template = os.getenv("CMSSW_BASE")

Definition at line 281 of file createPayload.py.