diff --git a/DataFormats/Scouting/interface/Run3ScoutingHBHERecHit.h b/DataFormats/Scouting/interface/Run3ScoutingHBHERecHit.h index b6ce363eca166..dac6107c09349 100644 --- a/DataFormats/Scouting/interface/Run3ScoutingHBHERecHit.h +++ b/DataFormats/Scouting/interface/Run3ScoutingHBHERecHit.h @@ -11,15 +11,17 @@ class Run3ScoutingHBHERecHit { public: - Run3ScoutingHBHERecHit(float energy, unsigned int detId) : energy_{energy}, detId_{detId} {} + Run3ScoutingHBHERecHit(float energy, float time, unsigned int detId) : energy_{energy}, time_{time}, detId_{detId} {} - Run3ScoutingHBHERecHit() : energy_{0}, detId_{0} {} + Run3ScoutingHBHERecHit() : energy_{0}, time_{0}, detId_{0} {} float energy() const { return energy_; } + float time() const { return time_; } unsigned int detId() const { return detId_; } private: float energy_; + float time_; unsigned int detId_; }; diff --git a/DataFormats/Scouting/src/classes_def.xml b/DataFormats/Scouting/src/classes_def.xml index 9832fd314a799..2643226f19d89 100644 --- a/DataFormats/Scouting/src/classes_def.xml +++ b/DataFormats/Scouting/src/classes_def.xml @@ -70,8 +70,9 @@ - + + diff --git a/DataFormats/Scouting/test/TestReadRun3Scouting.cc b/DataFormats/Scouting/test/TestReadRun3Scouting.cc index 3908f9a272173..2016531e3c7fc 100644 --- a/DataFormats/Scouting/test/TestReadRun3Scouting.cc +++ b/DataFormats/Scouting/test/TestReadRun3Scouting.cc @@ -224,9 +224,9 @@ namespace edmtest { if (expectedEERecHitIntegralValues_.size() != 1) { throwWithMessageFromConstructor("test configuration error, expectedEERecHitIntegralValues must have size 1"); } - if (expectedHBHERecHitFloatingPointValues_.size() != 1) { + if (expectedHBHERecHitFloatingPointValues_.size() != 2) { throwWithMessageFromConstructor( - "test configuration error, expectedHBHERecHitFloatingPointValues must have size 1"); + "test configuration error, expectedHBHERecHitFloatingPointValues must have size 2"); } if (expectedHBHERecHitIntegralValues_.size() != 1) { throwWithMessageFromConstructor("test configuration error, expectedHBHERecHitIntegralValues must have size 1"); @@ -1328,6 +1328,11 @@ namespace edmtest { if (hbheRecHit.detId() != static_cast(expectedHBHERecHitIntegralValues_[0] + iOffset)) { throwWithMessage("analyzeHBHERecHits, detId does not equal expected value"); } + if (inputHBHERecHitClassVersion_ == 4) { + if (hbheRecHit.time() != expectedHBHERecHitFloatingPointValues_[1] + offset) { + throwWithMessage("analyzeHBHERecHits, time does not equal expected value"); + } + } ++i; } } diff --git a/DataFormats/Scouting/test/TestWriteRun3Scouting.cc b/DataFormats/Scouting/test/TestWriteRun3Scouting.cc index ce78259a76979..b7a41f56519ef 100644 --- a/DataFormats/Scouting/test/TestWriteRun3Scouting.cc +++ b/DataFormats/Scouting/test/TestWriteRun3Scouting.cc @@ -199,8 +199,8 @@ namespace edmtest { if (eeRecHitsIntegralValues_.size() != 1) { throwWithMessage("eeRecHitsIntegralValues must have 1 elements and it does not"); } - if (hbheRecHitsFloatingPointValues_.size() != 1) { - throwWithMessage("hbheRecHitsFloatingPointValues must have 1 elements and it does not"); + if (hbheRecHitsFloatingPointValues_.size() != 2) { + throwWithMessage("hbheRecHitsFloatingPointValues must have 2 elements and it does not"); } if (hbheRecHitsIntegralValues_.size() != 1) { throwWithMessage("hbheRecHitsIntegralValues must have 1 elements and it does not"); @@ -696,6 +696,7 @@ namespace edmtest { int iOffset = static_cast(iEvent.id().event() + i); run3ScoutingHBHERecHits->emplace_back(static_cast(hbheRecHitsFloatingPointValues_[0] + offset), + static_cast(hbheRecHitsFloatingPointValues_[1] + offset), static_cast(hbheRecHitsIntegralValues_[0] + iOffset)); } iEvent.put(hbheRecHitsPutToken_, std::move(run3ScoutingHBHERecHits)); diff --git a/DataFormats/Scouting/test/create_Run3Scouting_test_file_cfg.py b/DataFormats/Scouting/test/create_Run3Scouting_test_file_cfg.py index d21dbbe3231ce..dd091b6924173 100644 --- a/DataFormats/Scouting/test/create_Run3Scouting_test_file_cfg.py +++ b/DataFormats/Scouting/test/create_Run3Scouting_test_file_cfg.py @@ -105,7 +105,7 @@ 17 ), hbheRecHitsFloatingPointValues = cms.vdouble( - 18.0 + 18.0, 28.0 ), hbheRecHitsIntegralValues = cms.vint32( 18 diff --git a/DataFormats/Scouting/test/test_readRun3Scouting_cfg.py b/DataFormats/Scouting/test/test_readRun3Scouting_cfg.py index c5df810af5237..4e580e8d545e0 100644 --- a/DataFormats/Scouting/test/test_readRun3Scouting_cfg.py +++ b/DataFormats/Scouting/test/test_readRun3Scouting_cfg.py @@ -10,7 +10,7 @@ parser.add_argument("--vertexVersion", type=int, help="vertex data format version (default: 4)", default=4) parser.add_argument("--ebRecHitVersion", type=int, help="EBRecHit data format version (default: 3)", default=3) parser.add_argument("--eeRecHitVersion", type=int, help="EERecHit data format version (default: 3)", default=3) -parser.add_argument("--hbheRecHitVersion", type=int, help="HBHERecHit data format version (default: 3)", default=3) +parser.add_argument("--hbheRecHitVersion", type=int, help="HBHERecHit data format version (default: 4)", default=4) parser.add_argument("--inputFile", type=str, help="Input file name (default: testRun3Scouting.root)", default="testRun3Scouting.root") parser.add_argument("--outputFileName", type=str, help="Output file name (default: testRun3Scouting2.root)", default="testRun3Scouting2.root") parser.add_argument("-f", "--fixStreamerInfo", action="store_true") @@ -132,7 +132,7 @@ eeRecHitsTag = cms.InputTag("run3ScoutingProducer", "", "PROD"), hbheRecHitClassVersion = cms.int32(args.hbheRecHitVersion), expectedHBHERecHitFloatingPointValues = cms.vdouble( - 18.0 + 18.0, 28.0 ), expectedHBHERecHitIntegralValues = cms.vint32( 18 diff --git a/HLTrigger/special/plugins/HLTScoutingRecHitProducer.cc b/HLTrigger/special/plugins/HLTScoutingRecHitProducer.cc index f65477d1d8971..df82073eceff0 100644 --- a/HLTrigger/special/plugins/HLTScoutingRecHitProducer.cc +++ b/HLTrigger/special/plugins/HLTScoutingRecHitProducer.cc @@ -129,7 +129,9 @@ void HLTScoutingRecHitProducer::produceHcal(edm::Event& iEvent, } run3ScoutHBHERecHits->emplace_back( - MiniFloatConverter::reduceMantissaToNbitsRounding(rh.energy(), mantissaPrecision), rh.detId()); + MiniFloatConverter::reduceMantissaToNbitsRounding(rh.energy(), mantissaPrecision), + MiniFloatConverter::reduceMantissaToNbitsRounding(rh.time(), mantissaPrecision), + rh.detId()); } iEvent.put(std::move(run3ScoutHBHERecHits), "HBHE" + tag);