I am now facing an other issue, trying to run a “production” analysis code written on ROOT version 5.
I get many errors and I do not understand why.
Following is a sample of the code.
// Travail sur l’etalonnage YAP
// On selectionne les evenements ayant declenche la voie 5
TCut YInPMT5 = “Amp[5]<(-10*SigLB[5])” ; // Seuil a 10 sigma
HHeader = "Etalonnage YAP ";
TCanvas *c11 = new TCanvas(“c11”, HHeader.c_str(), 10, 10, 1200, 800);
c11->Divide(2,2);
c11->cd(1);
TH1F hYAPAmp_Cut(“HistAmpYAPCutPMT5”, “Spectre YAP Amp Cut PMT5”, 200, -0.5, 0.);
te->Draw(“Amp[0]>>HistAmpYAPCutPMT5”, YInPMT5);
hYAPAmp_Cut.Fit(“gaus”,“R”,"", -0.15, -0.1);
// On calcule la constante Etalonnage YAP Amp
double FitRes_YAPAmp511;
{ TF1 *fit = hYAPAmp_Cut.GetFunction(“gaus”);
FitRes_YAPAmp511= fit->GetParameter(1);
}
double CalVal_YAPAmp= 511./FitRes_YAPAmp511; //keV/Volt
StrRes<<“Constante Calibration YAP: keV/volt\n” << CalVal_YAPAmp << endl;
cout <<“Constante Calibration YAP: keV/volt\n” << CalVal_YAPAmp << endl;
// Up to now it works
// On affiche le spectre etalonne et on fitte la resolution en energie
TH1F hYAP_Energ(“hYAP_Amp_keV”,“Spectre YAP Amp Cut PMT5”, 200, 0., 1000.);
char CalVal[10]; sprintf(CalVal, “%f”, CalVal_YAPAmp);
string toto = CalVal; toto += “*Amp[0]>>hYAP_Amp_keV”; cout<< toto << endl;
te->Draw(toto.c_str(),YInPMT5);
// There I get:
Constante Calibration YAP: keV/volt
-4339.94
-4339.944165*Amp[0]>>hYAP_Amp_keV
*** Break *** segmentation violation
Generating stack trace…
[invalid usage]: unrecognized option '-d’
Usage: atos [-p pid] [-o executable] [-f file] [-s slide | -l loadAddress] [-arch architecture] [-printHeader] [address …]
0x0000000112594c36 in _ZN13TSelectorDraw5BeginEP5TTree + 0x1166 from /Volumes/AliBaba/Codes/ExternLib/root/lib/libTreePlayer.so
[invalid usage]: unrecognized option '-d’
Usage: atos [-p pid] [-o executable] [-f file] [-s slide | -l loadAddress] [-arch architecture] [-printHeader] [address …]
0x00000001125c40f5 in _ZN11TTreePlayer7ProcessEP9TSelectorPKcxx + 0x95 from /Volumes/AliBaba/Codes/ExternLib/root/lib/libTreePlayer.so
[invalid usage]: unrecognized option '-d’
Usage: atos [-p pid] [-o executable] [-f file] [-s slide | -l loadAddress] [-arch architecture] [-printHeader] [address …]
0x00000001125bd23a in _ZN11TTreePlayer10DrawSelectEPKcS1_S1_xx + 0x78a from /Volumes/AliBaba/Codes/ExternLib/root/lib/libTreePlayer.so
[invalid usage]: unrecognized option '-d’
Usage: atos [-p pid] [-o executable] [-f file] [-s slide | -l loadAddress] [-arch architecture] [-printHeader] [address …]
0x00000001088b3d62 in main + 0xf22 from /Volumes/AliBaba/Codes/DO2Analyse/.//AnalyseDO2Exe
[invalid usage]: unrecognized option '-d’
Usage: atos [-p pid] [-o executable] [-f file] [-s slide | -l loadAddress] [-arch architecture] [-printHeader] [address …]
0x00007fff8b6715c9 in start + 0x1 from /usr/lib/system/libdyld.dylib
Can you help me?
Best regards