From 1e8b5fd0ea0c00681bedb4872a6ee5a3bcc1a82e Mon Sep 17 00:00:00 2001 From: danek kotlinski Date: Mon, 19 Jun 2023 15:28:00 +0200 Subject: [PATCH 1/9] fixed channel decoding for the timeout error --- .../SiPixelRawToDigi/interface/ErrorChecker.h | 4 ++ .../SiPixelRawToDigi/src/ErrorChecker.cc | 58 +++++++++++++++---- 2 files changed, 50 insertions(+), 12 deletions(-) diff --git a/EventFilter/SiPixelRawToDigi/interface/ErrorChecker.h b/EventFilter/SiPixelRawToDigi/interface/ErrorChecker.h index fcf4135594d4a..cddcb3e825f08 100644 --- a/EventFilter/SiPixelRawToDigi/interface/ErrorChecker.h +++ b/EventFilter/SiPixelRawToDigi/interface/ErrorChecker.h @@ -22,6 +22,10 @@ class ErrorChecker : public ErrorCheckerBase { protected: cms_uint32_t errorDetId(const SiPixelFrameConverter* converter, int errorType, const Word32& word) const override; + cms_uint32_t errorDetIdSimple(const SiPixelFrameConverter* converter, + int errorType, + unsigned int channel, + unsigned int roc) const; }; #endif // EventFilter_SiPixelRawToDigi_interface_ErrorChecker_h diff --git a/EventFilter/SiPixelRawToDigi/src/ErrorChecker.cc b/EventFilter/SiPixelRawToDigi/src/ErrorChecker.cc index 9bde98bef9250..678b6a24195c6 100644 --- a/EventFilter/SiPixelRawToDigi/src/ErrorChecker.cc +++ b/EventFilter/SiPixelRawToDigi/src/ErrorChecker.cc @@ -29,12 +29,15 @@ bool ErrorChecker::checkROC(bool& errorsInEvent, int errorType = (errorWord >> ROC_shift) & ERROR_mask; if LIKELY (errorType < 25) return true; + unsigned int channel = (errorWord >> LINK_shift) & LINK_mask; + unsigned int roc = 1; switch (errorType) { case (25): { - CablingPathToDetUnit cablingPath = {unsigned(fedId), (errorWord >> LINK_shift) & LINK_mask, 1}; - if (!theCablingTree->findItem(cablingPath)) + CablingPathToDetUnit cablingPath = {unsigned(fedId), channel, 1}; + if (!theCablingTree->findItem(cablingPath)) { return false; + } LogDebug("") << " invalid ROC=25 found (errorType=25)"; errorsInEvent = true; break; @@ -55,8 +58,8 @@ bool ErrorChecker::checkROC(bool& errorsInEvent, case (29): { LogDebug("") << " timeout on a channel (errorType=29)"; errorsInEvent = true; - if ((errorWord >> OMIT_ERR_shift) & OMIT_ERR_mask) { - LogDebug("") << " ...first errorType=29 error, this gets masked out"; + if (!((errorWord >> OMIT_ERR_shift) & OMIT_ERR_mask)) { //exit on the 2nd TO word + LogDebug("") << " ...2nd errorType=29 error, skip"; return false; } break; @@ -81,6 +84,11 @@ bool ErrorChecker::checkROC(bool& errorsInEvent, errorsInEvent = true; break; } + case (37): + case (38): { + roc = (errorWord >> ROC_shift) & ROC_mask; + break; + } default: return true; }; @@ -88,18 +96,40 @@ bool ErrorChecker::checkROC(bool& errorsInEvent, if (includeErrors_) { // store error SiPixelRawDataError error(errorWord, errorType, fedId); - cms_uint32_t detId; - detId = errorDetId(converter, errorType, errorWord); + cms_uint32_t detId = errorDetIdSimple(converter, errorType, channel, roc); errors[detId].push_back(error); } return false; } +// new, simpler version +cms_uint32_t ErrorChecker::errorDetIdSimple(const SiPixelFrameConverter* converter, + int errorType, + unsigned int channel, + unsigned int roc) const { + if (!converter) { + return dummyDetId; + } + + ElectronicIndex cabling; + DetectorIndex detIdx; + cabling.dcol = 0; + cabling.pxid = 2; + cabling.roc = roc; + cabling.link = channel; + int status = converter->toDetector(cabling, detIdx); + if (!status) { + return detIdx.rawId; + } // all OK return valid module id + + return dummyDetId; // failed, return dummy +} + // this function finds the detId for an error word that cannot be processed in word2digi cms_uint32_t ErrorChecker::errorDetId(const SiPixelFrameConverter* converter, int errorType, const Word32& word) const { - if (!converter) + if (!converter) { return dummyDetId; - + } ElectronicIndex cabling; switch (errorType) { @@ -116,8 +146,9 @@ cms_uint32_t ErrorChecker::errorDetId(const SiPixelFrameConverter* converter, in DetectorIndex detIdx; int status = converter->toDetector(cabling, detIdx); - if (!status) + if (!status) { return detIdx.rawId; + } break; } case 29: { @@ -143,9 +174,10 @@ cms_uint32_t ErrorChecker::errorDetId(const SiPixelFrameConverter* converter, in chanNmbr = (BLOCK / 2) * 9 + localCH; else chanNmbr = ((BLOCK - 1) / 2) * 9 + 4 + localCH; - if ((chanNmbr < 1) || (chanNmbr > 36)) - break; // signifies unexpected result + if ((chanNmbr < 1) || (chanNmbr > 36)) { + break; // signifies unexpected result WRONG! + } // set dummy values for cabling just to get detId from link if in Barrel cabling.dcol = 0; cabling.pxid = 2; @@ -153,8 +185,9 @@ cms_uint32_t ErrorChecker::errorDetId(const SiPixelFrameConverter* converter, in cabling.link = chanNmbr; DetectorIndex detIdx; int status = converter->toDetector(cabling, detIdx); - if (!status) + if (!status) { return detIdx.rawId; + } break; } case 37: @@ -175,5 +208,6 @@ cms_uint32_t ErrorChecker::errorDetId(const SiPixelFrameConverter* converter, in default: break; }; + return dummyDetId; } From 1b7e3bba074ef65067ba67f3497e99fa7802cf0d Mon Sep 17 00:00:00 2001 From: Matti Kortelainen Date: Tue, 13 Jun 2023 18:21:28 +0200 Subject: [PATCH 2/9] Make edmNew::DetSet::set() private This change makes it easier to reason about thread safety elsewhere. --- DataFormats/Common/interface/DetSetNew.h | 6 +++--- DataFormats/Common/interface/DetSetVectorNew.h | 6 +----- .../SiPixelClusterizer/plugins/SiPixelClusterProducer.cc | 2 +- RecoTracker/MeasurementDet/src/TkMeasurementDetSet.h | 3 +-- 4 files changed, 6 insertions(+), 11 deletions(-) diff --git a/DataFormats/Common/interface/DetSetNew.h b/DataFormats/Common/interface/DetSetNew.h index 0718f30afd282..4df05206f66e2 100644 --- a/DataFormats/Common/interface/DetSetNew.h +++ b/DataFormats/Common/interface/DetSetNew.h @@ -42,9 +42,6 @@ namespace edmNew { set(icont, item, update); } - //FIXME (it may confuse users as size_type is same type as id_type...) - inline void set(Container const &icont, typename Container::Item const &item, bool update = true); - bool isValid() const { return m_offset >= 0; } inline data_type &operator[](size_type i) { return data()[i]; } @@ -79,6 +76,9 @@ namespace edmNew { unsigned int makeKeyOf(const_iterator ci) const { return ci - &(container().front()); } private: + //FIXME (it may confuse users as size_type is same type as id_type...) + inline void set(Container const &icont, typename Container::Item const &item, bool update = true); + DataContainer const &container() const { return *m_data; } data_type const *data() const { diff --git a/DataFormats/Common/interface/DetSetVectorNew.h b/DataFormats/Common/interface/DetSetVectorNew.h index ec89a996f6ce6..69aacd489b2f1 100644 --- a/DataFormats/Common/interface/DetSetVectorNew.h +++ b/DataFormats/Common/interface/DetSetVectorNew.h @@ -183,14 +183,10 @@ namespace edmNew { IterHelp() : m_v(nullptr), m_update(false) {} IterHelp(DetSetVector const& iv, bool iup) : m_v(&iv), m_update(iup) {} - result_type& operator()(Item const& item) const { - m_detset.set(*m_v, item, m_update); - return m_detset; - } + result_type operator()(Item const& item) const { return result_type(*m_v, item, m_update); } private: DetSetVector const* m_v; - mutable result_type m_detset; bool m_update; }; diff --git a/RecoLocalTracker/SiPixelClusterizer/plugins/SiPixelClusterProducer.cc b/RecoLocalTracker/SiPixelClusterizer/plugins/SiPixelClusterProducer.cc index fbe5007b93c89..430f0086a89eb 100644 --- a/RecoLocalTracker/SiPixelClusterizer/plugins/SiPixelClusterProducer.cc +++ b/RecoLocalTracker/SiPixelClusterizer/plugins/SiPixelClusterProducer.cc @@ -124,7 +124,7 @@ void SiPixelClusterProducer::produce(edm::Event& e, const edm::EventSetup& es) { output->shrink_to_fit(); // set sequential identifier - for (auto& clusters : *output) { + for (auto clusters : *output) { uint16_t id = 0; for (auto& cluster : clusters) { cluster.setOriginalId(id++); diff --git a/RecoTracker/MeasurementDet/src/TkMeasurementDetSet.h b/RecoTracker/MeasurementDet/src/TkMeasurementDetSet.h index 92a85c6a5603e..f9dabef9b6c82 100644 --- a/RecoTracker/MeasurementDet/src/TkMeasurementDetSet.h +++ b/RecoTracker/MeasurementDet/src/TkMeasurementDetSet.h @@ -233,8 +233,7 @@ class StMeasurementDetSet { void getDetSet(int i) const { const auto& det = detSet_[i]; if (detIndex_[i] >= 0) { - // edmNew::DetSet::set() internally does an atomic update - det.detSet_.set(*handle_, handle_->item(detIndex_[i])); + det.detSet_ = StripDetset(*handle_, handle_->item(detIndex_[i]), true); det.empty_ = false; // better be false already incAct(); } else { // we should not be here From 0bc879bdc48bb7c739682277f644380a8fb74b41 Mon Sep 17 00:00:00 2001 From: Matti Kortelainen Date: Mon, 12 Jun 2023 18:46:41 +0200 Subject: [PATCH 3/9] Protect assignments of StripDetset() StMeasurementDetSet::getDetSet() The assigments are a critical section and must be protected. --- .../MeasurementDet/src/TkMeasurementDetSet.h | 41 +++++++++++-------- 1 file changed, 25 insertions(+), 16 deletions(-) diff --git a/RecoTracker/MeasurementDet/src/TkMeasurementDetSet.h b/RecoTracker/MeasurementDet/src/TkMeasurementDetSet.h index f9dabef9b6c82..cf6882dc09b18 100644 --- a/RecoTracker/MeasurementDet/src/TkMeasurementDetSet.h +++ b/RecoTracker/MeasurementDet/src/TkMeasurementDetSet.h @@ -165,7 +165,7 @@ class StMeasurementDetSet { void update(int i, int j) { assert(j >= 0); assert(detSet_[i].empty_); - assert(detSet_[i].ready_); + assert(detSet_[i].ready_ == ReadyState::kUnset); detIndex_[i] = j; detSet_[i].empty_ = false; incReady(); @@ -176,7 +176,7 @@ class StMeasurementDetSet { unsigned int id(int i) const { return conditions().id(i); } int find(unsigned int jd, int i = 0) const { return conditions().find(jd, i); } - bool empty(int i) const { return detSet_[i].empty_; } + bool empty(int i) const { return detSet_[i].empty_.load(std::memory_order_relaxed); } bool isActive(int i) const { return activeThisEvent_[i] && conditions().isActiveThisPeriod(i); } void setEmpty(int i) { @@ -189,7 +189,7 @@ class StMeasurementDetSet { printStat(); for (auto& d : detSet_) { d.empty_ = true; - d.ready_ = true; + d.ready_ = ReadyState::kUnset; } std::fill(detIndex_.begin(), detIndex_.end(), -1); std::fill(activeThisEvent_.begin(), activeThisEvent_.end(), true); @@ -208,7 +208,7 @@ class StMeasurementDetSet { const edm::Handle>& handle() const { return handle_; } // StripDetset & detSet(int i) { return detSet_[i]; } const StripDetset& detSet(int i) const { - if (detSet_[i].ready_) + if (detSet_[i].ready_.load(std::memory_order_acquire) != ReadyState::kSet) getDetSet(i); return detSet_[i].detSet_; } @@ -232,16 +232,24 @@ class StMeasurementDetSet { private: void getDetSet(int i) const { const auto& det = detSet_[i]; - if (detIndex_[i] >= 0) { - det.detSet_ = StripDetset(*handle_, handle_->item(detIndex_[i]), true); - det.empty_ = false; // better be false already - incAct(); - } else { // we should not be here - det.detSet_ = StripDetset(); - det.empty_ = true; + + ReadyState expected = ReadyState::kUnset; + if (det.ready_.compare_exchange_strong(expected, ReadyState::kSetting, std::memory_order_acq_rel)) { + if (detIndex_[i] >= 0) { + det.detSet_ = StripDetset(*handle_, handle_->item(detIndex_[i]), true); + det.empty_.store(false, std::memory_order_relaxed); // better be false already + incAct(); + } else { // we should not be here + det.detSet_ = StripDetset(); + det.empty_.store(true, std::memory_order_relaxed); + } + det.ready_.store(ReadyState::kSet, std::memory_order_release); + incSet(); + } else { + // need to wait + while (ReadyState::kSet != det.ready_.load(std::memory_order_acquire)) { + } } - det.ready_ = false; - incSet(); } friend class MeasurementTrackerImpl; @@ -251,14 +259,15 @@ class StMeasurementDetSet { // Globals, per-event edm::Handle> handle_; + enum class ReadyState : char { kUnset, kSetting, kSet }; + // Helper struct to define only the vector elements as mutable and // to have a vector of atomics without an explicit loop over // elements to set their values struct DetSetHelper { mutable std::atomic empty_ = true; - mutable std::atomic ready_ = true; // to be cleaned - // only thread-safe non-const member functions are called from a const function - CMS_THREAD_SAFE mutable StripDetset detSet_; + mutable std::atomic ready_ = ReadyState::kUnset; // to be cleaned + CMS_THREAD_GUARD(ready_) mutable StripDetset detSet_; }; std::vector activeThisEvent_; From aa3d47178b95581af9ac763eff5194eb4397c2d2 Mon Sep 17 00:00:00 2001 From: mmusich Date: Fri, 23 Jun 2023 08:39:28 +0200 Subject: [PATCH 4/9] add RECONANORUN3_ZB_reHLT and HARVESTRUN3_ZB relval steps and use them for 2022 data workflows, in order to employ the @rerecoZeroBias DQM sequence --- .../PyReleaseValidation/python/relval_standard.py | 12 ++++++------ .../PyReleaseValidation/python/relval_steps.py | 2 ++ 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/Configuration/PyReleaseValidation/python/relval_standard.py b/Configuration/PyReleaseValidation/python/relval_standard.py index f28476132a136..74a9614fd4464 100644 --- a/Configuration/PyReleaseValidation/python/relval_standard.py +++ b/Configuration/PyReleaseValidation/python/relval_standard.py @@ -452,7 +452,7 @@ ### run3 (2022) ### workflows[140.001] = ['',['RunMinimumBias2022A','HLTDR3_2023','RECONANORUN3_reHLT','HARVESTRUN3']] workflows[140.002] = ['',['RunSingleMuon2022A','HLTDR3_2023','RECONANORUN3_reHLT','HARVESTRUN3']] -workflows[140.003] = ['',['RunZeroBias2022A','HLTDR3_2023','RECONANORUN3_reHLT','HARVESTRUN3']] +workflows[140.003] = ['',['RunZeroBias2022A','HLTDR3_2023','RECONANORUN3_ZB_reHLT','HARVESTRUN3_ZB']] workflows[140.004] = ['',['RunBTagMu2022A','HLTDR3_2023','RECONANORUN3_reHLT','HARVESTRUN3']] workflows[140.005] = ['',['RunJetHT2022A','HLTDR3_2023','RECONANORUN3_reHLT','HARVESTRUN3']] workflows[140.006] = ['',['RunDisplacedJet2022A','HLTDR3_2023','RECONANORUN3_reHLT','HARVESTRUN3']] @@ -464,7 +464,7 @@ workflows[140.021] = ['',['RunMinimumBias2022B','HLTDR3_2023','RECONANORUN3_reHLT','HARVESTRUN3']] workflows[140.022] = ['',['RunSingleMuon2022B','HLTDR3_2023','RECONANORUN3_reHLT','HARVESTRUN3']] -workflows[140.023] = ['',['RunZeroBias2022B','HLTDR3_2023','RECONANORUN3_reHLT','HARVESTRUN3']] +workflows[140.023] = ['',['RunZeroBias2022B','HLTDR3_2023','RECONANORUN3_ZB_reHLT','HARVESTRUN3_ZB']] workflows[140.024] = ['',['RunBTagMu2022B','HLTDR3_2023','RECONANORUN3_reHLT','HARVESTRUN3']] workflows[140.025] = ['',['RunJetHT2022B','HLTDR3_2023','RECONANORUN3_reHLT','HARVESTRUN3']] workflows[140.026] = ['',['RunDisplacedJet2022B','HLTDR3_2023','RECONANORUN3_reHLT','HARVESTRUN3']] @@ -475,7 +475,7 @@ workflows[140.031] = ['',['RunMuonEG2022B','HLTDR3_2023','RECONANORUN3_reHLT','HARVESTRUN3']] workflows[140.042] = ['',['RunSingleMuon2022C','HLTDR3_2023','RECONANORUN3_reHLT','HARVESTRUN3']] -workflows[140.043] = ['',['RunZeroBias2022C','HLTDR3_2023','RECONANORUN3_reHLT','HARVESTRUN3']] +workflows[140.043] = ['',['RunZeroBias2022C','HLTDR3_2023','RECONANORUN3_ZB_reHLT','HARVESTRUN3_ZB']] workflows[140.044] = ['',['RunBTagMu2022C','HLTDR3_2023','RECONANORUN3_reHLT','HARVESTRUN3']] workflows[140.045] = ['',['RunJetHT2022C','HLTDR3_2023','RECONANORUN3_reHLT','HARVESTRUN3']] workflows[140.046] = ['',['RunDisplacedJet2022C','HLTDR3_2023','RECONANORUN3_reHLT','HARVESTRUN3']] @@ -486,7 +486,7 @@ workflows[140.051] = ['',['RunMuonEG2022C','HLTDR3_2023','RECONANORUN3_reHLT','HARVESTRUN3']] workflows[140.062] = ['',['RunMuon2022D','HLTDR3_2023','RECONANORUN3_reHLT','HARVESTRUN3']] -workflows[140.063] = ['',['RunZeroBias2022D','HLTDR3_2023','RECONANORUN3_reHLT','HARVESTRUN3']] +workflows[140.063] = ['',['RunZeroBias2022D','HLTDR3_2023','RECONANORUN3_ZB_reHLT','HARVESTRUN3_ZB']] workflows[140.064] = ['',['RunBTagMu2022D','HLTDR3_2023','RECONANORUN3_reHLT','HARVESTRUN3']] workflows[140.065] = ['',['RunJetMET2022D','HLTDR3_2023','RECONANORUN3_reHLT','HARVESTRUN3']] workflows[140.066] = ['',['RunDisplacedJet2022D','HLTDR3_2023','RECONANORUN3_reHLT','HARVESTRUN3']] @@ -500,7 +500,7 @@ workflows[140.065521] = ['Run3-2023_JetMET2022D_RecoHCALOnlyCPU',['RunJetMET2022D','HLTDR3_2023','RECODR3_reHLT_HCALOnlyCPU','HARVESTRUN3_HCALOnly']] workflows[140.071] = ['',['RunMuon2022E','HLTDR3_2023','RECONANORUN3_reHLT','HARVESTRUN3']] -workflows[140.072] = ['',['RunZeroBias2022E','HLTDR3_2023','RECONANORUN3_reHLT','HARVESTRUN3']] +workflows[140.072] = ['',['RunZeroBias2022E','HLTDR3_2023','RECONANORUN3_ZB_reHLT','HARVESTRUN3_ZB']] workflows[140.073] = ['',['RunBTagMu2022E','HLTDR3_2023','RECONANORUN3_reHLT','HARVESTRUN3']] workflows[140.074] = ['',['RunJetMET2022E','HLTDR3_2023','RECONANORUN3_reHLT','HARVESTRUN3']] workflows[140.075] = ['',['RunDisplacedJet2022E','HLTDR3_2023','RECONANORUN3_reHLT','HARVESTRUN3']] @@ -509,7 +509,7 @@ workflows[140.078] = ['',['RunMuonEG2022E','HLTDR3_2023','RECONANORUN3_reHLT','HARVESTRUN3']] ### run3 (2023) skims ### -workflows[140.104] = ['',['RunZeroBias2022D','HLTDR3_2023','RECONANORUN3_reHLT','SKIMZEROBIASRUN3_reHLT']] +workflows[140.104] = ['',['RunZeroBias2022D','HLTDR3_2023','RECONANORUN3_ZB_reHLT','SKIMZEROBIASRUN3_reHLT']] workflows[140.105] = ['',['RunBTagMu2022D','HLTDR3_2023','RECONANORUN3_reHLT','SKIMBTAGMURUN3_reHLT']] workflows[140.106] = ['',['RunJetMET2022D','HLTDR3_2023','RECONANORUN3_reHLT','SKIMJETMET0RUN3_reHLT']] workflows[140.107] = ['',['RunDisplacedJet2022D','HLTDR3_2023','RECONANORUN3_reHLT','SKIMDISPLACEDJETRUN3_reHLT']] diff --git a/Configuration/PyReleaseValidation/python/relval_steps.py b/Configuration/PyReleaseValidation/python/relval_steps.py index b98bdd2634aec..9f5ef4936721e 100644 --- a/Configuration/PyReleaseValidation/python/relval_steps.py +++ b/Configuration/PyReleaseValidation/python/relval_steps.py @@ -2850,6 +2850,7 @@ def gen2021HiMix(fragment,howMuch): steps['RECODR3_reHLT_HCALOnlyGPU']=merge([step3_gpu, steps['RECODR3_reHLT_HCALOnlyCPU']]) steps['RECONANORUN3_reHLT']=merge([{'-s':'RAW2DIGI,L1Reco,RECO,PAT,NANO,DQM:@standardDQM+@miniAODDQM+@nanoAODDQM'},steps['RECODR3_reHLT']]) +steps['RECONANORUN3_ZB_reHLT']=merge([{'-s':'RAW2DIGI,L1Reco,RECO,PAT,NANO,DQM:@rerecoZeroBias+@miniAODDQM+@nanoAODDQM'},steps['RECODR3_reHLT']]) steps['RECOCOSMRUN3_reHLT']=merge([{'--scenario':'cosmics','-s':'RAW2DIGI,L1Reco,RECO,DQM','--datatier':'RECO,DQMIO','--eventcontent':'RECO,DQM'},steps['RECONANORUN3_reHLT']]) # mask away - to be removed once we'll migrate the matrix to be fully unscheduled for RECO step @@ -3424,6 +3425,7 @@ def gen2021HiMix(fragment,howMuch): steps['HARVESTRUN3']=merge([{'--data':'', '-s':'HARVESTING:@standardDQM+@miniAODDQM+@nanoAODDQM','--era':'Run3'},steps['HARVESTDRUN3']]) +steps['HARVESTRUN3_ZB']=merge([{'--data':'', '-s':'HARVESTING:@rerecoZeroBias+@miniAODDQM+@nanoAODDQM','--era':'Run3'},steps['HARVESTDRUN3']]) steps['HARVESTRUN3_pixelTrackingOnly'] = merge([ {'-s':'HARVESTING:@pixelTrackingOnlyDQM'}, steps['HARVESTRUN3'] ]) steps['HARVESTRUN3_ECALOnly'] = merge([ {'-s':'HARVESTING:@ecal'}, steps['HARVESTRUN3'] ]) steps['HARVESTRUN3_HCALOnly'] = merge([ {'-s':'HARVESTING:@hcalOnly'}, steps['HARVESTRUN3'] ]) From 58b5d3df20112f6860ab84504417e1893c81155e Mon Sep 17 00:00:00 2001 From: Jordan Martins <36475694+jordan-martins@users.noreply.github.com> Date: Fri, 23 Jun 2023 09:25:48 +0200 Subject: [PATCH 5/9] Create PDWG_ReserveDMu_SD_cff.py I am adding a new cff to handle the creation of a SD. --- .../Skimming/python/PDWG_ReserveDMu_SD_cff.py | 61 +++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 Configuration/Skimming/python/PDWG_ReserveDMu_SD_cff.py diff --git a/Configuration/Skimming/python/PDWG_ReserveDMu_SD_cff.py b/Configuration/Skimming/python/PDWG_ReserveDMu_SD_cff.py new file mode 100644 index 0000000000000..09dc2ff4e8b31 --- /dev/null +++ b/Configuration/Skimming/python/PDWG_ReserveDMu_SD_cff.py @@ -0,0 +1,61 @@ +import FWCore.ParameterSet.Config as cms + +#Trigger bit requirement +import HLTrigger.HLTfilters.hltHighLevel_cfi as hlt +ReserveDMu = hlt.hltHighLevel.clone() +ReserveDMu.TriggerResultsTag = cms.InputTag( "TriggerResults", "", "HLT" ) +ReserveDMu.HLTPaths = cms.vstring( + 'HLT_Dimuon0_Jpsi3p5_Muon2_v*', + 'HLT_Dimuon0_Jpsi_L1_4R_0er1p5R_v*', + 'HLT_Dimuon0_Jpsi_L1_NoOS_v*', + 'HLT_Dimuon0_Jpsi_NoVertexing_L1_4R_0er1p5R_v*', + 'HLT_Dimuon0_Jpsi_NoVertexing_NoOS_v*', + 'HLT_Dimuon0_Jpsi_NoVertexing_v*', + 'HLT_Dimuon0_Jpsi_v*', + 'HLT_Dimuon0_LowMass_L1_0er1p5R_v*', + 'HLT_Dimuon0_LowMass_L1_0er1p5_v*', + 'HLT_Dimuon0_LowMass_L1_4R_v*', + 'HLT_Dimuon0_LowMass_L1_4_v*', + 'HLT_Dimuon0_LowMass_L1_TM530_v*', + 'HLT_Dimuon0_LowMass_v*', + 'HLT_Dimuon0_Upsilon_L1_4p5_v*', + 'HLT_Dimuon0_Upsilon_L1_4p5er2p0M_v*', + 'HLT_Dimuon0_Upsilon_L1_4p5er2p0_v*', + 'HLT_Dimuon0_Upsilon_Muon_NoL1Mass_v*', + 'HLT_Dimuon0_Upsilon_NoVertexing_v*', + 'HLT_Dimuon12_Upsilon_y1p4_v*', + 'HLT_Dimuon14_Phi_Barrel_Seagulls_v*', + 'HLT_Dimuon18_PsiPrime_noCorrL1_v*', + 'HLT_Dimuon18_PsiPrime_v*', + 'HLT_Dimuon24_Phi_noCorrL1_v*', + 'HLT_Dimuon24_Upsilon_noCorrL1_v*', + 'HLT_Dimuon25_Jpsi_noCorrL1_v*', + 'HLT_Dimuon25_Jpsi_v*', + 'HLT_DoubleMu2_Jpsi_DoubleTrk1_Phi1p05_v*', + 'HLT_DoubleMu3_DoubleEle7p5_CaloIdL_TrackIdL_Upsilon_v*', + 'HLT_DoubleMu3_TkMu_DsTau3Mu_v*', + 'HLT_DoubleMu3_Trk_Tau3mu_NoL1Mass_v*', + 'HLT_DoubleMu3_Trk_Tau3mu_v*', + 'HLT_DoubleMu4_3_Bs_v*', + 'HLT_DoubleMu4_3_Jpsi_v*', + 'HLT_DoubleMu4_JpsiTrkTrk_Displaced_v*', + 'HLT_DoubleMu4_Jpsi_Displaced_v*', + 'HLT_DoubleMu4_Jpsi_NoVertexing_v*', + 'HLT_DoubleMu4_MuMuTrk_Displaced_v*', + 'HLT_DoubleMu5_Upsilon_DoubleEle3_CaloIdL_TrackIdL_v*', + 'HLT_Mu25_TkMu0_Phi_v*', + 'HLT_Mu30_TkMu0_Psi_v*', + 'HLT_Mu30_TkMu0_Upsilon_v*', + 'HLT_Mu4_L1DoubleMu_v*', + 'HLT_Mu7p5_L2Mu2_Jpsi_v*', + 'HLT_Mu7p5_L2Mu2_Upsilon_v*', + 'HLT_Tau3Mu_Mu7_Mu1_TkMu1_IsoTau15_Charge1_v*', + 'HLT_Tau3Mu_Mu7_Mu1_TkMu1_IsoTau15_v*', + 'HLT_Tau3Mu_Mu7_Mu1_TkMu1_Tau15_Charge1_v*', + 'HLT_Tau3Mu_Mu7_Mu1_TkMu1_Tau15_v*', + 'HLT_Trimuon5_3p5_2_Upsilon_Muon_v*', + 'HLT_TrimuonOpen_5_3p5_2_Upsilon_Muon_v*') +ReserveDMu.andOr = cms.bool( True ) +# we want to intentionally throw and exception +# in case it does not match one of the HLT Paths +ReserveDMu.throw = cms.bool( True ) From 82694de8e6a7219ce10500cb7426473e3941adfb Mon Sep 17 00:00:00 2001 From: Jordan Martins <36475694+jordan-martins@users.noreply.github.com> Date: Fri, 23 Jun 2023 09:28:10 +0200 Subject: [PATCH 6/9] Update Skims_PDWG_cff.py Adding the PDWG_ReserveDMu_SD_cff file --- Configuration/Skimming/python/Skims_PDWG_cff.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/Configuration/Skimming/python/Skims_PDWG_cff.py b/Configuration/Skimming/python/Skims_PDWG_cff.py index e306fa57756b5..6ee1bfb312f9d 100644 --- a/Configuration/Skimming/python/Skims_PDWG_cff.py +++ b/Configuration/Skimming/python/Skims_PDWG_cff.py @@ -156,6 +156,19 @@ ##################### +from Configuration.Skimming.PDWG_ReserveDMu_SD_cff import * +ReserveDMuPath = cms.Path(ReserveDMu) +SKIMStreamReserveDMu = cms.FilteredStream( + responsible = 'PDWG', + name = 'ReserveDMu', + paths = (ReserveDMuPath), + content = skimRawContent.outputCommands, + selectEvents = cms.untracked.PSet(), + dataTier = cms.untracked.string('RAW') + ) + +##################### + from Configuration.Skimming.PDWG_DiPhoton_SD_cff import * CaloIdIsoPhotonPairsPath = cms.Path(CaloIdIsoPhotonPairsFilter) R9IdPhotonPairsPath = cms.Path(R9IdPhotonPairsFilter) From 3987d3129367c12e9e1bb1a6885875f29f32349a Mon Sep 17 00:00:00 2001 From: Jordan Martins <36475694+jordan-martins@users.noreply.github.com> Date: Fri, 23 Jun 2023 09:34:07 +0200 Subject: [PATCH 7/9] Update autoSkim.py Adding the ReserveDMu SD for all the ParkingDoubleMuonLowMass PDs --- Configuration/Skimming/python/autoSkim.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Configuration/Skimming/python/autoSkim.py b/Configuration/Skimming/python/autoSkim.py index 9b24732e91d73..5d5b8dae2ee7c 100644 --- a/Configuration/Skimming/python/autoSkim.py +++ b/Configuration/Skimming/python/autoSkim.py @@ -17,6 +17,14 @@ 'ZeroBias' : 'LogError+LogErrorMonitor', 'Commissioning' : 'EcalActivity+LogError+LogErrorMonitor', 'Cosmics':'CosmicSP+CosmicTP+LogError+LogErrorMonitor', + 'ParkingDoubleMuonLowMass0': 'ReserveDMu+LogError+LogErrorMonitor', + 'ParkingDoubleMuonLowMass1': 'ReserveDMu+LogError+LogErrorMonitor', + 'ParkingDoubleMuonLowMass2': 'ReserveDMu+LogError+LogErrorMonitor', + 'ParkingDoubleMuonLowMass3': 'ReserveDMu+LogError+LogErrorMonitor', + 'ParkingDoubleMuonLowMass4': 'ReserveDMu+LogError+LogErrorMonitor', + 'ParkingDoubleMuonLowMass5': 'ReserveDMu+LogError+LogErrorMonitor', + 'ParkingDoubleMuonLowMass6': 'ReserveDMu+LogError+LogErrorMonitor', + 'ParkingDoubleMuonLowMass7': 'ReserveDMu+LogError+LogErrorMonitor', # These should be uncommented when 2022 data reprocessing # Dedicated skim for 2022 From 2bf68b7ed76ee833b4247b248bb86dfab7bb37ca Mon Sep 17 00:00:00 2001 From: Jordan Martins <36475694+jordan-martins@users.noreply.github.com> Date: Fri, 23 Jun 2023 09:39:27 +0200 Subject: [PATCH 8/9] Create test_ReserveDMu_SD_cfg.py Test file for the ReserveDMu Secondary Dataset --- .../Skimming/test/test_ReserveDMu_SD_cfg.py | 147 ++++++++++++++++++ 1 file changed, 147 insertions(+) create mode 100644 Configuration/Skimming/test/test_ReserveDMu_SD_cfg.py diff --git a/Configuration/Skimming/test/test_ReserveDMu_SD_cfg.py b/Configuration/Skimming/test/test_ReserveDMu_SD_cfg.py new file mode 100644 index 0000000000000..fce12e64b4110 --- /dev/null +++ b/Configuration/Skimming/test/test_ReserveDMu_SD_cfg.py @@ -0,0 +1,147 @@ +# Auto generated configuration file +# using: +# Revision: 1.19 +# Source: /local/reps/CMSSW/CMSSW/Configuration/Applications/python/ConfigBuilder.py,v +# with command line options: SKIM --filein file:/eos/cms/tier0/store/backfill/1/data/Tier0_REPLAY_2023/ParkingDoubleMuonLowMass0/RAW/v9121550/000/368/389/00000/fce19dd3-8384-45ce-b705-e4accb9c3ec9.root --fileout file:SD_ReservedDMu.root --nThreads 8 --no_exec --number 10 --python_filename SD_ReserveDMu_cfg.py --scenario pp --step SKIM:ReserveDMu --data --conditions 130X_dataRun3_Prompt_v3 +import FWCore.ParameterSet.Config as cms + + + +process = cms.Process('SKIM') + +# import of standard configurations +process.load('Configuration.StandardSequences.Services_cff') +process.load('SimGeneral.HepPDTESSource.pythiapdt_cfi') +process.load('FWCore.MessageService.MessageLogger_cfi') +process.load('Configuration.EventContent.EventContent_cff') +process.load('Configuration.StandardSequences.GeometryRecoDB_cff') +process.load('Configuration.StandardSequences.MagneticField_cff') +process.load('Configuration.StandardSequences.Skims_cff') +process.load('Configuration.StandardSequences.FrontierConditions_GlobalTag_cff') + +process.maxEvents = cms.untracked.PSet( + input = cms.untracked.int32(10), + output = cms.optional.untracked.allowed(cms.int32,cms.PSet) +) + +# Input source +process.source = cms.Source("PoolSource", + fileNames = cms.untracked.vstring('file:/eos/cms/tier0/store/backfill/1/data/Tier0_REPLAY_2023/ParkingDoubleMuonLowMass0/RAW/v9121550/000/368/389/00000/fce19dd3-8384-45ce-b705-e4accb9c3ec9.root'), + secondaryFileNames = cms.untracked.vstring() +) + +process.options = cms.untracked.PSet( + FailPath = cms.untracked.vstring(), + IgnoreCompletely = cms.untracked.vstring(), + Rethrow = cms.untracked.vstring(), + SkipEvent = cms.untracked.vstring(), + accelerators = cms.untracked.vstring('*'), + allowUnscheduled = cms.obsolete.untracked.bool, + canDeleteEarly = cms.untracked.vstring(), + deleteNonConsumedUnscheduledModules = cms.untracked.bool(True), + dumpOptions = cms.untracked.bool(False), + emptyRunLumiMode = cms.obsolete.untracked.string, + eventSetup = cms.untracked.PSet( + forceNumberOfConcurrentIOVs = cms.untracked.PSet( + allowAnyLabel_=cms.required.untracked.uint32 + ), + numberOfConcurrentIOVs = cms.untracked.uint32(0) + ), + fileMode = cms.untracked.string('FULLMERGE'), + forceEventSetupCacheClearOnNewRun = cms.untracked.bool(False), + holdsReferencesToDeleteEarly = cms.untracked.VPSet(), + makeTriggerResults = cms.obsolete.untracked.bool, + modulesToIgnoreForDeleteEarly = cms.untracked.vstring(), + numberOfConcurrentLuminosityBlocks = cms.untracked.uint32(0), + numberOfConcurrentRuns = cms.untracked.uint32(1), + numberOfStreams = cms.untracked.uint32(0), + numberOfThreads = cms.untracked.uint32(1), + printDependencies = cms.untracked.bool(False), + sizeOfStackForThreadsInKB = cms.optional.untracked.uint32, + throwIfIllegalParameter = cms.untracked.bool(True), + wantSummary = cms.untracked.bool(False) +) + +# Production Info +process.configurationMetadata = cms.untracked.PSet( + annotation = cms.untracked.string('SKIM nevts:10'), + name = cms.untracked.string('Applications'), + version = cms.untracked.string('$Revision: 1.19 $') +) + +# Output definition + +process.RECOSIMoutput = cms.OutputModule("PoolOutputModule", + dataset = cms.untracked.PSet( + dataTier = cms.untracked.string(''), + filterName = cms.untracked.string('') + ), + fileName = cms.untracked.string('file:SD_ReservedDMu.root'), + outputCommands = process.RECOSIMEventContent.outputCommands, + splitLevel = cms.untracked.int32(0) +) + +# Additional output definition +process.SKIMStreamReserveDMu = cms.OutputModule("PoolOutputModule", + SelectEvents = cms.untracked.PSet( + SelectEvents = cms.vstring('ReserveDMuPath') + ), + dataset = cms.untracked.PSet( + dataTier = cms.untracked.string('RAW'), + filterName = cms.untracked.string('ReserveDMu') + ), + eventAutoFlushCompressedSize = cms.untracked.int32(5242880), + fileName = cms.untracked.string('ReserveDMu.root'), + outputCommands = cms.untracked.vstring( + 'drop *', + 'keep FEDRawDataCollection_rawDataCollector_*_*', + 'keep FEDRawDataCollection_source_*_*', + 'keep FEDRawDataCollection_rawDataCollector_*_*', + 'keep FEDRawDataCollection_source_*_*', + 'drop *_hlt*_*_*', + 'keep FEDRawDataCollection_rawDataCollector_*_*', + 'keep FEDRawDataCollection_source_*_*', + 'keep GlobalObjectMapRecord_hltGtStage2ObjectMap_*_*', + 'keep edmTriggerResults_*_*_*', + 'keep triggerTriggerEvent_*_*_*', + 'keep *_hltFEDSelectorL1_*_*', + 'keep *_hltScoutingEgammaPacker_*_*', + 'keep *_hltScoutingMuonPacker_*_*', + 'keep *_hltScoutingPFPacker_*_*', + 'keep *_hltScoutingPrimaryVertexPacker_*_*', + 'keep *_hltScoutingTrackPacker_*_*', + 'keep edmTriggerResults_*_*_*', + 'drop *_MEtoEDMConverter_*_*', + 'drop *_*_*_SKIM' + ) +) + +# Other statements +from Configuration.AlCa.GlobalTag import GlobalTag +process.GlobalTag = GlobalTag(process.GlobalTag, '130X_dataRun3_Prompt_v3', '') + +# Path and EndPath definitions +process.RECOSIMoutput_step = cms.EndPath(process.RECOSIMoutput) +process.SKIMStreamReserveDMuOutPath = cms.EndPath(process.SKIMStreamReserveDMu) + +# Schedule definition +process.schedule = cms.Schedule(process.ReserveDMuPath,process.RECOSIMoutput_step,process.SKIMStreamReserveDMuOutPath) +from PhysicsTools.PatAlgos.tools.helpers import associatePatAlgosToolsTask +associatePatAlgosToolsTask(process) + +#Setup FWK for multithreaded +process.options.numberOfThreads = 8 +process.options.numberOfStreams = 0 + + + +# Customisation from command line + +#Have logErrorHarvester wait for the same EDProducers to finish as those providing data for the OutputModule +from FWCore.Modules.logErrorHarvester_cff import customiseLogErrorHarvesterUsingOutputCommands +process = customiseLogErrorHarvesterUsingOutputCommands(process) + +# Add early deletion of temporary data products to reduce peak memory need +from Configuration.StandardSequences.earlyDeleteSettings_cff import customiseEarlyDelete +process = customiseEarlyDelete(process) +# End adding early deletion From 9276657eff42a8502031f74dad3b8c13243444d8 Mon Sep 17 00:00:00 2001 From: Jordan Martins <36475694+jordan-martins@users.noreply.github.com> Date: Fri, 23 Jun 2023 19:10:50 +0200 Subject: [PATCH 9/9] Update PDWG_ReserveDMu_SD_cff.py --- Configuration/Skimming/python/PDWG_ReserveDMu_SD_cff.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Configuration/Skimming/python/PDWG_ReserveDMu_SD_cff.py b/Configuration/Skimming/python/PDWG_ReserveDMu_SD_cff.py index 09dc2ff4e8b31..8b010203ce569 100644 --- a/Configuration/Skimming/python/PDWG_ReserveDMu_SD_cff.py +++ b/Configuration/Skimming/python/PDWG_ReserveDMu_SD_cff.py @@ -58,4 +58,5 @@ ReserveDMu.andOr = cms.bool( True ) # we want to intentionally throw and exception # in case it does not match one of the HLT Paths -ReserveDMu.throw = cms.bool( True ) +# set to False now, switch to on once matrix is updated +ReserveDMu.throw = cms.bool( False )