1#ifndef GAMR_NUCLEUS_TRANSITION_HH
2#define GAMR_NUCLEUS_TRANSITION_HH
24 Transition(
double E=0,
double PL=0,
double PH=4096,
double BL=0,
double BH=4096) :
27 void SetPeak() { std::cout <<
"Setting peak: " << std::endl;
fPeak.SetGate(); }
28 void SetPeak(
double Low,
double High) {
fPeak.SetGate(Low, High); }
34 double Apply(TH1D *hist)
const;
48 std::map<std::string, Transition > fMap;
52 TransitionMap(
const char *name, std::string asciimapfilename);
54 std::map<std::string, Transition > *
GetMap() {
return &fMap; }
55 void ReadFile(std::string asciimapfilename);
56 void WriteFile(std::string asciimapfilename);
57 void ls(Option_t *option =
"")
const
60 printf(
"Key Peak Low Peak High Background Low Background High\n");
61 for (
auto i = fMap.begin(); i != fMap.end(); ++i) {
62 for (
int ibackgate = 0; ibackgate<(i->second.GetGateBGs())->size(); ++ibackgate ) {
63 printf(
"%-20s%-12.2f%-12.2f%-18.2f%-18.2f\n", (i->first).c_str(),
64 (
double)((i->second).GetGate()->GetLow()),
65 (
double)((i->second).GetGate()->GetHigh()),
66 (
double)((*(i->second).GetGateBGs())[ibackgate].GetLow()),
67 (
double)((*(i->second).GetGateBGs())[ibackgate].GetHigh()));
double Apply(TH1D *hist) const
const GamR::TK::Gate * GetGate() const
double ApplyCountsError(TH1D *hist) const
std::vector< GamR::TK::Gate > fBackground
const std::vector< GamR::TK::Gate > * GetGateBGs() const
double ApplyError(TH1D *hist) const
Transition(double E=0, double PL=0, double PH=4096, double BL=0, double BH=4096)
void SetBackground(double Low, double High)
void SetPeak(double Low, double High)
const GamR::TK::Gate * GetGateBG() const
double ApplyCounts(TH1D *hist) const
void WriteFile(std::string asciimapfilename)
std::map< std::string, Transition > * GetMap()
TransitionMap(const char *name)
void ReadFile(std::string asciimapfilename)
void ls(Option_t *option="") const
Transition & operator[](std::string key)