6 gROOT->LoadMacro(
"$VMCWORKDIR/macro/hypGe/Marcell/SharedMacros/SharedMacroFunctions.C");
7 gSystem->Load(
"libHypGe");
9 TString Path = getenv(
"SIMDATADIR");
10 TString FullPath= Path+
"/Gamma/Ana/CombinedData/";
11 TString OutputFullPath= Path+
"/Gamma/Ana/CombinedData/Fitted/";
12 TString FilenameWithPath= FullPath+Filename;
15 TString TxtFilename = OutputFullPath +
"FittedDataNewGeometry.txt";
16 TString RootFilename = OutputFullPath+
"Fitted_"+Filename;
26 cout << nEvents << endl;
27 cout << energy << endl;
29 TFile *
file =
new TFile(FilenameWithPath);
31 file ->GetObject(
"GamEnergy",hEnergySpec);
65 for(
int i = 0;
i<NPeaks;
i++)
67 sprintf(buf,
"gausfunc_%d",
i);
68 Gausfunc[
i] =
new TF1(buf,
"gausn(0)", energy-
i*0.511-0.02,energy-
i*0.511+0.02);
69 Gausfunc[
i]-> SetParameter(0, 100);
70 Gausfunc[
i]-> SetParLimits(0,1,300);
72 Gausfunc[
i]-> SetParameter(1, energy-
i*0.511);
73 Gausfunc[
i]-> SetParLimits(1,energy-
i*0.511-0.01,energy-
i*0.511+0.01);
74 Gausfunc[
i]-> SetParameter(2, 0.0004);
75 Gausfunc[
i]-> SetParLimits(2,0.00001,0.01);
77 hEnergySpec->Fit(buf,
"rN");
78 sprintf(buf,
"fitfunc_%d",
i);
79 fitfunc[
i] =
new TF1(buf,
"gausn(0)+pol1(3)", energy-
i*0.511-0.02,energy-
i*0.511+0.02);
88 hEnergySpec->Fit(buf,
"r+");
90 FWHM[
i] = fitfunc[
i]->GetParameter(2)*2.3548;
91 FWHMError[
i] = fitfunc[
i]->GetParError(2)*2.3548;
92 Efficiency[
i] =fitfunc[
i]->GetParameter(0)*1000000/2/
nEvents;
93 EfficiencyError[
i] = fitfunc[
i]->GetParError(0)*1E6/2/
nEvents;
95 cout <<
"eff " <<
i <<
"\t" << Efficiency[
i] << endl;
96 cout <<
"effError " <<
i <<
"\t" << EfficiencyError[
i] << endl;
98 Double_t EffInclSEP = Efficiency[0]+Efficiency[1];
99 Double_t EffInclSEPError =
sqrt(EfficiencyError[0]*EfficiencyError[0]+EfficiencyError[1]*EfficiencyError[1]);
100 Double_t EffInclSEPDEP = Efficiency[0]+Efficiency[1]+Efficiency[2];
101 Double_t EffInclSEPDEPError =
sqrt(EfficiencyError[0]*EfficiencyError[0]+EfficiencyError[1]*EfficiencyError[1]+EfficiencyError[2]*EfficiencyError[2]);
103 cout <<
"eff1 " <<
"\t" << Efficiency[0] << endl;
104 cout <<
"eff2 " <<
"\t" << EffInclSEP << endl;
105 cout <<
"eff3 " <<
"\t" << EffInclSEPDEP << endl;
107 txtfile << Geo <<
"\t" << Sektar <<
"\t"<< energy <<
"\t"<< nEvents <<
"\t"<< Efficiency[0] <<
"\t"<< EfficiencyError[0] <<
"\t"<<FWHM[0] <<
"\t"<< FWHMError[0]<<
"\t" << EffInclSEP <<
"\t" << EffInclSEPError <<
"\t" << EffInclSEPDEP <<
"\t" << EffInclSEPDEPError <<endl;
109 cout << RootFilename.Data()<< endl;
friend F32vec4 sqrt(const F32vec4 &a)
cout<< "ifile "<< ifile<< endl;cout<< " momentum sampled over "<< nsteps<< " with step width "<< 1.5/nsteps<< endl;cout<< endl;cout<< "MEAN DEDX PARAMETRIZATION"<< endl;cout<< "mom limits "<< mean_inf<< " "<< mean_sup<< endl;cout<< "mu: ";for(int param=0;param< npardedx;param++) cout<< fdedx-> GetParameter(param)<< "
Double_t GetGeoFromFilename(TString Filename)
Int_t GetIfTargetIsSimulated(TString Filename)
Double_t GetEnergyFromFilename(TString Filename)
Int_t GetNumberOfCombinedEventsFromFilename(TString Filename)