MUSIC unknown
Analysis for the MUSIC active-target ionization chamber
Loading...
Searching...
No Matches
CrossSection.hpp
Go to the documentation of this file.
1#ifndef CROSS_SECTION_HPP
2#define CROSS_SECTION_HPP
32#include <Rtypes.h>
33#include <TString.h>
34#include <map>
35#include <utility>
36#include <vector>
37
38class TCutG;
39class TFile;
40class TGraph;
41class TH2F;
43
51public:
61 Bool_t Run();
62
77 static Bool_t ExitResidue(const TString &exit, Int_t z_beam, Int_t a_beam,
78 Int_t &z, Int_t &a);
83 static TString Label(const CrossSectionChannel &ch);
84
85private:
86 struct TalysCurve {
87 TString label;
88 TGraph *axn;
89 };
90 struct Point {
91 Int_t reac;
92 Double_t e_in, e_out, e_eff, e_eff_lo, e_eff_hi; // E_cm [MeV]
93 Double_t n_reac, n_denom;
94 Double_t sigma, stat, sys; // [mb]
95 Double_t Err() const;
96 };
97 struct ChannelResult {
98 const CrossSectionChannel *ch;
99 std::vector<TalysCurve> talys;
100 std::vector<Point> points;
101 };
102
103 Bool_t LoadCache();
104 Bool_t LoadBeam();
105 // Every residual-production graph of every model in
106 // root_files/talys/talys_xs.root, keyed by model then (Z, A).
107 void LoadTalys();
108 // The channel's curves: per model, the sum over its exits' residues.
109 std::vector<TalysCurve> ChannelCurves(const CrossSectionChannel &ch) const;
110 Bool_t RunChannel(const CrossSectionChannel &ch, ChannelResult &out);
111 // One strip's point, or kFALSE (with a printed reason) when it has none.
112 Bool_t Strip(const CrossSectionChannel &ch,
113 const std::vector<TalysCurve> &talys, Int_t reac, Point &pt);
114 void CompareReference(const ChannelResult &r) const;
115 // The figure for these channels; name is the file's basename.
116 void Draw(const std::vector<const ChannelResult *> &rs,
117 const TString &name) const;
118
119 static Long64_t ReadCount(TFile &f, const char *name, Bool_t &ok);
120 static TGraph *Clipped(TGraph *g, Double_t e_lo, Double_t e_hi);
121 static Double_t EffectiveEnergy(TGraph *axn, Double_t e_out, Double_t e_in);
122 static TCutG *ScaledCut(TCutG *cut, Double_t scale);
123 static Double_t CountInCut(TH2F *scatter, TCutG *cut, Double_t scale);
124 static Double_t Enclosed(Double_t nsigma);
125
126 TFile *cache_ = nullptr;
127 Long64_t n_seen_ = 0, n_beam_ = 0;
128 Double_t n_gas_ = 0.0, areal_ = 0.0;
129 Double_t dE_[18], e_strip0_ = 0.0, cm_frac_ = 0.0, e_mid_[17];
130 std::vector<TString> talys_labels_;
131 std::vector<std::map<std::pair<Int_t, Int_t>, TGraph *>> talys_raw_;
132 // Unfolding state carried from one strip to the next within a channel.
133 Int_t prev_reac_ = -1;
134 Double_t prev_true_ = 0.0, prev_migrate_ = 0.0;
135};
136
137#endif
Computes and reports the absolute cross sections.
static TString Label(const CrossSectionChannel &ch)
Display label for a channel.
Bool_t Run()
Run every channel and write the tables and figures.
static Bool_t ExitResidue(const TString &exit, Int_t z_beam, Int_t a_beam, Int_t &z, Int_t &a)
Residual nucleus left by a named exit channel.
One reaction channel the cross section is extracted for.