Hello, I’ve a macro to analyse sipms data having more than one functions.
For example, I’ve the function
int readSEventList(TString basepath, // path of the run files
vector<int> srun, // signal (beam) run numbers
vector<int> prun={-1}, // pedestal run number, -1 for no pedestal, apply default threshold
float nsigma=3, // number of sigma for the pedestal RMS (or its default value)
int thr_gain=4096, // max gain value (13 bits adc values, should not be requires) - fix potential bug in ASCII readout Spectroscopy mode
int channel=-1, // if >=0 process channel and related paired on the opposite end of the bar
int nboard=0) { // number of e
that I can run in a root session as
.L anasipm.cpp
readSEventList(“/data/”,{41},{37})
I would like run the macro for several srun by a for cycle in a bash script. Then I wrote a simple runevent.cpp macro loading anasipm one.
#
for i in {8..58}
do
nrun=$(($1+i))
echo $nrun
#
nohup root -b -q 'runevent.cpp('$nrun')'
done
But when running runevent.cpp I get
Processing runevent.cpp(9)...
In file included from input_line_8:1:
/ana_code/runevent.cpp:13:2: error: use of undeclared identifier 'readSEventList'
readSEventList("/nfs/luna02/casaburf/x17/data/", srun, prun);
^
Then, I guess anasipm.cpp macro is not really loaded. runevent.cpp (275 Bytes)
if I understand correctly, and please correct me if I am wrong, you would like to run the function readSEventList, defined in the macro anasipm.cpp, multiple times, once per run in a certain range of your choice.
Mixing ROOT and bash is an option.
Have you perhaps considered creating another macro, that imports anasipm.cpp, and manages the loop? (this is just one of many ways to achieve your goal - always provided I am not missing something)
@danilo: Yes, I’ve the anasipm.cpp macro in which the readSEventList is defined . I want to run it several times. Then I wrote runanasipm to load readSEventList and the bash script to set the run number.
@pcanal I included the anasipm.cpp in runanasipm, but now I get
Processing runevent.cpp(8)...
warning: Failed to call `runevent(8)` to execute the macro.
Add this function or rename the macro. Falling back to `.L`.
Hi @pcanal yes. I changed the function name forgotting to change the macro one. I noticed it after that I wrote it on the forum, but I was on trip then I coulndn’t edit the message