Newer
Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
#include "TROOT.h"
#include "TStyle.h"
#include "TFile.h"
#include "TTree.h"
#include "TChain.h"
#include "TCATSPhysics.h"
#include "TMust2Physics.h"
#include "NPReaction.h"
#include "ROOT/RDataFrame.hxx"
#include <ROOT/RVec.hxx>
#include "Utils.cpp"
#include <Rtypes.h>
#include <TCanvas.h>
#include <algorithm>
#include <iostream>
#include <vector>
void GetSpectrum()
{
ROOT::EnableImplicitMT();
gStyle->SetOptStat("nmeruoi");
ROOT::RDataFrame df("FinalTree", "./RootFiles/FinalTree_12Be.root");
auto dsc {df.Describe()};
dsc.Print();
//--> Read TCutGs
auto* cutChio {GetGraphCutFromFile("./Cuts/chio_v0.root")};
auto* cutPID {GetGraphCutFromFile("./../TOF.root", "TOF")};
//--> Get histograms
// kinematic lines
auto hKin {df.Histo2D({"hKin", "Kinematic lines;#theta_{Lab} [degree];E_{Vertex} [MeV]", 500, 0., 60., 500, 0., 30.}, "ThetaLab", "ELab")};
auto hBeam {df.Histo1D({"hBem", "Beam raw TOF", 500, 100., 300.}, "T_CATS1_CAV")};
// excitation energy
auto hEex {df.Histo1D("Ex")};
// beam energy
auto hBeamE {df.Histo1D("BeamEnergy")};
// Reaction
NPL::Reaction reaction("12Be(d,3He)11Li@355");
auto* g {reaction.GetKinematicLine3()};
auto* cRes {new TCanvas("cRes", "Results canvas", 1)};
cRes->DivideSquare(2);
cRes->cd(1);
hKin->DrawClone("colz");
g->SetLineColor(kRed); g->SetLineWidth(2);
g->Draw("l same");
cRes->cd(2);
hEex->DrawClone();
auto* cBeam {new TCanvas("cBeam", "Beam canvas", 1)};
cBeam->DivideSquare(2);
cBeam->cd(1);
hBeam->DrawClone();
cBeam->cd(2);
hBeamE->DrawClone();
}