Uploaded image for project: 'ROOT'
  1. ROOT
  2. ROOT-7823

TBranchProxy fails with unsplit TClonesArray

    XMLWordPrintable

Details

    • Bug
    • Status: Open (View Workflow)
    • Medium
    • Resolution: Unresolved
    • 6.06/00, 6.04/10
    • None
    • I/O
    • None
    • all

    Description

      I'm using ROOT 6.05.02 on Ubuntu GCC 4.9.2 with ROOT built with
      -std=c++11. My problems are also seen on 6.02, the details here are
      with 6.05.02.

      I'm trying to read a TTree using the TTreeReader mechanism. I'm having
      two problems with a branch that holds a TClonesArray of TH1F ("calib_wf"
      in the example file).

      The first is that it appears MakeSelector() outputs code which is not
      acceptable on later processing. It use of a TTreeReaderArray<TH1F>
      draws an error saying instead to use a TTreeReaderValue<TClonesArray>.

      The second problem is if I try to use either of the two TTreeReaderXxxx
      forms in PyROOT I get one of two errors (shown below). Either this same
      type error, or if using the recommended type there is a complaint that
      the branch proxy can not be initialized.

      One maybe unrelated detail: the test file was (and currently must be)
      made with ROOT 5 (5.34.xx I think).

      Details below:

      1) The output of TTree::MakeSelector() produces code which gives error
      on subsequent use:

      $ root -l
      root [0] tfile = TFile::Open("http://www.phy.bnl.gov/~chao/wire-cell-events/2.0/celltree_muon_1.5GeV_30x30deg.root")
      (TFile *) 0x329ae70
      root [1] TTree* tree = (TTree*)tfile->Get("Event/Sim")
      (TTree *) 0x36578d0
      root [2] tree->MakeSelector()
      (Int_t) 0
      root [3] tree->Process("Sim.C")
      Error in <CreateContentProxy()>: The branch calib_wf contains data of type TClonesArray, which should be accessed through a TTreeReaderValue< TClonesArray >.
      Error in <CreateContentProxy()>: The branch calib_wf contains data of type TClonesArray, which should be accessed through a TTreeReaderValue< TClonesArray >.
      Error in <CreateContentProxy()>: The branch calib_wf contains data of type TClonesArray, which should be accessed through a TTreeReaderValue< TClonesArray >.
      Error in <CreateContentProxy()>: The branch calib_wf contains data of type TClonesArray, which should be accessed through a TTreeReaderValue< TClonesArray >.
      Error in <CreateContentProxy()>: The branch calib_wf contains data of type TClonesArray, which should be accessed through a TTreeReaderValue< TClonesArray >.
      (Long64_t) 0

      If I edit the line for this "calib_wf" branch from:

      TTreeReaderArray<TH1F> calib_wf =

      {fReader, "calib_wf"};

      to

      TTreeReaderValue<TClonesArray> calib_wf = {fReader, "calib_wf"}

      ;

      then, the test passes:

      root [4] tree->Process("Sim.C")
      (Long64_t) 0

      Brett

      Attachments

        Activity

          People

            pcanal Philippe Canal
            bviren Brett Viren (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated: