Skip to content

Commit

Permalink
[RDF] Make df106_HiggsToFourLeptons.C run properly when compiled (roo…
Browse files Browse the repository at this point in the history
…t-project#15639)

* [RDF] Make df106_HiggsToFourLeptons.C run properly when compiled

* [RDF] merge Declares in df106 tutorial

* [RDF] remove macros in favor of copy-paste in df106

* [RDF] remove trailing '\' in df106 tutorial
  • Loading branch information
silverweed authored Jun 3, 2024
1 parent b9fc783 commit 717e77b
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions tutorials/dataframe/df106_HiggsToFourLeptons.C
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
/// \date March 2020, August 2022, August 2023
/// \authors Stefan Wunsch (KIT, CERN), Julia Mathe (CERN), Marta Czurylo (CERN)

#include "TInterpreter.h"
#include <Math/Vector4D.h>
#include <ROOT/RDFHelpers.hxx>
#include <ROOT/RDataFrame.hxx>
Expand Down Expand Up @@ -86,6 +87,19 @@ void df106_HiggsToFourLeptons()
// Add the ProgressBar feature
ROOT::RDF::Experimental::AddProgressBar(df);

#ifndef __CLING__
// If this tutorial is compiled, rather than run as a ROOT macro, the interpreter needs to be fed the signatures
// of all the functions we want to JIT in our analysis, as well as any type used in those signatures.
// clang-format off
gInterpreter->Declare(
"using ROOT::RVecF;"
"bool GoodElectronsAndMuons(const ROOT::RVecI &type, const RVecF &pt, const RVecF &eta, const RVecF &phi, const RVecF &e,"
"const RVecF &trackd0pv, const RVecF &tracksigd0pv, const RVecF &z0);"
"float ComputeInvariantMass(const RVecF &pt, const RVecF &eta, const RVecF &phi, const RVecF &e);"
);
// clang-format on
#endif

// Perform the analysis
// Access metadata information that is stored in the JSON config file of the RDataFrame
// The metadata contained in the JSON file is accessible within a `DefinePerSample` call, through the `RSampleInfo`
Expand Down

0 comments on commit 717e77b

Please sign in to comment.