From 02ccf33b21692a165f3a3abcebcb039958975b1e Mon Sep 17 00:00:00 2001 From: mmusich Date: Fri, 2 Sep 2022 19:03:27 +0200 Subject: [PATCH] update unit tests for different resonances --- ...STING.py => DiMuonTkAlDQMHarvester_cfg.py} | 39 +++++++++++++++---- ...r_cfg.py => DiMuonTkAlDQMValidator_cfg.py} | 36 +++++++++++++---- .../Alignment/test/testDiMuonVertexMonitor.sh | 16 +++++++- 3 files changed, 74 insertions(+), 17 deletions(-) rename DQMOffline/Alignment/test/{DiMuonVertex_HARVESTING.py => DiMuonTkAlDQMHarvester_cfg.py} (76%) rename DQMOffline/Alignment/test/{DiMuonVertexValidator_cfg.py => DiMuonTkAlDQMValidator_cfg.py} (67%) diff --git a/DQMOffline/Alignment/test/DiMuonVertex_HARVESTING.py b/DQMOffline/Alignment/test/DiMuonTkAlDQMHarvester_cfg.py similarity index 76% rename from DQMOffline/Alignment/test/DiMuonVertex_HARVESTING.py rename to DQMOffline/Alignment/test/DiMuonTkAlDQMHarvester_cfg.py index 5ef58f4e10de4..74fec13c942d5 100644 --- a/DQMOffline/Alignment/test/DiMuonVertex_HARVESTING.py +++ b/DQMOffline/Alignment/test/DiMuonTkAlDQMHarvester_cfg.py @@ -22,6 +22,11 @@ VarParsing.VarParsing.multiplicity.singleton, VarParsing.VarParsing.varType.string, "conditions") +options.register('resonance', + 'Z', + VarParsing.VarParsing.multiplicity.singleton, + VarParsing.VarParsing.varType.string, + "resonance type") options.parseArguments() # import of standard configurations @@ -43,7 +48,7 @@ # Input source process.source = cms.Source("DQMRootSource", - fileNames = cms.untracked.vstring('file:step3_inDQM.root') + fileNames = cms.untracked.vstring('file:step3_inDQM_'+options.resonance+'.root') ) process.options = cms.untracked.PSet( @@ -93,16 +98,34 @@ process.dqmsave_step = cms.Path(process.DQMSaver) +if (options.resonance == 'Z'): + print('',30*"#",'\n # will harvest Z file \n',30*"#") + _folderName = cms.string('AlCaReco/TkAlDiMuonAndVertex') + _doBkgFit = cms.bool(False) + _fitPar = cms.PSet(mean_par = cms.vdouble(90.,60.,120.), + width_par = cms.vdouble(5.0,0.0,120.0), + sigma_par = cms.vdouble(5.0,0.0,120.0)) +elif (options.resonance == 'Jpsi'): + print('',30*"#",'\n # will harvest J/psi file \n',30*"#") + _folderName = cms.string('AlCaReco/TkAlJpsiMuMu') + _doBkgFit = cms.bool(True) + _fitPar = cms.PSet(mean_par = cms.vdouble(3.09, 2.7, 3.4), + width_par = cms.vdouble(1.0, 0.0, 5.0), + sigma_par = cms.vdouble(1.0, 0.0, 5.0)) +elif (options.resonance == 'Upsilon'): + print('',30*"#",'\n # will harvest Upsilon file \n',30*"#") + _folderName = cms.string('AlCaReco/TkAlUpsilonMuMu') + _doBkgFit = cms.bool(True) + _fitPar = cms.PSet(mean_par = cms.vdouble(9.46, 8.9, 9.9), + width_par = cms.vdouble(1.0, 0.0, 5.0), + sigma_par = cms.vdouble(1.0, 0.0, 5.0)) + # the module to harvest process.DiMuonMassBiasClient = cms.EDProducer("DiMuonMassBiasClient", - FolderName = cms.string('AlCaReco/TkAlDiMuonAndVertex'), - fitBackground = cms.bool(False), + FolderName = _folderName, + fitBackground = _doBkgFit, debugMode = cms.bool(True), - fit_par = cms.PSet( - mean_par = cms.vdouble(90.,60.,120.), - width_par = cms.vdouble(5.0,0.0,120.0), - sigma_par = cms.vdouble(5.0,0.0,120.0) - ), + fit_par = _fitPar, MEtoHarvest = cms.vstring( 'DiMuMassVsMuMuPhi', 'DiMuMassVsMuMuEta', diff --git a/DQMOffline/Alignment/test/DiMuonVertexValidator_cfg.py b/DQMOffline/Alignment/test/DiMuonTkAlDQMValidator_cfg.py similarity index 67% rename from DQMOffline/Alignment/test/DiMuonVertexValidator_cfg.py rename to DQMOffline/Alignment/test/DiMuonTkAlDQMValidator_cfg.py index 7eefad16a4a45..dec1663aca375 100644 --- a/DQMOffline/Alignment/test/DiMuonVertexValidator_cfg.py +++ b/DQMOffline/Alignment/test/DiMuonTkAlDQMValidator_cfg.py @@ -17,6 +17,11 @@ VarParsing.VarParsing.multiplicity.singleton, VarParsing.VarParsing.varType.string, "conditions") +options.register('resonance', + 'Z', + VarParsing.VarParsing.multiplicity.singleton, + VarParsing.VarParsing.varType.string, + "resonance type") options.parseArguments() # import of standard configurations @@ -38,9 +43,30 @@ output = cms.optional.untracked.allowed(cms.int32,cms.PSet) ) +process.load("DQMOffline.Configuration.AlCaRecoDQM_cff") + +if (options.resonance == 'Z'): + # Z + print('',30*"#",'\n # will process Z->mm data\n',30*"#") + readFiles = ['/store/relval/CMSSW_12_5_0_pre2/RelValZMM_14/ALCARECO/TkAlDiMuonAndVertex-124X_mcRun3_2022_realistic_v3-v1/2580000/4f9aee02-35a2-49b7-93f5-831214cf32d8.root'] + process.seqALCARECOTkAlDQM = cms.Sequence(process.ALCARECOTkAlDiMuonAndVertexVtxDQM + process.ALCARECOTkAlDiMuonMassBiasDQM) +elif (options.resonance == 'Jpsi'): + # J/psi + print('',30*"#",'\n # will process Jpsi->mm data\n',30*"#") + readFiles = ['/store/relval/CMSSW_12_5_0_pre2/RelValEtaBToJpsiJpsi_14TeV/ALCARECO/TkAlJpsiMuMu-124X_mcRun3_2022_realistic_v3-v1/2580000/fc77aaed-b0f5-4446-87f5-f7341099bd73.root'] + process.seqALCARECOTkAlDQM = cms.Sequence(process.ALCARECOTkAlJpsiMuMuVtxDQM + process.ALCARECOTkAlJpsiMassBiasDQM) +elif (options.resonance == 'Upsilon'): + # upsilon + print('',30*"#",'\n # will process Upsilon->mm data\n',30*"#") + readFiles = ['/store/relval/CMSSW_12_5_0_pre2/RelValUpsilon1SToMuMu_14/ALCARECO/TkAlUpsilonMuMu-124X_mcRun3_2022_realistic_v3-v1/2580000/fca73916-5076-4c9f-a460-2481588825ab.root'] + process.seqALCARECOTkAlDQM = cms.Sequence(process.ALCARECOTkAlUpsilonMuMuVtxDQM + process.ALCARECOTkAlUpsilonMassBiasDQM) +else: + print('unrecongnized %s resonance',options.resonance) + exit(1) + # Input source process.source = cms.Source("PoolSource", - fileNames = cms.untracked.vstring('/store/relval/CMSSW_12_5_0_pre2/RelValZMM_14/ALCARECO/TkAlDiMuonAndVertex-124X_mcRun3_2022_realistic_v3-v1/2580000/4f9aee02-35a2-49b7-93f5-831214cf32d8.root'), + fileNames = cms.untracked.vstring(readFiles), secondaryFileNames = cms.untracked.vstring() ) @@ -79,7 +105,7 @@ dataTier = cms.untracked.string('DQMIO'), filterName = cms.untracked.string('') ), - fileName = cms.untracked.string('file:step3_inDQM.root'), + fileName = cms.untracked.string('file:step3_inDQM_'+options.resonance+'.root'), outputCommands = process.DQMEventContent.outputCommands, splitLevel = cms.untracked.int32(0) ) @@ -87,11 +113,7 @@ from Configuration.AlCa.GlobalTag import GlobalTag process.GlobalTag = GlobalTag(process.GlobalTag, options.globalTag, '') -process.load("DQMOffline.Configuration.AlCaRecoDQM_cff") - -process.seqALCARECOTkAlDiMuonAndVertex = cms.Sequence(process.ALCARECOTkAlDiMuonAndVertexVtxDQM + process.ALCARECOTkAlDiMuonMassBiasDQM) - -process.dqmoffline_step = cms.EndPath(process.seqALCARECOTkAlDiMuonAndVertex) +process.dqmoffline_step = cms.EndPath(process.seqALCARECOTkAlDQM) process.DQMoutput_step = cms.EndPath(process.DQMoutput) process.schedule = cms.Schedule(process.dqmoffline_step,process.DQMoutput_step) diff --git a/DQMOffline/Alignment/test/testDiMuonVertexMonitor.sh b/DQMOffline/Alignment/test/testDiMuonVertexMonitor.sh index 3ed3084c40b8c..08790cf92d9c1 100755 --- a/DQMOffline/Alignment/test/testDiMuonVertexMonitor.sh +++ b/DQMOffline/Alignment/test/testDiMuonVertexMonitor.sh @@ -7,5 +7,17 @@ if [ "${SCRAM_TEST_NAME}" != "" ] ; then cd ${SCRAM_TEST_NAME} fi -cmsRun ${LOCAL_TEST_DIR}/DiMuonVertexValidator_cfg.py || die "Failure using DiMuonVertexValidator_cfg.py" $? -cmsRun ${LOCAL_TEST_DIR}/DiMuonVertex_HARVESTING.py || die "Failure using DiMuonVertex_HARVESTING.py" $? +echo -e " Tesing on Z->mm \n\n" + +cmsRun ${LOCAL_TEST_DIR}/DiMuonTkAlDQMValidator_cfg.py resonance=Z || die "Failure using DiMuonTkAlDQMValidator_cfg.py resonance=Z" $? +cmsRun ${LOCAL_TEST_DIR}/DiMuonTkAlDQMHarvester_cfg.py resonance=Z || die "Failure using DiMuonTkAlDQMHarvester_cfg.py resonance=Z" $? + +echo -e " Testing on J/psi -> mm \n\n" + +cmsRun ${LOCAL_TEST_DIR}/DiMuonTkAlDQMValidator_cfg.py resonance=Jpsi || die "Failure using DiMuonTkAlDQMValidator_cfg.py resonance=Jpsi" $? +cmsRun ${LOCAL_TEST_DIR}/DiMuonTkAlDQMHarvester_cfg.py resonance=Jpsi || die "Failure using DiMuonTkAlDQMHarvester_cfg.py resonance=Jpsi" $? + +echo -e " Testing on Upsilon -> mm \n\n" + +cmsRun ${LOCAL_TEST_DIR}/DiMuonTkAlDQMValidator_cfg.py resonance=Upsilon || die "Failure using DiMuonTkAlDQMValidator_cfg.py resonance=Upsilon" $? +cmsRun ${LOCAL_TEST_DIR}/DiMuonTkAlDQMHarvester_cfg.py resonance=Upsilon || die "Failure using DiMuonTkAlDQMHarvester_cfg.py resonance=Upsilon" $?