1 #include <HLClonesArray.hxx> 7 HLClonesArray::HLClonesArray(
const std::string& tree_name,
const std::string& array_name,
const std::string& class_name,
const UInt_t size){
19 _objects =
new TClonesArray(class_name.c_str(), size);
28 HLClonesArray::~HLClonesArray(){
35 void HLClonesArray::ReadClonesArray(
const std::string& file){
53 _chain->AddFile(file.c_str());
62 Long64_t centry =
_chain->LoadTree(0);
64 std::cout <<
"HLClonesArray::ReadClonesArray(). failed in reading '" << name <<
"' clones array !!!" << std::endl;
67 Int_t nb =
_chain->GetEntry(0);
69 std::cout <<
"HLClonesArray::ReadClonesArray(). failed in reading '" << name <<
"' clones array !!!" << std::endl;
77 void HLClonesArray::WriteClonesArray(TTree& tree){
82 tree.Branch((
"N"+name).c_str(), &(
GetNObjects()), (
"N"+name+
"/I").c_str(), 32000);
83 tree.Branch(name.c_str(),
"TClonesArray",
GetClonesArray(), 32000, 99);
std::string _fileName
Name of the last file read.
std::string _treeName
Name of the Tree.
TChain * _chain
TChain used to read the "config" tree from the output file.
Int_t & GetNObjects()
Return the number of steps that have been added.
TClonesArray * GetClonesArray()
Int_t _NObjects
The number of steps that were added.
std::string _tcArrayName
Name of the TClonesArray in the tree.
const std::string & GetClonesArrayName() const
Return the name of the TClonesArray.