I have a very basic question related to
I would like to create branches and fill them in a loop within my c++ code.
Just like we used to do with
- what do I need to import in order to create a
- How can I translate this code in an
Sign in to CERN
_ROOT Version: 6.24
_Platform: CENT OS7
_Compiler: g++ (GCC) 10.2.1
If you can’t access the link the code is very simple:
TFile theFile(fileName.c_str(), "RECREATE");
TTree theTree("theTree", "Ntuple with event data");
uint16_t FW_block_size, FW_tlu_trigger_id, FW_data_format_ver, FW_tdc;
uint32_t event, FW_l1a_counter, FW_bx_counter, FW_event_status, FW_nframes;
theTree.Branch("event", &event, "event/i");
theTree.Branch("FW_block_size", &FW_block_size, "FW_block_size/i");
theTree.Branch("FW_tlu_trigger_id", &FW_tlu_trigger_id, "FW_tlu_trigger_id/i");
theTree.Branch("FW_block_size", &FW_block_size, "FW_block_size/s");
theTree.Branch("FW_tlu_trigger_id", &FW_tlu_trigger_id, "FW_tlu_trigger_id/s");
I don’t fully understand the nuisance 32 vs 16 bits, but ok.
I might be starting to understand…
RDataFrame are just a way to manipulate a
How can I easily make a
Branch containing a
Basically, I would like to create a jagged array in a
Dear @mauroroot ,
RDataFrame is an interface for data analysis and it is not a data format like TTree. I suggest you read the thorough documentation and try out a couple of tutorials. There is one in particular which might give you insights on creation of jagged arrays.
As an extremely simple kickstarter, consider
# Need this here because the type std::vector<std::vector<std::uint32_t>>
# is not automatically generated by ROOT. In general this may not be needed
df = ROOT.RDataFrame(10)
snapdf = (
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.