Skip to content
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

podio::DataSource #309

Merged
merged 32 commits into from
Oct 1, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
b6d1734
Integrating EDM4hep RDataSource
kjvbrt Aug 3, 2023
264899a
Add legacy reader
kjvbrt Aug 7, 2023
93fd3ac
Split off legacy reader
kjvbrt Aug 7, 2023
a2172d0
Protecting collection retrieval by mutex
kjvbrt Aug 8, 2023
58292c8
Add source test
kjvbrt Aug 14, 2023
96600f5
Updated man pages
kjvbrt Aug 15, 2023
33a357f
Renaming Source na DataSource
kjvbrt Aug 15, 2023
ca7e91e
Adding source test for run stages
kjvbrt Oct 3, 2023
ccd3671
Add tests for the standalone mode
kjvbrt Oct 12, 2023
da73dbb
Adding test files per process for histmaker
kjvbrt Oct 26, 2023
616a827
Adding selector by size and sorter by pT
kjvbrt Nov 15, 2023
2187e48
Few more analyzers
kjvbrt Nov 16, 2023
a61b6cf
Putting back things omitted from run_analysis.py
kjvbrt Jan 25, 2024
1530e5e
Adding e4hsource in LD_LIBRARY_PATH for managed tests
kjvbrt Jan 25, 2024
285a170
Making building of the source optional
kjvbrt Mar 1, 2024
e1aa165
Removed legacy support
kjvbrt Mar 1, 2024
9d74103
Separated analyzers using Collections into independent headers
kjvbrt Mar 4, 2024
258813c
Reimplementing analyzers needed for the stage1 of the example analysis
kjvbrt Mar 8, 2024
311379b
Adjusitng test input files
kjvbrt Mar 8, 2024
27dcbbd
Moving recoParticle definition
kjvbrt May 3, 2024
97db64b
Changes to use podio::ROOTDataSource
kjvbrt May 6, 2024
b1b76c3
using podio::DataSource
kjvbrt Aug 28, 2024
ce2981f
Adjusting stages source example
kjvbrt Sep 18, 2024
005ac4e
Adding C++ analysis tests
kjvbrt Sep 19, 2024
53f3402
Updating examples
kjvbrt Sep 20, 2024
7bd35ce
Formatting
kjvbrt Sep 20, 2024
d1aad33
Removing e4hsource
kjvbrt Sep 20, 2024
c2aa199
Adjust clang-format check
kjvbrt Sep 20, 2024
eb6dffe
Formatting
kjvbrt Sep 20, 2024
026ff54
Using PodioSource namespace
kjvbrt Oct 1, 2024
c0eb383
Adding .cache to .gitignore
kjvbrt Oct 1, 2024
26240f1
Formatting
kjvbrt Oct 1, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Protecting collection retrieval by mutex
  • Loading branch information
kjvbrt committed Oct 1, 2024
commit a2172d0c557543e3629137c20ca668f7092d55e8
4 changes: 0 additions & 4 deletions analyzers/dataframe/src/Track.cc
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,6 @@ namespace FCCAnalyses {
getD0 (const edm4hep::TrackCollection& inColl) {
ROOT::VecOps::RVec<std::size_t> result;
for (const auto& track: inColl) {
if (track.getTrackStates().size() > 1) {
std::cout << "Track with more than one state encountered!"
<< std::endl;
}
for (const auto& trackState: track.getTrackStates()) {
result.push_back(trackState.D0);
break;
Expand Down
13 changes: 7 additions & 6 deletions e4hsource/include/EDM4hepSource/EDM4hepLegacySource.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@
#define EDM4HEP_LEGACY_SOURCE_H__

// STL
#include <memory>
#include <vector>
#include <string>
#include <functional>
#include <shared_mutex>
#include <mutex>

// ROOT
#include <ROOT/RDataFrame.hxx>
Expand Down Expand Up @@ -75,12 +76,12 @@ namespace FCCAnalyses {
std::vector<std::vector<const podio::CollectionBase*>> m_Collections;
/// Active collections
std::vector<unsigned int> m_activeCollections;
/// Root legacy podio reader
std::map<int, podio::ROOTLegacyReader> m_podioReaders;
/// Root legacy podio readers
std::vector<std::unique_ptr<podio::ROOTLegacyReader>> m_podioReaders;
/// Podio frames
std::map<int, podio::Frame> m_frames;
/// Mutex to protect frame map
mutable std::shared_mutex m_frames_mutex;
std::vector<std::unique_ptr<podio::Frame>> m_frames;
/// Mutex to protect frame
std::mutex m_frames_mutex;
/// Setup input
void SetupInput(int nEvents);
};
Expand Down
19 changes: 8 additions & 11 deletions e4hsource/include/EDM4hepSource/EDM4hepSource.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#define EDM4HEP_SOURCE_H__

// STL
#include <podio/ROOTLegacyReader.h>
#include <memory>
#include <vector>
#include <string>
#include <functional>
Expand All @@ -14,7 +14,6 @@
// Podio
#include <podio/Frame.h>
#include <podio/ROOTFrameReader.h>
#include <podio/ROOTLegacyReader.h>
#include <podio/CollectionBase.h>

bool loadEDM4hepSource();
Expand Down Expand Up @@ -76,26 +75,24 @@ namespace FCCAnalyses {
std::vector<std::vector<const podio::CollectionBase*>> m_Collections;
/// Active collections
std::vector<unsigned int> m_activeCollections;
/// Root podio reader
std::map<int, podio::ROOTFrameReader> m_podioReaders;
/// Legacy Root podio reader
std::map<int, podio::ROOTLegacyReader> m_podioLegacyReaders;
/// Root podio readers
std::vector<std::unique_ptr<podio::ROOTFrameReader>> m_podioReaders;
/// Podio frames
std::map<int, podio::Frame> m_frames;
/// Legacy Podio reader
bool m_useLegacyReaders;
std::vector<std::unique_ptr<podio::Frame>> m_frames;
/// Setup input
void SetupInput(int nEvents);
};


/**
* \brief Retrieve from EDM4hepSource per-thread readers for the desired columns.
* \brief Retrieve from EDM4hepSource per-thread readers for the
* desired columns.
*/
template<typename T>
std::vector<T**>
EDM4hepSource::GetColumnReaders(std::string_view columnName) {
std::cout << "EDM4hepSource: Getting column readers for column: " << columnName << std::endl;
std::cout << "EDM4hepSource: Getting column readers for column: "
<< columnName << std::endl;

std::vector<T**> readers;

Expand Down
Loading