You need to fix at least:
/.../caloeff.cpp:376:76: warning: more '%' conversions than data arguments [-Wformat]
...myplottimeout7sub = TString::Format("%ssi-%d_time%d-%d-%d-%d-%d-%d.pdf",...
~^
and:
././calocal.cpp:228:76: warning: data argument not used by format string [-Wformat-extra-args]
...cdenenamesum = TString::Format("Released energy by 22GeV e^{+}", particl...
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^
You are missing:
#include "TCut.h"
#include "TPaletteAxis.h"
You can then try:
root [0] .x caloeff.cpp++g
and:
root [0] .x calocal.cpp++g
faca87
May 15, 2020, 5:37pm
22
Wile_E_Coyote:
.x caloeff.cpp++g
Hi @Wile_E_Coyote thank you! I fixed the error and I added the libraries! But it’s strange that in the past I used the macro without problems (root didn’t shows the errors)
Anyway, the real solution was to run root [0] .x caloeff.cpp++g
why do I need to run in this way now? I always runned root [0] .x caloeff.cpp
Hi,
Adding a ‘+
’ or ‘++
’ after the macro name is called ACLiC (see Compiling Your Code ), and it is useful to find potential errors in your code (since it is compiled). But note that it might still works without compiling it.(note that the ‘g
’ after the ‘++
’ is useless on Windows)
Cheers, Bertrand.
faca87
May 16, 2020, 12:19pm
24
Hi @bellenot I’m trying to use the macro…I see that the code
root [0] .x caloeff.cpp++g (or `root [0] .x caloeff.cpp++`)
sometimes works and sometimes not. I mean…I run the macro, it works…if I run it again it doesn’t work (even if I delete the created file by Aclic)…I restart the computer then it works again…you see…
do you know how to solve? I can’t restart the computer every time I run the macro…
It looks like that I should delete tthe memory of cmake…
First, it has nothing to do with CMake (or did I miss something?)
Then, did you try twice in the same ROOT session?
And could you delete the ACLiC generated files and try without ACLiC (root [0] .x caloeff.cpp
)?
It works fine without ACLiC:
C:\Users\bellenot\rootdev\Forum\faca87>root -l calocal.cpp
root [0]
Processing calocal.cpp...
TFile** si-500628.root
TFile* si-500628.root
KEY: TTree lemma;1 silicon ntuple
FCN=632.698 FROM MIGRAD STATUS=CONVERGED 88 CALLS 89 TOTAL
EDM=1.4353e-07 STRATEGY= 1 ERROR MATRIX ACCURATE
EXT PARAMETER STEP FIRST
NO. NAME VALUE ERROR SIZE DERIVATIVE
1 Constant 1.68952e+03 1.84465e+01 1.90458e-01 7.09505e-06
2 Mean -1.22988e+02 2.58332e-02 3.16525e-04 -5.67110e-03
3 Sigma 2.80810e+00 1.66361e-02 1.64897e-05 3.51701e-01
FCN=603.659 FROM MIGRAD STATUS=CONVERGED 85 CALLS 86 TOTAL
EDM=1.83452e-08 STRATEGY= 1 ERROR MATRIX ACCURATE
EXT PARAMETER STEP FIRST
NO. NAME VALUE ERROR SIZE DERIVATIVE
1 Constant 1.68950e+03 1.84470e+01 1.86021e-01 -1.24167e-06
2 Mean -1.22988e+02 2.58330e-02 3.09191e-04 6.71889e-03
3 Sigma 2.80814e+00 1.66384e-02 1.67985e-05 -4.70054e-02
FCN=772.659 FROM MIGRAD STATUS=CONVERGED 137 CALLS 138 TOTAL
EDM=6.47272e-09 STRATEGY= 1 ERROR MATRIX UNCERTAINTY 2.1 per cent
EXT PARAMETER STEP FIRST
NO. NAME VALUE ERROR SIZE DERIVATIVE
1 Constant 1 8.44741e+02 1.42849e+01 -6.00916e-03 -1.62790e-06
2 Mean 1 -1.22988e+02 3.17062e-02 4.83296e-06 -2.10299e-03
3 Sigma 1 2.80812e+00 1.96985e-02 1.86447e-05 -7.99488e-03
4 Constant 2 8.44762e+02 1.42844e+01 -6.00768e-03 -1.62796e-06
5 Mean 2 -1.22988e+02 3.15782e-02 3.58955e-06 1.47948e-03
6 Sigma 2 2.80816e+00 1.87178e-02 1.73016e-05 5.95280e-03
-122.988
2.8081
-122.988
2.80814
-122.988
2.80814
Mean = -122.988
Sigma = 2.80812
Info in <TCanvas::Print>: pdf file C:/graptestbeam/si-500628/sub_9-2/si-500628_deltatime9-2.pdf has been created
Info in <TCanvas::Print>: pdf file C:/graptestbeam/si-500628/sub_9-2/si-500628_time9-2.pdf has been created
Info in <TCanvas::Print>: pdf file C:/graptestbeam/si-500628/sub_9-2/si-500628_ene9-2.pdf has been created
FCN=307.678 FROM MIGRAD STATUS=CONVERGED 72 CALLS 73 TOTAL
EDM=1.26887e-10 STRATEGY= 1 ERROR MATRIX ACCURATE
EXT PARAMETER STEP FIRST
NO. NAME VALUE ERROR SIZE DERIVATIVE
1 Constant 1.75852e+03 1.90092e+01 1.36585e-01 4.96878e-07
2 Mean -1.23526e+02 2.63736e-02 2.24305e-04 4.70596e-04
3 Sigma 2.79536e+00 1.76973e-02 1.48914e-05 6.44680e-03
Warning in <Fit>: Abnormal termination of minimization.
FCN=205.217 FROM MIGRAD STATUS=CALL LIMIT 1348 CALLS 1349 TOTAL
EDM=0.0169942 STRATEGY= 1 ERROR MATRIX UNCERTAINTY 18.6 per cent
EXT PARAMETER APPROXIMATE STEP FIRST
NO. NAME VALUE ERROR SIZE DERIVATIVE
1 Constant 1.61984e+06 9.82294e+05 6.62260e+04 -3.68135e-06
2 Mean -1.38882e+02 1.70043e+00 -9.44270e-02 -4.57479e+00
3 Sigma 4.95562e+00 2.50183e-01 7.47261e-04 -2.51375e+02
Warning in <Fit>: Abnormal termination of minimization.
FCN=398.032 FROM MIGRAD STATUS=CALL LIMIT 1801 CALLS 1802 TOTAL
EDM=155.166 STRATEGY= 1 ERR MATRIX NOT POS-DEF
EXT PARAMETER APPROXIMATE STEP FIRST
NO. NAME VALUE ERROR SIZE DERIVATIVE
1 Constant 1 1.75851e+03 2.55062e-03 1.31874e-08 -2.09902e-01
2 Mean 1 -1.23526e+02 4.18871e-06 1.27582e-11 2.81841e+02
3 Sigma 1 2.79538e+00 2.35776e-06 2.83257e-11 -6.01755e+02
4 Constant 2 -2.33408e+10 1.82668e+09 -2.33408e+10 -2.39914e-09
5 Mean 2 -1.39207e+02 5.70513e-02 7.28979e-01 2.22107e+02
6 Sigma 2 1.56532e+00 6.16781e-03 3.39270e-02 3.19781e+03
-123.449
2.70351
-128.026
1.76952
-123.449
2.70606
Mean = -136.274
Sigma = 0.618691
Info in <TCanvas::Print>: pdf file C:/graptestbeam/si-500628/sub_9-2/sub_0/si-500628_deltatime9-0.pdf has been created
FCN=295.886 FROM MIGRAD STATUS=CONVERGED 70 CALLS 71 TOTAL
EDM=4.20328e-09 STRATEGY= 1 ERROR MATRIX ACCURATE
EXT PARAMETER STEP FIRST
NO. NAME VALUE ERROR SIZE DERIVATIVE
1 Constant 1.71880e+03 1.86407e+01 1.34148e-01 6.48458e-07
2 Mean -1.23557e+02 2.65327e-02 2.18638e-04 -3.05150e-03
3 Sigma 2.72054e+00 1.63220e-02 1.41643e-05 -2.71292e-02
FCN=24.9453 FROM MIGRAD STATUS=CONVERGED 160 CALLS 161 TOTAL
EDM=5.73458e-09 STRATEGY= 1 ERROR MATRIX ACCURATE
EXT PARAMETER STEP FIRST
NO. NAME VALUE ERROR SIZE DERIVATIVE
1 Constant 1.53578e+03 7.84028e+02 1.07648e-01 -1.85380e-06
2 Mean -1.21874e+02 1.19382e+00 8.72166e-05 -1.65053e-03
3 Sigma 1.95921e+00 3.29874e-01 8.62264e-06 -8.81500e-03
FCN=53.4969 FROM MIGRAD STATUS=CONVERGED 330 CALLS 331 TOTAL
EDM=8.85916e-08 STRATEGY= 1 ERROR MATRIX UNCERTAINTY 2.3 per cent
EXT PARAMETER STEP FIRST
NO. NAME VALUE ERROR SIZE DERIVATIVE
1 Constant 1 1.16200e+03 7.33782e+01 -1.40681e-01 -1.69274e-05
2 Mean 1 -1.25739e+02 1.65618e-01 -5.26218e-04 9.67428e-03
3 Sigma 1 1.76136e+00 7.14134e-02 -2.52567e-04 -8.89554e-03
4 Constant 2 1.35576e+03 6.08027e+01 2.11880e-01 -1.30022e-05
5 Mean 2 -1.21816e+02 1.65277e-01 -5.55806e-04 -1.05415e-02
6 Sigma 2 1.99556e+00 6.77790e-02 1.37466e-04 -1.91364e-02
-123.491
2.64001
-121.873
1.95891
-123.481
2.68918
Mean = -123.505
Sigma = 2.71609
Info in <TCanvas::Print>: pdf file C:/graptestbeam/si-500628/sub_9-2/sub_0/si-500628_deltatime9-2-0.pdf has been created
Info in <TCanvas::Print>: pdf file C:/graptestbeam/si-500628/sub_9-2/sub_0/si-500628_time9-2-0.pdf has been created
Info in <TCanvas::Print>: pdf file C:/graptestbeam/si-500628/sub_9-2/sub_0/si-500628_ene9-2-0.pdf has been created
FCN=1560.06 FROM MIGRAD STATUS=CONVERGED 91 CALLS 92 TOTAL
EDM=1.16319e-07 STRATEGY= 1 ERROR MATRIX ACCURATE
EXT PARAMETER STEP FIRST
NO. NAME VALUE ERROR SIZE DERIVATIVE
1 Constant 1.08854e+03 1.58658e+01 2.08171e-01 3.98250e-06
2 Mean -1.24706e+02 4.95445e-02 7.13508e-04 -1.04128e-02
3 Sigma 3.72991e+00 3.98608e-02 3.27021e-05 -3.34850e-03
FCN=1544.69 FROM MIGRAD STATUS=CONVERGED 93 CALLS 94 TOTAL
EDM=1.09724e-07 STRATEGY= 1 ERROR MATRIX ACCURATE
EXT PARAMETER STEP FIRST
NO. NAME VALUE ERROR SIZE DERIVATIVE
1 Constant 1.08846e+03 1.58520e+01 2.07100e-01 -2.82182e-06
2 Mean -1.24706e+02 4.94214e-02 7.10692e-04 3.56308e-03
3 Sigma 3.73027e+00 3.98030e-02 3.25102e-05 1.83481e-01
FCN=518.306 FROM MIGRAD STATUS=CONVERGED 1103 CALLS 1104 TOTAL
EDM=8.07108e-09 STRATEGY= 1 ERROR MATRIX ACCURATE
EXT PARAMETER STEP FIRST
NO. NAME VALUE ERROR SIZE DERIVATIVE
1 Constant 1 9.85731e+02 2.25296e+01 1.54045e-01 -3.61029e-06
2 Mean 1 -1.23451e+02 5.99669e-02 4.85661e-04 -2.88211e-04
3 Sigma 1 2.74275e+00 5.07113e-02 2.87335e-04 -2.41387e-03
4 Constant 2 3.28496e+02 1.42716e+01 6.75696e-02 -5.88531e-06
5 Mean 2 -1.28744e+02 2.54817e-01 1.14323e-03 -7.65518e-04
6 Sigma 2 5.62789e+00 1.21159e-01 7.00396e-04 1.80445e-04
-124.706
3.72991
-124.706
1.76952
-125.6
4.90583
Mean = -125.6
Sigma = 4.90599
Info in <TCanvas::Print>: pdf file C:/graptestbeam/si-500628/sub_9-2/sub_0/sub_1/si-500628_deltatime9-1.pdf has been created
FCN=2571.39 FROM MIGRAD STATUS=CONVERGED 128 CALLS 129 TOTAL
EDM=4.14867e-10 STRATEGY= 1 ERROR MATRIX UNCERTAINTY 2.3 per cent
EXT PARAMETER STEP FIRST
NO. NAME VALUE ERROR SIZE DERIVATIVE
1 Constant 1.16363e+03 1.75328e+01 -2.01684e-02 -2.61907e-06
2 Mean -1.25100e+02 4.55642e-02 1.42115e-05 2.85078e-04
3 Sigma 2.42616e+00 2.24100e-02 -1.20809e-06 -4.43035e-03
FCN=2512.39 FROM MIGRAD STATUS=CONVERGED 131 CALLS 132 TOTAL
EDM=3.47292e-10 STRATEGY= 1 ERROR MATRIX UNCERTAINTY 2.0 per cent
EXT PARAMETER STEP FIRST
NO. NAME VALUE ERROR SIZE DERIVATIVE
1 Constant 1.16363e+03 1.75029e+01 1.62387e-02 1.65750e-06
2 Mean -1.25100e+02 4.54527e-02 2.69162e-05 -7.17737e-06
3 Sigma 2.42616e+00 2.23650e-02 -1.70864e-06 -4.21258e-03
FCN=754.643 FROM MIGRAD STATUS=CONVERGED 524 CALLS 525 TOTAL
EDM=5.37122e-09 STRATEGY= 1 ERROR MATRIX ACCURATE
EXT PARAMETER STEP FIRST
NO. NAME VALUE ERROR SIZE DERIVATIVE
1 Constant 1 3.19944e+02 8.94960e+00 8.69133e-02 -4.71845e-06
2 Mean 1 -1.30885e+02 1.66934e-01 1.21316e-03 3.42215e-04
3 Sigma 1 3.80292e+00 8.01921e-02 3.59838e-05 -7.58566e-03
4 Constant 2 1.17442e+03 2.00064e+01 2.17394e-01 -1.12387e-06
5 Mean 2 -1.24101e+02 5.19570e-02 3.95205e-04 -5.16395e-05
6 Sigma 2 1.99280e+00 2.41036e-02 1.69892e-04 -3.92572e-03
-125.1
2.42616
-125.1
2.42616
-123.505
4.23304
Mean = -126.421
Sigma = 4.23294
Info in <TCanvas::Print>: pdf file C:/graptestbeam/si-500628/sub_9-2/sub_0/sub_1/si-500628_deltatime9-2-0-1.pdf has been created
Info in <TCanvas::Print>: pdf file C:/graptestbeam/si-500628/sub_9-2/sub_0/sub_1/si-500628_time9-2-0-1.pdf has been created
Info in <TCanvas::Print>: pdf file C:/graptestbeam/si-500628/sub_9-2/sub_0/sub_1/si-500628_ene9-2-0-1.pdf has been created
FCN=65.166 FROM MIGRAD STATUS=CONVERGED 105 CALLS 106 TOTAL
EDM=1.09891e-08 STRATEGY= 1 ERROR MATRIX ACCURATE
EXT PARAMETER STEP FIRST
NO. NAME VALUE ERROR SIZE DERIVATIVE
1 Constant 1.00827e+02 5.96758e+00 9.56034e-03 4.00882e-05
2 Mean 3.00149e+03 4.12045e+01 2.64590e-02 -1.21951e-05
3 Sigma 2.79015e+02 1.95428e+01 2.44276e-05 1.44199e-02
FCN=243.498 FROM MIGRAD STATUS=CONVERGED 82 CALLS 83 TOTAL
EDM=2.45585e-08 STRATEGY= 1 ERROR MATRIX ACCURATE
EXT PARAMETER STEP FIRST
NO. NAME VALUE ERROR SIZE DERIVATIVE
1 Constant 2.11916e+02 3.58546e+00 2.18143e-02 -7.74227e-05
2 Mean 3.35611e+03 4.36825e+00 2.62122e-02 -1.06698e-05
3 Sigma 2.20881e+02 3.29284e+00 2.67344e-05 -3.66425e-02
FCN=138.874 FROM MIGRAD STATUS=CONVERGED 265 CALLS 266 TOTAL
EDM=1.94052e-08 STRATEGY= 1 ERROR MATRIX ACCURATE
EXT PARAMETER STEP FIRST
NO. NAME VALUE ERROR SIZE DERIVATIVE
1 Constant 1 1.09806e+02 4.33105e+00 1.12756e-02 -7.67746e-06
2 Mean 1 3.04913e+03 2.29237e+01 3.41038e-02 -1.09531e-05
3 Sigma 1 2.96315e+02 1.04816e+01 2.12361e-02 -2.43796e-05
4 Constant 2 1.72218e+02 8.88191e+00 2.00716e-02 -4.69807e-05
5 Mean 2 3.46715e+03 6.86872e+00 2.05077e-02 -1.11408e-05
6 Sigma 2 1.56276e+02 5.53023e+00 1.27185e-02 -2.65981e-05
3001.67
278.697
3356.11
220.881
3238.51
319.73
Mean = 3238.37
Sigma = 320.005
Info in <TCanvas::Print>: pdf file C:/graptestbeam/si-500628/sub_9-2/sub_0/sub_1/si-500628_ene_0.pdf has been created
root [1]
faca87
May 16, 2020, 12:46pm
27
Hi @bellenot thank you, sorry I tought that Root called CMAKE like Geant4 does it.
Anyway, I modified the macro in the morning
caloeff.cpp (153.0 KB)
this is the new one and it runned…
Now it isn’t running with and without ACLIC
I deleted all Aclic file …you see
there aren’t aclic file in the macros directory
then I runned the macro
but nothing is happening
root [0] .L caloeff.cpp
In file included from input_line_123:1:
/.../caloeff.cpp:314:79: warning: more '%' conversions than data arguments [-Wformat]
TString myplottimeout7sub = TString::Format("%ssi-%d_time%d-%d-%d-%d-%d-%d-%d.pdf",outfolder7sub.Data(),ifile,a,b,c,d,e,f); // TO USE FOR FILES WITH TARGET
~^
/.../caloeff.cpp:316:138: warning: format specifies type 'int' but the argument has type 'char *' [-Wformat]
TString myploteneoutcut = TString::Format("%ssi-%d_ene%d-%d_cut%d-%d_&&_enemax_lead%d=%d_%s.pdf",outfolder.Data(),ifile,a,b,c,b,enecut,energyunit); // TO USE FOR FILES WHIT TARGET
~~ ^~~~~~~~~~
%s
/.../caloeff.cpp:316:93: warning: more '%' conversions than data arguments [-Wformat]
TString myploteneoutcut = TString::Format("%ssi-%d_ene%d-%d_cut%d-%d_&&_enemax_lead%d=%d_%s.pdf",outfolder.Data(),ifile,a,b,c,b,enecut,energyunit); // TO USE FOR FILES WHIT TARGET
~^
root [1]
@bellenot Can you please tell me why obvious source code problems are not reported on Windows?
Good question, I’ll investigate…
faca87
May 16, 2020, 1:20pm
31
Hi @Wile_E_Coyote and @bellenot I fixed the errors
caloeff.cpp (148.7 KB)
but same problem
If ROOT exits, that means there was a problem… Are you sure you run the exact same macro than the one attached in your first post?
And I’ll try with ROOT 6.20.04 later
faca87
May 16, 2020, 1:21pm
33
Hi @bellenot Here the last macro caloeff.cpp (148.7 KB)
I modified it, but in the morning I used it …
As I said, sometimes it works and sometimes not…
You should try to debug it. For that you have to build ROOT in debug mode, and then use ACLiC to be able to put breakpoints to see what’s happening in your code…
As I said, I will try with ROOT 6.20.04 later
faca87
May 16, 2020, 1:31pm
35
Hi @bellenot now it worked by using Aclic …but Alic just say there are variables that I don’t use
It doesn’t hurt, but you can still clean your code
BTW, why do you run in the %ROOTSYS%\bin
directory?
faca87
May 16, 2020, 1:36pm
38
Hi @bellenot I read the path here
Where should I run?
As you prefer, anywhere else, otherwise you will mess-up the bin directory…(just my two cents)
faca87
May 16, 2020, 1:42pm
40
then have I to move the “thisroot.bat” file to other directory?