@moneta Thank you for your reply. It does make sense. Unfortunately, there seems to be a few issues
1. My branch names in my tree is actually Muon.PT, Muon.Phi, Muon.Eta, etc. However, when I replace PT, Phi, Eta with the actual branch names (Muon.PT, Muon.Phi, Muon.Eta) I get an error that states
root [0]
Processing selectMuon.c…
In file included from input_line_8:1:
/mnt/c/1/MG5_aMC_v2_6_6/triplet2s/Events/run_01/selectMuon.c:68:21: error: expected ‘;’ at end of declaration
RVec Muon.PT;
^
;
/mnt/c/1/MG5_aMC_v2_6_6/triplet2s/Events/run_01/selectMuon.c:69:17: error: redefinition of ‘Muon’
RVec Muon.Eta;
^
/mnt/c/1/MG5_aMC_v2_6_6/triplet2s/Events/run_01/selectMuon.c:68:17: note: previous definition is here
RVec Muon.PT;
^
/mnt/c/1/MG5_aMC_v2_6_6/triplet2s/Events/run_01/selectMuon.c:69:21: error: expected ‘;’ at end of declaration
RVec Muon.Eta;
^
;
/mnt/c/1/MG5_aMC_v2_6_6/triplet2s/Events/run_01/selectMuon.c:70:17: error: redefinition of ‘Muon’
RVec Muon.Phi;
^
/mnt/c/1/MG5_aMC_v2_6_6/triplet2s/Events/run_01/selectMuon.c:68:17: note: previous definition is here
RVec Muon.PT;
^
/mnt/c/1/MG5_aMC_v2_6_6/triplet2s/Events/run_01/selectMuon.c:70:21: error: expected ‘;’ at end of declaration
RVec Muon.Phi;
^
;
/mnt/c/1/MG5_aMC_v2_6_6/triplet2s/Events/run_01/selectMuon.c:84:33: error: no member named ‘PT’ in ‘ROOT::VecOps::RVec’
for (size_t i = 0; i < Muon.PT.size(); i++)
~~~~ ^
/mnt/c/1/MG5_aMC_v2_6_6/triplet2s/Events/run_01/selectMuon.c:97:46: error: no member named ‘PT’ in ‘ROOT::VecOps::RVec’
ROOT::Math::PtEtaPhiMVector m1((Muon.PT)[1], Muon.Eta[1], Muon.Phi[1], 0.1);
~~~~ ^
/mnt/c/1/MG5_aMC_v2_6_6/triplet2s/Events/run_01/selectMuon.c:97:59: error: no member named ‘Eta’ in ‘ROOT::VecOps::RVec’
ROOT::Math::PtEtaPhiMVector m1((Muon.PT)[1], Muon.Eta[1], Muon.Phi[1], 0.1);
~~~~ ^
/mnt/c/1/MG5_aMC_v2_6_6/triplet2s/Events/run_01/selectMuon.c:97:72: error: no member named ‘Phi’ in ‘ROOT::VecOps::RVec’
ROOT::Math::PtEtaPhiMVector m1((Muon.PT)[1], Muon.Eta[1], Muon.Phi[1], 0.1);
~~~~ ^
/mnt/c/1/MG5_aMC_v2_6_6/triplet2s/Events/run_01/selectMuon.c:98:46: error: no member named ‘PT’ in ‘ROOT::VecOps::RVec’
ROOT::Math::PtEtaPhiMVector m2((Muon.PT)[2], Muon.Eta[2], Muon.Phi[2], 0.1);
~~~~ ^
/mnt/c/1/MG5_aMC_v2_6_6/triplet2s/Events/run_01/selectMuon.c:98:59: error: no member named ‘Eta’ in ‘ROOT::VecOps::RVec’
ROOT::Math::PtEtaPhiMVector m2((Muon.PT)[2], Muon.Eta[2], Muon.Phi[2], 0.1);
~~~~ ^
/mnt/c/1/MG5_aMC_v2_6_6/triplet2s/Events/run_01/selectMuon.c:98:72: error: no member named ‘Phi’ in ‘ROOT::VecOps::RVec’
ROOT::Math::PtEtaPhiMVector m2((Muon.PT)[2], Muon.Eta[2], Muon.Phi[2], 0.1);
~~~~ ^
*** Break *** segmentation violation
Generating stack trace…
0x00007fdc29e430e4 in from /home/cucip/builddir/lib/libCling.so
0x00007fdc29e43d08 in from /home/cucip/builddir/lib/libCling.so
0x00007fdc29e47e6a in cling::DeclUnloader::VisitFunctionDecl(clang::FunctionDecl*) + 0x15a from /home/cucip/builddir/lib/libCling.so
0x00007fdc29e16d05 in cling::TransactionUnloader::unloadDeclarations(cling::Transaction*, cling::DeclUnloader&) + 0x175 from /home/cucip/builddir/lib/libCling.so
0x00007fdc29e175a0 in cling::TransactionUnloader::RevertTransaction(cling::Transaction*) + 0x2f0 from /home/cucip/builddir/lib/libCling.so
0x00007fdc29dfd5f5 in cling::Interpreter::unload(cling::Transaction&) + 0x235 from /home/cucip/builddir/lib/libCling.so
0x00007fdc29e796c1 in cling::IncrementalParser::commitTransaction(llvm::PointerIntPair<cling::Transaction*, 2u, cling::IncrementalParser::EParseResult, llvm::PointerLikeTypeTraitscling::Transaction*, llvm::PointerIntPairInfo<cling::Transaction*, 2u, llvm::PointerLikeTypeTraitscling::Transaction* > >&, bool) + 0xf1 from /home/cucip/builddir/lib/libCling.so
0x00007fdc29e79b88 in cling::IncrementalParser::Compile(llvm::StringRef, cling::CompilationOptions const&) + 0x68 from /home/cucip/builddir/lib/libCling.so
0x00007fdc29dfaf23 in cling::Interpreter::DeclareInternal(std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&, cling::CompilationOptions const&, cling::Transaction**) const + 0x53 from /home/cucip/builddir/lib/libCling.so
0x00007fdc29dfd356 in cling::Interpreter::loadHeader(std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&, cling::Transaction**) + 0x186 from /home/cucip/builddir/lib/libCling.so
0x00007fdc29ec5b0c in cling::MetaSema::actOnLCommand(llvm::StringRef, cling::Transaction**) + 0x15c from /home/cucip/builddir/lib/libCling.so
0x00007fdc29ec5cad in cling::MetaSema::actOnxCommand(llvm::StringRef, llvm::StringRef, cling::Value*) + 0x4d from /home/cucip/builddir/lib/libCling.so
0x00007fdc29ed6084 in cling::MetaParser::isXCommand(cling::MetaSema::ActionResult&, cling::Value*) + 0x194 from /home/cucip/builddir/lib/libCling.so
0x00007fdc29ed7476 in cling::MetaParser::isCommand(cling::MetaSema::ActionResult&, cling::Value*) + 0xa6 from /home/cucip/builddir/lib/libCling.so
0x00007fdc29ebf64b in cling::MetaProcessor::process(llvm::StringRef, cling::Interpreter::CompilationResult&, cling::Value*, bool) + 0x10b from /home/cucip/builddir/lib/libCling.so
0x00007fdc29d7b68e in from /home/cucip/builddir/lib/libCling.so
0x00007fdc29d8fe72 in from /home/cucip/builddir/lib/libCling.so
0x00007fdc29d84537 in from /home/cucip/builddir/lib/libCling.so
0x00007fdc2f512908 in TApplication::ExecuteFile(char const*, int*, bool) at /home/cucip/root-6.18.04/core/base/src/TApplication.cxx:1156 from /home/cucip/builddir/lib/libCore.so
0x00007fdc2f5120ac in TApplication::ProcessLine(char const*, bool, int*) at /home/cucip/root-6.18.04/core/base/src/TApplication.cxx:1007 from /home/cucip/builddir/lib/libCore.so
0x00007fdc2f9e18e2 in TRint::ProcessLineNr(char const*, char const*, int*) at /home/cucip/root-6.18.04/core/rint/src/TRint.cxx:762 from /home/cucip/builddir/lib/libRint.so
0x00007fdc2f9e31d9 in TRint::Run(bool) at /home/cucip/root-6.18.04/core/rint/src/TRint.cxx:421 from /home/cucip/builddir/lib/libRint.so
0x00007fdc30000a0c in from /home/cucip/builddir/bin/root.exe
0x00007fdc2e971b97 in __libc_start_main + 0xe7 from /lib/x86_64-linux-gnu/libc.so.6
0x00007fdc30000a6a in _start + 0x2a from /home/cucip/builddir/bin/root.exe
2. However, if I write in the ROOT terminal
ROOT::RDataFrame df(“Delphes”, “tag_1_delphes_events.root”);
RVec Muon.PT;
auto hist = df.Histo1D(“MuonPT”) ;
hist->Draw();
I end up getting a histogram.
3. In attempt to get rid of some of the errors if I edit my code to just write MuonPT instead of Muon.PT the code runs without error but no plots are produced. In my terminal however, I get the error: Unknown Column MuonPT.
Any other variations would just give me the same warnings or an empty plot. Do you know how I can fix it or what the problem is?
Many thanks!