Understanding T->SetBranchAddress in Emacs Macro

  • Thread starter Thread starter lavster
  • Start date Start date
AI Thread Summary
The discussion centers on the command T->SetBranchAddress("B_PX", &B_PX); in a macro written in Emacs, which is identified as part of the ROOT framework for data analysis. This command associates the TBranch named "B_PX" with a local variable B_PX, allowing access to data from a file. Emacs is simply a text editor and does not influence the functionality of the macro. A TBranch is part of a TTree, which serves as a data structure that organizes related information, akin to a database where each branch holds specific attributes of data entries. The conversation also touches on variable declaration, clarifying that Int_t and Float_t are types used in ROOT, with Int_t representing integers and Float_t representing floating-point numbers. For deeper understanding, familiarity with C/C++ programming is recommended.
lavster
Messages
213
Reaction score
0
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
 
Technology news on Phys.org


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

thanks

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++.
 


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

cheers :)
 


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).
 


great,that seems simple enough. how do you declare the variables?is that using the float_t and int_t commands? what's the difference betweem the two. I am assuming int means integer?

thanks againfor all your help!
 


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.
 
Thread 'Is this public key encryption?'
I've tried to intuit public key encryption but never quite managed. But this seems to wrap it up in a bow. This seems to be a very elegant way of transmitting a message publicly that only the sender and receiver can decipher. Is this how PKE works? No, it cant be. In the above case, the requester knows the target's "secret" key - because they have his ID, and therefore knows his birthdate.
I tried a web search "the loss of programming ", and found an article saying that all aspects of writing, developing, and testing software programs will one day all be handled through artificial intelligence. One must wonder then, who is responsible. WHO is responsible for any problems, bugs, deficiencies, or whatever malfunctions which the programs make their users endure? Things may work wrong however the "wrong" happens. AI needs to fix the problems for the users. Any way to...
Back
Top