#include #include #include #include "TROOT.h" #include "TFile.h" #include "TH1D.h" #include "JPhysics/JRadiation.hh" #include "JROOT/JManager.hh" #include "JROOT/JRootToolkit.hh" #include "Jeep/JParser.hh" #include "Jeep/JMessage.hh" /** * Example application to display theta RMS of muon energy loss. */ int main(int argc, char **argv) { using namespace std; using namespace JPP; string outputFile; int debug; try { JParser<> zap; zap['o'] = make_field(outputFile) = "ginneken.root"; zap['d'] = make_field(debug) = 0; zap(argc, argv); } catch(const exception &error) { FATAL(error.what() << endl); } const JRadiation radiation(4.0, 8.0, 40, 0.01, 0.1, 0.1); // Be JManager HA(new TH1D("Brems1 [% GeV]", NULL, 10000, -7.5, log10(0.5))); JManager HB(new TH1D("Brems2 [% GeV]", NULL, 10000, -3.2, log10(0.5))); JManager HC(new TH1D("EErad [% GeV]", NULL, 10000, -7.8, 0.0)); for (const double E : { 1.0e2, 1.0e3 }) { TH1D* ha = HA[E]; TH1D* hb = HB[E]; TH1D* hc = HC[E]; for (int i = 1; i <= ha->GetNbinsX(); ++i) { const double x = ha->GetBinCenter(i); const double v = pow(10.0, x); const double y = radiation.ThetaRMSfromBrems(E, v); ha->SetBinContent(i, y); } for (int i = 1; i <= hb->GetNbinsX(); ++i) { const double x = hb->GetBinCenter(i); const double v = 1.0 - pow(10.0, x); const double y = radiation.ThetaRMSfromBrems(E, v); hb->SetBinContent(i, y); } for (int i = 1; i <= hc->GetNbinsX(); ++i) { const double x = hc->GetBinCenter(i); const double v = pow(10.0, x); const double y = radiation.ThetaRMSfromEErad(E, v); hc->SetBinContent(i, y); } } TFile out(outputFile.c_str(), "recreate"); out << HA << HB << HC; out.Write(); out.Close(); }