Skip to content

Commit be1db70

Browse files
authored
Merge pull request cms-sw#33958 from mmusich/introduceAlCaHarvestingUnitTest
add BeamSpot workflows to Calibration/TkAlCaRecoProducers unit test
2 parents a39394f + 56f3561 commit be1db70

File tree

2 files changed

+44
-8
lines changed

2 files changed

+44
-8
lines changed

Calibration/TkAlCaRecoProducers/test/parseFwkJobReport.py

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,13 @@
33
import sys
44

55
## declare all constants here
6-
TARGET_LIST_OF_TAGS=['SiPixelQualityFromDbRcd_other', 'SiPixelQualityFromDbRcd_prompt', 'SiPixelQualityFromDbRcd_stuckTBM',
6+
TARGET_LIST_OF_TAGS=['BeamSpotObject_ByLumi', 'BeamSpotObject_ByRun', 'BeamSpotObjectHP_ByLumi', 'BeamSpotObjectHP_ByRun',
7+
'SiPixelQualityFromDbRcd_other', 'SiPixelQualityFromDbRcd_prompt', 'SiPixelQualityFromDbRcd_stuckTBM',
78
'SiStripApvGain_pcl', 'SiStripApvGainAAG_pcl',
89
'SiStripBadStrip_pcl', 'SiPixelAli_pcl']
910
TARGET_DQM_FILES=1
1011
TARGET_DQM_FILENAME='./DQM_V0001_R000325022__Express__PCLTest__ALCAPROMPT.root'
11-
TARGET_DB_FILES=7
12+
TARGET_DB_FILES=11
1213
TARGET_DB_FILENAME='sqlite_file:promptCalibConditions.db'
1314
TOTAL_TARGET_FILES=TARGET_DQM_FILES+TARGET_DB_FILES
1415

@@ -47,16 +48,19 @@ def parseXML(xmlfile):
4748
listOfInputTags.append(child.attrib['Value'])
4849

4950
if(countDBfiles!=TARGET_DB_FILES):
50-
print("ERROR! Found a not expected number of DB files",countDBfiles)
51+
print("ERROR! Found an unexpected number of DB files (",countDBfiles,")")
5152
return -1
5253

5354
if(countDQMfiles!=TARGET_DQM_FILES):
54-
print("ERROR! Found a not expected number of DQM files",countDQMfiles)
55+
print("ERROR! Found an uexpected number of DQM files (",countDQMfiles,")")
5556
return -1
5657

5758
## That's strict!
5859
if(listOfInputTags!=TARGET_LIST_OF_TAGS):
59-
print("ERROR! This ",[x for x in listOfTags if x not in listOfInputTags]," is the set of different tags")
60+
if (listOfInputTags>TARGET_LIST_OF_TAGS):
61+
print("ERROR!\n This ",[x for x in TARGET_LIST_OF_TAGS if x not in listOfInputTags]," is the set of expected tags not found in the FwdJobReport!")
62+
else:
63+
print("ERROR!\n This ",[x for x in listOfInputTags if x not in TARGET_LIST_OF_TAGS]," is the set of tags found in the FwkJobReport, but not expected!")
6064
return -1
6165

6266
return 0
@@ -66,7 +70,7 @@ def main():
6670
try:
6771
f = open("FrameworkJobReport.xml")
6872
except IOError:
69-
print("File not accessible")
73+
print("FrameworkJobReport.xml is not accessible")
7074
sys.exit(1)
7175

7276
# parse xml file

Calibration/TkAlCaRecoProducers/test/testPCLAlCaHarvesting.py

Lines changed: 34 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,17 +74,32 @@ def findRunStopTime(run_number):
7474
input = cms.untracked.int32(1)
7575
)
7676

77+
##
78+
## Define the tags to write
79+
##
7780
process.PoolDBOutputService.toPut.append(process.ALCAHARVESTSiStripQuality_dbOutput)
7881
process.PoolDBOutputService.toPut.append(process.ALCAHARVESTSiStripGains_dbOutput)
7982
process.PoolDBOutputService.toPut.append(process.ALCAHARVESTSiStripGainsAAG_dbOutput )
8083
process.PoolDBOutputService.toPut.append(process.ALCAHARVESTSiPixelAli_dbOutput)
8184
process.PoolDBOutputService.toPut.extend(process.ALCAHARVESTSiPixelQuality_dbOutput)
85+
process.PoolDBOutputService.toPut.append(process.ALCAHARVESTBeamSpotByRun_dbOutput)
86+
process.PoolDBOutputService.toPut.append(process.ALCAHARVESTBeamSpotByLumi_dbOutput)
87+
process.PoolDBOutputService.toPut.append(process.ALCAHARVESTBeamSpotHPByRun_dbOutput)
88+
process.PoolDBOutputService.toPut.append(process.ALCAHARVESTBeamSpotHPByLumi_dbOutput)
8289

90+
##
91+
## Define the file metadatas
92+
##
8393
process.pclMetadataWriter.recordsToMap.append(process.ALCAHARVESTSiStripQuality_metadata)
8494
process.pclMetadataWriter.recordsToMap.append(process.ALCAHARVESTSiStripGains_metadata )
8595
process.pclMetadataWriter.recordsToMap.append(process.ALCAHARVESTSiStripGainsAAG_metadata)
8696
process.pclMetadataWriter.recordsToMap.append(process.ALCAHARVESTSiPixelAli_metadata)
8797
process.pclMetadataWriter.recordsToMap.extend(process.ALCAHARVESTSiPixelQuality_metadata)
98+
process.pclMetadataWriter.recordsToMap.append(process.ALCAHARVESTBeamSpotByRun_metadata)
99+
process.pclMetadataWriter.recordsToMap.append(process.ALCAHARVESTBeamSpotByLumi_metadata)
100+
process.pclMetadataWriter.recordsToMap.append(process.ALCAHARVESTBeamSpotHPByRun_metadata)
101+
process.pclMetadataWriter.recordsToMap.append(process.ALCAHARVESTBeamSpotHPByLumi_metadata)
102+
88103

89104
process.load('Configuration.StandardSequences.FrontierConditions_GlobalTag_cff')
90105
from Configuration.AlCa.GlobalTag import GlobalTag
@@ -94,22 +109,39 @@ def findRunStopTime(run_number):
94109
process.alcaSiStripQualityHarvester.CalibrationThreshold = cms.untracked.uint32(0)
95110

96111
process.SiStripGains = cms.Path(process.ALCAHARVESTSiStripGains)
97-
#process.alcaSiStripGainsHarvester.
112+
process.alcaSiStripGainsHarvester.DQMdir=''
113+
process.alcaSiStripGainsHarvester.minNrEntries=0
114+
process.alcaSiStripGainsHarvester.GoodFracForTagProd=0
115+
process.alcaSiStripGainsHarvester.NClustersForTagProd=0
98116

99117
process.SiStripGainsAAG = cms.Path(process.ALCAHARVESTSiStripGainsAAG)
100-
#process.alcaSiStripGainsAAGHarvester.
118+
process.alcaSiStripGainsAAGHarvester.minNrEntries=0
119+
process.alcaSiStripGainsAAGHarvester.minNrEntries=0
120+
process.alcaSiStripGainsAAGHarvester.GoodFracForTagProd=0
121+
process.alcaSiStripGainsAAGHarvester.NClustersForTagProd=0
101122

102123
process.SiPixelAli = cms.Path(process.ALCAHARVESTSiPixelAli)
124+
process.SiPixelAliMilleFileExtractor.outputBinaryFile = cms.string('')
125+
process.SiPixelAliPedeAlignmentProducer.algoConfig.mergeBinaryFiles=[]
103126

104127
process.SiPixelQuality = cms.Path(process.ALCAHARVESTSiPixelQuality)
105128

106129
process.ALCAHARVESTDQMSaveAndMetadataWriter = cms.Path(process.dqmSaver+process.pclMetadataWriter)
107130

131+
process.BeamSpotByRun = cms.Path(process.ALCAHARVESTBeamSpotByRun)
132+
process.BeamSpotByLumi = cms.Path(process.ALCAHARVESTBeamSpotByLumi)
133+
process.BeamSpotHPByRun = cms.Path(process.ALCAHARVESTBeamSpotHPByRun)
134+
process.BeamSpotHPByLumi = cms.Path(process.ALCAHARVESTBeamSpotHPByLumi)
135+
108136
process.schedule = cms.Schedule(process.SiStripQuality,
109137
process.SiStripGains,
110138
process.SiStripGainsAAG,
111139
process.SiPixelAli,
112140
process.SiPixelQuality,
141+
process.BeamSpotByRun,
142+
process.BeamSpotByLumi,
143+
process.BeamSpotHPByRun,
144+
process.BeamSpotHPByLumi,
113145
process.ALCAHARVESTDQMSaveAndMetadataWriter)
114146

115147
from PhysicsTools.PatAlgos.tools.helpers import associatePatAlgosToolsTask

0 commit comments

Comments
 (0)