7 #include "OscLib/IOscCalc.h"
21 return dynamic_cast<const osc::NoOscillations*
>(c) != 0;
29 : fFrom(from), fTo(to)
40 for(
int i = 0; i <
fHist->GetNbinsX()+2; ++i){
42 const double LElo =
fHist->GetXaxis()->GetBinLowEdge(i);
43 const double LEhi =
fHist->GetXaxis()->GetBinUpEdge(i);
44 fHist->SetBinContent(i, approx->
P_LoverE(from, to, LElo, LEhi));
47 const double E =
fHist->GetBinCenter(i);
48 const double Elo =
fHist->GetXaxis()->GetBinLowEdge(i);
49 const double Ehi =
fHist->GetXaxis()->GetBinUpEdge(i);
53 std::min(Elo, 0.98*E),
54 std::max(Ehi, 1.02*E)));
56 fHist->SetBinError(i, 0);
60 if(LoverE && !IsNoOscillations(calc)){
61 std::cout <<
"Trying to use a calculator which is not OscCalcSterileApprox with an L/E axis. Will have to code up additional hacks for this to work" << std::endl;
65 for(
int i = 0; i <
fHist->GetNbinsX()+2; ++i){
66 const double E =
fHist->GetBinCenter(i);
67 fHist->SetBinContent(i, E > 0 ? calc->P(from, to, E) : 0);
68 fHist->SetBinError(i, 0);
78 const TString className = h->ClassName();
80 if(className ==
"TH1D"){
89 fHist->SetTitle(
";True Energy (GeV);Probability");
96 static bool once =
true;
99 std::cerr <<
"OscCurve's fHist is associated with a directory. How did that happen?" << std::endl;
118 if(&rhs ==
this)
return *
this;
138 std::map<int, std::string> nus;
139 nus[12] = nus[-12] =
"e";
140 nus[14] = nus[-14] =
"#mu";
141 nus[16] = nus[-16] =
"#tau";
143 const std::string
nu = (
fFrom > 0) ?
"#nu" :
"#bar#nu";
145 ret->SetTitle((nu+
"_{"+nus[
fFrom]+
"}#rightarrow"+nu+
"_{"+nus[
fTo]+
"}").c_str());
double P_LoverE(int from, int to, double LElo, double LEhi)
const OscCalcSterileApprox * DowncastToSterileApprox(const osc::IOscCalc *calc, bool allowFail)
static TH1D * Copy(const TH1D *h)
BEGIN_PROLOG could also be cerr
const Binning kTrueLOverEBins
process_name opflashCryoW ana
static void Delete(TH1D *&h)
OscCurve(osc::IOscCalc *calc, int from, int to, bool LoverE)
TH1D * ToTH1(bool title=false) const
const Binning kTrueEnergyBins
Default true-energy bin edges.
OscCurve & operator=(const OscCurve &rhs)
Transition probability for any one channel as a function of energy.
static TH1D * New(const std::string &title, const Binning &bins)
double P_range(int from, int to, double Elo, double Ehi)
Prevent histograms being added to the current directory.
BEGIN_PROLOG could also be cout