Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

What does T->SetBranchAddress ( B_PX , &B_PX); mean in the macro written in emacs

  1. Jul 16, 2010 #1
    what does T->SetBranchAddress ("B_PX", &B_PX); mean in the macro written in emacs

    what does T->SetBranchAddress ("B_PX", &B_PX); mean in the macro written in emacs

    thanks
     
  2. jcsd
  3. Jul 16, 2010 #2
    Re: what does T->SetBranchAddress ("B_PX", &B_PX); mean in the macro written in emacs

    That looks like its actually a TTree object from ROOT. It means that the TBranch called "B_PX" is being read from a file, and when you want to access its done through your local variable (that is declared) B_PX.

    This will probably help you:
    http://root.cern.ch/drupal/content/users-guide

    Emacs is just an editor, like vi or wordpad, it has no relevance except reading the text file that the macro is written on. The program is written *in* C/C++.
     
  4. Jul 17, 2010 #3
    Re: what does T->SetBranchAddress ("B_PX", &B_PX); mean in the macro written in emacs

    excellent thanks! thanks for the link and your explanation!! however, whats a tbranch, or just a branch in general?

    cheers :)
     
  5. Jul 17, 2010 #4
    Re: what does T->SetBranchAddress ("B_PX", &B_PX); mean in the macro written in emacs

    Basically, a tree is a storage container that links assorted information/data-pieces together.

    For example, say you take a group of people and record info on all of them (height, weight, age, sex, name, etc). You could assign each of those values to a branch in the tree. If you want all of the info on person #3, you'd just look at the 3rd entry in each branch of the tree.

    Incidentally, branches can also be more complicated, they can be structures, objects, arrays, arrays of objects, etc.

    In the ROOT software, they typically denote all of their objects by Txxxxxx, so TBranch is just their version of a branch in a TTree (their version of a tree).
     
  6. Jul 18, 2010 #5
    Re: what does T->SetBranchAddress ("B_PX", &B_PX); mean in the macro written in emacs

    great,that seems simple enough. how do you declare the variables?is that using the float_t and int_t commands? whats the difference betweem the two. im assuming int means integer?

    thanks againfor all your help!
     
  7. Jul 18, 2010 #6
    Re: what does T->SetBranchAddress ("B_PX", &B_PX); mean in the macro written in emacs

    No problem lavster.

    Int_t is basically just like int, which is an integer. Float_t is just like a regular float (floats are basically the computers attempt to make real numbers). At this point you really should pick up an intro C/C++ book -- it will then all make more sense.
     
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook




Similar Discussions: What does T->SetBranchAddress ( B_PX , &B_PX); mean in the macro written in emacs
Loading...