diff --git a/analyzers/dataframe/FCCAnalyses/Defines.h b/analyzers/dataframe/FCCAnalyses/Defines.h index 2493c138ac..7e8f510c2c 100644 --- a/analyzers/dataframe/FCCAnalyses/Defines.h +++ b/analyzers/dataframe/FCCAnalyses/Defines.h @@ -13,16 +13,16 @@ * @brief FCC analyzers collection. */ namespace FCCAnalyses { - using Vec_b = ROOT::VecOps::RVec; - using Vec_d = ROOT::VecOps::RVec; - using Vec_f = ROOT::VecOps::RVec; - using Vec_i = ROOT::VecOps::RVec; - using Vec_ui = ROOT::VecOps::RVec; +using Vec_b = ROOT::VecOps::RVec; +using Vec_d = ROOT::VecOps::RVec; +using Vec_f = ROOT::VecOps::RVec; +using Vec_i = ROOT::VecOps::RVec; +using Vec_ui = ROOT::VecOps::RVec; - using rp = edm4hep::ReconstructedParticleData; - using Vec_rp = ROOT::VecOps::RVec; - using Vec_mc = ROOT::VecOps::RVec; - using Vec_tlv = ROOT::VecOps::RVec; +using rp = edm4hep::ReconstructedParticleData; +using Vec_rp = ROOT::VecOps::RVec; +using Vec_mc = ROOT::VecOps::RVec; +using Vec_tlv = ROOT::VecOps::RVec; } // namespace FCCAnalyses #endif diff --git a/analyzers/dataframe/FCCAnalyses/LinkDef.h b/analyzers/dataframe/FCCAnalyses/LinkDef.h index da789da7f2..a1eee99d85 100644 --- a/analyzers/dataframe/FCCAnalyses/LinkDef.h +++ b/analyzers/dataframe/FCCAnalyses/LinkDef.h @@ -8,10 +8,12 @@ //Dictionaries for output objects #pragma link C++ class std::vector+; -#pragma link C++ class ROOT::VecOps::RVec+; -#pragma link C++ class ROOT::VecOps::RVec>+; -#pragma link C++ class ROOT::VecOps::RVec+; -#pragma link C++ class ROOT::VecOps::RVec>+; +#pragma link C++ class ROOT::VecOps::RVec < TLorentzVector> + ; +#pragma link C++ class ROOT::VecOps::RVec < ROOT::VecOps::RVec < \ + TLorentzVector>> + \ + ; +#pragma link C++ class ROOT::VecOps::RVec < TVector3> + ; +#pragma link C++ class ROOT::VecOps::RVec < ROOT::VecOps::RVec < TVector3>> + ; #pragma link C++ class std::vector+; @@ -20,24 +22,28 @@ #pragma link C++ class ROOT::VecOps::RVec+; #pragma link C++ class ROOT::VecOps::RVec+; #pragma link C++ class ROOT::VecOps::RVec+; -#pragma link C++ class ROOT::VecOps::RVec+; +#pragma link C++ class ROOT::VecOps::RVec < edm4hep::ClusterData> + ; #pragma link C++ class ROOT::VecOps::RVec+; #pragma link C++ class ROOT::VecOps::RVec+; -#pragma link C++ class ROOT::VecOps::RVec>+; +#pragma link C++ class ROOT::VecOps::RVec < ROOT::VecOps::RVec < \ + edm4hep::ReconstructedParticleData>> + \ + ; // Vectors -#pragma link C++ class ROOT::VecOps::RVec>+; -#pragma link C++ class ROOT::VecOps::RVec>+; -#pragma link C++ class ROOT::VecOps::RVec>+; +#pragma link C++ class ROOT::VecOps::RVec < std::vector < int>> + ; +#pragma link C++ class ROOT::VecOps::RVec < std::vector < float>> + ; +#pragma link C++ class ROOT::VecOps::RVec < std::vector < double>> + ; #pragma link C++ class ROOT::VecOps::RVec>+; #pragma link C++ class ROOT::VecOps::RVec>+; #pragma link C++ class ROOT::VecOps::RVec>+; -#pragma link C++ class std::vector>+; -#pragma link C++ class std::vector>+; -#pragma link C++ class std::vector>+; +#pragma link C++ class std::vector < std::vector < int>> + ; +#pragma link C++ class std::vector < std::vector < float>> + ; +#pragma link C++ class std::vector < std::vector < double>> + ; #pragma link C++ class ROOT::VecOps::RVec+; -#pragma link C++ class ROOT::VecOps::RVec>+; +#pragma link C++ class ROOT::VecOps::RVec < ROOT::VecOps::RVec < \ + FCCAnalyses::VertexingUtils::FCCAnalysesVertex>> + \ + ; //to load all other functions #pragma link C++ function dummyLoader; diff --git a/analyzers/dataframe/src/ReconstructedParticle.cc b/analyzers/dataframe/src/ReconstructedParticle.cc index 6d64abbbeb..fb01ebfa36 100644 --- a/analyzers/dataframe/src/ReconstructedParticle.cc +++ b/analyzers/dataframe/src/ReconstructedParticle.cc @@ -34,7 +34,6 @@ ROOT::VecOps::RVec sel_type::operator()( return result; } - /// sel_absType sel_absType::sel_absType(const int type) : m_type(type) { if (m_type < 0) { @@ -60,7 +59,6 @@ ROOT::VecOps::RVec sel_absType::operator()( return result; } - /// sel_pt sel_pt::sel_pt(float arg_min_pt) : m_min_pt(arg_min_pt) {}; ROOT::VecOps::RVec sel_pt::operator() (ROOT::VecOps::RVec in) { @@ -121,7 +119,6 @@ ROOT::VecOps::RVec sel_charge::operator() ( return result; } - resonanceBuilder::resonanceBuilder(float arg_resonance_mass) {m_resonance_mass = arg_resonance_mass;} ROOT::VecOps::RVec resonanceBuilder::operator()(ROOT::VecOps::RVec legs) { ROOT::VecOps::RVec result; @@ -251,7 +248,6 @@ ROOT::VecOps::RVec get_pt(ROOT::VecOps::RVec merge(ROOT::VecOps::RVec x, ROOT::VecOps::RVec y) { //to be keept as ROOT::VecOps::RVec std::vector result; diff --git a/examples/FCChh/HH_bbtautau/analysis.cc b/examples/FCChh/HH_bbtautau/analysis.cc index e686f943f0..e1fb1feb24 100644 --- a/examples/FCChh/HH_bbtautau/analysis.cc +++ b/examples/FCChh/HH_bbtautau/analysis.cc @@ -16,10 +16,8 @@ #include "ReconstructedParticle2Track.h" #include "MCParticle.h" - auto _m = edm4hep::ReconstructedParticleData(); - // Reproduce Heppy analysis int main(int argc, char* argv[]){ diff --git a/tests/integration/data_source.cxx b/tests/integration/data_source.cxx index 0efacd7ccf..b977580792 100644 --- a/tests/integration/data_source.cxx +++ b/tests/integration/data_source.cxx @@ -1,23 +1,24 @@ // ROOT -#include #include #include +#include #include // PODIO #include // EDM4hep -#include -#include #include #include +#include +#include #include -edm4hep::MCParticleCollection selElectrons(const edm4hep::MCParticleCollection& inParticles) { +edm4hep::MCParticleCollection +selElectrons(const edm4hep::MCParticleCollection &inParticles) { edm4hep::MCParticleCollection electrons; electrons.setSubsetCollection(); - for (auto particle: inParticles) { + for (auto particle : inParticles) { if (particle.getPDG() == 11) { auto electron = edm4hep::MCParticle(particle); electrons.push_back(electron); @@ -31,24 +32,24 @@ struct selPDG { selPDG(int pdg, bool chargeConjugateAllowed); const int m_pdg; const bool m_chargeConjugateAllowed; - edm4hep::MCParticleCollection operator() (const edm4hep::MCParticleCollection& inParticles); + edm4hep::MCParticleCollection + operator()(const edm4hep::MCParticleCollection &inParticles); }; -selPDG::selPDG(int pdg, - bool chargeConjugateAllowed) : m_pdg(pdg), - m_chargeConjugateAllowed(chargeConjugateAllowed) {}; +selPDG::selPDG(int pdg, bool chargeConjugateAllowed) + : m_pdg(pdg), m_chargeConjugateAllowed(chargeConjugateAllowed){}; -edm4hep::MCParticleCollection selPDG::operator() (const edm4hep::MCParticleCollection& inParticles) { +edm4hep::MCParticleCollection +selPDG::operator()(const edm4hep::MCParticleCollection &inParticles) { edm4hep::MCParticleCollection result; result.setSubsetCollection(); - for (auto particle: inParticles) { + for (auto particle : inParticles) { if (m_chargeConjugateAllowed) { - if (std::abs(particle.getPDG() ) == std::abs(m_pdg)) { + if (std::abs(particle.getPDG()) == std::abs(m_pdg)) { result.push_back(particle); } - } - else { - if(particle.getPDG() == m_pdg) { + } else { + if (particle.getPDG() == m_pdg) { result.push_back(particle); } } @@ -57,24 +58,26 @@ edm4hep::MCParticleCollection selPDG::operator() (const edm4hep::MCParticleColle return result; } -ROOT::VecOps::RVec getPx(const edm4hep::MCParticleCollection& inParticles) { +ROOT::VecOps::RVec +getPx(const edm4hep::MCParticleCollection &inParticles) { ROOT::VecOps::RVec result; - for (auto particle: inParticles) { + for (auto particle : inParticles) { result.push_back(particle.getMomentum().x); } return result; } -edm4hep::MCParticleCollection get_stable_particles_from_decay(edm4hep::MCParticle in) { +edm4hep::MCParticleCollection +get_stable_particles_from_decay(edm4hep::MCParticle in) { edm4hep::MCParticleCollection result; result.setSubsetCollection(); auto daughters = in.getDaughters(); - if (daughters.size() != 0) { // particle is unstable - for (const auto& daughter : daughters) { + if (daughters.size() != 0) { // particle is unstable + for (const auto &daughter : daughters) { auto stable_daughters = get_stable_particles_from_decay(daughter); - for (const auto& stable_daughter : stable_daughters) { + for (const auto &stable_daughter : stable_daughters) { result.push_back(stable_daughter); } } @@ -85,12 +88,12 @@ edm4hep::MCParticleCollection get_stable_particles_from_decay(edm4hep::MCParticl return result; } -edm4hep::MCParticle get_mcParticle( - const edm4hep::ReconstructedParticle& recoParticle, - const edm4hep::RecoMCParticleLinkCollection& assocColl) { +edm4hep::MCParticle +get_mcParticle(const edm4hep::ReconstructedParticle &recoParticle, + const edm4hep::RecoMCParticleLinkCollection &assocColl) { edm4hep::MCParticle no_result; - for (const auto& assoc: assocColl) { + for (const auto &assoc : assocColl) { if (assoc.getFrom() == recoParticle) { return assoc.getTo(); } @@ -99,12 +102,9 @@ edm4hep::MCParticle get_mcParticle( return no_result; } - int main(int argc, const char *argv[]) { auto verbosity = ROOT::Experimental::RLogScopedVerbosity( - ROOT::Detail::RDF::RDFLogChannel(), - ROOT::Experimental::ELogLevel::kInfo - ); + ROOT::Detail::RDF::RDFLogChannel(), ROOT::Experimental::ELogLevel::kInfo); int nThreads = 1; if (argc > 1) { @@ -126,7 +126,7 @@ int main(int argc, const char *argv[]) { // rdf.Describe().Print(); // std::cout << std::endl; - std::cout << "Info: Num. of slots: " << rdf.GetNSlots() << std::endl; + std::cout << "Info: Num. of slots: " << rdf.GetNSlots() << std::endl; auto rdf2 = rdf.Define("particles_px", getPx, {"Particle"}); // auto rdf3 = rdf2.Define("electrons", selElectrons, {"MCParticles"}); diff --git a/tests/integration/data_source_associations.cxx b/tests/integration/data_source_associations.cxx index 18df8a7b8b..fec2649ed3 100644 --- a/tests/integration/data_source_associations.cxx +++ b/tests/integration/data_source_associations.cxx @@ -1,61 +1,59 @@ // std +#include #include #include -#include // ROOT -#include #include #include +#include #include +#include #include #include #include -#include // PODIO #include // EDM4hep +#include "edm4hep/RecoMCParticleLinkCollection.h" +#include "edm4hep/ReconstructedParticleCollection.h" +#include "edm4hep/TrackCollection.h" +#include "edm4hep/TrackState.h" #include #include #include -#include "edm4hep/TrackState.h" -#include "edm4hep/TrackCollection.h" -#include "edm4hep/ReconstructedParticleCollection.h" -#include "edm4hep/RecoMCParticleLinkCollection.h" // FCCAnalyses #include "FCCAnalyses/SmearObjects.h" #include "FCCAnalyses/VertexingUtils.h" - /// for a given MC particle, returns a "track state", i.e. a vector of 5 helix /// parameters, in Delphes convention TVectorD TrackParamFromMC_DelphesConv(edm4hep::MCParticle aMCParticle) { - TVector3 p(aMCParticle.getMomentum().x, - aMCParticle.getMomentum().y, + TVector3 p(aMCParticle.getMomentum().x, aMCParticle.getMomentum().y, aMCParticle.getMomentum().z); - TVector3 x(1e-3 * aMCParticle.getVertex().x, - 1e-3 * aMCParticle.getVertex().y, + TVector3 x(1e-3 * aMCParticle.getVertex().x, 1e-3 * aMCParticle.getVertex().y, 1e-3 * aMCParticle.getVertex().z); // mm to m float Q = aMCParticle.getCharge(); - TVectorD param = FCCAnalyses::VertexingUtils::XPtoPar(x, p, Q); // convention Franco + TVectorD param = + FCCAnalyses::VertexingUtils::XPtoPar(x, p, Q); // convention Franco return param; } - TMatrixDSym get_trackCov(const edm4hep::TrackState &atrack, bool Units_mm) { auto covMatrix = atrack.covMatrix; - TMatrixDSym covM = FCCAnalyses::VertexingUtils::Edm4hep2Delphes_TrackCovMatrix(covMatrix, Units_mm); + TMatrixDSym covM = + FCCAnalyses::VertexingUtils::Edm4hep2Delphes_TrackCovMatrix(covMatrix, + Units_mm); return covM; } - /** * \brief Generates new track states, by rescaling the covariance matrix of the * tracks. @@ -67,11 +65,9 @@ struct SmearedTracks { SmearedTracks(float smear_d0, float smear_phi, float smear_omega, float smear_z0, float smear_tlambda, bool debug); ROOT::VecOps::RVec - operator()( - const edm4hep::RecoMCParticleLinkCollection &mcRecoLink); + operator()(const edm4hep::RecoMCParticleLinkCollection &mcRecoLink); }; - SmearedTracks::SmearedTracks(float smear_d0, float smear_phi, float smear_omega, float smear_z0, float smear_tlambda, bool debug = false) { @@ -85,9 +81,7 @@ SmearedTracks::SmearedTracks(float smear_d0, float smear_phi, float smear_omega, m_debug = debug; } - -ROOT::VecOps::RVec -SmearedTracks::operator() ( +ROOT::VecOps::RVec SmearedTracks::operator()( const edm4hep::RecoMCParticleLinkCollection &mcRecoLink) { // returns a vector of TrackStates that is parallel to the collection of full @@ -159,8 +153,8 @@ SmearedTracks::operator() ( //} // generate a new track state (in Delphes's convention) - TVectorD smeared_param_delphes = - FCCAnalyses::SmearObjects::CovSmear(mcTrackParam, Cov, &m_random, m_debug); + TVectorD smeared_param_delphes = FCCAnalyses::SmearObjects::CovSmear( + mcTrackParam, Cov, &m_random, m_debug); if (smeared_param_delphes == zero) { // Cholesky decomposition failed result.emplace_back(trackState); @@ -168,8 +162,9 @@ SmearedTracks::operator() ( } // back to the edm4hep conventions.. - TVectorD smeared_param = FCCAnalyses::VertexingUtils::Delphes2Edm4hep_TrackParam( - smeared_param_delphes, false); + TVectorD smeared_param = + FCCAnalyses::VertexingUtils::Delphes2Edm4hep_TrackParam( + smeared_param_delphes, false); auto smearedTrackState = trackState; if (smeared_param.GetNoElements() > 4) { @@ -192,20 +187,21 @@ SmearedTracks::operator() ( if (m_debug) { std::cout << std::endl - << "Original track " << trackState.D0 << " " << trackState.phi << " " - << trackState.omega << " " << trackState.Z0 << " " << trackState.tanLambda - << std::endl; + << "Original track " << trackState.D0 << " " << trackState.phi + << " " << trackState.omega << " " << trackState.Z0 << " " + << trackState.tanLambda << std::endl; std::cout << "Smeared track " << smearedTrackState.D0 << " " - << smearedTrackState.phi << " " << smearedTrackState.omega << " " - << smearedTrackState.Z0 << " " << smearedTrackState.tanLambda - << std::endl; + << smearedTrackState.phi << " " << smearedTrackState.omega + << " " << smearedTrackState.Z0 << " " + << smearedTrackState.tanLambda << std::endl; std::cout << "MC particle " << mcTrackParam_edm4hep[0] << " " << mcTrackParam_edm4hep[1] << " " << mcTrackParam_edm4hep[2] << " " << mcTrackParam_edm4hep[3] << " " << mcTrackParam_edm4hep[4] << std::endl; for (int j = 0; j < 15; j++) std::cout << "smeared cov matrix(" << j - << "): " << smearedTrackState.covMatrix[j] << ", scale factor: " + << "): " << smearedTrackState.covMatrix[j] + << ", scale factor: " << smearedTrackState.covMatrix[j] / trackState.covMatrix[j] << std::endl; } @@ -221,14 +217,9 @@ SmearedTracks::operator() ( return result; } - - - int main(int argc, char *argv[]) { auto verbosity = ROOT::Experimental::RLogScopedVerbosity( - ROOT::Detail::RDF::RDFLogChannel(), - ROOT::Experimental::ELogLevel::kInfo - ); + ROOT::Detail::RDF::RDFLogChannel(), ROOT::Experimental::ELogLevel::kInfo); bool success = gInterpreter->Declare("#include \"edm4hep/TrackState.h\""); if (!success) { @@ -257,18 +248,17 @@ int main(int argc, char *argv[]) { // rdf.Describe().Print(); // std::cout << std::endl; - std::cout << "Info: Num. of slots: " << rdf.GetNSlots() << std::endl; + std::cout << "Info: Num. of slots: " << rdf.GetNSlots() << std::endl; - auto rdf2 = rdf.Define( - "SmearedTracks", - SmearedTracks(2.0, 2.0, 2.0, 2.0, 2.0, false), - {"MCRecoAssociations"} - ); + auto rdf2 = + rdf.Define("SmearedTracks", SmearedTracks(2.0, 2.0, 2.0, 2.0, 2.0, false), + {"MCRecoAssociations"}); - auto rdf3 = rdf2.Define("smearTrack_omega", "return SmearedTracks.empty() ? -1 : SmearedTracks.at(0).omega;"); + auto rdf3 = rdf2.Define( + "smearTrack_omega", + "return SmearedTracks.empty() ? -1 : SmearedTracks.at(0).omega;"); auto h_smeared_tracks_omega = rdf3.Histo1D("smearTrack_omega"); - h_smeared_tracks_omega->Print(); auto canvas = std::make_unique("canvas", "Canvas", 450, 450); diff --git a/tests/integration/low_level_associations.cxx b/tests/integration/low_level_associations.cxx index 6a14bc67df..70bdf047ba 100644 --- a/tests/integration/low_level_associations.cxx +++ b/tests/integration/low_level_associations.cxx @@ -1,21 +1,18 @@ // ROOT -#include "ROOT/RVec.hxx" #include "ROOT/RDataFrame.hxx" #include "ROOT/RLogger.hxx" +#include "ROOT/RVec.hxx" #include "TCanvas.h" // EDM4hep #include "edm4hep/MCParticleData.h" #include "edm4hep/SimCalorimeterHitData.h" // FCCAnalyses -#include "FCCAnalyses/SmearObjects.h" #include "FCCAnalyses/ReconstructedParticle2MC.h" - +#include "FCCAnalyses/SmearObjects.h" int main(int argc, const char *argv[]) { auto verbosity = ROOT::Experimental::RLogScopedVerbosity( - ROOT::Detail::RDF::RDFLogChannel(), - ROOT::Experimental::ELogLevel::kInfo - ); + ROOT::Detail::RDF::RDFLogChannel(), ROOT::Experimental::ELogLevel::kInfo); bool success = gInterpreter->Declare("#include \"edm4hep/TrackState.h\""); if (!success) { @@ -44,25 +41,25 @@ int main(int argc, const char *argv[]) { // rdf.Describe().Print(); // std::cout << std::endl; - std::cout << "Info: Num. of slots: " << rdf.GetNSlots() << std::endl; + std::cout << "Info: Num. of slots: " << rdf.GetNSlots() << std::endl; - auto rdf2 = rdf.Alias("MCRecoAssociations0", "_MCRecoAssociations_from.index"); + auto rdf2 = + rdf.Alias("MCRecoAssociations0", "_MCRecoAssociations_from.index"); auto rdf3 = rdf2.Alias("MCRecoAssociations1", "_MCRecoAssociations_to.index"); auto rdf4 = rdf3.Define( - "RP_MC_index", - FCCAnalyses::ReconstructedParticle2MC::getRP2MC_index, - {"MCRecoAssociations0", "MCRecoAssociations1", "ReconstructedParticles"} - ); + "RP_MC_index", FCCAnalyses::ReconstructedParticle2MC::getRP2MC_index, + {"MCRecoAssociations0", "MCRecoAssociations1", "ReconstructedParticles"}); auto rdf5 = rdf4.Define( "SmearedTracks", FCCAnalyses::SmearObjects::SmearedTracks(2.0, 2.0, 2.0, 2.0, 2.0, true), - {"ReconstructedParticles", "_EFlowTrack_trackStates", "RP_MC_index", "Particle"} - ); - auto rdf6 = rdf5.Define("smearTrack_omega", "return SmearedTracks.empty() ? -1 : SmearedTracks.at(0).omega;"); + {"ReconstructedParticles", "_EFlowTrack_trackStates", "RP_MC_index", + "Particle"}); + auto rdf6 = rdf5.Define( + "smearTrack_omega", + "return SmearedTracks.empty() ? -1 : SmearedTracks.at(0).omega;"); // auto rdf6 = rdf5.Define("smearTrack_omega", "return RP_MC_index[0];"); auto h_smeared_tracks_omega = rdf6.Histo1D("smearTrack_omega"); - h_smeared_tracks_omega->Print(); auto canvas = std::make_unique("canvas", "Canvas", 450, 450); diff --git a/tests/integration/low_level_edm4hep.cxx b/tests/integration/low_level_edm4hep.cxx index 659f0f47d3..9d4d25b19d 100644 --- a/tests/integration/low_level_edm4hep.cxx +++ b/tests/integration/low_level_edm4hep.cxx @@ -1,13 +1,14 @@ // ROOT -#include #include #include +#include #include // EDM4hep #include #include -ROOT::VecOps::RVec selElectrons(ROOT::VecOps::RVec& inParticles) { +ROOT::VecOps::RVec +selElectrons(ROOT::VecOps::RVec &inParticles) { ROOT::VecOps::RVec electrons; for (size_t i = 0; i < inParticles.size(); ++i) { if (inParticles[i].PDG == 11) { @@ -22,24 +23,24 @@ struct selPDG { selPDG(int pdg, bool chargeConjugateAllowed); const int m_pdg; const bool m_chargeConjugateAllowed; - ROOT::VecOps::RVec operator() (ROOT::VecOps::RVec& inParticles); + ROOT::VecOps::RVec + operator()(ROOT::VecOps::RVec &inParticles); }; -selPDG::selPDG(int pdg, - bool chargeConjugateAllowed) : m_pdg(pdg), - m_chargeConjugateAllowed(chargeConjugateAllowed) {}; +selPDG::selPDG(int pdg, bool chargeConjugateAllowed) + : m_pdg(pdg), m_chargeConjugateAllowed(chargeConjugateAllowed){}; -ROOT::VecOps::RVec selPDG::operator() (ROOT::VecOps::RVec& inParticles) { +ROOT::VecOps::RVec +selPDG::operator()(ROOT::VecOps::RVec &inParticles) { ROOT::VecOps::RVec result; for (size_t i = 0; i < inParticles.size(); ++i) { auto &particle = inParticles[i]; if (m_chargeConjugateAllowed) { - if (std::abs(particle.PDG ) == std::abs(m_pdg)) { + if (std::abs(particle.PDG) == std::abs(m_pdg)) { result.emplace_back(particle); } - } - else { - if(particle.PDG == m_pdg) { + } else { + if (particle.PDG == m_pdg) { result.emplace_back(particle); } } @@ -48,21 +49,19 @@ ROOT::VecOps::RVec selPDG::operator() (ROOT::VecOps::RV return result; } -ROOT::VecOps::RVec getPx(ROOT::VecOps::RVec inParticles) { +ROOT::VecOps::RVec +getPx(ROOT::VecOps::RVec inParticles) { ROOT::VecOps::RVec result; - for (auto& p: inParticles) { + for (auto &p : inParticles) { result.push_back(p.momentum.x); } return result; } - int main(int argc, const char *argv[]) { auto verbosity = ROOT::Experimental::RLogScopedVerbosity( - ROOT::Detail::RDF::RDFLogChannel(), - ROOT::Experimental::ELogLevel::kInfo - ); + ROOT::Detail::RDF::RDFLogChannel(), ROOT::Experimental::ELogLevel::kInfo); int nThreads = 1; if (argc > 1) { @@ -84,7 +83,7 @@ int main(int argc, const char *argv[]) { // rdf.Describe().Print(); // std::cout << std::endl; - std::cout << "Info: Num. of slots: " << rdf.GetNSlots() << std::endl; + std::cout << "Info: Num. of slots: " << rdf.GetNSlots() << std::endl; auto rdf2 = rdf.Define("particles_px", getPx, {"Particle"}); // auto rdf3 = rdf2.Define("electrons", selElectrons, {"MCParticles"});