Skip to content

Commit

Permalink
update unit tests for different resonances
Browse files Browse the repository at this point in the history
  • Loading branch information
mmusich committed Sep 7, 2022
1 parent 274affb commit 4fc6e85
Show file tree
Hide file tree
Showing 3 changed files with 74 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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(
Expand Down Expand Up @@ -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',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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_4_0/RelValZMM_14/ALCARECO/TkAlDiMuonAndVertex-124X_mcRun3_2022_realistic_v5-v1/2580000/f869e2f4-8884-4b4e-af8b-720938ab7fc5.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_4_6/RelValEtaBToJpsiJpsi_14TeV/ALCARECO/TkAlJpsiMuMu-124X_mcRun3_2022_realistic_v10-v4/10000/47a900a0-2646-4909-9105-00aa9905210e.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_4_6/RelValUpsilon1SToMuMu_14/ALCARECO/TkAlUpsilonMuMu-124X_mcRun3_2022_realistic_v10-v4/10000/ee6e1532-933a-4ed2-a64b-b70a8c8a3953.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_4_0/RelValZMM_14/ALCARECO/TkAlDiMuonAndVertex-124X_mcRun3_2022_realistic_v5-v1/2580000/f869e2f4-8884-4b4e-af8b-720938ab7fc5.root'),
fileNames = cms.untracked.vstring(readFiles),
secondaryFileNames = cms.untracked.vstring()
)

Expand Down Expand Up @@ -79,19 +105,15 @@
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)
)

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)
16 changes: 14 additions & 2 deletions DQMOffline/Alignment/test/testDiMuonVertexMonitor.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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" $?

0 comments on commit 4fc6e85

Please sign in to comment.