From afe8b59257860864937b417680ba7ede174bb455 Mon Sep 17 00:00:00 2001 From: matteo Date: Mon, 27 Nov 2023 09:54:54 +0100 Subject: [PATCH] New structure for EtSums --- .../L1Scouting/interface/L1ScoutingCalo.h | 133 +++++++++++++-- DataFormats/L1Scouting/src/classes.h | 1 + DataFormats/L1Scouting/src/classes_def.xml | 5 + .../interface/conversion.h | 20 +-- .../L1ScoutingRawToDigi/interface/masks.h | 8 +- .../L1ScoutingRawToDigi/interface/shifts.h | 2 + .../plugins/ScCALORawToDigi.cc | 153 +++++++++++++----- .../plugins/ScCALORawToDigi.h | 3 +- .../test/testScoutingRun3_unpackers.py | 4 +- .../Utilities/test/dumpScObjects.py | 9 +- 10 files changed, 265 insertions(+), 73 deletions(-) diff --git a/DataFormats/L1Scouting/interface/L1ScoutingCalo.h b/DataFormats/L1Scouting/interface/L1ScoutingCalo.h index 4adc413c5dc36..61f6f8cc1a2d3 100644 --- a/DataFormats/L1Scouting/interface/L1ScoutingCalo.h +++ b/DataFormats/L1Scouting/interface/L1ScoutingCalo.h @@ -14,6 +14,8 @@ namespace l1ScoutingRun3 { typedef OrbitCollection ScTauOrbitCollection; class ScEtSum; typedef OrbitCollection ScEtSumOrbitCollection; + class ScBxSums; + typedef OrbitCollection ScBxSumsOrbitCollection; class ScCaloObject { public: @@ -72,8 +74,12 @@ namespace l1ScoutingRun3 { int hwEt, int hwEta, int hwPhi, - int iso) - : ScCaloObject(hwEt, hwEta ,hwPhi , iso) {} + int hwQual) + : ScCaloObject(hwEt, hwEta ,hwPhi , hwQual) {} + + // store quality instead of iso + inline void setHwQual(int hwQual) { setHwIso(hwQual);} + inline int hwQual() const {return hwIso();} }; @@ -137,22 +143,123 @@ namespace l1ScoutingRun3 { inline int hwPhi() const {return hwPhi_;} inline l1t::EtSum::EtSumType type() const {return type_;} - // inline float Et() const { - // return et_scale_* hwEt_; - // } - // inline float phi() const { - // float fPhi = phi_scale_*hwPhi_; - // fPhi = fPhi>=M_PI ? fPhi-2.*M_PI : fPhi; - // return fPhi; - // } - private: int hwEt_; int hwPhi_; l1t::EtSum::EtSumType type_; + }; + + class ScBxSums { + + public: + ScBxSums() + : hwTotalEt_(0), hwTotalEtEm_(0), minBiasHFP0_(0), + hwTotalHt_(0), towerCount_(0), minBiasHFM0_(0), + hwMissEt_(0), hwMissEtPhi_(0), hwAsymEt_(0), minBiasHFP1_(0), + hwMissHt_(0), hwMissHtPhi_(0), hwAsymHt_(0), minBiasHFM1_(0), + hwMissEtHF_(0), hwMissEtHFPhi_(0), hwAsymEtHF_(0), + hwMissHtHF_(0), hwMissHtHFPhi_(0), hwAsymHtHF_(0), centrality_(0) + {} - // static constexpr float phi_scale_ = 2.*M_PI/144.; - // static constexpr float et_scale_ = 0.5; + ScBxSums( + int hwTotalEt, int hwTotalEtEm, int minBiasHFP0, + int hwTotalHt, int towerCount, int minBiasHFM0, + int hwMissEt, int hwMissEtPhi, int hwAsymEt, int minBiasHFP1, + int hwMissHt, int hwMissHtPhi, int hwAsymHt, int minBiasHFM1, + int hwMissEtHF, int hwMissEtHFPhi, int hwAsymEtHF, + int hwMissHtHF, int hwMissHtHFPhi, int hwAsymHtHF, int centrality + ) + : hwTotalEt_(hwTotalEt), hwTotalEtEm_(hwTotalEtEm), minBiasHFP0_(minBiasHFP0), + hwTotalHt_(hwTotalHt), towerCount_(towerCount), minBiasHFM0_(minBiasHFM0), + hwMissEt_(hwMissEt), hwMissEtPhi_(hwMissEtPhi), hwAsymEt_(hwAsymEt), + minBiasHFP1_(minBiasHFP1), hwMissHt_(hwMissHt), hwMissHtPhi_(hwMissHtPhi), + hwAsymHt_(hwAsymHt), minBiasHFM1_(minBiasHFM1), hwMissEtHF_(hwMissEtHF), + hwMissEtHFPhi_(hwMissEtHFPhi), hwAsymEtHF_(hwAsymEtHF), hwMissHtHF_(hwMissHtHF), + hwMissHtHFPhi_(hwMissHtHFPhi), hwAsymHtHF_(hwAsymHtHF), centrality_(centrality) + {} + + ScBxSums(const ScBxSums& other) = default; + ScBxSums(ScBxSums&& other) = default; + ScBxSums & operator=(const ScBxSums& other) = default; + ScBxSums & operator=(ScBxSums&& other) = default; + + void swap(ScBxSums& other){ + using std::swap; + swap(hwTotalEt_, other.hwTotalEt_); + swap(hwTotalEtEm_, other.hwTotalEtEm_); + swap(minBiasHFP0_, other.minBiasHFP0_); + swap(hwTotalHt_, other.hwTotalHt_); + swap(towerCount_, other.towerCount_); + swap(minBiasHFM0_, other.minBiasHFM0_); + swap(hwMissEt_, other.hwMissEt_); + swap(hwMissEtPhi_, other.hwMissEtPhi_); + swap(hwAsymEt_, other.hwAsymEt_); + swap(minBiasHFP1_, other.minBiasHFP1_); + swap(hwMissHt_, other.hwMissHt_); + swap(hwMissHtPhi_, other.hwMissHtPhi_); + swap(hwAsymHt_, other.hwAsymHt_); + swap(minBiasHFM1_, other.minBiasHFM1_); + swap(hwMissEtHF_, other.hwMissEtHF_); + swap(hwMissEtHFPhi_, other.hwMissEtHFPhi_); + swap(hwAsymEtHF_, other.hwAsymEtHF_); + swap(hwMissHtHF_, other.hwMissHtHF_); + swap(hwMissHtHFPhi_, other.hwMissHtHFPhi_); + swap(hwAsymHtHF_, other.hwAsymHtHF_); + swap(centrality_, other.centrality_); + + } + + inline void setHwTotalEt(int hwTotalEt) {hwTotalEt_ = hwTotalEt;} + inline void setHwTotalEtEm(int hwTotalEtEm) {hwTotalEtEm_ = hwTotalEtEm;} + inline void setMinBiasHFP0(int minBiasHFP0) {minBiasHFP0_ = minBiasHFP0;} + inline void setHwTotalHt(int hwTotalHt) {hwTotalHt_ = hwTotalHt;} + inline void setTowerCount(int towerCount) {towerCount_ = towerCount;} + inline void setMinBiasHFM0(int minBiasHFM0) {minBiasHFM0_ = minBiasHFM0;} + inline void setHwMissEt(int hwMissEt) {hwMissEt_ = hwMissEt;} + inline void setHwMissEtPhi(int hwMissEtPhi) {hwMissEtPhi_ = hwMissEtPhi;} + inline void setHwAsymEt(int hwAsymEt) {hwAsymEt_ = hwAsymEt;} + inline void setMinBiasHFP1(int minBiasHFP1) {minBiasHFP1_ = minBiasHFP1;} + inline void setHwMissHt(int hwMissHt) {hwMissHt_ = hwMissHt;} + inline void setHwMissHtPhi(int hwMissHtPhi) {hwMissHtPhi_ = hwMissHtPhi;} + inline void setHwAsymHt(int hwAsymHt) {hwAsymHt_ = hwAsymHt;} + inline void setMinBiasHFM1(int minBiasHFM1) {minBiasHFM1_ = minBiasHFM1;} + inline void setHwMissEtHF(int hwMissEtHF) {hwMissEtHF_ = hwMissEtHF;} + inline void setHwMissEtHFPhi(int hwMissEtHFPhi) {hwMissEtHFPhi_ = hwMissEtHFPhi;} + inline void setHwAsymEtHF(int hwAsymEtHF) {hwAsymEtHF_ = hwAsymEtHF;} + inline void setHwMissHtHF(int hwMissHtHF) {hwMissHtHF_ = hwMissHtHF;} + inline void setHwMissHtHFPhi(int hwMissHtHFPhi) {hwMissHtHFPhi_ = hwMissHtHFPhi;} + inline void setHwAsymHtHF(int hwAsymHtHF) {hwAsymHtHF_ = hwAsymHtHF;} + inline void setCentrality(int centrality) {centrality_ = centrality;} + + const int hwTotalEt() { return hwTotalEt_;} + const int hwTotalEtEm() { return hwTotalEtEm_;} + const int minBiasHFP0() { return minBiasHFP0_;} + const int hwTotalHt() { return hwTotalHt_;} + const int towerCount() { return towerCount_;} + const int minBiasHFM0() { return minBiasHFM0_;} + const int hwMissEt() { return hwMissEt_;} + const int hwMissEtPhi() { return hwMissEtPhi_;} + const int hwAsymEt() { return hwAsymEt_;} + const int minBiasHFP1() { return minBiasHFP1_;} + const int hwMissHt() { return hwMissHt_;} + const int hwMissHtPhi() { return hwMissHtPhi_;} + const int hwAsymHt() { return hwAsymHt_;} + const int minBiasHFM1() { return minBiasHFM1_;} + const int hwMissEtHF() { return hwMissEtHF_;} + const int hwMissEtHFPhi() { return hwMissEtHFPhi_;} + const int hwAsymEtHF() { return hwAsymEtHF_;} + const int hwMissHtHF() { return hwMissHtHF_;} + const int hwMissHtHFPhi() { return hwMissHtHFPhi_;} + const int hwAsymHtHF() { return hwAsymHtHF_;} + const int centrality() { return centrality_;} + + private: + int hwTotalEt_, hwTotalEtEm_, minBiasHFP0_; // sums from ET block + int hwTotalHt_, towerCount_, minBiasHFM0_; // sums from HT block + int hwMissEt_, hwMissEtPhi_, hwAsymEt_, minBiasHFP1_; // sums from EtMiss block + int hwMissHt_, hwMissHtPhi_, hwAsymHt_, minBiasHFM1_; // sums from HTMiss block + int hwMissEtHF_, hwMissEtHFPhi_, hwAsymEtHF_; // sums from ETHFMiss block + int hwMissHtHF_, hwMissHtHFPhi_, hwAsymHtHF_, centrality_; // sums from HTHFMiss block }; } // namespace l1ScoutingRun3 diff --git a/DataFormats/L1Scouting/src/classes.h b/DataFormats/L1Scouting/src/classes.h index 9cf7945282771..4e473b6ddd498 100644 --- a/DataFormats/L1Scouting/src/classes.h +++ b/DataFormats/L1Scouting/src/classes.h @@ -12,4 +12,5 @@ namespace l1ScoutingRun3 { edm::Wrapper ScEGammaOrbitCollectionWrapper; edm::Wrapper ScTauOrbitCollectionWrapper; edm::Wrapper ScEtSumOrbitCollectionWrapper; + edm::Wrapper ScBxSumsOrbitCollectionWrapper; } \ No newline at end of file diff --git a/DataFormats/L1Scouting/src/classes_def.xml b/DataFormats/L1Scouting/src/classes_def.xml index 88c0da686b26c..9296247961b8b 100644 --- a/DataFormats/L1Scouting/src/classes_def.xml +++ b/DataFormats/L1Scouting/src/classes_def.xml @@ -26,5 +26,10 @@ + + + + + \ No newline at end of file diff --git a/EventFilter/L1ScoutingRawToDigi/interface/conversion.h b/EventFilter/L1ScoutingRawToDigi/interface/conversion.h index 4fa75925a706e..a240dafd3f42c 100644 --- a/EventFilter/L1ScoutingRawToDigi/interface/conversion.h +++ b/EventFilter/L1ScoutingRawToDigi/interface/conversion.h @@ -4,6 +4,11 @@ #include "EventFilter/L1ScoutingRawToDigi/interface/scales.h" namespace l1ScoutingRun3 { + + inline float _setPhiRange(float phi) { + phi = phi >= M_PI ? phi-2.*M_PI : phi; + return phi; + } namespace ugmt { @@ -14,9 +19,8 @@ namespace l1ScoutingRun3 { return scales::eta_scale*hwEta; }; inline float fPhi(int hwPhi) { - float fPhi_ = scales::phi_scale*hwPhi; - fPhi_ = fPhi_>=M_PI ? fPhi_-2.*M_PI : fPhi_; - return fPhi_; + //float fPhi_ = scales::phi_scale*hwPhi; + return _setPhiRange(scales::phi_scale*hwPhi); }; inline float fPtUnconstrained(int hwPtUnconstrained) { return scales::ptunconstrained_scale*(hwPtUnconstrained-1); @@ -25,9 +29,8 @@ namespace l1ScoutingRun3 { return scales::eta_scale*hwEtaAtVtx; }; inline float fPhiAtVtx(int hwPhiAtVtx) { - float fPhi_ = scales::phi_scale*hwPhiAtVtx; - fPhi_ = fPhi_>=M_PI ? fPhi_-2.*M_PI : fPhi_; - return fPhi_; + //float fPhi_ = scales::phi_scale*hwPhiAtVtx; + return _setPhiRange(scales::phi_scale*hwPhiAtVtx); }; } // namespace ugmt @@ -41,9 +44,8 @@ namespace l1ScoutingRun3 { return scales::eta_scale*hwEta; }; inline float fPhi(int hwPhi) { - float fPhi_ = scales::phi_scale*hwPhi; - fPhi_ = fPhi_>= M_PI ? fPhi_-2.*M_PI : fPhi_; - return fPhi_; + //float fPhi_ = scales::phi_scale*hwPhi; + return _setPhiRange(scales::phi_scale*hwPhi); }; } // namespace demux diff --git a/EventFilter/L1ScoutingRawToDigi/interface/masks.h b/EventFilter/L1ScoutingRawToDigi/interface/masks.h index ba1fa65418790..add18839cf66b 100644 --- a/EventFilter/L1ScoutingRawToDigi/interface/masks.h +++ b/EventFilter/L1ScoutingRawToDigi/interface/masks.h @@ -43,6 +43,8 @@ namespace demux { static constexpr uint32_t ET = 0x07ff; static constexpr uint32_t eta = 0x00ff; static constexpr uint32_t phi = 0x00ff; + static constexpr uint32_t disp = 0x0001; + static constexpr uint32_t qual = 0x0003; }; // struct masksCaloEGamma{ @@ -69,17 +71,17 @@ namespace demux { static constexpr uint32_t HTEt = 0x0fff; // Et of HT object static constexpr uint32_t HTtowerCount = 0x1fff; - static constexpr uint32_t HTMinBiasHF = 0x0003; + static constexpr uint32_t HTMinBiasHF = 0x000f; static constexpr uint32_t ETmissEt = 0x0fff; static constexpr uint32_t ETmissPhi = 0x00ff; static constexpr uint32_t ETmissASYMET = 0x00ff; - static constexpr uint32_t ETmissMinBiasHF = 0x0003; + static constexpr uint32_t ETmissMinBiasHF = 0x000f; static constexpr uint32_t HTmissEt = 0x0fff; static constexpr uint32_t HTmissPhi = 0x00ff; static constexpr uint32_t HTmissASYMHT = 0x00ff; - static constexpr uint32_t HTmissMinBiasHF = 0x0003; + static constexpr uint32_t HTmissMinBiasHF = 0x000f; static constexpr uint32_t ETHFmissEt = 0x0fff; static constexpr uint32_t ETHFmissPhi = 0x00ff; diff --git a/EventFilter/L1ScoutingRawToDigi/interface/shifts.h b/EventFilter/L1ScoutingRawToDigi/interface/shifts.h index c5b278d938cd7..1d1bb04189e67 100644 --- a/EventFilter/L1ScoutingRawToDigi/interface/shifts.h +++ b/EventFilter/L1ScoutingRawToDigi/interface/shifts.h @@ -37,6 +37,8 @@ namespace demux { static constexpr uint32_t ET = 0; static constexpr uint32_t eta = 11; static constexpr uint32_t phi = 19; + static constexpr uint32_t disp = 27; + static constexpr uint32_t qual = 28; }; // struct shiftsCaloEGamma{ diff --git a/EventFilter/L1ScoutingRawToDigi/plugins/ScCALORawToDigi.cc b/EventFilter/L1ScoutingRawToDigi/plugins/ScCALORawToDigi.cc index 872d17c66527f..134292e68137d 100644 --- a/EventFilter/L1ScoutingRawToDigi/plugins/ScCALORawToDigi.cc +++ b/EventFilter/L1ScoutingRawToDigi/plugins/ScCALORawToDigi.cc @@ -9,14 +9,16 @@ ScCaloRawToDigi::ScCaloRawToDigi(const edm::ParameterSet& iConfig) { orbitBufferJets_ = std::vector>(3565); orbitBufferEGammas_ = std::vector>(3565); orbitBufferTaus_ = std::vector>(3565); - orbitBufferEtSums_ = std::vector>(3565); + // orbitBufferEtSums_ = std::vector>(3565); + orbitBufferEtSums_ = std::vector>(3565); nJetsOrbit_=0; nEGammasOrbit_=0; nTausOrbit_=0; nEtSumsOrbit_=0; produces().setBranchAlias( "ScJetOrbitCollection" ); produces().setBranchAlias( "ScTauOrbitCollection" ); produces().setBranchAlias( "ScEGammaOrbitCollection" ); - produces().setBranchAlias( "ScEtSumOrbitCollection" ); + // produces().setBranchAlias( "ScEtSumOrbitCollection" ); + produces().setBranchAlias( "ScBxSumsOrbitCollection" ); rawToken = consumes(srcInputTag); } @@ -36,7 +38,8 @@ void ScCaloRawToDigi::produce(edm::Event& iEvent, const edm::EventSetup& iSetup) std::unique_ptr unpackedJets(new ScJetOrbitCollection); std::unique_ptr unpackedTaus(new ScTauOrbitCollection); std::unique_ptr unpackedEGammas(new ScEGammaOrbitCollection); - std::unique_ptr unpackedEtSums(new ScEtSumOrbitCollection); + // std::unique_ptr unpackedEtSums(new ScEtSumOrbitCollection); + std::unique_ptr unpackedEtSums(new ScBxSumsOrbitCollection); if((sourceRawData.size()==0) && debug_ ){ std::cout << "No raw data for CALO source\n"; @@ -118,17 +121,18 @@ void ScCaloRawToDigi::unpackOrbit( void ScCaloRawToDigi::unpackLinkJets(uint32_t* dataBlock, int bx){ using namespace l1ScoutingRun3; - int32_t ET(0), Eta(0), Phi(0); + int32_t ET(0), Eta(0), Phi(0), Qual(0); for (uint32_t i=0; i<6; i++) { ET = ((dataBlock[i] >> demux::shiftsJet::ET) & demux::masksJet::ET); if (ET != 0) { - Eta = ((dataBlock[i] >> demux::shiftsJet::eta) & demux::masksJet::eta); - Phi = ((dataBlock[i] >> demux::shiftsJet::phi) & demux::masksJet::phi); + Eta = ((dataBlock[i] >> demux::shiftsJet::eta) & demux::masksJet::eta); + Phi = ((dataBlock[i] >> demux::shiftsJet::phi) & demux::masksJet::phi); + Qual = ((dataBlock[i] >> demux::shiftsJet::qual) & demux::masksJet::qual); if (Eta > 127) Eta = Eta - 256; - ScJet jet(ET, Eta, Phi, 0); + ScJet jet(ET, Eta, Phi, Qual); orbitBufferJets_[bx].push_back(jet); nJetsOrbit_ ++; @@ -204,58 +208,129 @@ void ScCaloRawToDigi::unpackLinkTaus(uint32_t* dataBlock, int bx){ void ScCaloRawToDigi::unpackEtSums(uint32_t* dataBlock, int bx){ using namespace l1ScoutingRun3; - int32_t ETEt(0), HTEt(0), ETmissEt(0), ETmissPhi(0), HTmissEt(0), HTmissPhi(0); + ScBxSums bxSums; + int32_t ETEt(0), ETEttem(0), ETMinBiasHFP0(0); // ET + int32_t HTEt(0), HTtowerCount(0), HTMinBiasHFM0(0); // HT + int32_t ETmissEt(0), ETmissPhi(0), ETmissASYMET(0), ETmissMinBiasHFP1(0); //ETMiss + int32_t HTmissEt(0), HTmissPhi(0), HTmissASYMHT(0), HTmissMinBiasHFM1(0); // HTMiss + int32_t ETHFmissEt(0), ETHFmissPhi(0), ETHFmissASYMETHF(0), ETHFmissCENT(0); // ETHFMiss + int32_t HTHFmissEt(0), HTHFmissPhi(0), HTHFmissASYMHTHF(0), HTHFmissCENT(0); // HTHFMiss + // ET ETEt = ((dataBlock[0] >> demux::shiftsESums::ETEt) & demux::masksESums::ETEt); - - ScEtSum sumTotEt(ETEt, 0, l1t::EtSum::EtSumType::kTotalEt); - orbitBufferEtSums_[bx].push_back(sumTotEt); + ETEttem = ((dataBlock[0] >> demux::shiftsESums::ETEttem) & demux::masksESums::ETEttem); + ETMinBiasHFP0 = ((dataBlock[0] >> demux::shiftsESums::ETMinBiasHF) & demux::masksESums::ETMinBiasHF); + + // orbitBufferEtSums_[bx].emplace_back(ScEtSum(ETEt, 0, l1t::EtSum::EtSumType::kTotalEt)); + // orbitBufferEtSums_[bx].emplace_back(ScEtSum(ETEttem, 0, l1t::EtSum::EtSumType::kTotalEtEm)); + // orbitBufferEtSums_[bx].emplace_back(ScEtSum(ETMinBiasHFP0, 0, l1t::EtSum::EtSumType::kMinBiasHFP0)); + bxSums.setHwTotalEt(ETEt); + bxSums.setHwTotalEtEm(ETEttem); + bxSums.setMinBiasHFP0(ETMinBiasHFP0); // HT HTEt = ((dataBlock[1] >> demux::shiftsESums::HTEt) & demux::masksESums::HTEt); + HTtowerCount = ((dataBlock[1] >> demux::shiftsESums::HTtowerCount) & demux::masksESums::HTtowerCount); + HTMinBiasHFM0 = ((dataBlock[1] >> demux::shiftsESums::HTMinBiasHF) & demux::masksESums::HTMinBiasHF); - ScEtSum sumTotHt(HTEt, 0, l1t::EtSum::EtSumType::kTotalHt); - orbitBufferEtSums_[bx].push_back(sumTotHt); + // orbitBufferEtSums_[bx].emplace_back(ScEtSum(HTEt, 0, l1t::EtSum::EtSumType::kTotalHt)); + // orbitBufferEtSums_[bx].emplace_back(ScEtSum(HTtowerCount, 0, l1t::EtSum::EtSumType::kTowerCount)); + // orbitBufferEtSums_[bx].emplace_back(ScEtSum(HTMinBiasHFM0, 0, l1t::EtSum::EtSumType::kMinBiasHFM0)); + + bxSums.setHwTotalHt(HTEt); + bxSums.setTowerCount(HTtowerCount); + bxSums.setMinBiasHFM0(HTMinBiasHFM0); // ETMiss ETmissEt = ((dataBlock[2] >> demux::shiftsESums::ETmissEt) & demux::masksESums::ETmissEt); ETmissPhi = ((dataBlock[2] >> demux::shiftsESums::ETmissPhi) & demux::masksESums::ETmissPhi); + ETmissASYMET = ((dataBlock[2] >> demux::shiftsESums::ETmissASYMET) & demux::masksESums::ETmissASYMET); + ETmissMinBiasHFP1 = ((dataBlock[2] >> demux::shiftsESums::ETmissMinBiasHF) & demux::masksESums::ETmissMinBiasHF); + + // orbitBufferEtSums_[bx].emplace_back(ScEtSum(ETmissEt, ETmissPhi, l1t::EtSum::EtSumType::kMissingEt)); + // orbitBufferEtSums_[bx].emplace_back(ScEtSum(ETmissASYMET, 0, l1t::EtSum::EtSumType::kAsymEt)); + // orbitBufferEtSums_[bx].emplace_back(ScEtSum(ETmissMinBiasHFP1, 0, l1t::EtSum::EtSumType::kMinBiasHFP1)); - ScEtSum sumMissEt(ETmissEt, ETmissPhi, l1t::EtSum::EtSumType::kMissingEt); - orbitBufferEtSums_[bx].push_back(sumMissEt); + bxSums.setHwMissEt(ETmissEt); + bxSums.setHwMissEtPhi(ETmissPhi); + bxSums.setHwAsymEt(ETmissASYMET); + bxSums.setMinBiasHFP1(ETmissMinBiasHFP1); // HTMiss HTmissEt = ((dataBlock[3] >> demux::shiftsESums::HTmissEt) & demux::masksESums::HTmissEt); HTmissPhi = ((dataBlock[3] >> demux::shiftsESums::HTmissPhi) & demux::masksESums::HTmissPhi); + HTmissASYMHT = ((dataBlock[3] >> demux::shiftsESums::HTmissASYMHT) & demux::masksESums::HTmissASYMHT); + HTmissMinBiasHFM1 = ((dataBlock[3] >> demux::shiftsESums::HTmissMinBiasHF) & demux::masksESums::HTmissMinBiasHF); + + // orbitBufferEtSums_[bx].emplace_back(ScEtSum(HTmissEt, HTmissPhi, l1t::EtSum::EtSumType::kMissingHt)); + // orbitBufferEtSums_[bx].emplace_back(ScEtSum(HTmissASYMHT, 0, l1t::EtSum::EtSumType::kAsymHt)); + // orbitBufferEtSums_[bx].emplace_back(ScEtSum(HTmissMinBiasHFM1, 0, l1t::EtSum::EtSumType::kMinBiasHFM1)); + + std::cout << "BX " << bx << ", Frame 3: " << std::endl; + std::cout << " Raw: 0x" << std::hex << dataBlock[3] << std::dec << "\n" + << " MHTEt: " << HTmissEt << ", MHTEt PHI: " << HTmissPhi << std::endl; + + bxSums.setHwMissHt(HTmissEt); + bxSums.setHwMissHtPhi(HTmissPhi); + bxSums.setHwAsymHt(HTmissASYMHT); + bxSums.setMinBiasHFM1(HTmissMinBiasHFM1); + + // ETHFMiss + ETHFmissEt = ((dataBlock[4] >> demux::shiftsESums::ETHFmissEt) & demux::masksESums::ETHFmissEt); + ETHFmissPhi = ((dataBlock[4] >> demux::shiftsESums::ETHFmissPhi) & demux::masksESums::ETHFmissPhi); + ETHFmissASYMETHF = ((dataBlock[4] >> demux::shiftsESums::ETHFmissASYMETHF) & demux::masksESums::ETHFmissASYMETHF); + ETHFmissCENT = ((dataBlock[4] >> demux::shiftsESums::ETHFmissCENT) & demux::masksESums::ETHFmissCENT); + + // orbitBufferEtSums_[bx].emplace_back(ScEtSum(ETHFmissEt, ETHFmissPhi, l1t::EtSum::EtSumType::kMissingEtHF)); + // orbitBufferEtSums_[bx].emplace_back(ScEtSum(ETHFmissASYMETHF, 0, l1t::EtSum::EtSumType::kAsymEtHF)); + + bxSums.setHwMissEtHF(ETHFmissEt); + bxSums.setHwMissEtHFPhi(ETHFmissPhi); + bxSums.setHwAsymEtHF(ETHFmissASYMETHF); + + // HTHFMiss + HTHFmissEt = ((dataBlock[5] >> demux::shiftsESums::ETHFmissEt) & demux::masksESums::ETHFmissEt); + HTHFmissPhi = ((dataBlock[5] >> demux::shiftsESums::ETHFmissPhi) & demux::masksESums::ETHFmissPhi); + HTHFmissASYMHTHF = ((dataBlock[5] >> demux::shiftsESums::ETHFmissASYMETHF) & demux::masksESums::ETHFmissASYMETHF); + HTHFmissCENT = ((dataBlock[5] >> demux::shiftsESums::ETHFmissCENT) & demux::masksESums::ETHFmissCENT); + + // orbitBufferEtSums_[bx].emplace_back(ScEtSum(HTHFmissEt, HTHFmissPhi, l1t::EtSum::EtSumType::kMissingHtHF)); + // orbitBufferEtSums_[bx].emplace_back(ScEtSum(HTHFmissASYMHTHF, 0, l1t::EtSum::EtSumType::kAsymHtHF)); + // orbitBufferEtSums_[bx].emplace_back(ScEtSum((HTHFmissCENT<<4) + ETHFmissCENT, 0, l1t::EtSum::EtSumType::kCentrality)); + + bxSums.setHwMissHtHF(HTHFmissEt); + bxSums.setHwMissHtHFPhi(HTHFmissPhi); + bxSums.setHwAsymHtHF(HTHFmissASYMHTHF); + bxSums.setCentrality((HTHFmissCENT<<4) + ETHFmissCENT); - ScEtSum sumMissHt(HTmissEt, HTmissPhi, l1t::EtSum::EtSumType::kMissingHt); - orbitBufferEtSums_[bx].push_back(sumMissHt); + // nEtSumsOrbit_ += 17; + nEtSumsOrbit_ += 1; - nEtSumsOrbit_ += 4; + orbitBufferEtSums_[bx].push_back(bxSums); if (debug_){ - std::cout << "Type: TotalET\n" - << " Raw: 0x" << std::hex << dataBlock[0] << std::dec << "\n" - << " Et [GeV/Hw]: " << demux::fEt(sumTotEt.hwEt()) << "/" << sumTotEt.hwEt() - << std::endl; - - std::cout << "Type: TotalHT\n" - << " Raw: 0x" << std::hex << dataBlock[1] << std::dec << "\n" - << " Et [GeV/Hw]: " << demux::fEt(sumTotEt.hwEt()) << "/" << sumTotEt.hwEt() - << std::endl; - - std::cout << "Type: ETMiss\n" - << " Raw: 0x" << std::hex << dataBlock[2] << std::dec << "\n" - << " Et [GeV/Hw]: " << demux::fEt(sumMissEt.hwEt()) << "/" << sumMissEt.hwEt() << "\n" - << " Phi [Rad/Hw]: " << demux::fPhi(sumMissEt.hwPhi()) << "/" << sumMissEt.hwPhi() - << std::endl; - - std::cout << "Type: HTMiss\n" - << " Raw: 0x" << std::hex << dataBlock[3] << std::dec << "\n" - << " Et [GeV/Hw]: " << demux::fEt(sumMissHt.hwEt()) << "/" << sumMissHt.hwEt() << "\n" - << " Phi [Rad/Hw]: " << demux::fPhi(sumMissHt.hwPhi()) << "/" << sumMissHt.hwPhi() - << std::endl; + // std::cout << "Type: TotalET\n" + // << " Raw: 0x" << std::hex << dataBlock[0] << std::dec << "\n" + // << " Et [GeV/Hw]: " << demux::fEt(sumTotEt.hwEt()) << "/" << sumTotEt.hwEt() + // << std::endl; + + // std::cout << "Type: TotalHT\n" + // << " Raw: 0x" << std::hex << dataBlock[1] << std::dec << "\n" + // << " Et [GeV/Hw]: " << demux::fEt(sumTotHt.hwEt()) << "/" << sumTotHt.hwEt() + // << std::endl; + + // std::cout << "Type: ETMiss\n" + // << " Raw: 0x" << std::hex << dataBlock[2] << std::dec << "\n" + // << " Et [GeV/Hw]: " << demux::fEt(sumMissEt.hwEt()) << "/" << sumMissEt.hwEt() << "\n" + // << " Phi [Rad/Hw]: " << demux::fPhi(sumMissEt.hwPhi()) << "/" << sumMissEt.hwPhi() + // << std::endl; + + // std::cout << "Type: HTMiss\n" + // << " Raw: 0x" << std::hex << dataBlock[3] << std::dec << "\n" + // << " Et [GeV/Hw]: " << demux::fEt(sumMissHt.hwEt()) << "/" << sumMissHt.hwEt() << "\n" + // << " Phi [Rad/Hw]: " << demux::fPhi(sumMissHt.hwPhi()) << "/" << sumMissHt.hwPhi() + // << std::endl; } } diff --git a/EventFilter/L1ScoutingRawToDigi/plugins/ScCALORawToDigi.h b/EventFilter/L1ScoutingRawToDigi/plugins/ScCALORawToDigi.h index 8ea8ec76260ad..49bc27351ceb6 100644 --- a/EventFilter/L1ScoutingRawToDigi/plugins/ScCALORawToDigi.h +++ b/EventFilter/L1ScoutingRawToDigi/plugins/ScCALORawToDigi.h @@ -47,7 +47,8 @@ class ScCaloRawToDigi : public edm::stream::EDProducer<> { std::vector> orbitBufferJets_; std::vector> orbitBufferEGammas_; std::vector> orbitBufferTaus_; - std::vector> orbitBufferEtSums_; + //std::vector> orbitBufferEtSums_; + std::vector> orbitBufferEtSums_; bool debug_ = false; edm::InputTag srcInputTag; diff --git a/EventFilter/Utilities/test/testScoutingRun3_unpackers.py b/EventFilter/Utilities/test/testScoutingRun3_unpackers.py index 84bfd757c99bd..eece932ed8623 100644 --- a/EventFilter/Utilities/test/testScoutingRun3_unpackers.py +++ b/EventFilter/Utilities/test/testScoutingRun3_unpackers.py @@ -53,7 +53,7 @@ process = cms.Process("SCPU") process.maxEvents = cms.untracked.PSet( - input = cms.untracked.int32(-1) + input = cms.untracked.int32(1) ) process.options = cms.untracked.PSet( @@ -102,7 +102,7 @@ ram_dir_path=options.buBaseDir+"/run"+str(options.runNumber).zfill(6)+"/" flist = [ - ram_dir_path + "run" + str(options.runNumber) + "_ls0340_index000028.raw" + ram_dir_path + "run" + str(options.runNumber) + "_ls0340_index000001.raw"#"_ls0340_index000028.raw" ] process.source = cms.Source("DAQSource", diff --git a/L1TriggerScouting/Utilities/test/dumpScObjects.py b/L1TriggerScouting/Utilities/test/dumpScObjects.py index 49c438686fffa..ff40699c4876b 100644 --- a/L1TriggerScouting/Utilities/test/dumpScObjects.py +++ b/L1TriggerScouting/Utilities/test/dumpScObjects.py @@ -44,12 +44,9 @@ #checkMuons = cms.untracked.bool(False), # test removing a collection searchEvent = cms.untracked.bool(True), - orbitNumber = cms.untracked.uint32(88985058), - searchStartBx = cms.untracked.uint32(2395-2), - searchStopBx = cms.untracked.uint32(2395+2), - #orbitNumber = cms.untracked.uint32(88981531), - #searchStartBx = cms.untracked.uint32(1027-2), - #searchStopBx = cms.untracked.uint32(1027+2), + orbitNumber = cms.untracked.uint32(88982581), + searchStartBx = cms.untracked.uint32(1484-2), + searchStopBx = cms.untracked.uint32(1484+2), ) process.p = cms.Path(