-
Notifications
You must be signed in to change notification settings - Fork 4.6k
Introduce L1ScoutingNanoAOD for Run3 #48163
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
cmsbuild
merged 12 commits into
cms-sw:master
from
patinkaew:l1scouting_nano_dev_15_1_0_pre3
Aug 11, 2025
Merged
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
3efc42c
add bxOffsets getter
patinkaew 753adff
change beginData to protected in FlatTable for OrbitFlatTable
patinkaew dd9c7ab
add OrbitFlatTable
patinkaew 9085c00
add OrbitOutputModule, OrbitOutputBranches, and SelectedBxTableOutput…
patinkaew b71b7ac
add SimpleOrbitFlatTableProducer
patinkaew 9fb65be
add L1ScoutingPhysicalValueMapProducer for producing physical values …
patinkaew ed370b2
add L1ScoutingEtSumOrbitFlatTableProducer to produce OrbitFlatTable f…
patinkaew 4a42a26
add configuration files for L1ScoutingNano
patinkaew ef691dd
add L1ScoutingNano to autoNano
patinkaew 5005b94
add relval_nano for L1ScoutingNano
patinkaew 023d550
apply code check and code format
patinkaew 7fa4b88
move OrbitFlatTable to DataFormats/NanoAOD, as suggested by Matti
patinkaew File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,102 @@ | ||
| #ifndef DataFormats_L1Scouting_OrbitFlatTable_h | ||
| #define DataFormats_L1Scouting_OrbitFlatTable_h | ||
|
|
||
| /** | ||
| * A cross-breed of a FlatTable and an OrbitCollection | ||
| */ | ||
|
|
||
| #include "DataFormats/NanoAOD/interface/FlatTable.h" | ||
|
|
||
| #include <cstdint> | ||
| #include <vector> | ||
| #include <string> | ||
| #include <type_traits> | ||
|
|
||
| namespace l1ScoutingRun3 { | ||
|
|
||
| class OrbitFlatTable : public nanoaod::FlatTable { | ||
| public: | ||
| static constexpr unsigned int NBX = 3564; | ||
|
|
||
| OrbitFlatTable() : nanoaod::FlatTable(), bxOffsets_(orbitBufferSize_ + 1, 0) {} | ||
|
|
||
| OrbitFlatTable(std::vector<unsigned> bxOffsets, | ||
| const std::string &name, | ||
| bool singleton = false, | ||
| bool extension = false) | ||
| : nanoaod::FlatTable(bxOffsets.back(), name, singleton, extension), bxOffsets_(bxOffsets) { | ||
| if (bxOffsets.size() != orbitBufferSize_ + 1) { | ||
| throw cms::Exception("LogicError") << "Mismatch between bxOffsets.size() " << bxOffsets.size() | ||
| << " and orbitBufferSize_ + 1" << (orbitBufferSize_ + 1); | ||
| } | ||
| } | ||
|
|
||
| ~OrbitFlatTable() {} | ||
|
|
||
| using FlatTable::nRows; | ||
| using FlatTable::size; | ||
|
|
||
| /// number of rows for single BX | ||
| unsigned int nRows(unsigned bx) const { | ||
| if (bx >= orbitBufferSize_) | ||
| throwBadBx(bx); | ||
| return bxOffsets_[bx + 1] - bxOffsets_[bx]; | ||
| }; | ||
| unsigned int size(unsigned bx) const { return nRows(bx); } | ||
|
|
||
| /// get a column by index (const) | ||
| template <typename T> | ||
| auto columnData(unsigned int column) const { | ||
| return nanoaod::FlatTable::columnData<T>(column); | ||
| } | ||
|
|
||
| /// get a column by index and bx (const) | ||
| template <typename T> | ||
| auto columnData(unsigned int column, unsigned bx) const { | ||
| if (bx >= orbitBufferSize_) | ||
| throwBadBx(bx); | ||
| auto begin = beginData<T>(column); | ||
| return std::span(begin + bxOffsets_[bx], begin + bxOffsets_[bx + 1]); | ||
| } | ||
|
|
||
| /// get a column by index (non-const) | ||
| template <typename T> | ||
| auto columnData(unsigned int column) { | ||
| return nanoaod::FlatTable::columnData<T>(column); | ||
| } | ||
|
|
||
| /// get a column by index and bx (non-const) | ||
| template <typename T> | ||
| auto columnData(unsigned int column, unsigned bx) { | ||
| if (bx >= orbitBufferSize_) | ||
| throwBadBx(bx); | ||
| auto begin = beginData<T>(column); | ||
| return std::span(begin + bxOffsets_[bx], begin + bxOffsets_[bx + 1]); | ||
| } | ||
|
|
||
| /// get a column value for singleton (const) | ||
| template <typename T> | ||
| const auto &columValue(unsigned int column, unsigned bx) const { | ||
| if (!singleton()) | ||
| throw cms::Exception("LogicError", "columnValue works only for singleton tables"); | ||
| if (bx >= orbitBufferSize_ || bxOffsets_[bx + 1] == bxOffsets_[bx]) | ||
| throwBadBx(bx); | ||
| auto begin = beginData<T>(column); | ||
| return *(begin + bxOffsets_[bx]); | ||
| } | ||
|
|
||
| private: | ||
| std::vector<unsigned> bxOffsets_; | ||
|
|
||
| // there are 3564 BX in one orbtit [1,3564], one extra | ||
| // count added to keep first entry of the vector | ||
| static constexpr int orbitBufferSize_ = NBX + 1; | ||
|
|
||
| [[noreturn]] void throwBadBx(unsigned bx) const { | ||
| throw cms::Exception("OrbitFlatTable") << "Trying to access bad bx " << bx; | ||
| } | ||
| }; | ||
|
|
||
| } // namespace l1ScoutingRun3 | ||
|
|
||
| #endif |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,7 @@ | ||
| #include "Rtypes.h" | ||
|
|
||
| #include "DataFormats/NanoAOD/interface/FlatTable.h" | ||
| #include "DataFormats/NanoAOD/interface/OrbitFlatTable.h" | ||
| #include "DataFormats/NanoAOD/interface/MergeableCounterTable.h" | ||
| #include "DataFormats/NanoAOD/interface/UniqueString.h" | ||
| #include "DataFormats/Common/interface/Wrapper.h" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,8 +1,15 @@ | ||
| <use name="tbb"/> | ||
| <use name="FWCore/Framework"/> | ||
| <use name="FWCore/ParameterSet"/> | ||
| <use name="FWCore/PluginManager"/> | ||
| <use name="IOPool/Provenance"/> | ||
| <use name="DataFormats/Common"/> | ||
| <use name="DataFormats/L1Trigger"/> | ||
| <use name="DataFormats/L1Scouting"/> | ||
| <use name="DataFormats/NanoAOD"/> | ||
| <use name="PhysicsTools/NanoAOD"/> | ||
| <use name="EventFilter/Utilities"/> | ||
| <use name="L1TriggerScouting/Utilities"/> | ||
| <use name="CommonTools/Utils"/> | ||
| <use name="Utilities/General"/> | ||
| <flags EDM_PLUGIN="1"/> |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like these two lines overflow the WF counter.
My naive suggestion for now would be to move the L1Scounting to a new series (2500.28x). I also leave it for the others to comment.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@patinkaew -- please, have a look at #48459
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ftorrresd thank you!
Sorry for a late reply, we had a discussion during L1Scouting Weekly today also and we are fine with moving to a new series. However, I think the new PR to extend the workflow numbers can work really well also. I will keep on eye on #48459 and once that is merged, I will rebase this PR.