22 string locOutputFileName =
"hd_root.root";
23 if(gPARMS->Exists(
"OUTPUT_FILENAME"))
24 gPARMS->GetParameter(
"OUTPUT_FILENAME", locOutputFileName);
27 TFile* locFile = (TFile*)gROOT->FindObject(locOutputFileName.c_str());
33 TDirectory *
mainDir = gDirectory;
34 TDirectory *dircDir = gDirectory->mkdir(
"DIRC_truth");
37 int nChannels = 108*64;
38 hTruthPixelHitTime =
new TH2F(
"hTruthPixelHitTime",
"; Pixel Channel # ; #Delta t (ns)", nChannels, 0, nChannels, 200, -100, 100);
40 hTruthBarHitXY =
new TH2F(
"hTruthBarHitXY",
"; Bar Hit X (cm); Bar Hit Y (cm)", 200, -100, 100, 200, -100, 100);
41 hTruthBarHitBar =
new TH1F(
"hTruthBarHitBar",
"; Bar #", 48, 0.5, 47.5);
42 hTruthPmtHitZY_North =
new TH2F(
"hTruthPmtHitZY_North",
"North Box; PMT Hit Z (cm); PMT Hit Y (cm)", 100, 525, 560, 110, 0., 110.);
43 hTruthPmtHitZY_South =
new TH2F(
"hTruthPmtHitZY_South",
"South Box; PMT Hit Z (cm); PMT Hit Y (cm)", 100, 525, 560, 110, -110., 0.);
45 hTruthPmtHit_North =
new TH2F(
"hTruthPmtHit_North",
"North Box; Pmt Hit Column ; Pixel Hit Row", 6, 0, 6, 18, 0, 18);
46 hTruthPmtHit_South =
new TH2F(
"hTruthPmtHit_South",
"South Box; Pmt Hit Column ; Pixel Hit Row", 6, 0, 6, 18, 0, 18);
47 hTruthPixelHit_North =
new TH2F(
"hTruthPixelHit_North",
"North Box; Pixel Hit X ; Pixel Hit Y", 144, -0.5, 143.5, 48, -0.5, 47.5);
48 hTruthPixelHit_South =
new TH2F(
"hTruthPixelHit_South",
"South Box; Pixel Hit X ; Pixel Hit Y", 144, -0.5, 143.5, 48, -0.5, 47.5);
50 hPixelHit_North =
new TH2F(
"hPixelHit_North",
"North Box; Pixel Hit X ; Pixel Hit Y", 144, -0.5, 143.5, 48, -0.5, 47.5);
51 hPixelHit_South =
new TH2F(
"hPixelHit_South",
"South Box; Pixel Hit X ; Pixel Hit Y", 144, -0.5, 143.5, 48, -0.5, 47.5);
65 vector<const DBeamPhoton*> beam_photons;
66 vector<const DMCThrown*> mcthrowns;
67 vector<const DMCTrackHit*> mctrackhits;
68 vector<const DDIRCTruthBarHit*> dircBarHits;
69 vector<const DDIRCTruthPmtHit*> dircPmtHits;
70 vector<const DDIRCPmtHit*> dircRecoPmtHits;
72 loop->Get(beam_photons);
74 loop->Get(mctrackhits);
75 loop->Get(dircPmtHits);
76 loop->Get(dircBarHits);
77 loop->Get(dircRecoPmtHits);
80 vector<const DDIRCGeometry*> locDIRCGeometryVec;
81 loop->Get(locDIRCGeometryVec);
82 auto locDIRCGeometry = locDIRCGeometryVec[0];
84 for (
unsigned int j = 0; j < dircBarHits.size(); j++){
89 double x = dircBarHits[j]->x;
90 double y = dircBarHits[j]->y;
91 int bar = dircBarHits[j]->bar;
93 japp->RootWriteLock();
99 for (
unsigned int h = 0;
h < dircPmtHits.size();
h++){
101 int ch=dircPmtHits[
h]->ch;
103 double x = dircPmtHits[
h]->x;
104 double y = dircPmtHits[
h]->y;
105 double z = dircPmtHits[
h]->z;
106 double t = dircPmtHits[
h]->t;
107 double t_fixed = dircPmtHits[
h]->t_fixed;
110 int pmt_column = locDIRCGeometry->GetPmtColumn(ch);
111 int pmt_row = locDIRCGeometry->GetPmtRow(ch);
114 int pixel_row = locDIRCGeometry->GetPixelRow(ch);
115 int pixel_col = locDIRCGeometry->GetPixelColumn(ch);
117 japp->RootWriteLock();
132 for (
unsigned int h = 0;
h < dircRecoPmtHits.size();
h++){
134 int ch=dircRecoPmtHits[
h]->ch;
138 int pixel_row = locDIRCGeometry->GetPixelRow(ch);
139 int pixel_col = locDIRCGeometry->GetPixelColumn(ch);
151 japp->RootWriteLock();
TH2F * hTruthPmtHit_North
TH2F * hTruthPixelHitTime
TH2F * hTruthPixelHit_North
jerror_t evnt(JEventLoop *loop, uint64_t eventnumber)
TH2F * hTruthPixelHit_South
TH2F * hTruthPmtHit_South
~DEventProcessor_truth_dirc()
TH2F * hTruthPmtHitZY_North
TH2F * hTruthPmtHitZY_South
DEventProcessor_truth_dirc()
jerror_t brun(jana::JEventLoop *loop, int32_t runnumber)