Hello, I’ve a macro to open root file created by compass, find coincidences and save a new root file.
Now we set the autosave in compass then compass autosaves root files based on the maximum file size.
Then, I’ve to implement the possibility to merge the root files created by compass.
compass saves in this way:
- The first file is called SDataR_run_RUNNUMBER.root
- The other files are called SDataR_run_RUNNUMBER_1.root, SDataR_run_RUNNUMBER_2.root, SDataR_run_RUNNUMBER_3.root
Obviously the number of files is variable. Then, the macro should
- Look for the first file SDataR_run_RUNNUMBER.root, then look for other files.
If there is only SDataR_run_RUNNUMBER.root it can use it. If there are also SDataR_run_RUNNUMBER_*.root files, the macro should firstly sum all the root files SDataR_run_RUNNUMBER.root + SDataR_run_RUNNUMBER_1.root + SDataR_run_RUNNUMBER_2.root… SDataR_run_RUNNUMBER_N.root
how should I do that?