All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
CRTHisto.cc
Go to the documentation of this file.
1 #include "CRTHisto.h"
2 
3 #include "TH1D.h"
4 #include "TH2D.h"
5 
6 void ana::SBNOsc::CRTHistos::Initialize(const std::string &postfix, const std::vector<double> &tagger_volume) {
7 #define CRT_HISTO2D(name, binx, lo_x, hi_x, biny, lo_y, hi_y) name = new TH2D((#name + postfix).c_str(), #name, binx, lo_x, hi_x, biny, lo_y, hi_y); StoreHisto(name)
8 
9  unsigned n_bins = 200;
10  CRT_HISTO2D(crt_hits_xy, n_bins, tagger_volume[0], tagger_volume[3], n_bins, tagger_volume[1], tagger_volume[4]);
11  CRT_HISTO2D(crt_hits_xz, n_bins, tagger_volume[0], tagger_volume[3], n_bins, tagger_volume[2], tagger_volume[5]);
12  CRT_HISTO2D(crt_hits_yz, n_bins, tagger_volume[1], tagger_volume[4], n_bins, tagger_volume[2], tagger_volume[5]);
13 #undef CRT_HISTO2D
14 }
15 
16 void ana::SBNOsc::CRTHistos::Get(TFile &f, const std::string &postfix) {
17 #define GET_CRT_HISTO2D(name, postfix) name = (TH2D *) f.Get((#name + postfix).c_str()); StoreHisto(name);
18  GET_CRT_HISTO2D(crt_hits_xy, postfix);
19  GET_CRT_HISTO2D(crt_hits_xz, postfix);
20  GET_CRT_HISTO2D(crt_hits_yz, postfix);
21 #undef GET_CRT_HISTO2D
22 }
23 
25  crt_hits_xy->Fill(hit.location.X(), hit.location.Y());
26  crt_hits_xz->Fill(hit.location.X(), hit.location.Z());
27  crt_hits_yz->Fill(hit.location.Y(), hit.location.Z());
28 }
29 
30 
32  crt_hits_xy->Fill(hit.x_pos, hit.y_pos);
33  crt_hits_xz->Fill(hit.x_pos, hit.z_pos);
34  crt_hits_yz->Fill(hit.y_pos, hit.z_pos);
35 }
36 
void Fill(const numu::CRTHit &hit)
Definition: CRTHisto.cc:24
#define CRT_HISTO2D(name, binx, lo_x, hi_x, biny, lo_y, hi_y)
void Get(TFile &f, const std::string &postfix)
Definition: CRTHisto.cc:16
#define GET_CRT_HISTO2D(name, postfix)
process_name hit
Definition: cheaterreco.fcl:51
TVector3 location
Location of the hit.
Definition: DetInfo.h:16
float z_pos
position in z-direction (cm).
Definition: CRTHit.hh:42
float y_pos
position in y-direction (cm).
Definition: CRTHit.hh:40
float x_pos
position in x-direction (cm).
Definition: CRTHit.hh:38
void Initialize(const std::string &postfix, const std::vector< double > &tagger_volume)
Definition: CRTHisto.cc:6