Skip to content

Commit

Permalink
Using PodioSource namespace
Browse files Browse the repository at this point in the history
  • Loading branch information
kjvbrt committed Oct 1, 2024
1 parent eb6dffe commit 026ff54
Show file tree
Hide file tree
Showing 8 changed files with 21 additions and 22 deletions.
18 changes: 9 additions & 9 deletions analyzers/dataframe/FCCAnalyses/LinkSource.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,17 @@
// EDM4hep
#include "edm4hep/RecoMCParticleLinkCollection.h"

namespace FCCAnalyses ::Source ::Link {
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 sel_PDG {
struct selPDG {
const int m_pdg;

explicit sel_PDG(const int pdg) : m_pdg(pdg){};
explicit selPDG(const int pdg) : m_pdg(pdg){};

template <typename T> T operator()(const T &inLinkColl) {
T result;
Expand All @@ -37,13 +37,13 @@ struct sel_PDG {
*
* \param pdg[in] Desired absolute value of PDG ID of the MC particle.
*/
struct sel_absPDG {
struct selAbsPDG {
const int m_pdg;

explicit sel_absPDG(const int pdg) : m_pdg(pdg) {
explicit selAbsPDG(const int pdg) : m_pdg(pdg) {
if (m_pdg < 0) {
throw std::invalid_argument(
"FCCAnalyses::Source::Link::sel_absPDG: Received negative value!");
"FCCAnalyses::PodioSource::Link::sel_absPDG: Received negative value!");
}
};

Expand All @@ -68,10 +68,10 @@ struct sel_absPDG {
*
* \param status[in] Desired generator status of the particle.
*/
struct sel_genStatus {
struct selGenStatus {
const int m_status;

explicit sel_genStatus(const int status) : m_status(status){};
explicit selGenStatus(const int status) : m_status(status){};

template <typename T> T operator()(const T &inLinkColl) {
T result;
Expand All @@ -87,6 +87,6 @@ struct sel_genStatus {
return result;
}
};
} // namespace FCCAnalyses::Source::Link
} // namespace FCCAnalyses::PodioSource::Link

#endif /* SOURCE_LINK_ANALYZERS_H */
6 changes: 3 additions & 3 deletions analyzers/dataframe/FCCAnalyses/ReconstructedParticleSource.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#include "edm4hep/RecoMCParticleLinkCollection.h"
#include "edm4hep/ReconstructedParticleCollection.h"

namespace FCCAnalyses ::Source ::ReconstructedParticle {
namespace FCCAnalyses ::PodioSource ::ReconstructedParticle {
// -------------------- Selectors -----------------------------------------

/**
Expand Down Expand Up @@ -235,8 +235,8 @@ struct recoilBuilder {
operator()(const edm4hep::ReconstructedParticleCollection &inColl);
};

} // namespace FCCAnalyses::Source::ReconstructedParticle
} // namespace FCCAnalyses ::PodioSource ::ReconstructedParticle

// namespace recoParticle = FCCAnalyses::Source::ReconstructedParticle;
// namespace recoParticle = FCCAnalyses::PodioSource::ReconstructedParticle;

#endif /* ANALYZERS_SOURCE_RECONSTRUCTED_PARTICLE_H */
4 changes: 2 additions & 2 deletions analyzers/dataframe/FCCAnalyses/TrackSource.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#include "edm4hep/TrackCollection.h"
#include "edm4hep/TrackMCParticleLinkCollection.h"

namespace FCCAnalyses ::Source ::Track {
namespace FCCAnalyses ::PodioSource ::Track {
/**
* \brief Analyzer to select tracks associated with a MC particle of a
* specified PDG ID.
Expand Down Expand Up @@ -40,6 +40,6 @@ getNstates(const edm4hep::TrackCollection &inColl);
*
*/
ROOT::VecOps::RVec<float> getD0(const edm4hep::TrackCollection &inColl);
} // namespace FCCAnalyses::Source::Track
} // namespace FCCAnalyses::PodioSource::Track

#endif /* ANALYZERS_SOURCE_TRACK_H */
4 changes: 2 additions & 2 deletions analyzers/dataframe/src/ReconstructedParticleSource.cc
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
// EDM4hep
#include <edm4hep/utils/kinematics.h>

namespace FCCAnalyses ::Source ::ReconstructedParticle {
namespace FCCAnalyses ::PodioSource ::ReconstructedParticle {
selPDG::selPDG(const int pdg) : m_pdg(pdg){};

edm4hep::ReconstructedParticleCollection
Expand Down Expand Up @@ -297,4 +297,4 @@ edm4hep::ReconstructedParticleCollection recoilBuilder::operator()(
return result;
};

} // namespace FCCAnalyses::Source::ReconstructedParticle
} // namespace FCCAnalyses::PodioSource::ReconstructedParticle
4 changes: 2 additions & 2 deletions analyzers/dataframe/src/TrackSource.cc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include "FCCAnalyses/TrackSource.h"

namespace FCCAnalyses ::Source ::Track {
namespace FCCAnalyses ::PodioSource ::Track {
selPDG::selPDG(const int pdg, const bool chargeConjugateAllowed)
: m_pdg(pdg), m_chargeConjugateAllowed(chargeConjugateAllowed){};

Expand Down Expand Up @@ -46,4 +46,4 @@ ROOT::VecOps::RVec<float> getD0(const edm4hep::TrackCollection &inColl) {

return result;
}
} // namespace FCCAnalyses::Source::Track
} // namespace FCCAnalyses::PodioSource::Track
2 changes: 1 addition & 1 deletion examples/data_source/standalone.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def main():
ROOT.gSystem.Load('libFCCAnalyses')
if ROOT.dummyLoader:
print('----> DEBUG: Found FCCAnalyses library.')
ROOT.gInterpreter.Declare("using namespace FCCAnalyses::Source;")
ROOT.gInterpreter.Declare("using namespace FCCAnalyses::PodioSource;")
print('----> INFO: Loading analyzers from libFCCAnalyses... ',)

if ROOT.podio.DataSource:
Expand Down
2 changes: 1 addition & 1 deletion python/run_analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ def initialize(args, rdf_module, anapath: str):

# for convenience and compatibility with user code
if args.use_data_source:
ROOT.gInterpreter.Declare("using namespace FCCAnalyses::Source;")
ROOT.gInterpreter.Declare("using namespace FCCAnalyses::PodioSource;")
else:
ROOT.gInterpreter.Declare("using namespace FCCAnalyses;")

Expand Down
3 changes: 1 addition & 2 deletions python/run_fccanalysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -277,8 +277,7 @@ def initialize(config, args, analysis):

# For convenience and compatibility with user code
if config['use_data_source']:
# ROOT.gInterpreter.Declare("using namespace FCCAnalyses::Source;")
ROOT.gInterpreter.Declare("using namespace FCCAnalyses::Source;")
ROOT.gInterpreter.Declare("using namespace FCCAnalyses::PodioSource;")
else:
ROOT.gInterpreter.Declare("using namespace FCCAnalyses;")

Expand Down

0 comments on commit 026ff54

Please sign in to comment.