Creating Macros in ROOT

Hello everyone,

I am a summer student at CERN and participated in the ROOT workshop last week. Unfortunately, I found the workshop difficult and felt excluded, as I have no prior experience with the command line and felt that the workshop was better suited for non-beginners. Nevertheless, I am starting to go through the workshop material at my own pace now, with the help of the ROOT primer and manual.

The sources I mentioned above are good at explaining how to execute a ROOT macro. However, none explain how to actually make a ROOT macro. For instance, the manual says to:

Create a new file in your preferred text editor.

This is not explained further and is foreign to me. The workshop, primer, and manual all assume that I know how to do this. But I do not. Surely, more summer students and ROOT beginners have faced this problem before. So why do the primer, manual, and workshop material not mention this further? But if it is hidden somewhere I have not found, I apologize. I also apologize if someone has asked this already here, but I searched and could not find it.

So, could someone please explain how I can make a macro from the command line? I have connected to lxplus. Any (lighter) material suggestions where I can read about the command line in Linux would be greatly appreciated.

Thank you for your time and help.

Welcome to the ROOT forum.

The use of a text editor is assumed to be a beginner’s knowledge that’s why it is not explained in more detail in the documentation. You can find the definition of a “text editor” in many places on the web. For instance:

" A text editor is a simple computer program that allows users to create, change, or edit plain text files . It can be used for creating computer programs"

Examples of such programs are vi, vim, nano etc …

I hope it helps.

1 Like

Hi @astongea,

thank you for your question and also the feedback on the course. As mentioned above, the command line tools are an assumed prior knowledge to run the macros version of the exercises, however, you can always try and use the SWAN notebooks instead. For some basic command line tools, just google, for example: create a new file using nano or vim and you should find plenty of resources online.

If you would like to practice more/ask more questions you can sign up for either of the next summer student ROOT course sessions (one tomorrow afternoon and one on July 27th). The covered material will be similar, but maybe now you will be able to follow the course better or ask more specific questions.

Cheers,
Marta

1 Like

Thank you for your help! Yes, I figured a text editor edits text, but was unaware of the examples you listed. As I said, I have no prior experience with Linux. It works for me now. Thank you for your help, sorry for my lack of experience.

Hi again,

don’t be sorry, we’re here to help. In the meantime I also found something that could be a useful resource for you: The Unix Shell: Summary and Setup. And don’t hesitate to ask more questions!

Cheers,
Marta