BmnRoot 26.10.0-210-gc52d34b0
Software framework of the BM@N experiment
Loading...
Searching...
No Matches
dump_object.C File Reference
#include "TBranch.h"
#include "TClass.h"
#include "TClonesArray.h"
#include "TFile.h"
#include "TKey.h"
#include "TTree.h"
#include <iostream>
Include dependency graph for dump_object.C:

Go to the source code of this file.

Functions

int dump_object (const char *filePath="/home/igor/DATA/bmn/26.02.0/dst/rc_noa_rlerr.run_Top_9555_ev0_p0.root", const char *objectName="DstRunHeader", Long64_t entry=0, const char *treeName="bmndata")
 Print all data members of an object read from a .root file.

Function Documentation

◆ dump_object()

int dump_object ( const char * filePath = "/home/igor/DATA/bmn/26.02.0/dst/rc_noa_rlerr.run_Top_9555_ev0_p0.root",
const char * objectName = "DstRunHeader",
Long64_t entry = 0,
const char * treeName = "bmndata" )

The name is looked up as a key of the file first - run-level objects such as DstRunHeader - and then as a top-level class branch of the tree, read at the given entry - per-event objects such as DstEventHeader. or StsHit. A TClonesArray is dumped element by element.

Parameters
filePath.root file to read
objectNamekey or top-level branch name
entrytree entry to read the branch at, ignored for a key
treeNametree holding the branches
Returns
0 on success, -1 if the object is not found or cannot be read

Definition at line 41 of file dump_object.C.

References TObjArray::At(), TClonesArray::Class(), TObject::Class(), TObject::ClassName(), TClass::Dump(), TClass::DynamicCast(), TDirectoryFile::Get(), TTree::GetBranch(), TClass::GetClass(), TBranch::GetClassName(), TObjArray::GetEntriesFast(), TBranch::GetEntry(), TDirectoryFile::GetKey(), TBranch::GetMother(), TNamed::GetName(), i, TClass::InheritsFrom(), TObject::IsA(), TObject::IsZombie(), and TBranch::SetAddress().

Here is the call graph for this function: