-
Notifications
You must be signed in to change notification settings - Fork 121
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Integrating EDM4hep RDataSource * Add legacy reader * Split off legacy reader * Protecting collection retrieval by mutex * Add source test * Updated man pages * Renaming Source na DataSource * Adding source test for run stages * Add tests for the standalone mode * Adding test files per process for histmaker * Adding selector by size and sorter by pT * Few more analyzers * Putting back things omitted from run_analysis.py * Adding e4hsource in LD_LIBRARY_PATH for managed tests * Making building of the source optional * Removed legacy support * Separated analyzers using Collections into independent headers * Reimplementing analyzers needed for the stage1 of the example analysis * Adjusitng test input files * Moving recoParticle definition * Changes to use podio::ROOTDataSource * using podio::DataSource * Adjusting stages source example * Adding C++ analysis tests * Updating examples * Formatting * Removing e4hsource * Adjust clang-format check * Formatting * Using PodioSource namespace * Adding .cache to .gitignore * Formatting
- Loading branch information
Showing
37 changed files
with
1,966 additions
and
132 deletions.
There are no files selected for viewing
This file contains 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 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 |
---|---|---|
|
@@ -17,6 +17,7 @@ __pycache__/ | |
# Editors | ||
*~ | ||
.vimlocal | ||
.cache/ | ||
|
||
# Distribution / packaging | ||
.Python | ||
|
This file contains 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 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 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 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 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,92 @@ | ||
#ifndef SOURCE_LINK_ANALYZERS_H | ||
#define SOURCE_LINK_ANALYZERS_H | ||
|
||
// EDM4hep | ||
#include "edm4hep/RecoMCParticleLinkCollection.h" | ||
|
||
namespace FCCAnalyses ::PodioSource ::Link { | ||
/** | ||
* \brief Analyzer to select links where the MC particle has a specified PDG | ||
* ID. | ||
* | ||
* \param[in] pdg Desired PDG ID of the MC particle. | ||
*/ | ||
struct selPDG { | ||
const int m_pdg; | ||
|
||
explicit selPDG(const int pdg) : m_pdg(pdg){}; | ||
|
||
template <typename T> T operator()(const T &inLinkColl) { | ||
T result; | ||
result.setSubsetCollection(); | ||
|
||
for (const auto &link : inLinkColl) { | ||
const auto &particle = link.getTo(); | ||
if (particle.getPDG() == m_pdg) { | ||
result.push_back(link); | ||
} | ||
} | ||
|
||
return result; | ||
} | ||
}; | ||
|
||
/** | ||
* \brief Analyzer to select links where MC particle has a specified absolute | ||
* value of PDG ID. | ||
* | ||
* \param pdg[in] Desired absolute value of PDG ID of the MC particle. | ||
*/ | ||
struct selAbsPDG { | ||
const int m_pdg; | ||
|
||
explicit selAbsPDG(const int pdg) : m_pdg(pdg) { | ||
if (m_pdg < 0) { | ||
throw std::invalid_argument("FCCAnalyses::PodioSource::Link::sel_absPDG: " | ||
"Received negative value!"); | ||
} | ||
}; | ||
|
||
template <typename T> auto operator()(const T &inLinkColl) { | ||
T result; | ||
result.setSubsetCollection(); | ||
|
||
for (const auto &link : inLinkColl) { | ||
const auto &particle = link.getTo(); | ||
if (std::abs(particle.getPDG()) == m_pdg) { | ||
result.push_back(link); | ||
} | ||
} | ||
|
||
return result; | ||
}; | ||
}; | ||
|
||
/** | ||
* \brief Analyzer to select links where the MC particle has a specified | ||
* generator status. | ||
* | ||
* \param status[in] Desired generator status of the particle. | ||
*/ | ||
struct selGenStatus { | ||
const int m_status; | ||
|
||
explicit selGenStatus(const int status) : m_status(status){}; | ||
|
||
template <typename T> T operator()(const T &inLinkColl) { | ||
T result; | ||
result.setSubsetCollection(); | ||
|
||
for (const auto &link : inLinkColl) { | ||
const auto &particle = link.getTo(); | ||
if (particle.getGeneratorStatus() == m_status) { | ||
result.push_back(link); | ||
} | ||
} | ||
|
||
return result; | ||
} | ||
}; | ||
} // namespace FCCAnalyses::PodioSource::Link | ||
|
||
#endif /* SOURCE_LINK_ANALYZERS_H */ |
This file contains 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
Oops, something went wrong.