MUSIC unknown
Analysis for the MUSIC active-target ionization chamber
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
27class TFile;
28class TH2F;
29class TTree;
31
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
58
61TString Path();
69void Write(const TString &channel,
70 const std::vector<TagEfficiencyRecord> &records,
71 const TString &method);
79Bool_t Load(const TString &channel, Int_t reac, TagEfficiencyRecord &record);
82TString Method();
83} // namespace TagEfficiencyStore
84
97public:
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
111private:
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 &region);
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
The bootstrap method for measuring the tag efficiency.
static const char * MethodLabel()
The label stamped into the store for this method.
Bool_t Run()
Measure every configured channel and write the store and figures.
Persistence for the efficiency records.
Bool_t Load(const TString &channel, Int_t reac, TagEfficiencyRecord &record)
Read one record.
TString Method()
The method label stamped into the store.
TString Path()
Path to the store.
void Write(const TString &channel, const std::vector< TagEfficiencyRecord > &records, const TString &method)
Replace one channel's records, keeping every other channel's.
One reaction channel the cross section is extracted for.
One channel and strip's efficiency, as the cross section consumes it.
Int_t reac
Reaction strip index; -1 for an unset record.
Double_t migrate
Fraction of true reactions at this strip counted at strip reac + 1 instead, which the cross section u...
Double_t n_counted
The numerator this efficiency belongs to: the events counted at this strip by the same selection the ...
Double_t eff
Fraction of true reactions at this strip that end up in n_counted.
Double_t tag_eff
Of eff, the part the tag alone passes; the remainder is the region cut.
Double_t eff_err
Uncertainty on eff, or 0 when the method provides none.