Hi Jean-Eric, Progress is slow with folders and trees, but there is some progress. I implemented in version 3.03 the possibility to create a true branch hierarchy (TBranchElement has now a Branch method). This addition was required to fully support an effective Tree as it is possible with folders, but I had no time yet to improve (and simplify) the current interface between Folders->Trees->Folders. Rene Brun Jean-Eric Campagne wrote: > > Hello, > > Below you will find a part of an initialisation of a Monte Carlo Tree > Hit processing. The Tree Branch has been created acoording to the "Post > a List in a Folder" technics. > > My first question concerns the possibility to create automatically the > Folder hierachy (instead of calling the routine createFolder which > makes the job) following the name of the branch that is coded in the > FindBranch method: .topFold.RunMC.EventMC.Hits.MCHitList. At the most > convenient it would be nice to just call FindBranch("MCHitList") and if > there is no ambiguity (this is the responsaboility of the code > developper) then the Folder hierarchy can be infered and created? > > My second question concerns the MakeClass in an interactive Root > session, reading such Tree is it now with root 3.03/05 possible to > generate automatically a code that make access to the elements of the > List in the branch? > > Regards > J.E Campagne > > //------------------------------------------------------ > RootStorage::RootStorage(const std::string& fileIn, const std::string& fileOut){ > m_status = BaseStorage::OK; > > //create Folders Hierarchy > createFolders(); > > //Open the Input file > m_fileIn = new TFile(fileIn.data(),"read"); > if (!m_fileIn->IsOpen()) { > cout << "RootStorage: File " << fileIn << " cannot be openned " << endl; > m_status = BaseStorage::FATAL; > } > > //create Hit List > m_mcHitList = new TList(); > m_mcHitList->SetName("MCHitList"); > > //Get the Tree of the MC hits > if (!m_treeMCH) { > cout << "RootStorage: No TreeMCH in file " << m_fileIn->GetName() << endl; > m_status = BaseStorage::FATAL; > } > > //How to avoid this hard coding style... > m_branchMCH = m_treeMCH->FindBranch(".topFold.RunMC.EventMC.Hits.MCHitList"); > > if (!m_branchMCH){ > cout << "RootStorage: Cannot retreive MCM branch " << endl; > m_status = BaseStorage::FATAL; > } > ............................................................................. > .LAL - IN2P3 - CNRS > .LAL - B.P 34 - 91898 Orsay Cedex - France > .Piece 108 > .Tel +33 (0)1 64 46 84 29 > .Fax +33 (0)1 64 46 83 97 > ...........................................................................
This archive was generated by hypermail 2b29 : Sat Jan 04 2003 - 23:50:53 MET