Skip to content
Snippets Groups Projects
Commit c304c4be authored by tiwillia's avatar tiwillia Committed by tiwillia
Browse files

Modified TestEm5 for compatibility with LHCbPR

git-svn-id: svn+ssh://svn.cern.ch/reps/lhcb/Geant4/trunk@195367 4525493e-7705-40b1-a816-d608a930855b
parent 1c5192f9
No related branches found
No related tags found
No related merge requests found
......@@ -18,7 +18,7 @@ include_dirs ../include
#------ Building the library -------
macro_append ROOT_linkopts " -lHist"
macro_append ROOT_linkopts " -lHist -lGpad"
library G4TestEm5 $(G4LibraryFlags) ../src/*.cc
apply_pattern linker_library library=G4TestEm5
......
......@@ -6,6 +6,7 @@
#include"TF1.h"
#include<map>
#include"TFitResultPtr.h"
#include<fstream>
struct DataPoint{
double Energy;
double rms;
......
......@@ -23,7 +23,7 @@ cd $TestDir
fi
MacGen.py $n
testEm5.exe BruteForce.mac
testEm5.exe BruteForce.mac $n
......
......@@ -50,6 +50,7 @@
#include"TGraphErrors.h"
#include"TH1D.h"
#include"TFile.h"
#include"TCanvas.h"
#ifdef G4VIS_USE
#include "G4VisExecutive.hh"
......@@ -126,6 +127,10 @@ int main(int argc,char** argv) {
TFile* Out= new TFile("RMSResults.root","RECREATE");
rmsplot->Write();
rmsfittedplot->Write();
TCanvas C;
rmsplot->Draw("AP");
C.Print("Results.pdf");
std::vector<TH1D*>::iterator Vi=V.begin();
for(;Vi!=V.end();++Vi)
{
......
......@@ -43,6 +43,8 @@ void RMSPlotter::AddRun(Double_t _Energy, Double_t _rms){
}
TGraphErrors* RMSPlotter::MakePlots(){
std::ofstream outt("Results_Table.txt");
outt<<"Energy/MeV "<<"RMS of Scattering Angle/mRad "<<" Uncertainty/mRad" <<std::endl;
int D= DataPoints.size();
Double_t* E=new Double_t[D];
Double_t* R=new Double_t[D];
......@@ -55,13 +57,16 @@ TGraphErrors* RMSPlotter::MakePlots(){
R[a]=(*Di).rms=(*Di).Distribution->GetMean();
RU[a]=(*Di).rmsUncert=(*Di).Distribution->GetRMS();
EU[a]=0;
outt<<E[a]<<" , "<<R[a]<<" , "<<RU[a]<<std::endl;
}
ThePlot= new TGraphErrors(D,E,R,EU,RU);
ThePlot->SetTitle("Plot from taking RMS of RMS Distribution;Energy/MeV;RMS/mrad");
ThePlot->SetTitle("RMS of Scattering Angle Against Energy;Energy/MeV;RMS/mrad");
delete[] E;
delete[] R;
delete[] RU;
delete[] EU;
outt.close();
std::cout<<"MADE A PLOT "<<std::endl;
return ThePlot;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment