Millepede from shell script


I have some detectors I want to align using Millepede. I have already written the code to generate the binary file used by Pede. Everything works fine as long as I open root, load the bin.C file, which creates the binary file using Mille, and run the function [root] bin("path to rootfile")
Now I would like to run both Mille and Pede by using a shell script. The problem is that when I try to run the bin.C file with $ root -b -q -l "bin.C(\"path\")" I get a segmentation violation. This occur when I try to create Mille *mil=new Mille("binary.bin");

I think it may be when executing $ root -b -q -l "bin.C(\"path\")" what happens in root is then [root] .x bin.C("path to rootfile")
But what I want is [root] .L bin.C+ [root] bin("path to rootfile") Is there a way to achieve that from a shell script, or do you have some other suggestions?


Hello, could you try to do

If you do

it is the equivalent of opening root and doing “.x foo.C”.

If you want a command-line thing to do “.L foo.C; foo()” then you will have to write a short wrapper script like:


  gROOT.ProcessLine(".L foo.C");

Depending on whether you run in interpreted mode or ACLiC-compiled mode, you may need to add + and #includes and such. I never run my do_X scripts in compiled mode, but they often compile the thing that is .L’ed.