Skip to content

Commit 7a8f35e

Browse files
committed
Merge pull request cms-sw#2467 from deguio/autoValidation
DQM updates -- Auto validation
2 parents f065d1d + 9b5ab72 commit 7a8f35e

File tree

5 files changed

+88
-25
lines changed

5 files changed

+88
-25
lines changed

Configuration/Applications/python/ConfigBuilder.py

+47-24
Original file line numberDiff line numberDiff line change
@@ -1614,38 +1614,56 @@ def prepare_POSTRECO(self, sequence = None):
16141614

16151615

16161616
def prepare_VALIDATION(self, sequence = 'validation'):
1617+
print sequence,"in preparing validation"
16171618
self.loadDefaultOrSpecifiedCFF(sequence,self.VALIDATIONDefaultCFF)
1619+
from Validation.Configuration.autoValidation import autoValidation
16181620
#in case VALIDATION:something:somethingelse -> something,somethingelse
16191621
sequence=sequence.split('.')[-1]
16201622
if sequence.find(',')!=-1:
1621-
prevalSeqName=sequence.split(',')[0]
1622-
valSeqName=sequence.split(',')[1]
1623+
prevalSeqName=sequence.split(',')[0].split('+')
1624+
valSeqName=sequence.split(',')[1].split('+')
1625+
self.expandMapping(prevalSeqName,autoValidation,index=0)
1626+
self.expandMapping(valSeqName,autoValidation,index=1)
16231627
else:
1624-
postfix=''
1625-
if sequence:
1626-
postfix='_'+sequence
1627-
prevalSeqName='prevalidation'+postfix
1628-
valSeqName='validation'+postfix
1629-
if not hasattr(self.process,valSeqName):
1630-
prevalSeqName=''
1631-
valSeqName=sequence
1632-
1633-
if not 'DIGI' in self.stepMap and not self._options.fast and not valSeqName.startswith('genvalid'):
1628+
if '@' in sequence:
1629+
prevalSeqName=sequence.split('+')
1630+
valSeqName=sequence.split('+')
1631+
self.expandMapping(prevalSeqName,autoValidation,index=0)
1632+
self.expandMapping(valSeqName,autoValidation,index=1)
1633+
else:
1634+
postfix=''
1635+
if sequence:
1636+
postfix='_'+sequence
1637+
prevalSeqName=['prevalidation'+postfix]
1638+
valSeqName=['validation'+postfix]
1639+
if not hasattr(self.process,valSeqName[0]):
1640+
prevalSeqName=['']
1641+
valSeqName=[sequence]
1642+
1643+
def NFI(index):
1644+
##name from index, required to keep backward compatibility
1645+
if index==0:
1646+
return ''
1647+
else:
1648+
return '%s'%index
1649+
1650+
if not 'DIGI' in self.stepMap and not self._options.fast and not any(map( lambda s : s.startswith('genvalid'), valSeqName)):
16341651
if self._options.restoreRNDSeeds==False and not self._options.restoreRNDSeeds==True:
16351652
self._options.restoreRNDSeeds=True
16361653

16371654
#rename the HLT process in validation steps
16381655
if ('HLT' in self.stepMap and not self._options.fast) or self._options.hltProcess:
1639-
self.renameHLTprocessInSequence(valSeqName)
1640-
if prevalSeqName:
1641-
self.renameHLTprocessInSequence(prevalSeqName)
1642-
1643-
if prevalSeqName:
1644-
self.process.prevalidation_step = cms.Path( getattr(self.process, prevalSeqName ) )
1645-
self.schedule.append(self.process.prevalidation_step)
1646-
1647-
self.process.validation_step = cms.EndPath( getattr(self.process,valSeqName ) )
1648-
self.schedule.append(self.process.validation_step)
1656+
for s in valSeqName+prevalSeqName:
1657+
if s:
1658+
self.renameHLTprocessInSequence(s)
1659+
for (i,s) in enumerate(prevalSeqName):
1660+
if s:
1661+
setattr(self.process,'prevalidation_step%s'%NFI(i), cms.Path( getattr(self.process, s)) )
1662+
self.schedule.append(getattr(self.process,'prevalidation_step%s'%NFI(i)))
1663+
1664+
for (i,s) in enumerate(valSeqName):
1665+
setattr(self.process,'validation_step%s'%NFI(i), cms.EndPath( getattr(self.process, s)))
1666+
self.schedule.append(getattr(self.process,'validation_step%s'%NFI(i)))
16491667

16501668
if not 'DIGI' in self.stepMap and not self._options.fast:
16511669
self.executeAndRemember("process.mix.playback = True")
@@ -1655,7 +1673,8 @@ def prepare_VALIDATION(self, sequence = 'validation'):
16551673

16561674
if hasattr(self.process,"genstepfilter") and len(self.process.genstepfilter.triggerConditions):
16571675
#will get in the schedule, smoothly
1658-
self.process.validation_step._seq = self.process.genstepfilter * self.process.validation_step._seq
1676+
for (i,s) in enumerate(valSeqName):
1677+
getattr(self.process,'validation_step%s'%NFI(i))._seq = self.process.genstepfilter * getattr(self.process,'validation_step%s'%NFI(i))._seq
16591678

16601679
return
16611680

@@ -1804,7 +1823,11 @@ def prepare_HARVESTING(self, sequence = None):
18041823
# decide which HARVESTING paths to use
18051824
harvestingList = sequence.split("+")
18061825
from DQMOffline.Configuration.autoDQM import autoDQM
1807-
self.expandMapping(harvestingList,autoDQM,index=1)
1826+
from Validation.Configuration.autoValidation import autoValidation
1827+
import copy
1828+
combined_mapping = copy.deepcopy( autoDQM )
1829+
combined_mapping.update( autoValidation )
1830+
self.expandMapping(harvestingList,combined_mapping,index=-1)
18081831

18091832
if len(set(harvestingList))!=len(harvestingList):
18101833
harvestingList=list(set(harvestingList))

Configuration/StandardSequences/python/Validation_cff.py

+8
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,10 @@
2626
from Validation.EventGenerator.BasicGenValidation_cff import *
2727

2828
prevalidation = cms.Sequence( globalPrevalidation * hltassociation )
29+
prevalidationLiteTracking = cms.Sequence( prevalidation )
30+
prevalidationLiteTracking.replace(globalPrevalidation,globalPrevalidationLiteTracking)
31+
32+
2933

3034
validation = cms.Sequence(cms.SequencePlaceholder("mix")
3135
+genvalid_all
@@ -35,6 +39,10 @@
3539
*globalValidation
3640
*hltvalidation)
3741

42+
validationLiteTracking = cms.Sequence( validation )
43+
validationLiteTracking.replace(globalValidation,globalValidationLiteTracking)
44+
validationLiteTracking.remove(condDataValidation)
45+
3846
prevalidation_preprod = cms.Sequence( preprodPrevalidation )
3947

4048
validation_preprod = cms.Sequence(
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
autoValidation = { 'liteTracking' : ['prevalidationLiteTracking','validationLiteTracking','validationHarvesting']
2+
}

Validation/Configuration/python/globalValidation_cff.py

+31
Original file line numberDiff line numberDiff line change
@@ -90,3 +90,34 @@
9090
+ bTagPlotsMCbcl
9191
+ L1Validator
9292
)
93+
94+
#lite tracking validator to be used in the Validation matrix
95+
liteTrackValidator=trackValidator.clone()
96+
liteTrackValidator.label=cms.VInputTag(cms.InputTag("generalTracks"),
97+
cms.InputTag("cutsRecoTracksHp")
98+
)
99+
100+
#lite validation
101+
globalValidationLiteTracking = cms.Sequence(globalValidation)
102+
globalValidationLiteTracking.replace(trackValidator,liteTrackValidator)
103+
104+
#lite pre-validation
105+
globalPrevalidationLiteTracking = cms.Sequence(globalPrevalidation)
106+
globalPrevalidationLiteTracking.remove(cutsRecoTracksZero)
107+
globalPrevalidationLiteTracking.remove(cutsRecoTracksZeroHp)
108+
globalPrevalidationLiteTracking.remove(cutsRecoTracksFirst)
109+
globalPrevalidationLiteTracking.remove(cutsRecoTracksFirstHp)
110+
globalPrevalidationLiteTracking.remove(cutsRecoTracksSecond)
111+
globalPrevalidationLiteTracking.remove(cutsRecoTracksSecondHp)
112+
globalPrevalidationLiteTracking.remove(cutsRecoTracksThird)
113+
globalPrevalidationLiteTracking.remove(cutsRecoTracksThirdHp)
114+
globalPrevalidationLiteTracking.remove(cutsRecoTracksFourth)
115+
globalPrevalidationLiteTracking.remove(cutsRecoTracksFourthHp)
116+
globalPrevalidationLiteTracking.remove(cutsRecoTracksFifth)
117+
globalPrevalidationLiteTracking.remove(cutsRecoTracksFifthHp)
118+
globalPrevalidationLiteTracking.remove(cutsRecoTracksSixth)
119+
globalPrevalidationLiteTracking.remove(cutsRecoTracksSixthHp)
120+
globalPrevalidationLiteTracking.remove(cutsRecoTracksNinth)
121+
globalPrevalidationLiteTracking.remove(cutsRecoTracksNinthHp)
122+
globalPrevalidationLiteTracking.remove(cutsRecoTracksTenth)
123+
globalPrevalidationLiteTracking.remove(cutsRecoTracksTenthHp)

Validation/Configuration/python/postValidation_cff.py

-1
Original file line numberDiff line numberDiff line change
@@ -51,4 +51,3 @@
5151
postValidation_gen = cms.Sequence(
5252
EventGeneratorPostProcessor
5353
)
54-

0 commit comments

Comments
 (0)