Skip to content
Snippets Groups Projects
  1. Apr 19, 2005
  2. Mar 11, 2005
    • Rene Brun's avatar
      From Philippe: · 32b8056e
      Rene Brun authored
      This patch implements support for the accessing the collection object in
      TTreeFormula:
      
      //     Accessing collection objects
      //     ============================
      //
      //  TTree::Draw default's handling of collections is to assume that any
      //  request on a collection pertain to it content.  For example, if fTracks
      //  is a collection of Track objects, the following:
      //      tree->Draw("event.fTracks.fPx");
      //  will plot the value of fPx for each Track objects inside the collection.
      //  Also
      //     tree->Draw("event.fTracks.size()");
      //  would plot the result of the member function Track::size() for each
      //  Track object inside the collection.
      //  To access information about the collection itself, TTree::Draw support
      //  the '@' notation.  If a variable which points to a collection is
      prefixed
      //  or postfixed with '@', the next part of the expression will pertain to
      //  the collection object.  For example:
      //     tree->Draw("event.@fTracks.size()");
      //  will plot the size of the collection refered to by fTracks (i.e the
      number
      //  of Track objects).
      
      
      git-svn-id: http://root.cern.ch/svn/root/trunk@11309 27541ba8-7e3a-0410-8455-c3a389f83636
      32b8056e
  3. Feb 18, 2005
    • Fons Rademakers's avatar
      From Philippe: · 0f658be6
      Fons Rademakers authored
      This patch extends the notion of TTree variable aliases to allow
      them to be used as part of single data name.
      
      For example, you can now do:
          tree->SetAlias("theGoodTrack","event.fTracks[3]");
          tree->Draw("theGoodTrack.fPx"); // same as "event.fTracks[3].fPx"
      
      This patch includes a little clean-up in TTreeFormula::DefinedVariable
      to better separate the different phases of the parsing (dimension requests,
      leaf finding and exploration into the user class).
      
      This patch also includes an update to DrawTest to test for the new alias
      feature and in case of failure to print the corresponding Draw command.
      
      
      git-svn-id: http://root.cern.ch/svn/root/trunk@11141 27541ba8-7e3a-0410-8455-c3a389f83636
      0f658be6
  4. Jan 25, 2005
  5. Jan 19, 2005
  6. Dec 18, 2003
    • Rene Brun's avatar
      From Philippe: · eddbab77
      Rene Brun authored
              Add support for the boolean optimization in TFormula::GetExpFormula
      
              Prevent TTree::Scan from printing random value for invalid formulas
      
              Add a new TTreeFormula special function:
      
            Alt$(primary,alternate) : return the value of "primary" if it is available
                          for the current iteration otherwise return the value of "alternate".
                          For example, with arr1[3] and arr2[2]
            tree->Draw("arr1-Alt$(arr2,0)");
                       will draw arr[0]+arr2[0] ; arr[1]+arr2[1] and arr[1]+0
                          Or with a variable size array arr3
             tree->Draw("Alt$(arr3[0],0)+Alt$(arr3[1],0)+Alt$(arr3[2],0)");
                          will draw the sum arr3 for the index 0 to min(2,actual_size_of_arr3-1)
                          As a comparison
             tree->Draw("arr3[0]+arr3[1]+arr3[2]");
                          will draw the sum arr3 for the index 0 to 2 only if the
                          actual_size_of_arr3 is greater or equal to 3.
                          Note that the array in 'primary' is flatened/linearilized thus using
                          Alt$ with multi-dimensional arrays of different dimensions in unlikely
                          to yield the expected results.  To visualize a bit more what elements
                          would be matched by TTree::Draw, TTree::Scan can be used:
             tree->Scan("arr1:Alt$(arr2,0)");
                          will print on one line the value of arr1 and (arr2,0) that will be
                          matched by
             tree->Draw("arr1-Alt$(arr2,0)");
      
      
      git-svn-id: http://root.cern.ch/svn/root/trunk@7780 27541ba8-7e3a-0410-8455-c3a389f83636
      eddbab77
  7. Aug 14, 2003
  8. Jun 30, 2003
    • Rene Brun's avatar
      From Philippe: · a657328d
      Rene Brun authored
      The following patch implements TTree variable alias.
      
      To use them:
              mytree->SetAlias("mult","fPx*fPy");
              mytree->Draw("mult");
      
      Note that the aliases have been added to the TTree object so that they can be persistent (with the tree) if you choose.
      
      Also note that the alias are not checked for validity until they are used in a Draw or Scan command.
      
      Existing alias are silently replaced.
      
      The new functions are:
              TTree::SetAlias
              TTree::GetAlias
              TChain::GetAlias
              TTree::GetListOfAliases
      
      This patch also adds operator= for TFormula, TF1, TF2, TF3 (it calls the respective Copy member functions).  It makes TTreeFormula::operator= private (Copy has not been implemented yet).
      
      Also some of the TFormula and TTreeFormula codes (those stored in fOper) has been aliased to enums (this renders the code is little bit more readable and searchable).
      
      TFormula and TTreeFormula have been updated to handle strings in a more flexible (and for TTreeFormula to be able to return them).
      
      
      git-svn-id: http://root.cern.ch/svn/root/trunk@6805 27541ba8-7e3a-0410-8455-c3a389f83636
      a657328d
  9. Jun 13, 2003
  10. Jan 30, 2003
    • Rene Brun's avatar
      From Philippe: · 275f3f2c
      Rene Brun authored
      This patch adds systematic test for the ability of TTree::Draw to draw TBits objects.
      It also fixes all the bug discovered during the tests.
      It also adds a test for split level 2.
      
      
      git-svn-id: http://root.cern.ch/svn/root/trunk@6011 27541ba8-7e3a-0410-8455-c3a389f83636
      275f3f2c
  11. Oct 21, 2002
  12. Aug 05, 2002
  13. Aug 01, 2002
  14. Dec 04, 2001
    • Rene Brun's avatar
      This update from Philippe rationalizes the treatment of array of chars and bytes. · ce83a050
      Rene Brun authored
      They are now considered by default as an array of numbers.  However if
      they are used with an operator== or an operator!= and if the second argument
      is also a string, the strcmp function will be used.  In addition, a direct call
      of the function strstr is allowed.   The checks and error messages have been
      improved for both the operator and strstr.
      This update also corrects the problem where an expression was drawn multiple
      times when using a fixed length array in string comparaison.
      
      
      git-svn-id: http://root.cern.ch/svn/root/trunk@3390 27541ba8-7e3a-0410-8455-c3a389f83636
      ce83a050
  15. Jul 11, 2001
  16. Jul 10, 2001
  17. Jul 06, 2001
Loading