Currently I am successfully manage to compile the Garfield++/garfieldpp/Examples/RPC/ example, on my local computer and as a result, when executing the ./Weight file I get two plots in a root canvas which I can save, from File → Save as → save the plot as .pdf.
Now I wanted to try running it on lxplus but when I run the ./Weight file on lxplus it just stays on hold on:
Script: Electrons have drifted. It took 0.07s to run.
Sensor::ExportSignal: File 'SignalNaN.csv.csv' exported.
Sensor::ExportSignal: File 'ChargeNaN.csv.csv' exported.
|
I guess waiting for the user input to save the plots, but is there a way to run it like in batch mode, like a root file root -b Weight.C ?
What am I overlooking ?
Thanks in advanced
Hi @Las_D_Nestor,
Based on your description, it seems that the application might be trying to show a GUI (X11?). Can you enable X11 forwarding (i.e., $ ssh -X ...)and try again?
Regarding the question about a batch mode, perhaps @hschindl can provide some information here.
Cheers,
J.
I have tried with GUI(x11), but the graphics and stability connection are very bad in my case. I have try it but with no success, that is why I post about the batch mode, because with that I can easily run the file and then copy the results to my local computer, much faster.
Hi,
try commenting out the last line
app.Run(kTRUE);
and/or adding a line
gROOT->SetBatch(true);
at the beginning of the program.
I will give it a try. And I get the error
: In function 'int main(int, char**)':
../Garfield++/garfieldpp/Examples/RPC/Weight.C:193:1: error: 'gRoot' was not declared in this scope
193 | gRoot->SetBatch(true);
| ^~~~~
make[2]: *** [CMakeFiles/Weight.dir/Weight.C.o] Error 1
make[1]: *** [CMakeFiles/Weight.dir/all] Error 2
make: *** [all] Error 2
Even do I have the header file #include <TROOT.h> . I am still looking what might be wrong
ohh, god I feel so bad. But, it now complies and finishes the job, but how can I save the plots? it finishes with :
AvalancheGrid::StartGridAvalanche::Avalanche maximum size of 1.6e+07 electrons reached at 0.901481 ns.
AvalancheGrid::StartGridAvalanche::Final avalanche size = 16000000 at t = 0.92892 ns.
Script: Electrons have drifted. It took 0.07s to run.
Sensor::ExportSignal: File 'SignalNaN.csv.csv' exported.
Sensor::ExportSignal: File 'ChargeNaN.csv.csv' exported.
and doing an ls
CMakeCache.txt ChargeNaN.csv SignalNaN.csv Weight
CMakeFiles Makefile TimingRPCGas.gas cmake_install.cmake
and I see no plot file saved, I mean I could replicate it having the .csv.
This is what I have made so far, I can run it in batch mode, and save all canvas in the end right before gROOT->SetBatch(true);
cSignal->SaveAs("cSignal.png");
cCharge->SaveAs("cCharge.png");
cDrift->SaveAs("cDrift.png");
But the cSignal.png, cCharge.png are the same image, and cDrfit.png is not saved.
Well still no luck on the images and cDrift has a boolean flag set to false which I change to true and adding #include "TPad.h" and also gPad->Modified(); gPad->Update(); right before the three saves as, still no image of cDrift is created.
Did you set the flag plotDrift to true?
yes, I double checked and it worked, when I added Pad->Modified(); gPad->Update(); before
cSignal->SaveAs("cSignal.png");
cCharge->SaveAs("cCharge.png");
cDrift->SaveAs("cDrift.png");
Thanks, a lot.