MUSIC
unknown
Analysis for the MUSIC active-target ionization chamber
Toggle main menu visibility
Loading...
Searching...
No Matches
TagEfficiency.hpp
Go to the documentation of this file.
1
#ifndef TAG_EFFICIENCY_HPP
2
#define TAG_EFFICIENCY_HPP
20
#include "
RegionCuts.hpp
"
21
#include <Rtypes.h>
22
#include <TCutG.h>
23
#include <TString.h>
24
#include <map>
25
#include <vector>
26
27
class
TFile;
28
class
TH2F;
29
class
TTree;
30
struct
CrossSectionChannel
;
31
38
struct
TagEfficiencyRecord
{
39
Int_t
reac
= -1;
44
Double_t
n_counted
= 0.0;
46
Double_t
eff
= 0.0;
48
Double_t
eff_err
= 0.0;
51
Double_t
migrate
= 0.0;
53
Double_t
tag_eff
= 0.0;
54
};
55
57
namespace
TagEfficiencyStore
{
58
61
TString
Path
();
69
void
Write
(
const
TString &channel,
70
const
std::vector<TagEfficiencyRecord> &records,
71
const
TString &method);
79
Bool_t
Load
(
const
TString &channel, Int_t reac,
TagEfficiencyRecord
&record);
82
TString
Method
();
83
}
// namespace TagEfficiencyStore
84
96
class
TagEfficiency
{
97
public
:
103
Bool_t
Run
();
104
106
static
const
char
*
MethodLabel
() {
107
return
"bootstrap: mean trace inside the hand-drawn cut, resampled with "
108
"the measured per-strip beam widths"
;
109
}
110
111
private
:
112
struct
Strip {
113
TCutG *cut =
nullptr
;
// the channel's hand-drawn cut at this strip
114
std::vector<Double_t> mean;
// mean trace of the events inside it
115
Double_t count = 0.0;
// how many
116
};
117
struct
Outcome {
118
Long64_t n = 0, tagged = 0, inside = 0, next_inside = 0;
119
};
120
121
Bool_t LoadSigmas(TFile &cache);
122
// One channel end to end; kTRUE when it produced at least one record.
123
Bool_t RunChannel(
const
CrossSectionChannel &ch, TTree *reservoir);
124
void
LoadDrawnCuts(
const
TString ®ion);
125
void
MeanTraces(TTree *reservoir);
126
Outcome Bootstrap(Int_t reac, TH2F *plane);
127
void
DrawMeanTrace(
const
TString &subdir, Int_t reac,
const
Strip &st);
128
void
DrawPlane(
const
TString &subdir, Int_t reac, TH2F *plane, TCutG *cut);
129
130
std::map<Int_t, Strip> strips_;
// the channel being run
131
};
132
133
#endif
RegionCuts.hpp
TagEfficiency
The bootstrap method for measuring the tag efficiency.
Definition
TagEfficiency.hpp:96
TagEfficiency::MethodLabel
static const char * MethodLabel()
The label stamped into the store for this method.
Definition
TagEfficiency.hpp:106
TagEfficiency::Run
Bool_t Run()
Measure every configured channel and write the store and figures.
Definition
TagEfficiency.cpp:332
TagEfficiencyStore
Persistence for the efficiency records.
Definition
TagEfficiency.hpp:57
TagEfficiencyStore::Load
Bool_t Load(const TString &channel, Int_t reac, TagEfficiencyRecord &record)
Read one record.
Definition
TagEfficiency.cpp:64
TagEfficiencyStore::Method
TString Method()
The method label stamped into the store.
Definition
TagEfficiency.cpp:87
TagEfficiencyStore::Path
TString Path()
Path to the store.
Definition
TagEfficiency.cpp:27
TagEfficiencyStore::Write
void Write(const TString &channel, const std::vector< TagEfficiencyRecord > &records, const TString &method)
Replace one channel's records, keeping every other channel's.
Definition
TagEfficiency.cpp:38
CrossSectionChannel
One reaction channel the cross section is extracted for.
Definition
Constants.hpp:222
TagEfficiencyRecord
One channel and strip's efficiency, as the cross section consumes it.
Definition
TagEfficiency.hpp:38
TagEfficiencyRecord::reac
Int_t reac
Reaction strip index; -1 for an unset record.
Definition
TagEfficiency.hpp:39
TagEfficiencyRecord::migrate
Double_t migrate
Fraction of true reactions at this strip counted at strip reac + 1 instead, which the cross section u...
Definition
TagEfficiency.hpp:51
TagEfficiencyRecord::n_counted
Double_t n_counted
The numerator this efficiency belongs to: the events counted at this strip by the same selection the ...
Definition
TagEfficiency.hpp:44
TagEfficiencyRecord::eff
Double_t eff
Fraction of true reactions at this strip that end up in n_counted.
Definition
TagEfficiency.hpp:46
TagEfficiencyRecord::tag_eff
Double_t tag_eff
Of eff, the part the tag alone passes; the remainder is the region cut.
Definition
TagEfficiency.hpp:53
TagEfficiencyRecord::eff_err
Double_t eff_err
Uncertainty on eff, or 0 when the method provides none.
Definition
TagEfficiency.hpp:48
tooling
include
TagEfficiency.hpp
Generated by
1.17.0