Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 78031
b: "refs/heads/CMSSW_7_0_X"
c: be1d3ca
h: "refs/heads/CMSSW_7_0_X"
i:
  78029: 192117e
  78027: a27490c
  78023: f18db37
  78015: a838751
v: v3
  • Loading branch information
Andrea Perrotta committed Nov 16, 2009
1 parent 603c811 commit 1777041
Show file tree
Hide file tree
Showing 2 changed files with 100 additions and 90 deletions.
2 changes: 1 addition & 1 deletion [refs]
@@ -1,3 +1,3 @@
---
refs/heads/gh-pages: 517fc50ef888eab98e534466557d7fe8de342307
"refs/heads/CMSSW_7_0_X": caedfe42c780815ca1837fb7243254ef9eeab00a
"refs/heads/CMSSW_7_0_X": be1d3ca1d1c7674ce346bedcefaee60ff2e45fa3
188 changes: 99 additions & 89 deletions trunk/Validation/RecoMuon/test/muonReleaseSummary.py
Expand Up @@ -5,17 +5,17 @@
import fileinput
import string

NewVersion='3_4_0_pre4'
RefVersion='3_4_0_pre2'
NewVersion='3_3_3'
RefVersion='3_3_2'
NewRelease='CMSSW_'+NewVersion
RefRelease='CMSSW_'+RefVersion
#NewRelease='Summer09'
#RefRelease='Summer09_pre1'

#NewCondition='MC'
#RefCondition='MC'
NewCondition='STARTUP'
RefCondition='STARTUP'
NewCondition='MC'
RefCondition='MC'
#NewCondition='STARTUP'
#RefCondition='STARTUP'

NewFastSim=False
RefFastSim=False
Expand All @@ -35,7 +35,7 @@
Submit=True
Publish=False

GetFilesFromCastor=False
GetFilesFromCastor=True
GetRefsFromCastor=True
CastorRepository = '/castor/cern.ch/cms/store/temp/dqm/offline/harvesting_output/mc/relval'
#CastorRepository = '/castor/cern.ch/user/n/nuno/relval/harvest'
Expand All @@ -47,28 +47,31 @@

if (NewFastSim):
NewTag = NewCondition+'_noPU_ootb_FSIM'
NewLabel=NewCondition+'_31X_V9_FastSim-v1'
NewLabel=NewCondition+'_31X_V9_FastSim'
NewFormat='GEN-SIM-DIGI-RECO'
else:
NewTag = NewCondition+'_noPU_ootb'
NewLabel=NewCondition+'_31X_V9-v1'
# NewLabel=NewCondition+'31X_V3_preproduction_312-v1'
NewLabel=NewCondition+'_31X_V9'
# NewLabel=NewCondition+'31X_V3_preproduction_312'
if (NewCondition=='STARTUP'):
NewLabel=NewCondition+'31X_V8-v1'
NewLabel=NewCondition+'31X_V8'
NewFormat='GEN-SIM-RECO'

if (RefFastSim):
RefTag = RefCondition+'_noPU_ootb_FSIM'
RefLabel=RefCondition+'_31X_FastSim_v1'
RefLabel=RefCondition+'_31X_FastSim'
RefFormat='GEN-SIM-DIGI-RECO'
else:
RefTag = RefCondition+'_noPU_ootb'
RefLabel=RefCondition+'_31X_V8-v1'
# RefLabel=RefCondition+'_31X_V2_preproduction_311-v1'
RefLabel=RefCondition+'_31X_V8'
# RefLabel=RefCondition+'_31X_V2_preproduction_311'
if (RefCondition=='STARTUP'):
RefLabel=RefCondition+'31X_V7-v1'
RefLabel=RefCondition+'31X_V8'
RefFormat='GEN-SIM-RECO'

NewLabel=NewLabel+'-v1'
RefLabel=RefLabel+'-v1'

if (NewFastSim):
NewCondition=NewCondition+'_FSIM'
if (RefFastSim):
Expand Down Expand Up @@ -97,79 +100,86 @@ def replace(map, filein, fileout):

for sample in samples :

newdir=NewRepository+'/'+NewRelease+'/'+NewTag+'/'+sample


if(os.path.exists(NewRelease+'/'+NewTag+'/'+sample)==False):
os.makedirs(NewRelease+'/'+NewTag+'/'+sample)

if(os.path.exists(RefRelease+'/'+RefTag+'/'+sample)==False):
os.makedirs(RefRelease+'/'+RefTag+'/'+sample)

checkFile = NewRelease+'/'+NewTag+'/'+sample+'/globalMuons_tpToGlbAssociation.pdf'
if (NewFastSim):
checkFile = NewRelease+'/'+NewTag+'/'+sample+'/globalMuons_tpToGlbAssociationFS.pdf'
if (os.path.isfile(checkFile)==True):
print "Files of type "+checkFile+' exist alredy: delete them first, if you really want to overwrite them'
else:
newSample=NewRepository+'/'+NewRelease+'/'+NewTag+'/'+sample+'/'+'val.'+sample+'.root'
refSample=RefRepository+'/'+RefRelease+'/'+RefTag+'/'+sample+'/'+'val.'+sample+'.root'

if (os.path.isfile(NewRelease+'/'+NewTag+'/'+sample+'/val'+sample+'.root')==True):
# FOR SOME REASON THIS DOES NOT WORK: to be checked...
print "New file found at: ",NewRelease+'/'+NewTag+'/'+sample+'/val'+sample+'.root'+' -> Use that one'
elif (GetFilesFromCastor):
NEVT='9000'
if (sample=='RelValSingleMuPt10'):
NEVT='25000'
elif(sample=='RelValZMM'):
NEVT='8995'
elif((sample=='RelValTTbar')&(NewCondition=='STARTUP')):
NEVT='34000'
os.system('rfcp '+CastorRepository+'/'+NewVersion+'/'+sample+'__'+NewRelease+'-'+NewLabel+'__'+NewFormat+'/run_1/nevents_'+NEVT+'/DQM_V0001_R000000001__'+sample+'__'+NewRelease+'-'+NewLabel+'__'+NewFormat+'_1.root '+NewRelease+'/'+NewTag+'/'+sample+'/'+'val.'+sample+'.root')
# os.system('rfcp '+CastorRepository+'/'+NewRelease+'/DQM_V0001_R000000001__'+sample+'__'+NewRelease+'-'+NewLabel+'__'+NewFormat+'.root '+NewRelease+'/'+NewTag+'/'+sample+'/'+'val.'+sample+'.root')
newdir=NewRepository+'/'+NewRelease+'/'+NewTag+'/'+sample


if(os.path.exists(NewRelease+'/'+NewTag+'/'+sample)==False):
os.makedirs(NewRelease+'/'+NewTag+'/'+sample)

if(os.path.exists(RefRelease+'/'+RefTag+'/'+sample)==False):
os.makedirs(RefRelease+'/'+RefTag+'/'+sample)

checkFile = NewRelease+'/'+NewTag+'/'+sample+'/globalMuons_tpToGlbAssociation.pdf'
if (NewFastSim):
checkFile = NewRelease+'/'+NewTag+'/'+sample+'/globalMuons_tpToGlbAssociationFS.pdf'
if (os.path.isfile(checkFile)==True):
print "Files of type "+checkFile+' exist alredy: delete them first, if you really want to overwrite them'
else:
newSample=NewRepository+'/'+NewRelease+'/'+NewTag+'/'+sample+'/'+'val.'+sample+'.root'
refSample=RefRepository+'/'+RefRelease+'/'+RefTag+'/'+sample+'/'+'val.'+sample+'.root'

if (os.path.isfile(NewRelease+'/'+NewTag+'/'+sample+'/val'+sample+'.root')==True):
# FOR SOME REASON THIS DOES NOT WORK: to be checked...
print "New file found at: ",NewRelease+'/'+NewTag+'/'+sample+'/val'+sample+'.root'+' -> Use that one'

elif (GetFilesFromCastor):
# Check the number of events in the harvested samples, needed to retrieve the path on castor
if (NewFastSim):
NEVT='27000'
else:
NEVT='9000'
if (sample=='RelValSingleMuPt10'):
NEVT='25000'
elif(sample=='RelValZMM'):
NEVT='8995'
elif((sample=='RelValTTbar')&(NewCondition=='STARTUP')):
NEVT='34000'
os.system('rfcp '+CastorRepository+'/'+NewVersion+'/'+sample+'__'+NewRelease+'-'+NewLabel+'__'+NewFormat+'/run_1/nevents_'+NEVT+'/DQM_V0001_R000000001__'+sample+'__'+NewRelease+'-'+NewLabel+'__'+NewFormat+'_1.root '+NewRelease+'/'+NewTag+'/'+sample+'/'+'val.'+sample+'.root')
# os.system('rfcp '+CastorRepository+'/'+NewRelease+'/DQM_V0001_R000000001__'+sample+'__'+NewRelease+'-'+NewLabel+'__'+NewFormat+'.root '+NewRelease+'/'+NewTag+'/'+sample+'/'+'val.'+sample+'.root')
#preprod-hegeman os.system('rfcp '+CastorRepository+'/DQM_V0001_R000000001__'+sample+'__'+NewRelease+'-'+NewLabel+'__'+NewFormat+'_1.root '+NewRelease+'/'+NewTag+'/'+sample+'/'+'val.'+sample+'.root')
elif (os.path.isfile(newSample)) :
os.system('cp '+newSample+' '+NewRelease+'/'+NewTag+'/'+sample)

elif (os.path.isfile(newSample)) :
os.system('cp '+newSample+' '+NewRelease+'/'+NewTag+'/'+sample)


if (os.path.isfile(RefRelease+'/'+RefTag+'/'+sample+'/val'+sample+'.root')!=True and os.path.isfile(refSample)):
print '*** Getting reference file from '+RefRelease
os.system('cp '+refSample+' '+RefRelease+'/'+RefTag+'/'+sample)
elif (GetRefsFromCastor):
print '*** Getting reference file from castor'
os.system('rfcp '+CastorRefRepository+'/'+RefRelease+'_'+RefCondition+'_'+sample+'_val.'+sample+'.root '+RefRelease+'/'+RefTag+'/'+sample+'/'+'val.'+sample+'.root')
else:
print '*** WARNING: no reference file was found'

cfgFileName=sample+'_'+NewRelease+'_'+RefRelease
hltcfgFileName='HLT'+sample+'_'+NewRelease+'_'+RefRelease

if os.path.isfile(RefRelease+'/'+RefTag+'/'+sample+'/val.'+sample+'.root'):
replace_map_RECO = { 'DATATYPE': 'RECO', 'NEW_FILE':NewRelease+'/'+NewTag+'/'+sample+'/val.'+sample+'.root', 'REF_FILE':RefRelease+'/'+RefTag+'/'+sample+'/val.'+sample+'.root', 'REF_LABEL':sample, 'NEW_LABEL': sample, 'REF_RELEASE':RefRelease, 'NEW_RELEASE':NewRelease, 'REFSELECTION':RefTag, 'NEWSELECTION':NewTag, 'TrackValHistoPublisher': cfgFileName}
if (ValidateHLT):
replace_map_HLT = { 'DATATYPE': 'HLT', 'NEW_FILE':NewRelease+'/'+NewTag+'/'+sample+'/val.'+sample+'.root', 'REF_FILE':RefRelease+'/'+RefTag+'/'+sample+'/val.'+sample+'.root', 'REF_LABEL':sample, 'NEW_LABEL': sample, 'REF_RELEASE':RefRelease, 'NEW_RELEASE':NewRelease, 'REFSELECTION':RefTag, 'NEWSELECTION':NewTag, 'TrackValHistoPublisher': hltcfgFileName}
else:
print "No reference file found at: ", RefRelease+'/'+RefTag+'/'+sample
replace_map_RECO = { 'DATATYPE': 'RECO', 'NEW_FILE':NewRelease+'/'+NewTag+'/'+sample+'/val.'+sample+'.root', 'REF_FILE':NewRelease+'/'+NewTag+'/'+sample+'/val.'+sample+'.root', 'REF_LABEL':sample, 'NEW_LABEL': sample, 'REF_RELEASE':NewRelease, 'NEW_RELEASE':NewRelease, 'REFSELECTION':NewTag, 'NEWSELECTION':NewTag, 'TrackValHistoPublisher': cfgFileName}
if (ValidateHLT):
replace_map_HLT = { 'DATATYPE': 'HLT', 'NEW_FILE':NewRelease+'/'+NewTag+'/'+sample+'/val.'+sample+'.root', 'REF_FILE':NewRelease+'/'+NewTag+'/'+sample+'/val.'+sample+'.root', 'REF_LABEL':sample, 'NEW_LABEL': sample, 'REF_RELEASE':NewRelease, 'NEW_RELEASE':NewRelease, 'REFSELECTION':NewTag, 'NEWSELECTION':NewTag, 'TrackValHistoPublisher': hltcfgFileName}

templatemacroFile = open(macro, 'r')
macroFile = open(cfgFileName+'.C' , 'w' )
replace(replace_map_RECO, templatemacroFile, macroFile)

if (ValidateHLT):
templatemacroFile = open(macro, 'r')
hltmacroFile = open(hltcfgFileName+'.C' , 'w' )
replace(replace_map_HLT, templatemacroFile, hltmacroFile)

if(Submit):
os.system('root -b -q -l '+ cfgFileName+'.C'+ '> macro.'+cfgFileName+'.log')
if (ValidateHLT):
os.system('root -b -q -l '+ hltcfgFileName+'.C'+ '> macro.'+hltcfgFileName+'.log')

if(Publish):
if(os.path.exists(newdir)==False):
os.makedirs(newdir)
os.system('rm '+NewRelease+'/'+NewTag+'/'+sample+'/val.'+sample+'.root')
os.system('scp -r '+NewRelease+'/'+NewTag+'/'+sample+'/* ' + newdir)
if (os.path.isfile(RefRelease+'/'+RefTag+'/'+sample+'/val'+sample+'.root')!=True and os.path.isfile(refSample)):
print '*** Getting reference file from '+RefRelease
os.system('cp '+refSample+' '+RefRelease+'/'+RefTag+'/'+sample)
elif (GetRefsFromCastor):
print '*** Getting reference file from castor'
os.system('rfcp '+CastorRefRepository+'/'+RefRelease+'_'+RefCondition+'_'+sample+'_val.'+sample+'.root '+RefRelease+'/'+RefTag+'/'+sample+'/'+'val.'+sample+'.root')
else:
print '*** WARNING: no reference file was found'

cfgFileName=sample+'_'+NewRelease+'_'+RefRelease
hltcfgFileName='HLT'+sample+'_'+NewRelease+'_'+RefRelease

if os.path.isfile(RefRelease+'/'+RefTag+'/'+sample+'/val.'+sample+'.root'):
replace_map_RECO = { 'DATATYPE': 'RECO', 'NEW_FILE':NewRelease+'/'+NewTag+'/'+sample+'/val.'+sample+'.root', 'REF_FILE':RefRelease+'/'+RefTag+'/'+sample+'/val.'+sample+'.root', 'REF_LABEL':sample, 'NEW_LABEL': sample, 'REF_RELEASE':RefRelease, 'NEW_RELEASE':NewRelease, 'REFSELECTION':RefTag, 'NEWSELECTION':NewTag, 'TrackValHistoPublisher': cfgFileName}
if (ValidateHLT):
replace_map_HLT = { 'DATATYPE': 'HLT', 'NEW_FILE':NewRelease+'/'+NewTag+'/'+sample+'/val.'+sample+'.root', 'REF_FILE':RefRelease+'/'+RefTag+'/'+sample+'/val.'+sample+'.root', 'REF_LABEL':sample, 'NEW_LABEL': sample, 'REF_RELEASE':RefRelease, 'NEW_RELEASE':NewRelease, 'REFSELECTION':RefTag, 'NEWSELECTION':NewTag, 'TrackValHistoPublisher': hltcfgFileName}
else:
print "No reference file found at: ", RefRelease+'/'+RefTag+'/'+sample
replace_map_RECO = { 'DATATYPE': 'RECO', 'NEW_FILE':NewRelease+'/'+NewTag+'/'+sample+'/val.'+sample+'.root', 'REF_FILE':NewRelease+'/'+NewTag+'/'+sample+'/val.'+sample+'.root', 'REF_LABEL':sample, 'NEW_LABEL': sample, 'REF_RELEASE':NewRelease, 'NEW_RELEASE':NewRelease, 'REFSELECTION':NewTag, 'NEWSELECTION':NewTag, 'TrackValHistoPublisher': cfgFileName}
if (ValidateHLT):
replace_map_HLT = { 'DATATYPE': 'HLT', 'NEW_FILE':NewRelease+'/'+NewTag+'/'+sample+'/val.'+sample+'.root', 'REF_FILE':NewRelease+'/'+NewTag+'/'+sample+'/val.'+sample+'.root', 'REF_LABEL':sample, 'NEW_LABEL': sample, 'REF_RELEASE':NewRelease, 'NEW_RELEASE':NewRelease, 'REFSELECTION':NewTag, 'NEWSELECTION':NewTag, 'TrackValHistoPublisher': hltcfgFileName}

templatemacroFile = open(macro, 'r')
macroFile = open(cfgFileName+'.C' , 'w' )
replace(replace_map_RECO, templatemacroFile, macroFile)

if (ValidateHLT):
templatemacroFile = open(macro, 'r')
hltmacroFile = open(hltcfgFileName+'.C' , 'w' )
replace(replace_map_HLT, templatemacroFile, hltmacroFile)

if(Submit):
os.system('root -b -q -l '+ cfgFileName+'.C'+ '> macro.'+cfgFileName+'.log')
if (ValidateHLT):
os.system('root -b -q -l '+ hltcfgFileName+'.C'+ '> macro.'+hltcfgFileName+'.log')

if(Publish):
if(os.path.exists(newdir)==False):
os.makedirs(newdir)
os.system('rm '+NewRelease+'/'+NewTag+'/'+sample+'/val.'+sample+'.root')
os.system('scp -r '+NewRelease+'/'+NewTag+'/'+sample+'/* ' + newdir)

0 comments on commit 1777041

Please sign in to comment.