From 90b28d6265b5661a71a1b41caf4a4cfbc8bc19b7 Mon Sep 17 00:00:00 2001 From: Carlo Battilana Date: Fri, 15 Nov 2019 13:45:40 +0100 Subject: [PATCH 1/8] Update instructions --- README.md | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index a9887e2ab2029..6cf53219d474e 100644 --- a/README.md +++ b/README.md @@ -7,12 +7,13 @@ In the present days this code is evolving fast, hence the installation recipe ma ### Installation: ``` -cmsrel CMSSW_10_6_0 -cd CMSSW_10_6_0/src/ +cmsrel CMSSW_10_6_5_patch1 +cd CMSSW_10_6_5_patch1/src/ cmsenv -git cms-merge-topic oglez:Phase2_CMSSW_10_6_0_pre4_Summer2019 # phase-2 unpacker -git cms-merge-topic -u pozzobon:DTHough_NP_20190619_106X_noL1T # MTT-CHT emulator -git cms-merge-topic -u dtp2-tpg-am:AM_106X_dev # AM emulator +git cms-merge-topic oglez:Phase2_DTAB7Unpacker_v9. 1 +git cms-merge-topic battibass:phase-2_reco_fix +git cms-merge-topic -u pozzobon:DTHough_NP_20191004_106X_noL1T# MTT-CHT emulator +git cms-merge-topic -u dtp2-tpg-am:v1.4_AM_106X # AM emulator git clone https://github.com/battibass/DTNtuples.git DTDPGAnalysis/DTNtuples scramv1 b -j 5 ``` From 798c573a9d68cd16ba906feb8ab3fb3eb3a9a140 Mon Sep 17 00:00:00 2001 From: Carlo Battilana Date: Fri, 15 Nov 2019 14:05:47 +0100 Subject: [PATCH 2/8] Update README.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 6cf53219d474e..9004482a67c0c 100644 --- a/README.md +++ b/README.md @@ -10,8 +10,8 @@ In the present days this code is evolving fast, hence the installation recipe ma cmsrel CMSSW_10_6_5_patch1 cd CMSSW_10_6_5_patch1/src/ cmsenv -git cms-merge-topic oglez:Phase2_DTAB7Unpacker_v9. 1 -git cms-merge-topic battibass:phase-2_reco_fix +git cms-merge-topic oglez:Phase2_DTAB7Unpacker_v9.1 +git cms-merge-topic battibass:phase-2_DT_reco_fix git cms-merge-topic -u pozzobon:DTHough_NP_20191004_106X_noL1T# MTT-CHT emulator git cms-merge-topic -u dtp2-tpg-am:v1.4_AM_106X # AM emulator git clone https://github.com/battibass/DTNtuples.git DTDPGAnalysis/DTNtuples From 65ac71dc28bb2a52b951ba99a56072fd80a83ab7 Mon Sep 17 00:00:00 2001 From: Carlo Battilana Date: Fri, 15 Nov 2019 14:09:22 +0100 Subject: [PATCH 3/8] Update README.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 9004482a67c0c..67ef466023e2c 100644 --- a/README.md +++ b/README.md @@ -12,9 +12,9 @@ cd CMSSW_10_6_5_patch1/src/ cmsenv git cms-merge-topic oglez:Phase2_DTAB7Unpacker_v9.1 git cms-merge-topic battibass:phase-2_DT_reco_fix -git cms-merge-topic -u pozzobon:DTHough_NP_20191004_106X_noL1T# MTT-CHT emulator +git cms-merge-topic -u pozzobon:DTHough_NP_20191004_106X_noL1T # MTT-CHT emulator git cms-merge-topic -u dtp2-tpg-am:v1.4_AM_106X # AM emulator -git clone https://github.com/battibass/DTNtuples.git DTDPGAnalysis/DTNtuples +git clone https://github.com/battibass/DTNtuples.git DTDPGAnalysis/DTNtuples -b add_muon_reco scramv1 b -j 5 ``` From 59dff93d25c9167d35e19d78ffa12f0db528caa6 Mon Sep 17 00:00:00 2001 From: Carlo Battilana Date: Fri, 15 Nov 2019 15:15:33 +0100 Subject: [PATCH 4/8] Add phase-2 RECO config --- python/customiseDtPhase2Reco_cff.py | 42 +++++++++++++++++++++ test/dtDpgNtuples_slicetest_cfg.py | 58 +++++++++++++++++++++++------ 2 files changed, 88 insertions(+), 12 deletions(-) create mode 100644 python/customiseDtPhase2Reco_cff.py diff --git a/python/customiseDtPhase2Reco_cff.py b/python/customiseDtPhase2Reco_cff.py new file mode 100644 index 0000000000000..adb7bc3dcb1a7 --- /dev/null +++ b/python/customiseDtPhase2Reco_cff.py @@ -0,0 +1,42 @@ +import FWCore.ParameterSet.Config as cms + +def customiseForPhase2Reco(process, pathName, tTrigFile, t0File) : + + process.dt1DRecHitsPh2 = process.dt1DRecHits.clone() + process.dt1DRecHitsPh2.dtDigiLabel = cms.InputTag("dtAB7unpacker") + + process.dt4DSegmentsPh2 = process.dt4DSegments.clone() + process.dt4DSegmentsPh2.recHits1DLabel = cms.InputTag("dt1DRecHitsPh2") + + process.dt4DSegmentsT0SegPh2 = process.dt4DSegmentsT0Seg.clone() + process.dt4DSegmentsT0SegPh2.recHits4DLabel = cms.InputTag("dt4DSegmentsPh2") + + process.dtlocalrecoT0SegPh2 = cms.Sequence( process.dt1DRecHitsPh2 + + process.dt4DSegmentsPh2 + + process.dt4DSegmentsT0SegPh2 ) + + + + if tTrigFile != '' : + process.dt1DRecHitsPh2.recAlgoConfig.tTrigModeConfig.tTrigLabel = cms.string('cosmics_ph2') + process.dt4DSegmentsPh2.Reco4DAlgoConfig.Reco2DAlgoConfig.recAlgoConfig.tTrigModeConfig.tTrigLabel = cms.string('cosmics_ph2') + process.dt4DSegmentsPh2.Reco4DAlgoConfig.recAlgoConfig.tTrigModeConfig.tTrigLabel = cms.string('cosmics_ph2') + process.dt4DSegmentsT0SegPh2.recAlgoConfig.tTrigModeConfig.tTrigLabel = cms.string('cosmics_ph2') + + if t0File != '' : + process.dt1DRecHitsPh2.recAlgoConfig.tTrigModeConfig.t0Label = cms.string('ph2') + process.dt4DSegmentsPh2.Reco4DAlgoConfig.Reco2DAlgoConfig.recAlgoConfig.tTrigModeConfig.t0Label = cms.string('ph2') + process.dt4DSegmentsPh2.Reco4DAlgoConfig.recAlgoConfig.tTrigModeConfig.t0Label = cms.string('ph2') + process.dt4DSegmentsT0SegPh2.recAlgoConfig.tTrigModeConfig.t0Label = cms.string('ph2') + + if hasattr(process,"dtNtupleProducer") and hasattr(process,pathName) : + + print "[customiseForPhase2Reco]: including phase-2 local reco in ntuples" + + process.dtNtupleProducer.ph2DtSegmentTag = cms.untracked.InputTag("dt4DSegmentsPh2") + + getattr(process,pathName).replace(process.dtNtupleProducer, + process.dtlocalrecoT0SegPh2 + + process.dtNtupleProducer) + + return process diff --git a/test/dtDpgNtuples_slicetest_cfg.py b/test/dtDpgNtuples_slicetest_cfg.py index 7a0798f0da931..203a172b737d6 100644 --- a/test/dtDpgNtuples_slicetest_cfg.py +++ b/test/dtDpgNtuples_slicetest_cfg.py @@ -48,13 +48,26 @@ '', #default value VarParsing.VarParsing.multiplicity.singleton, VarParsing.VarParsing.varType.string, - "File with customised DT tTrigs, used only if non ''") + "File with customised DT legacy tTrigs, used only if non ''") options.register('t0File', '', #default value VarParsing.VarParsing.multiplicity.singleton, VarParsing.VarParsing.varType.string, - "File with customised DT t0is, used only if non ''") + "File with customised DT legacy t0is, used only if non ''") + +options.register('tTrigFilePh2', + '', #default value + VarParsing.VarParsing.multiplicity.singleton, + VarParsing.VarParsing.varType.string, + "File with customised DT phase-2 tTrigs, used only if non ''") + +options.register('t0FilePh2', + '', #default value + VarParsing.VarParsing.multiplicity.singleton, + VarParsing.VarParsing.varType.string, + "File with customised DT phase-2 t0is, used only if non ''") + options.register('vDriftFile', '', #default value @@ -84,9 +97,11 @@ process.GlobalTag.globaltag = cms.string(options.globalTag) -if options.tTrigFile != '' or \ - options.vDriftFile != '' or \ - options.t0File != '' : +if options.tTrigFile != '' or \ + options.t0File != '' or \ + options.tTrigFilePh2 != '' or \ + options.t0FilePh2 != '' or \ + options.vDriftFile != '' : process.GlobalTag.toGet = cms.VPSet() if options.tTrigFile != '' : @@ -97,20 +112,35 @@ ) ) -if options.vDriftFile != '' : - process.GlobalTag.toGet.append(cms.PSet(record = cms.string("DTMtimeRcd"), - tag = cms.string("vDrift"), - connect = cms.string("sqlite_file:" + options.vDriftFile) +if options.t0File != '' : + process.GlobalTag.toGet.append(cms.PSet(record = cms.string("DTT0Rcd"), + tag = cms.string("t0"), + connect = cms.string("sqlite_file:" + options.t0File) ) ) -if options.t0File != '' : +if options.tTrigFilePh2 != '' : + process.GlobalTag.toGet.append(cms.PSet(record = cms.string("DTTtrigRcd"), + tag = cms.string("ttrig"), + connect = cms.string("sqlite_file:" + options.tTrigFilePh2), + label = cms.untracked.string("cosmics_ph2") + ) + ) + +if options.t0FilePh2 != '' : process.GlobalTag.toGet.append(cms.PSet(record = cms.string("DTT0Rcd"), tag = cms.string("t0"), - connect = cms.string("sqlite_file:" + options.t0File) + connect = cms.string("sqlite_file:" + options.t0FilePh2), + label = cms.untracked.string("ph2") + ) + ) + +if options.vDriftFile != '' : + process.GlobalTag.toGet.append(cms.PSet(record = cms.string("DTMtimeRcd"), + tag = cms.string("vDrift"), + connect = cms.string("sqlite_file:" + options.vDriftFile) ) ) - process.source = cms.Source("PoolSource", @@ -181,3 +211,7 @@ + process.bmtfDigis + process.dtlocalrecoT0Seg + process.dtNtupleProducer) + +if options.tTrigFilePh2 != '' and options.t0FilePh2 != '' : + from DTDPGAnalysis.DTNtuples.customiseDtPhase2Reco_cff import customiseForPhase2Reco + process = customiseForPhase2Reco(process,"p", options.tTrigFilePh2, options.t0FilePh2) From 64c09227bb27c735ed214327c34873ca7ecd80f5 Mon Sep 17 00:00:00 2001 From: Carlo Battilana Date: Mon, 18 Nov 2019 17:32:47 +0100 Subject: [PATCH 5/8] Bonus: fill PU variables in simulation workflows --- python/customiseDtNtuples_cff.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/customiseDtNtuples_cff.py b/python/customiseDtNtuples_cff.py index dab666aba3510..7cb7a3904de97 100644 --- a/python/customiseDtNtuples_cff.py +++ b/python/customiseDtNtuples_cff.py @@ -7,7 +7,7 @@ def customiseForRunningOnMC(process, pathName) : print "[customiseForRunningOnMC]: updating ntuple input tags" process.dtNtupleProducer.genPartTag = "prunedGenParticles" - # process.dtNtupleProducer.puInfoTag = "addPileupInfo" + process.dtNtupleProducer.puInfoTag = "addPileupInfo" process.dtNtupleProducer.lumiScalerTag = "none" From d099a861a40afce50a446c2d7afbb0f860a598a9 Mon Sep 17 00:00:00 2001 From: Carlo Battilana Date: Tue, 19 Nov 2019 13:27:29 +0100 Subject: [PATCH 6/8] Add runOnDat --- test/dtDpgNtuples_slicetest_cfg.py | 29 ++++++++++++++++++++--------- 1 file changed, 20 insertions(+), 9 deletions(-) diff --git a/test/dtDpgNtuples_slicetest_cfg.py b/test/dtDpgNtuples_slicetest_cfg.py index 203a172b737d6..0c9e5408a33a1 100644 --- a/test/dtDpgNtuples_slicetest_cfg.py +++ b/test/dtDpgNtuples_slicetest_cfg.py @@ -21,7 +21,7 @@ "Maximum number of processed events") options.register('runNumber', - '329806', #default value + '333369', #default value VarParsing.VarParsing.multiplicity.singleton, VarParsing.VarParsing.varType.int, "Run number to be looked for in either 'inputFolderCentral' or 'inputFolderDT' folders") @@ -57,13 +57,13 @@ "File with customised DT legacy t0is, used only if non ''") options.register('tTrigFilePh2', - '', #default value + '/eos/cms/store/group/dpg_dt/comm_dt/commissioning_2019_data/calib/ttrig_phase2_Run333369.db', #default value VarParsing.VarParsing.multiplicity.singleton, VarParsing.VarParsing.varType.string, "File with customised DT phase-2 tTrigs, used only if non ''") options.register('t0FilePh2', - '', #default value + '/eos/cms/store/group/dpg_dt/comm_dt/commissioning_2019_data/calib/t0_phase2_Run333364.db', #default value VarParsing.VarParsing.multiplicity.singleton, VarParsing.VarParsing.varType.string, "File with customised DT phase-2 t0is, used only if non ''") @@ -75,6 +75,12 @@ VarParsing.VarParsing.varType.string, "File with customised DT vDrifts, used only if non ''") +options.register('runOnDat', + False, #default value + VarParsing.VarParsing.multiplicity.singleton, + VarParsing.VarParsing.varType.bool, + "If set to True switches source from 'PoolSource' to 'NewEventStreamFileReader'") + options.register('ntupleName', '', #default value VarParsing.VarParsing.multiplicity.singleton, @@ -84,6 +90,11 @@ options.parseArguments() +if options.runOnDat : + inputSourceType = "NewEventStreamFileReader" +else: + inputSourceType = "PoolSource" + process = cms.Process("DTNTUPLES",eras.Run2_2018) process.load('Configuration.StandardSequences.Services_cff') @@ -142,11 +153,9 @@ ) ) -process.source = cms.Source("PoolSource", +process.source = cms.Source(inputSourceType, - fileNames = cms.untracked.vstring(), - secondaryFileNames = cms.untracked.vstring() - + fileNames = cms.untracked.vstring() ) if options.inputFile != '' : @@ -157,8 +166,10 @@ else : runStr = str(options.runNumber).zfill(9) - runFolder = options.inputFolderCentral + "/" + runStr[0:3] + "/" + runStr[3:6] + "/" + runStr[6:] + "/00000" - + runFolder = options.inputFolderCentral + "/" + runStr[0:3] + "/" + runStr[3:6] + "/" + runStr[6:] + if not options.runOnDat: + runFolder = runFolder + "/00000" + print "[dtDpgNtuples_slicetest_cfg.py]: looking for files under:\n\t\t\t" + runFolder if os.path.exists(runFolder) : From c535c15aae6af490e7c256180e3d69b912c2052e Mon Sep 17 00:00:00 2001 From: Carlo Battilana Date: Fri, 22 Nov 2019 16:29:46 +0100 Subject: [PATCH 7/8] Add calibration branch based Jonas one --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 67ef466023e2c..3a1a5bb48c82f 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ cmsrel CMSSW_10_6_5_patch1 cd CMSSW_10_6_5_patch1/src/ cmsenv git cms-merge-topic oglez:Phase2_DTAB7Unpacker_v9.1 -git cms-merge-topic battibass:phase-2_DT_reco_fix +git cms-merge-topic battibass:Phase2_DTRecoAndCalib git cms-merge-topic -u pozzobon:DTHough_NP_20191004_106X_noL1T # MTT-CHT emulator git cms-merge-topic -u dtp2-tpg-am:v1.4_AM_106X # AM emulator git clone https://github.com/battibass/DTNtuples.git DTDPGAnalysis/DTNtuples -b add_muon_reco From 4b9cd48b4932095dfc40006beadf682918ac6981 Mon Sep 17 00:00:00 2001 From: Carlo Battilana Date: Fri, 29 Nov 2019 12:13:56 +0100 Subject: [PATCH 8/8] Installation instructions now checkout DTNtuples master branch --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 3a1a5bb48c82f..f9bc26577196d 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,7 @@ git cms-merge-topic oglez:Phase2_DTAB7Unpacker_v9.1 git cms-merge-topic battibass:Phase2_DTRecoAndCalib git cms-merge-topic -u pozzobon:DTHough_NP_20191004_106X_noL1T # MTT-CHT emulator git cms-merge-topic -u dtp2-tpg-am:v1.4_AM_106X # AM emulator -git clone https://github.com/battibass/DTNtuples.git DTDPGAnalysis/DTNtuples -b add_muon_reco +git clone https://github.com/battibass/DTNtuples.git DTDPGAnalysis/DTNtuples scramv1 b -j 5 ```