#include <cmath>
#include <iostream>
#include <iomanip>
#include <vector>
#include <TF1.h>
#include <TH1D.h>
#include <TH2D.h>
#include <TFile.h>
#include <TProfile.h>
#include <TCanvas.h>
#include <TRandom2.h>
#include <TVector3.h>
#include <TString.h>
#include <TLatex.h>
#include <TLine.h>
#include <TROOT.h>
#include <TMath.h>
#include "include/RootUtils.hh"
#include "include/PhotonTracer.hh"
Go to the source code of this file.
Definition at line 26 of file TransverseEff.C.
References om::cout, msf_helper::generator, MECModelEnuComparisons::i, iterations, iX, art::left(), nbins, submit_syst::x, submit_syst::y, and test::z.
33 PhotonTracer tracer(5.0);
35 TH2D* hTransverseEff =
new TH2D(
"hTransverseEff",
";X (cm);Y (cm)", 100, -0.5, 4.1, 100, -0.5, 6.14);
36 int nbins = hTransverseEff->GetXaxis()->GetNbins()*hTransverseEff->GetYaxis()->GetNbins();
39 Long64_t totalIter(0);
41 for (
int iX = 1;
iX <= hTransverseEff->GetXaxis()->GetNbins(); ++
iX)
43 for (
int iY = 1; iY <= hTransverseEff->GetYaxis()->GetNbins(); ++iY)
47 double x = hTransverseEff->GetXaxis()->GetBinCenter(
iX);
48 double y = hTransverseEff->GetYaxis()->GetBinCenter(iY);
50 Long64_t successes(0);
56 double percent_done = 100.0*((double)totalIter/(
double)(iterations*
nbins));
57 cout <<
"percent done: " << setprecision(2) << fixed << percent_done <<
"%\r" << flush;
59 if ( tracer.TraceOnePhoton( z, x, y,
false ) ) successes += 1.0;
61 hTransverseEff->SetBinContent(
iX, iY, successes/(
double)iterations);
66 hTransverseEff->Draw(
"colz");
constexpr auto const & left(const_AssnsIter< L, R, D, Dir > const &a, const_AssnsIter< L, R, D, Dir > const &b)
Long64_t iterations[nThreads]