# Running the macro

**URL:** <https://root-forum.cern.ch/t/running-the-macro/35180>\
**Category:** Newbie\
**Created:** [July 13, 2019, 8:57pm UTC](https://root-forum.cern.ch/t/running-the-macro/35180 "2019-07-13T20:57:27Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![shahina](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/shahina/32/19464_2.png) [@shahina](https://root-forum.cern.ch/u/shahina)\
**Post date:** [July 13, 2019, 8:57pm UTC](https://root-forum.cern.ch/t/running-the-macro/35180/1 "2019-07-13T20:57:27Z")

</div>

Hi,

I am having trouble running the following macro. Can anyone help me with that? I don’t know what arguments to pass on the terminal in order to run this. Also, it takes some input file as the input which I don’t understand how is it getting created. The input file inside the cal folder exists for some run but not for all. I have just entered the values in the calDefault\_quadratic.txt. Can someone help me? I will be really thankful to you.[mg25yields.cpp](https://root-forum.cern.ch/uploads/short-url/6ftTBBN12boXT0MVpTG2Snd0jx6.cpp) (5.8 KB)  
Here is the link to the cal folder.  
[https://drive.google.com/drive/folders/1CxwgCdTWFIIGV0fWqBfwVTrnzr-BUMOu?usp=sharing](https://drive.google.com/drive/folders/1CxwgCdTWFIIGV0fWqBfwVTrnzr-BUMOu?usp=sharing)

---

<div class="post-metadata">

**Author:** ![eguiraud](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/eguiraud/32/32217_2.png) [@eguiraud](https://root-forum.cern.ch/u/eguiraud)\
**Post date:** [July 15, 2019, 7:28am UTC](https://root-forum.cern.ch/t/running-the-macro/35180/2 "2019-07-15T07:28:33Z")

</div>

Hi @shahina,  
I can’t seem to access the google drive share without permission.

`mh25yields.cpp` is not a macro (i.e. is not meant to be executed via the ROOT interpreter, e.g. with `root macro.cpp`). It’s a full C++ program made to be compiled (e.g. with `g++ -o mg25yields mg25yields.cpp $(root-config --libs --cflags)`) and then you can run it and pass arguments to it with `./mg25yields arg1 arg2 arg3 ...`.

Reading the code, the arguments you need to pass are, in order, `runNumber`, `inputCalName`, `outputCalName` and `reportName`. They are all optional, the code uses some default values if you don’t provide any of the arguments.

It looks like there are several hardcoded paths in the program, so if you don’t have the correct files in the correct directories, the program will complain.

You will have to ask the author of the program for more specific details, I’m afraid.

Hope this helps!  
Cheers,  
Enrico
