my code is so complex it is written for root 5 so it wont to be easy for me to change the code to be compatible with root 6 (as a beginner). Could you please give an alternate resolution?
Wile solution (AClic) is the alternate solution. But you may need to change a few things in your code. Often the code working for CINT needs to be made fully C++ compliant to be run into AClic or ROOT 6. But that’s a good thing, your code becomes “stronger” after a such exercise. Just try what Wile suggested.
I used Root6 but I found new error the following :
( /home/mohammed/Desktop/NewWork27june/ProcessResultAllTriger/processResultsAllTrigPt.C:106:3: error: expected unqualified-id
if(bMerged){ )
could someone give a suggestion?
Please post the full error message and a few lines of code around the error message. Often this error message shows if you have an extra semicolon somewhere.
The error message as follows :
root [0] .x processResultsAllTrigPt.C
In file included from input_line_8:1:
/home/mohammed/Desktop/NewWork27june/ProcessResultAllTriger/processResultsAllTrigPt.C:106:3: error: expected unqualified-id
if(bMerged){
^
and the line it complains read as follows:
TFile * file = new TFile(“ResultData18JUL.root”, “READ”);
TFile * file;
if(bMerged){
if(bAll)
file = new TFile(“ResultData18JUL.root”, “READ”);
else
file = new TFile(Form(“MergedResultsCent%d_%d.root”,
centMin, centMax), “READ”);
2x definitions of the same variable? Just remove the second TFile *file. By the way: this code leaks memory. You first open a file and if bMerged && bAll you open the same file again - and if bMerged && !bAll, you open the MergedResults file but the ResultData file is still open.
I modified the code by this way
TFile * file = new TFile(“ResultData18JUL.root”, “READ”);
TIter nextkey(gDirectory->GetListOfKeys());
TKey* key;
while (Key = (TKey*)nextkey()){
if(!strcmp( key->GetName(), Form(“OutputCent%d_%d”, centMin, centMax))){
TList * V0Xi = (TList*)key->ReadObj();
But i found this message error as follows
/home/mohammed/Desktop/NewWork27june/ProcessResultAllTriger/processResultsAllTrigPt.C:114:5: error: expected unqualified-id
while (Key = (TKey*)nextkey()){
^
/home/mohammed/Desktop/NewWork27june/ProcessResultAllTriger/processResultsAllTrigPt.C:207:3: error: expected unqualified-id
for(Int_t iVtx = 0; iVtx < nVtx; iVtx++)
^
/home/mohammed/Desktop/NewWork27june/ProcessResultAllTriger/processResultsAllTrigPt.C:242:3: error: expected unqualified-id
for(Int_t iVtx = 0; iVtx < nVtx; iVtx++)
^
/home/mohammed/Desktop/NewWork27june/ProcessResultAllTriger/processResultsAllTrigPt.C:282:3: error: expected unqualified-id
for(Int_t iVtx = 0; iVtx < nVtx; iVtx++)
As Wile said earlier you have code outside curly brackets … I would recommend you carefully check the indentation of your code and make sure it is real C++. right now some statements are “floating around”…
i think i got this mistake now during copy from my original code because i didn’t have this error before… i will send you the my original code processResultsAllTrigPt.C (44.2 KB)
You should not remove … you should move… I have modified your macro. I fixed many mistakes but there is still some which you should fix yourself because it really depends on what you want to do. For instance fHistdPhidEtaSibK0s is declared as a vector but then you access it as a simple variable … you should choose… I guess you should spend some time cleaning up this macro which looks really ugly and difficult to understand. In particular indent it properly. processResultsAllTrigPt.C (44.9 KB)
.