To compile and see errors without executing the code, the simplest is to enter ROOT and type:
.L processResultsAllTrigPt.C
Proceed this way until you have fixed all the compilation Errors and Warnings then you can execute the macro with .x
hello experts
I fixed almost my error but still I have this following error:
/home/mohammed/Desktop/NewWork27june/ProcessResultAllTriger/New.C:512:4: error: use of undeclared identifier ‘fitHist’
fitHist(h1PhiMass[iPtT][iPtA][iPhi], massMean, massRes, sig, sigErr);
^
/home/mohammed/Desktop/NewWork27june/ProcessResultAllTriger/New.C:546:9: error: use of undeclared identifier ‘fitHist’
fitHist(h1PhiBulkMass[iPtT][iPtA][iPhi], massMean, massRes, sig…
^
/home/mohammed/Desktop/NewWork27june/ProcessResultAllTriger/New.C:574:9: error: use of undeclared identifier ‘fitHist’
fitHist(h1EtaMass[iPtT][iPtA][iEta], massMean, massRes, sig, sigErr);
^
/home/mohammed/Desktop/NewWork27june/ProcessResultAllTriger/New.C:617:7: error: use of undeclared identifier ‘fitHist’
fitHist(h1Bulk1Mass[iPtT][iPtA], massMean, massRes, sig1, sigErr1);
^
/home/mohammed/Desktop/NewWork27june/ProcessResultAllTriger/New.C:649:7: error: use of undeclared identifier ‘fitHist’
fitHist(h1Bulk2Mass[iPtT][iPtA], massMean, massRes, sig1, sigErr1);
^
/home/mohammed/Desktop/NewWork27june/ProcessResultAllTriger/New.C:678:7: error: use of undeclared identifier ‘fitHist’
fitHist(h1PeakNSMass[iPtT][iPtA], massMean, massRes, sig1, sigErr1);
^
/home/mohammed/Desktop/NewWork27june/ProcessResultAllTriger/New.C:713:7: error: use of undeclared identifier ‘fitHist’
fitHist(h1PeakASMass[iPtT][iPtA], massMean, massRes, sig1, sigErr1);
^
and also i upload my code
New.C (41.8 KB)
could someone give a suggestion?
I solved this error and when i used .L processResultsAllTrigPt.C
I didn’t have any error but when I run my code by .x processResultsAllTrigPt.C I found this following message:
root [1] .L New.C
root [2] .x New.C
#0 0x00007fe7310828fa in __GI___waitpid (pid=6506, stat_loc=stat_loc
entry=0x7ffe3e57a5f8, options=options
entry=0) at ../sysdeps/unix/sysv/linux/waitpid.c:29
#1 0x00007fe730ff19cb in do_system (line=<optimized out>) at ../sysdeps/posix/system.c:148
#2 0x00007fe731c12ce7 in TUnixSystem::Exec (shellcmd=<optimized out>, this=0x5575ebc55740) at /home/mohammed/alice/sw/SOURCES/ROOT/v6-10-08/v6-10-08/core/unix/src/TUnixSystem.cxx:2118
#3 TUnixSystem::StackTrace (this=0x5575ebc55740) at /home/mohammed/alice/sw/SOURCES/ROOT/v6-10-08/v6-10-08/core/unix/src/TUnixSystem.cxx:2412
#4 0x00007fe72cec1ca5 in cling::MultiplexInterpreterCallbacks::PrintStackTrace (this=<optimized out>) at /home/mohammed/alice/sw/SOURCES/ROOT/v6-10-08/v6-10-08/interpreter/cling/lib/Interpreter/MultiplexInterpreterCallbacks.h:124
#5 0x00007fe72cec1738 in cling_runtime_internal_throwIfInvalidPointer (Interp=0x5575ebcb8300, Expr=0x5575ee1e5b40, Arg=<optimized out>) at /home/mohammed/alice/sw/SOURCES/ROOT/v6-10-08/v6-10-08/interpreter/cling/lib/Interpreter/Exception.cpp:42
#6 0x00007fe73237f3a2 in ?? ()
#7 0x00005575ee3350e0 in ?? ()
#8 0x00007fe73191e410 in vtable for std::basic_ifstream<char, std::char_traits<char> > () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#9 0x0000000000000000 in ?? ()
Error in <HandleInterpreterException>: Trying to dereference null pointer or trying to call routine taking non-null arguments.
Execution of your code was aborted.
In file included from input_line_16:1:
/home/mohammed/Desktop/NewWork27june/ProcessResultAllTriger/New.C:90:19: warning: null passed to a callee that requires a non-null argument [-Wnonnull]
if(!strcmp( key->GetName(), Form("OutputCent%d_%d", centMin, centMax))){
could someone give a suggestion?
Thanks
Can you post the New.C
file which does not produce errors with .L
?
Also see here how to post code and traceback. (enclose with 3 backquotes)
I used Root6
this my code upload
New.C (41.7 KB)
sorry this code
New.C (41.7 KB)
I am missing fitHisto.C at the line:
gROOT->LoadMacro("fitHisto.C");
An I think some root files will be missing at the line:
TFile * file = new TFile("ResultData18JUL.root", "READ");
I have this two file I will upload fitHist.C file but the root file is to long i can’t upload
fitHisto.C (8.6 KB)
How can i send for you this root file?
Seems to me you first should fix fitHisto.C
. It has many errors too.
try:
.L fitHisto.C
ok i will do to check it
I didn’t have error in fitHisto.C file i check it
root [0] .L fitHisto.C
root [1]
Ah ok … I get many errors with the last root version.
I see that, in the trace back you sent, you are accusing a null pointer. on line:
if(!strcmp( key->GetName(), Form("OutputCent%d_%d", centMin, centMax))){
may be check that the arguments of strcmp are valid ?
I solved my problem now it’s work
Thanks so much
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.