Skip to content
Snippets Groups Projects
Commit d3719b86 authored by flavigny's avatar flavigny
Browse files

Merge branch 'NPTool.2.dev' of https://gitlab.in2p3.fr/np/nptool into NPTool.2.dev

parents 364b186c 84519b92
No related branches found
No related tags found
No related merge requests found
Pipeline #72594 passed
......@@ -75,6 +75,9 @@ void Analysis::TreatEvent(){
OriginalELab = ReactionConditions->GetKineticEnergy(0);
OriginalThetaLab = ReactionConditions->GetTheta(0);
OriginalBeamEnergy = ReactionConditions->GetBeamEnergy();
ReactionVertexX = ReactionConditions->GetVertexPositionX();
ReactionVertexY = ReactionConditions->GetVertexPositionY();
ReactionVertexZ = ReactionConditions->GetVertexPositionZ();
// Get the Init information on beam position and energy
// and apply by hand the experimental resolution
// This is because the beam diagnosis are not simulated
......@@ -207,6 +210,9 @@ void Analysis::InitOutputBranch() {
RootOutput::getInstance()->GetTree()->Branch("OriginalELab",&OriginalELab,"OriginalELab/D");
RootOutput::getInstance()->GetTree()->Branch("OriginalThetaLab",&OriginalThetaLab,"OriginalThetaLab/D");
RootOutput::getInstance()->GetTree()->Branch("OriginalBeamEnergy",&OriginalBeamEnergy,"OriginalBeamEnergy/D");
RootOutput::getInstance()->GetTree()->Branch("ReactionVertexX",&ReactionVertexX,"ReactionVertexX/D");
RootOutput::getInstance()->GetTree()->Branch("ReactionVertexY",&ReactionVertexY,"ReactionVertexY/D");
RootOutput::getInstance()->GetTree()->Branch("ReactionVertexZ",&ReactionVertexZ,"ReactionVertexZ/D");
}
////////////////////////////////////////////////////////////////////////////////
......
......@@ -54,6 +54,9 @@ class Analysis: public NPL::VAnalysis{
double OriginalELab;
double OriginalThetaLab;
double OriginalBeamEnergy;
double ReactionVertexX;
double ReactionVertexY;
double ReactionVertexZ;
NPL::Reaction* He10Reaction;
// intermediate variable
......
......@@ -86,7 +86,7 @@ void ShowResults(){
f->SetNpx(1000);
TCanvas* c2 = new TCanvas("Simulated","Simulated",600,0,600,600);
c2->Divide(2,2);
c2->Divide(2,3);
c2->cd(1);
chain->Draw("OriginalELab:OriginalThetaLab>>hS(1000,0,90,1000,0,30)","","col");
......@@ -110,6 +110,7 @@ void ShowResults(){
TLine* lT = new TLine(0,0,90,90);
lT->Draw();
c2->cd(4);
chain->Draw("OriginalBeamEnergy:BeamEnergy>>hS4(1000,500,600,1000,500,600)","BeamEnergy>0","col");
TH1F* hS4 = (TH1F*) gDirectory->FindObjectAny("hS4");
......@@ -120,5 +121,16 @@ void ShowResults(){
lB->Draw();
c2->cd(5);
chain->Draw("ReactionVertexY:ReactionVertexX>>hVXY(1000,-20,20,1000,-20,20)","","col");
TH2F* hVXY = (TH2F*) gDirectory->FindObjectAny("hVXY");
hVXY->GetYaxis()->SetTitle("Reaction vertex Y (mm)");
hVXY->GetXaxis()->SetTitle("Reaction vertex X (mm)");
c2->cd(6);
chain->Draw("ReactionVertexX:ReactionVertexZ*1000.>>hVXZ(1000,-15,15,1000,-20,20)","","col");
TH2F* hVXZ = (TH2F*) gDirectory->FindObjectAny("hVXZ");
hVXZ->GetZaxis()->SetTitle("Reaction vertex X (mm)");
hVXZ->GetXaxis()->SetTitle("Reaction vertex Z (um)");
}
npsimulation -D Example1.detector -E Example1.reaction -O Example1 -B run.mac
npanalysis --last-sim -O Example1
root ShowResults.C
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment