From 0a95191219290c29da744908bd1f19b1c5c4f782 Mon Sep 17 00:00:00 2001 From: Fabio Cossutti Date: Tue, 1 Jun 2021 11:59:40 +0200 Subject: [PATCH 1/8] Slim down AODSIM MTD event content --- .../RecoLocalFastTime_EventContent_cff.py | 8 +++----- .../python/RecoMTD_EventContent_cff.py | 19 +++++++++++-------- 2 files changed, 14 insertions(+), 13 deletions(-) diff --git a/RecoLocalFastTime/Configuration/python/RecoLocalFastTime_EventContent_cff.py b/RecoLocalFastTime/Configuration/python/RecoLocalFastTime_EventContent_cff.py index 44ea32fd320bf..428688d8808d9 100644 --- a/RecoLocalFastTime/Configuration/python/RecoLocalFastTime_EventContent_cff.py +++ b/RecoLocalFastTime/Configuration/python/RecoLocalFastTime_EventContent_cff.py @@ -12,14 +12,12 @@ #RECO content RecoLocalFastTimeRECO = cms.PSet( outputCommands = cms.untracked.vstring( - 'keep *_mtdRecHits_*_*', - 'keep *_mtdClusters_*_*', + 'keep *_mtdRecHits_*_*', + 'keep *_mtdClusters_*_*', ) ) #AOD content RecoLocalFastTimeAOD = cms.PSet( - outputCommands = cms.untracked.vstring( - 'keep *_mtdClusters_*_*', - ) + outputCommands = cms.untracked.vstring() ) diff --git a/RecoMTD/Configuration/python/RecoMTD_EventContent_cff.py b/RecoMTD/Configuration/python/RecoMTD_EventContent_cff.py index bc036dbbb9e95..49399e4e7e365 100644 --- a/RecoMTD/Configuration/python/RecoMTD_EventContent_cff.py +++ b/RecoMTD/Configuration/python/RecoMTD_EventContent_cff.py @@ -1,7 +1,7 @@ import FWCore.ParameterSet.Config as cms -#AOD -RecoMTDAOD = cms.PSet( +#FEVT content +RecoMTDFEVT = cms.PSet( outputCommands = cms.untracked.vstring( 'keep *_trackExtenderWithMTD_*_*', 'keep *_mtdTrackQualityMVA_*_*') @@ -9,12 +9,15 @@ #RECO content RecoMTDRECO = cms.PSet( - outputCommands = cms.untracked.vstring() + outputCommands = cms.untracked.vstring() ) -RecoMTDRECO.outputCommands.extend(RecoMTDAOD.outputCommands) +RecoMTDRECO.outputCommands.extend(RecoMTDFEVT.outputCommands) -#FEVT content -RecoMTDFEVT = cms.PSet( - outputCommands = cms.untracked.vstring() +#AOD +RecoMTDAOD = cms.PSet( + outputCommands = cms.untracked.vstring( + 'keep *_trackExtenderWithMTD_*_*', + 'drop recoTracks_trackExtenderWithMTD_*_*', + 'drop recoTrackExtras_trackExtenderWithMTD_*_*', + 'keep *_mtdTrackQualityMVA_*_*') ) -RecoMTDFEVT.outputCommands.extend(RecoMTDRECO.outputCommands) From 1e2de4a6f0628a60ed8b1e14e754fe9369095976 Mon Sep 17 00:00:00 2001 From: Fabio Cossutti Date: Tue, 1 Jun 2021 17:48:58 +0200 Subject: [PATCH 2/8] Replace ValueMaps with needed objects --- .../RecoLocalFastTime_EventContent_cff.py | 4 +- .../python/RecoMTD_EventContent_cff.py | 5 +-- .../interface/MTDTrackQualityMVA.h | 3 +- .../plugins/MTDTrackQualityMVAProducer.cc | 30 ++++++------- .../TimingIDTools/src/MTDTrackQualityMVA.cc | 23 +++++----- .../plugins/TrackExtenderWithMTD.cc | 43 +++++++++++-------- .../plugins/MtdTracksValidation.cc | 12 +++--- 7 files changed, 62 insertions(+), 58 deletions(-) diff --git a/RecoLocalFastTime/Configuration/python/RecoLocalFastTime_EventContent_cff.py b/RecoLocalFastTime/Configuration/python/RecoLocalFastTime_EventContent_cff.py index 428688d8808d9..938dd554892d0 100644 --- a/RecoLocalFastTime/Configuration/python/RecoLocalFastTime_EventContent_cff.py +++ b/RecoLocalFastTime/Configuration/python/RecoLocalFastTime_EventContent_cff.py @@ -18,6 +18,8 @@ ) #AOD content RecoLocalFastTimeAOD = cms.PSet( - outputCommands = cms.untracked.vstring() + outputCommands = cms.untracked.vstring( + 'keep *_mtdClusters_*_*', + ) ) diff --git a/RecoMTD/Configuration/python/RecoMTD_EventContent_cff.py b/RecoMTD/Configuration/python/RecoMTD_EventContent_cff.py index 49399e4e7e365..64477b07e4655 100644 --- a/RecoMTD/Configuration/python/RecoMTD_EventContent_cff.py +++ b/RecoMTD/Configuration/python/RecoMTD_EventContent_cff.py @@ -16,8 +16,7 @@ #AOD RecoMTDAOD = cms.PSet( outputCommands = cms.untracked.vstring( - 'keep *_trackExtenderWithMTD_*_*', - 'drop recoTracks_trackExtenderWithMTD_*_*', - 'drop recoTrackExtras_trackExtenderWithMTD_*_*', + 'keep intedmValueMap_trackExtenderWithMTD_*_*', + 'keep floatedmValueMap_trackExtenderWithMTD_*_*', 'keep *_mtdTrackQualityMVA_*_*') ) diff --git a/RecoMTD/TimingIDTools/interface/MTDTrackQualityMVA.h b/RecoMTD/TimingIDTools/interface/MTDTrackQualityMVA.h index 46d9191906c8d..4d31e1acdeff0 100644 --- a/RecoMTD/TimingIDTools/interface/MTDTrackQualityMVA.h +++ b/RecoMTD/TimingIDTools/interface/MTDTrackQualityMVA.h @@ -38,7 +38,8 @@ class MTDTrackQualityMVA { //---getters--- // 4D float operator()(const reco::TrackRef& trk, - const reco::TrackRef& ext_trk, + const edm::ValueMap& npixBarrels, + const edm::ValueMap& npixEndcaps, const edm::ValueMap& btl_chi2s, const edm::ValueMap& btl_time_chi2s, const edm::ValueMap& etl_chi2s, diff --git a/RecoMTD/TimingIDTools/plugins/MTDTrackQualityMVAProducer.cc b/RecoMTD/TimingIDTools/plugins/MTDTrackQualityMVAProducer.cc index 37152256f1a9e..014421d1ef8fc 100644 --- a/RecoMTD/TimingIDTools/plugins/MTDTrackQualityMVAProducer.cc +++ b/RecoMTD/TimingIDTools/plugins/MTDTrackQualityMVAProducer.cc @@ -44,14 +44,14 @@ class MTDTrackQualityMVAProducer : public edm::stream::EDProducer<> { edm::EDGetTokenT> etlMatchTimeChi2Token_; edm::EDGetTokenT> mtdTimeToken_; edm::EDGetTokenT> pathLengthToken_; - edm::EDGetTokenT> trackAssocToken_; + edm::EDGetTokenT> npixBarrelToken_; + edm::EDGetTokenT> npixEndcapToken_; MTDTrackQualityMVA mva_; }; MTDTrackQualityMVAProducer::MTDTrackQualityMVAProducer(const ParameterSet& iConfig) : tracksToken_(consumes(iConfig.getParameter("tracksSrc"))), - tracksMTDToken_(consumes(iConfig.getParameter("tracksMTDSrc"))), btlMatchChi2Token_(consumes>(iConfig.getParameter("btlMatchChi2Src"))), btlMatchTimeChi2Token_( consumes>(iConfig.getParameter("btlMatchTimeChi2Src"))), @@ -60,7 +60,8 @@ MTDTrackQualityMVAProducer::MTDTrackQualityMVAProducer(const ParameterSet& iConf consumes>(iConfig.getParameter("etlMatchTimeChi2Src"))), mtdTimeToken_(consumes>(iConfig.getParameter("mtdTimeSrc"))), pathLengthToken_(consumes>(iConfig.getParameter("pathLengthSrc"))), - trackAssocToken_(consumes>(iConfig.getParameter("trackAssocSrc"))), + npixBarrelToken_(consumes>(iConfig.getParameter("npixBarrelSrc"))), + npixEndcapToken_(consumes>(iConfig.getParameter("npixEndcapSrc"))), mva_(iConfig.getParameter("qualityBDT_weights_file").fullPath()) { produces>(mvaName); } @@ -69,8 +70,6 @@ MTDTrackQualityMVAProducer::MTDTrackQualityMVAProducer(const ParameterSet& iConf void MTDTrackQualityMVAProducer::fillDescriptions(edm::ConfigurationDescriptions& descriptions) { edm::ParameterSetDescription desc; desc.add("tracksSrc", edm::InputTag("generalTracks"))->setComment("Input tracks collection"); - desc.add("tracksMTDSrc", edm::InputTag("trackExtenderWithMTD")) - ->setComment("Input tracks collection for MTD extended tracks"); desc.add("btlMatchChi2Src", edm::InputTag("trackExtenderWithMTD", "btlMatchChi2")) ->setComment("BTL Chi2 Matching value Map"); desc.add("btlMatchTimeChi2Src", edm::InputTag("trackExtenderWithMTD", "btlMatchTimeChi2")) @@ -79,12 +78,14 @@ void MTDTrackQualityMVAProducer::fillDescriptions(edm::ConfigurationDescriptions ->setComment("ETL Chi2 Matching value Map"); desc.add("etlMatchTimeChi2Src", edm::InputTag("trackExtenderWithMTD", "etlMatchTimeChi2")) ->setComment("ETL Chi2 Matching value Map"); - desc.add("mtdTimeSrc", edm::InputTag("trackExtenderWithMTD", "tmtd")) + desc.add("mtdTimeSrc", edm::InputTag("trackExtenderWithMTD", "generalTracktmtd")) ->setComment("MTD TIme value Map"); - desc.add("pathLengthSrc", edm::InputTag("trackExtenderWithMTD", "pathLength")) + desc.add("pathLengthSrc", edm::InputTag("trackExtenderWithMTD", "generalTrackPathLength")) ->setComment("MTD PathLength value Map"); - desc.add("trackAssocSrc", edm::InputTag("trackExtenderWithMTD", "generalTrackassoc")) - ->setComment("Association between General and MTD Extended tracks"); + desc.add("npixBarrelSrc", edm::InputTag("trackExtenderWithMTD", "npixBarrel")) + ->setComment("# of Barrel pixel associated to refitted tracks"); + desc.add("npixEndcapSrc", edm::InputTag("trackExtenderWithMTD", "npixEndcap")) + ->setComment("# of Endcap pixel associated to refitted tracks"); desc.add("qualityBDT_weights_file", edm::FileInPath("RecoMTD/TimingIDTools/data/clf4D_MTDquality_bo.xml")) ->setComment("Track MTD quality BDT weights"); @@ -108,15 +109,13 @@ void MTDTrackQualityMVAProducer::produce(edm::Event& ev, const edm::EventSetup& ev.getByToken(tracksToken_, tracksH); const auto& tracks = *tracksH; - edm::Handle tracksMTDH; - ev.getByToken(tracksMTDToken_, tracksMTDH); - const auto& btlMatchChi2 = ev.get(btlMatchChi2Token_); const auto& btlMatchTimeChi2 = ev.get(btlMatchTimeChi2Token_); const auto& etlMatchChi2 = ev.get(etlMatchChi2Token_); const auto& etlMatchTimeChi2 = ev.get(etlMatchTimeChi2Token_); const auto& pathLength = ev.get(pathLengthToken_); - const auto& trackAssoc = ev.get(trackAssocToken_); + const auto& npixBarrel = ev.get(npixBarrelToken_); + const auto& npixEndcap = ev.get(npixEndcapToken_); const auto& mtdTime = ev.get(mtdTimeToken_); std::vector mvaOutRaw; @@ -124,12 +123,11 @@ void MTDTrackQualityMVAProducer::produce(edm::Event& ev, const edm::EventSetup& //Loop over tracks collection for (unsigned int itrack = 0; itrack < tracks.size(); ++itrack) { const reco::TrackRef trackref(tracksH, itrack); - if (trackAssoc[trackref] == -1) + if (pathLength[trackref] == -1.) mvaOutRaw.push_back(-1.); else { - const reco::TrackRef mtdTrackref = reco::TrackRef(tracksMTDH, trackAssoc[trackref]); mvaOutRaw.push_back(mva_( - trackref, mtdTrackref, btlMatchChi2, btlMatchTimeChi2, etlMatchChi2, etlMatchTimeChi2, mtdTime, pathLength)); + trackref, npixBarrel, npixEndcap, btlMatchChi2, btlMatchTimeChi2, etlMatchChi2, etlMatchTimeChi2, mtdTime, pathLength)); } } fillValueMap(ev, tracksH, mvaOutRaw, mvaName); diff --git a/RecoMTD/TimingIDTools/src/MTDTrackQualityMVA.cc b/RecoMTD/TimingIDTools/src/MTDTrackQualityMVA.cc index 26f7255cb7741..968e63216c09f 100644 --- a/RecoMTD/TimingIDTools/src/MTDTrackQualityMVA.cc +++ b/RecoMTD/TimingIDTools/src/MTDTrackQualityMVA.cc @@ -13,15 +13,14 @@ MTDTrackQualityMVA::MTDTrackQualityMVA(std::string weights_file) { } float MTDTrackQualityMVA::operator()(const reco::TrackRef& trk, - const reco::TrackRef& ext_trk, + const edm::ValueMap& npixBarrels, + const edm::ValueMap& npixEndcaps, const edm::ValueMap& btl_chi2s, const edm::ValueMap& btl_time_chi2s, const edm::ValueMap& etl_chi2s, const edm::ValueMap& etl_time_chi2s, const edm::ValueMap& tmtds, const edm::ValueMap& trk_lengths) const { - const auto& pattern = ext_trk->hitPattern(); - std::map vars; //---training performed only above 0.5 GeV @@ -30,23 +29,23 @@ float MTDTrackQualityMVA::operator()(const reco::TrackRef& trk, return -1; //---training performed only for tracks with MTD hits - if (tmtds[ext_trk] > 0) { + if (tmtds[trk] > 0) { vars.emplace(vars_[int(VarID::pt)], trk->pt()); vars.emplace(vars_[int(VarID::eta)], trk->eta()); vars.emplace(vars_[int(VarID::phi)], trk->phi()); vars.emplace(vars_[int(VarID::chi2)], trk->chi2()); vars.emplace(vars_[int(VarID::ndof)], trk->ndof()); vars.emplace(vars_[int(VarID::numberOfValidHits)], trk->numberOfValidHits()); - vars.emplace(vars_[int(VarID::numberOfValidPixelBarrelHits)], pattern.numberOfValidPixelBarrelHits()); - vars.emplace(vars_[int(VarID::numberOfValidPixelEndcapHits)], pattern.numberOfValidPixelEndcapHits()); - vars.emplace(vars_[int(VarID::btlMatchChi2)], btl_chi2s.contains(ext_trk.id()) ? btl_chi2s[ext_trk] : -1); + vars.emplace(vars_[int(VarID::numberOfValidPixelBarrelHits)], npixBarrels[trk]); + vars.emplace(vars_[int(VarID::numberOfValidPixelEndcapHits)], npixEndcaps[trk]); + vars.emplace(vars_[int(VarID::btlMatchChi2)], btl_chi2s.contains(trk.id()) ? btl_chi2s[trk] : -1); vars.emplace(vars_[int(VarID::btlMatchTimeChi2)], - btl_time_chi2s.contains(ext_trk.id()) ? btl_time_chi2s[ext_trk] : -1); - vars.emplace(vars_[int(VarID::etlMatchChi2)], etl_chi2s.contains(ext_trk.id()) ? etl_chi2s[ext_trk] : -1); + btl_time_chi2s.contains(trk.id()) ? btl_time_chi2s[trk] : -1); + vars.emplace(vars_[int(VarID::etlMatchChi2)], etl_chi2s.contains(trk.id()) ? etl_chi2s[trk] : -1); vars.emplace(vars_[int(VarID::etlMatchTimeChi2)], - etl_time_chi2s.contains(ext_trk.id()) ? etl_time_chi2s[ext_trk] : -1); - vars.emplace(vars_[int(VarID::mtdt)], tmtds[ext_trk]); - vars.emplace(vars_[int(VarID::path_len)], trk_lengths[ext_trk]); + etl_time_chi2s.contains(trk.id()) ? etl_time_chi2s[trk] : -1); + vars.emplace(vars_[int(VarID::mtdt)], tmtds[trk]); + vars.emplace(vars_[int(VarID::path_len)], trk_lengths[trk]); return 1. / (1 + sqrt(2 / (1 + mva_->evaluate(vars, false)) - 1)); //return values between 0-1 (probability) } else return -1; diff --git a/RecoMTD/TrackExtender/plugins/TrackExtenderWithMTD.cc b/RecoMTD/TrackExtender/plugins/TrackExtenderWithMTD.cc index afaa27d3695f2..23af1b66c4b8c 100644 --- a/RecoMTD/TrackExtender/plugins/TrackExtenderWithMTD.cc +++ b/RecoMTD/TrackExtender/plugins/TrackExtenderWithMTD.cc @@ -371,9 +371,8 @@ class TrackExtenderWithMTDT : public edm::stream::EDProducer<> { edm::EDPutToken etlMatchChi2Token; edm::EDPutToken btlMatchTimeChi2Token; edm::EDPutToken etlMatchTimeChi2Token; - edm::EDPutToken pathLengthToken; - edm::EDPutToken tmtdToken; - edm::EDPutToken sigmatmtdToken; + edm::EDPutToken npixBarrelToken; + edm::EDPutToken npixEndcapToken; edm::EDPutToken pOrigTrkToken; edm::EDPutToken betaOrigTrkToken; edm::EDPutToken t0OrigTrkToken; @@ -455,9 +454,8 @@ TrackExtenderWithMTDT::TrackExtenderWithMTDT(const ParameterSet etlMatchChi2Token = produces>("etlMatchChi2"); btlMatchTimeChi2Token = produces>("btlMatchTimeChi2"); etlMatchTimeChi2Token = produces>("etlMatchTimeChi2"); - pathLengthToken = produces>("pathLength"); - tmtdToken = produces>("tmtd"); - sigmatmtdToken = produces>("sigmatmtd"); + npixBarrelToken = produces>("npixBarrel"); + npixEndcapToken = produces>("npixEndcap"); pOrigTrkToken = produces>("generalTrackp"); betaOrigTrkToken = produces>("generalTrackBeta"); t0OrigTrkToken = produces>("generalTrackt0"); @@ -566,9 +564,8 @@ void TrackExtenderWithMTDT::produce(edm::Event& ev, const edm:: std::vector etlMatchChi2; std::vector btlMatchTimeChi2; std::vector etlMatchTimeChi2; - std::vector pathLengthsRaw; - std::vector tmtdRaw; - std::vector sigmatmtdRaw; + std::vector npixBarrel; + std::vector npixEndcap; std::vector pOrigTrkRaw; std::vector betaOrigTrkRaw; std::vector t0OrigTrkRaw; @@ -721,9 +718,6 @@ void TrackExtenderWithMTDT::produce(edm::Event& ev, const edm:: etlMatchChi2.push_back(mETL.hit ? mETL.estChi2 : -1); btlMatchTimeChi2.push_back(mBTL.hit ? mBTL.timeChi2 : -1); etlMatchTimeChi2.push_back(mETL.hit ? mETL.timeChi2 : -1); - pathLengthsRaw.push_back(pathLength); - tmtdRaw.push_back(tmtd); - sigmatmtdRaw.push_back(sigmatmtd); pathLengthMap = pathLength; tmtdMap = tmtd; sigmatmtdMap = sigmatmtd; @@ -738,6 +732,8 @@ void TrackExtenderWithMTDT::produce(edm::Event& ev, const edm:: for (unsigned ihit = hitsstart; ihit < hitsend; ++ihit) { backtrack.appendHitPattern((*outhits)[ihit], ttopo); } + npixBarrel.push_back(backtrack.hitPattern().numberOfValidPixelBarrelHits()); + npixEndcap.push_back(backtrack.hitPattern().numberOfValidPixelEndcapHits()); } else { LogTrace("TrackExtenderWithMTD") << "Error in the MTD track refitting. This should not happen"; } @@ -751,6 +747,16 @@ void TrackExtenderWithMTDT::produce(edm::Event& ev, const edm:: tmtdOrigTrkRaw.push_back(tmtdMap); sigmatmtdOrigTrkRaw.push_back(sigmatmtdMap); assocOrigTrkRaw.push_back(iMap); + + if ( iMap == -1 ) { + btlMatchChi2.push_back(-1.); + etlMatchChi2.push_back(-1.); + btlMatchTimeChi2.push_back(-1.); + etlMatchTimeChi2.push_back(-1.); + npixBarrel.push_back(-1.); + npixEndcap.push_back(-1.); + } + ++itrack; } @@ -758,13 +764,12 @@ void TrackExtenderWithMTDT::produce(edm::Event& ev, const edm:: ev.put(std::move(extras)); ev.put(std::move(outhits)); - fillValueMap(ev, outTrksHandle, btlMatchChi2, btlMatchChi2Token); - fillValueMap(ev, outTrksHandle, etlMatchChi2, etlMatchChi2Token); - fillValueMap(ev, outTrksHandle, btlMatchTimeChi2, btlMatchTimeChi2Token); - fillValueMap(ev, outTrksHandle, etlMatchTimeChi2, etlMatchTimeChi2Token); - fillValueMap(ev, outTrksHandle, pathLengthsRaw, pathLengthToken); - fillValueMap(ev, outTrksHandle, tmtdRaw, tmtdToken); - fillValueMap(ev, outTrksHandle, sigmatmtdRaw, sigmatmtdToken); + fillValueMap(ev, tracksH, btlMatchChi2, btlMatchChi2Token); + fillValueMap(ev, tracksH, etlMatchChi2, etlMatchChi2Token); + fillValueMap(ev, tracksH, btlMatchTimeChi2, btlMatchTimeChi2Token); + fillValueMap(ev, tracksH, etlMatchTimeChi2, etlMatchTimeChi2Token); + fillValueMap(ev, tracksH, npixBarrel, npixBarrelToken); + fillValueMap(ev, tracksH, npixEndcap, npixEndcapToken); fillValueMap(ev, tracksH, pOrigTrkRaw, pOrigTrkToken); fillValueMap(ev, tracksH, betaOrigTrkRaw, betaOrigTrkToken); fillValueMap(ev, tracksH, t0OrigTrkRaw, t0OrigTrkToken); diff --git a/Validation/MtdValidation/plugins/MtdTracksValidation.cc b/Validation/MtdValidation/plugins/MtdTracksValidation.cc index 2ae95a5fc1a59..e7f30981b5c14 100644 --- a/Validation/MtdValidation/plugins/MtdTracksValidation.cc +++ b/Validation/MtdValidation/plugins/MtdTracksValidation.cc @@ -179,8 +179,8 @@ void MtdTracksValidation::analyze(const edm::Event& iEvent, const edm::EventSetu if (track.pt() < trackMinPt_) continue; - meTracktmtd_->Fill(tMtd[mtdTrackref]); - if (std::round(SigmatMtd[mtdTrackref] - Sigmat0Pid[trackref]) != 0) { + meTracktmtd_->Fill(tMtd[trackref]); + if (std::round(SigmatMtd[trackref] - Sigmat0Pid[trackref]) != 0) { LogWarning("mtdTracks") << "TimeError associated to refitted track is different from TimeError stored in tofPID " "sigmat0 ValueMap: this should not happen"; } @@ -194,7 +194,7 @@ void MtdTracksValidation::analyze(const edm::Event& iEvent, const edm::EventSetu meTrackSigmat0SafePid_->Fill(Sigmat0Safe[trackref]); meTrackMVAQual_->Fill(mtdQualMVA[trackref]); - meTrackPathLenghtvsEta_->Fill(std::abs(track.eta()), pathLength[mtdTrackref]); + meTrackPathLenghtvsEta_->Fill(std::abs(track.eta()), pathLength[trackref]); if (std::abs(track.eta()) < trackMinEta_) { // --- all BTL tracks (with and without hit in MTD) --- @@ -397,13 +397,13 @@ void MtdTracksValidation::fillDescriptions(edm::ConfigurationDescriptions& descr desc.add("inputTagG", edm::InputTag("generalTracks")); desc.add("inputTagT", edm::InputTag("trackExtenderWithMTD")); desc.add("inputTagV", edm::InputTag("offlinePrimaryVertices4D")); - desc.add("tmtd", edm::InputTag("trackExtenderWithMTD:tmtd")); - desc.add("sigmatmtd", edm::InputTag("trackExtenderWithMTD:sigmatmtd")); + desc.add("tmtd", edm::InputTag("trackExtenderWithMTD:generalTracktmtd")); + desc.add("sigmatmtd", edm::InputTag("trackExtenderWithMTD:generalTracksigmatmtd")); desc.add("t0Src", edm::InputTag("trackExtenderWithMTD:generalTrackt0")); desc.add("sigmat0Src", edm::InputTag("trackExtenderWithMTD:generalTracksigmat0")); desc.add("trackAssocSrc", edm::InputTag("trackExtenderWithMTD:generalTrackassoc")) ->setComment("Association between General and MTD Extended tracks"); - desc.add("pathLengthSrc", edm::InputTag("trackExtenderWithMTD:pathLength")); + desc.add("pathLengthSrc", edm::InputTag("trackExtenderWithMTD:generalTrackPathLength")); desc.add("t0SafePID", edm::InputTag("tofPID:t0safe")); desc.add("sigmat0SafePID", edm::InputTag("tofPID:sigmat0safe")); desc.add("sigmat0PID", edm::InputTag("tofPID:sigmat0")); From c0e3b23a772b5a4660ba56cdb1464fdd303889a4 Mon Sep 17 00:00:00 2001 From: Fabio Cossutti Date: Thu, 3 Jun 2021 17:43:45 +0200 Subject: [PATCH 3/8] scram b code-format --- .../plugins/MTDTrackQualityMVAProducer.cc | 11 +++++++++-- RecoMTD/TimingIDTools/src/MTDTrackQualityMVA.cc | 6 ++---- RecoMTD/TrackExtender/plugins/TrackExtenderWithMTD.cc | 2 +- 3 files changed, 12 insertions(+), 7 deletions(-) diff --git a/RecoMTD/TimingIDTools/plugins/MTDTrackQualityMVAProducer.cc b/RecoMTD/TimingIDTools/plugins/MTDTrackQualityMVAProducer.cc index 014421d1ef8fc..54fd444fe946d 100644 --- a/RecoMTD/TimingIDTools/plugins/MTDTrackQualityMVAProducer.cc +++ b/RecoMTD/TimingIDTools/plugins/MTDTrackQualityMVAProducer.cc @@ -126,8 +126,15 @@ void MTDTrackQualityMVAProducer::produce(edm::Event& ev, const edm::EventSetup& if (pathLength[trackref] == -1.) mvaOutRaw.push_back(-1.); else { - mvaOutRaw.push_back(mva_( - trackref, npixBarrel, npixEndcap, btlMatchChi2, btlMatchTimeChi2, etlMatchChi2, etlMatchTimeChi2, mtdTime, pathLength)); + mvaOutRaw.push_back(mva_(trackref, + npixBarrel, + npixEndcap, + btlMatchChi2, + btlMatchTimeChi2, + etlMatchChi2, + etlMatchTimeChi2, + mtdTime, + pathLength)); } } fillValueMap(ev, tracksH, mvaOutRaw, mvaName); diff --git a/RecoMTD/TimingIDTools/src/MTDTrackQualityMVA.cc b/RecoMTD/TimingIDTools/src/MTDTrackQualityMVA.cc index 968e63216c09f..f3a5cc0db37f8 100644 --- a/RecoMTD/TimingIDTools/src/MTDTrackQualityMVA.cc +++ b/RecoMTD/TimingIDTools/src/MTDTrackQualityMVA.cc @@ -39,11 +39,9 @@ float MTDTrackQualityMVA::operator()(const reco::TrackRef& trk, vars.emplace(vars_[int(VarID::numberOfValidPixelBarrelHits)], npixBarrels[trk]); vars.emplace(vars_[int(VarID::numberOfValidPixelEndcapHits)], npixEndcaps[trk]); vars.emplace(vars_[int(VarID::btlMatchChi2)], btl_chi2s.contains(trk.id()) ? btl_chi2s[trk] : -1); - vars.emplace(vars_[int(VarID::btlMatchTimeChi2)], - btl_time_chi2s.contains(trk.id()) ? btl_time_chi2s[trk] : -1); + vars.emplace(vars_[int(VarID::btlMatchTimeChi2)], btl_time_chi2s.contains(trk.id()) ? btl_time_chi2s[trk] : -1); vars.emplace(vars_[int(VarID::etlMatchChi2)], etl_chi2s.contains(trk.id()) ? etl_chi2s[trk] : -1); - vars.emplace(vars_[int(VarID::etlMatchTimeChi2)], - etl_time_chi2s.contains(trk.id()) ? etl_time_chi2s[trk] : -1); + vars.emplace(vars_[int(VarID::etlMatchTimeChi2)], etl_time_chi2s.contains(trk.id()) ? etl_time_chi2s[trk] : -1); vars.emplace(vars_[int(VarID::mtdt)], tmtds[trk]); vars.emplace(vars_[int(VarID::path_len)], trk_lengths[trk]); return 1. / (1 + sqrt(2 / (1 + mva_->evaluate(vars, false)) - 1)); //return values between 0-1 (probability) diff --git a/RecoMTD/TrackExtender/plugins/TrackExtenderWithMTD.cc b/RecoMTD/TrackExtender/plugins/TrackExtenderWithMTD.cc index 23af1b66c4b8c..b69ebc1227664 100644 --- a/RecoMTD/TrackExtender/plugins/TrackExtenderWithMTD.cc +++ b/RecoMTD/TrackExtender/plugins/TrackExtenderWithMTD.cc @@ -748,7 +748,7 @@ void TrackExtenderWithMTDT::produce(edm::Event& ev, const edm:: sigmatmtdOrigTrkRaw.push_back(sigmatmtdMap); assocOrigTrkRaw.push_back(iMap); - if ( iMap == -1 ) { + if (iMap == -1) { btlMatchChi2.push_back(-1.); etlMatchChi2.push_back(-1.); btlMatchTimeChi2.push_back(-1.); From f7fa938d6f17425d7704dac35acecc61b5b53133 Mon Sep 17 00:00:00 2001 From: Fabio Cossutti Date: Fri, 4 Jun 2021 11:15:06 +0200 Subject: [PATCH 4/8] Remove mtdClusters from AODSIM --- .../python/RecoLocalFastTime_EventContent_cff.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/RecoLocalFastTime/Configuration/python/RecoLocalFastTime_EventContent_cff.py b/RecoLocalFastTime/Configuration/python/RecoLocalFastTime_EventContent_cff.py index 938dd554892d0..428688d8808d9 100644 --- a/RecoLocalFastTime/Configuration/python/RecoLocalFastTime_EventContent_cff.py +++ b/RecoLocalFastTime/Configuration/python/RecoLocalFastTime_EventContent_cff.py @@ -18,8 +18,6 @@ ) #AOD content RecoLocalFastTimeAOD = cms.PSet( - outputCommands = cms.untracked.vstring( - 'keep *_mtdClusters_*_*', - ) + outputCommands = cms.untracked.vstring() ) From ebed210d7e02e37ca0c9dafca3dc51dd8ca73381 Mon Sep 17 00:00:00 2001 From: Fabio Cossutti Date: Mon, 21 Jun 2021 18:28:56 +0200 Subject: [PATCH 5/8] Swap FEVT and RECO definitions in RecoMTD (as suggested by P. Srimanobhas) --- .../Configuration/python/RecoMTD_EventContent_cff.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/RecoMTD/Configuration/python/RecoMTD_EventContent_cff.py b/RecoMTD/Configuration/python/RecoMTD_EventContent_cff.py index 64477b07e4655..003e3539aadc1 100644 --- a/RecoMTD/Configuration/python/RecoMTD_EventContent_cff.py +++ b/RecoMTD/Configuration/python/RecoMTD_EventContent_cff.py @@ -1,17 +1,17 @@ import FWCore.ParameterSet.Config as cms -#FEVT content -RecoMTDFEVT = cms.PSet( +#RECO content +RecoMTDRECO = cms.PSet( outputCommands = cms.untracked.vstring( 'keep *_trackExtenderWithMTD_*_*', 'keep *_mtdTrackQualityMVA_*_*') ) -#RECO content -RecoMTDRECO = cms.PSet( +#FEVT content +RecoMTDFEVT = cms.PSet( outputCommands = cms.untracked.vstring() ) -RecoMTDRECO.outputCommands.extend(RecoMTDFEVT.outputCommands) +RecoMTDFEVT.outputCommands.extend(RecoMTDRECO.outputCommands) #AOD RecoMTDAOD = cms.PSet( From 0540f9e691d26f7b66d40e0ce1a3e6f73bf69080 Mon Sep 17 00:00:00 2001 From: Fabio Cossutti Date: Tue, 22 Jun 2021 12:17:20 +0200 Subject: [PATCH 6/8] Define lower data tiers as supersets of higher tiers --- .../RecoLocalFastTime_EventContent_cff.py | 29 ++++++++++--------- .../python/RecoMTD_EventContent_cff.py | 22 +++++++------- 2 files changed, 28 insertions(+), 23 deletions(-) diff --git a/RecoLocalFastTime/Configuration/python/RecoLocalFastTime_EventContent_cff.py b/RecoLocalFastTime/Configuration/python/RecoLocalFastTime_EventContent_cff.py index 428688d8808d9..2cc8234f05fd0 100644 --- a/RecoLocalFastTime/Configuration/python/RecoLocalFastTime_EventContent_cff.py +++ b/RecoLocalFastTime/Configuration/python/RecoLocalFastTime_EventContent_cff.py @@ -1,23 +1,26 @@ import FWCore.ParameterSet.Config as cms -#FEVT -RecoLocalFastTimeFEVT = cms.PSet( - outputCommands = cms.untracked.vstring( - 'keep *_mtdUncalibratedRecHits_*_*', - 'keep *_mtdRecHits_*_*', - 'keep *_mtdClusters_*_*', - 'keep *_mtdTrackingRecHits_*_*' - ) +#AOD content +RecoLocalFastTimeAOD = cms.PSet( + outputCommands = cms.untracked.vstring() ) + #RECO content RecoLocalFastTimeRECO = cms.PSet( outputCommands = cms.untracked.vstring( 'keep *_mtdRecHits_*_*', 'keep *_mtdClusters_*_*', - ) -) -#AOD content -RecoLocalFastTimeAOD = cms.PSet( - outputCommands = cms.untracked.vstring() + ) ) +RecoLocalFastTimeRECO.outputCommands.extend(RecoLocalFastTimeAOD.outputCommands) +#FEVT +RecoLocalFastTimeFEVT = cms.PSet( + outputCommands = cms.untracked.vstring( + 'keep *_mtdRecHits_*_*', + 'keep *_mtdClusters_*_*', + 'keep *_mtdUncalibratedRecHits_*_*', + 'keep *_mtdTrackingRecHits_*_*', + ) +) +RecoLocalFastTimeFEVT.outputCommands.extend(RecoLocalFastTimeRECO.outputCommands) diff --git a/RecoMTD/Configuration/python/RecoMTD_EventContent_cff.py b/RecoMTD/Configuration/python/RecoMTD_EventContent_cff.py index 003e3539aadc1..e5a804f582cf8 100644 --- a/RecoMTD/Configuration/python/RecoMTD_EventContent_cff.py +++ b/RecoMTD/Configuration/python/RecoMTD_EventContent_cff.py @@ -1,22 +1,24 @@ import FWCore.ParameterSet.Config as cms +#AOD +RecoMTDAOD = cms.PSet( + outputCommands = cms.untracked.vstring( + 'keep intedmValueMap_trackExtenderWithMTD_*_*', + 'keep floatedmValueMap_trackExtenderWithMTD_*_*', + 'keep *_mtdTrackQualityMVA_*_*') +) + #RECO content RecoMTDRECO = cms.PSet( outputCommands = cms.untracked.vstring( - 'keep *_trackExtenderWithMTD_*_*', - 'keep *_mtdTrackQualityMVA_*_*') + 'keep *_trackExtenderWithMTD_*_*', + 'keep *_mtdTrackQualityMVA_*_*', + ) ) +RecoMTDRECO.outputCommands.extend(RecoMTDAOD.outputCommands) #FEVT content RecoMTDFEVT = cms.PSet( outputCommands = cms.untracked.vstring() ) RecoMTDFEVT.outputCommands.extend(RecoMTDRECO.outputCommands) - -#AOD -RecoMTDAOD = cms.PSet( - outputCommands = cms.untracked.vstring( - 'keep intedmValueMap_trackExtenderWithMTD_*_*', - 'keep floatedmValueMap_trackExtenderWithMTD_*_*', - 'keep *_mtdTrackQualityMVA_*_*') -) From 211c7bda498f841f1f56fa2b8436e89348397ac0 Mon Sep 17 00:00:00 2001 From: Fabio Cossutti Date: Tue, 22 Jun 2021 15:47:25 +0200 Subject: [PATCH 7/8] Make the tier definition fully encapsulated and dependent on smaller ones --- .../python/RecoLocalFastTime_EventContent_cff.py | 2 -- RecoMTD/Configuration/python/RecoMTD_EventContent_cff.py | 4 ++-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/RecoLocalFastTime/Configuration/python/RecoLocalFastTime_EventContent_cff.py b/RecoLocalFastTime/Configuration/python/RecoLocalFastTime_EventContent_cff.py index 2cc8234f05fd0..dd8ce385f0c3f 100644 --- a/RecoLocalFastTime/Configuration/python/RecoLocalFastTime_EventContent_cff.py +++ b/RecoLocalFastTime/Configuration/python/RecoLocalFastTime_EventContent_cff.py @@ -17,8 +17,6 @@ #FEVT RecoLocalFastTimeFEVT = cms.PSet( outputCommands = cms.untracked.vstring( - 'keep *_mtdRecHits_*_*', - 'keep *_mtdClusters_*_*', 'keep *_mtdUncalibratedRecHits_*_*', 'keep *_mtdTrackingRecHits_*_*', ) diff --git a/RecoMTD/Configuration/python/RecoMTD_EventContent_cff.py b/RecoMTD/Configuration/python/RecoMTD_EventContent_cff.py index e5a804f582cf8..8f1e2dc5cbdb3 100644 --- a/RecoMTD/Configuration/python/RecoMTD_EventContent_cff.py +++ b/RecoMTD/Configuration/python/RecoMTD_EventContent_cff.py @@ -11,8 +11,8 @@ #RECO content RecoMTDRECO = cms.PSet( outputCommands = cms.untracked.vstring( - 'keep *_trackExtenderWithMTD_*_*', - 'keep *_mtdTrackQualityMVA_*_*', + 'keep recoTrack*_trackExtenderWithMTD_*_*', + 'keep TrackingRecHitsOwned_trackExtenderWithMTD_*_*', ) ) RecoMTDRECO.outputCommands.extend(RecoMTDAOD.outputCommands) From 78321d518eb10fd4050fe100f811d8fdb57094d1 Mon Sep 17 00:00:00 2001 From: Fabio Cossutti Date: Tue, 22 Jun 2021 15:50:49 +0200 Subject: [PATCH 8/8] Downgrade verbosity in track validation --- Validation/MtdValidation/plugins/MtdTracksValidation.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Validation/MtdValidation/plugins/MtdTracksValidation.cc b/Validation/MtdValidation/plugins/MtdTracksValidation.cc index e7f30981b5c14..9aa690b7fbb4a 100644 --- a/Validation/MtdValidation/plugins/MtdTracksValidation.cc +++ b/Validation/MtdValidation/plugins/MtdTracksValidation.cc @@ -169,7 +169,7 @@ void MtdTracksValidation::analyze(const edm::Event& iEvent, const edm::EventSetu index++; if (trackAssoc[trackref] == -1) { - LogWarning("mtdTracks") << "Extended track not associated"; + LogInfo("mtdTracks") << "Extended track not associated"; continue; }