11 #include <beast/microtpc/modules/MicrotpcStudyModule.h>
12 #include <beast/microtpc/dataobjects/MicrotpcSimHit.h>
13 #include <beast/microtpc/dataobjects/TPCG4TrackInfo.h>
14 #include <beast/microtpc/dataobjects/MicrotpcHit.h>
15 #include <beast/microtpc/dataobjects/MicrotpcRecoTrack.h>
16 #include <generators/SAD/dataobjects/SADMetaHit.h>
17 #include <framework/datastore/StoreArray.h>
18 #include <framework/logging/Logger.h>
19 #include <framework/gearbox/GearDir.h>
21 #include <boost/foreach.hpp>
39 using namespace microtpc;
53 setDescription(
"Study module for Microtpcs (BEAST)");
56 addParam(
"ChipRowNb", m_ChipRowNb,
"Chip number of row", 226);
57 addParam(
"ChipColumnNb", m_ChipColumnNb,
"Chip number of column", 80);
58 addParam(
"ChipColumnX", m_ChipColumnX,
"Chip x dimension in cm / 2", 1.0);
59 addParam(
"ChipRowY", m_ChipRowY,
"Chip y dimension in cm / 2", 0.86);
60 addParam(
"z_DG", m_z_DG,
"Drift gap distance [cm]", 12.0);
63 MicrotpcStudyModule::~MicrotpcStudyModule()
68 void MicrotpcStudyModule::defineHisto()
70 for (
int i = 0 ; i < 6 ; i++) {
71 h_tpc_rate[i] =
new TH1F(TString::Format(
"h_tpc_rate_%d", i),
"detector #", 8, 0., 8.);
74 h_mctpc_recoil[0] =
new TH3F(
"h_mctpc_recoil_He",
"Neutron recoil energy [MeV]", 13, -0.5, 12.5, 8, -0.5, 7.5, 1000, 0., 10.);
75 h_mctpc_recoilW[0] =
new TH3F(
"h_mctpc_recoil_w_He",
"Neutron recoil energy [MeV]", 13, -0.5, 12.5, 8, -0.5, 7.5, 1000, 0., 10.);
76 h_mctpc_recoil[0]->Sumw2();
77 h_mctpc_recoilW[0]->Sumw2();
79 h_mctpc_recoil[1] =
new TH3F(
"h_mctpc_recoil_O",
"Neutron recoil energy [MeV]", 13, -0.5, 12.5, 8, -0.5, 7.5, 1000, 0., 10.);
80 h_mctpc_recoilW[1] =
new TH3F(
"h_mctpc_recoil_w_O",
"Neutron recoil energy [MeV]", 13, -0.5, 12.5, 8, -0.5, 7.5, 1000, 0., 10.);
81 h_mctpc_recoil[1]->Sumw2();
82 h_mctpc_recoilW[1]->Sumw2();
84 h_mctpc_recoil[2] =
new TH3F(
"h_mctpc_recoil_C",
"Neutron recoil energy [MeV]", 13, -0.5, 12.5, 8, -0.5, 7.5, 1000, 0., 10.);
85 h_mctpc_recoilW[2] =
new TH3F(
"h_mctpc_recoil_w_C",
"Neutron recoil energy [MeV]", 13, -0.5, 12.5, 8, -0.5, 7.5, 1000, 0., 10.);
86 h_mctpc_recoil[2]->Sumw2();
87 h_mctpc_recoilW[2]->Sumw2();
90 for (
int i = 0 ; i < 12 ; i++) {
91 h_mctpc_kinetic[i] =
new TH2F(TString::Format(
"h_mctpc_kinetic_%d", i),
"Neutron kin. energy [GeV]", 8, -0.5, 7.5, 1000, 0., 10.);
92 h_mctpc_kinetic_zoom[i] =
new TH2F(TString::Format(
"h_mctpc_kinetic_zoom_%d", i),
"Neutron kin. energy [MeV]", 8, -0.5, 7.5, 1000,
94 h_mctpc_tvp[i] =
new TH2F(TString::Format(
"h_mctpc_tvp_%d", i),
"theta v phi", 180, 0., 180., 360, -180., 180.);
95 h_mctpc_tvpW[i] =
new TH2F(TString::Format(
"h_mctpc_tvpW_%d", i),
"theta v phi weighted by kin", 180, 0., 180., 360, -180., 180.);
96 h_mctpc_zr[i] =
new TH2F(TString::Format(
"h_mctpc_zr_%d", i),
"r v z", 200, -400., 400., 200, 0., 400.);
97 h_mctpc_kinetic[i]->Sumw2();
98 h_mctpc_kinetic_zoom[i]->Sumw2();
99 h_mctpc_tvp[i]->Sumw2();
100 h_mctpc_tvpW[i]->Sumw2();
101 h_mctpc_zr[i]->Sumw2();
103 for (
int i = 0 ; i < 8 ; i++) {
104 for (
int j = 0; j < 12; j++) {
105 h_Wtvp1[i][j] =
new TH2F(TString::Format(
"h_Wtvp1_%d_%d", i, j),
"Phi [deg] v. theta [deg]", 180, 0., 180, 360, -180., 180.);
106 h_Wtvp2[i][j] =
new TH2F(TString::Format(
"h_Wtvp2_%d_%d", i, j),
"Phi [deg] v. theta [deg]", 180, 0., 180, 360, -180., 180.);
107 h_Wevtrl1[i][j] =
new TH2F(TString::Format(
"h_Wevtrl1_%d_%d", i, j),
"Deposited energy [keV] v. track length [cm]", 2000, 0., 10000,
109 h_Wevtrl2[i][j] =
new TH2F(TString::Format(
"h_Wevtrl2_%d_%d", i, j),
"Deposited energy [keV] v. track length [cm]", 2000, 0., 10000,
114 for (
int i = 0 ; i < 8 ; i++) {
115 h_z[i] =
new TH1F(TString::Format(
"h_z_%d", i),
"Charged density per cm^2", 2000, 0.0, 20.0);
117 h_zr[i] =
new TH2F(TString::Format(
"h_zr_%d", i),
"Charged density vs z vs r", 100, 0, 20, 100, 0., 5.);
119 h_xy[i] =
new TH2F(TString::Format(
"h_xy_%d", i),
"Charged density vs y vs x", 100, -5., 5., 100, -5., 5.);
121 h_zx[i] =
new TH2F(TString::Format(
"h_zx_%d", i),
"Charged density vs x vs r", 100, 0, 20, 100, -5., 5.);
123 h_zy[i] =
new TH2F(TString::Format(
"h_zy_%d", i),
"Charged density vs y vs r", 100, 0, 20, 100, -5., 5.);
125 h_evtrl[i] =
new TH2F(TString::Format(
"h_evtrl_%d", i),
"Deposited energy [keV] v. track length [cm]", 2000, 0., 10000, 200, 0.,
127 h_evtrlb[i] =
new TH2F(TString::Format(
"h_evtrlb_%d", i),
"Deposited energy [keV] v. track length [cm]", 2000, 0., 10000, 200, 0.,
129 h_evtrlc[i] =
new TH2F(TString::Format(
"h_evtrlc_%d", i),
"Deposited energy [keV] v. track length [cm]", 2000, 0., 10000, 200, 0.,
131 h_evtrld[i] =
new TH2F(TString::Format(
"h_evtrld_%d", i),
"Deposited energy [keV] v. track length [cm]", 2000, 0., 10000, 200, 0.,
134 h_evtrl_p[i] =
new TH2F(TString::Format(
"h_evtrl_p_%d", i),
"Deposited energy [keV] v. track length [cm]", 2000, 0., 2000, 200, 0.,
136 h_evtrl_x[i] =
new TH2F(TString::Format(
"h_evtrl_x_%d", i),
"Deposited energy [keV] v. track length [cm]", 2000, 0., 2000, 200, 0.,
138 h_evtrl_Hex[i] =
new TH2F(TString::Format(
"h_evtrl_Hex_%d", i),
"Deposited energy [keV] v. track length [cm]", 2000, 0., 2000, 200,
140 h_evtrl_He[i] =
new TH2F(TString::Format(
"h_evtrl_He_%d", i),
"Deposited energy [keV] v. track length [cm]", 2000, 0., 2000, 200,
142 h_evtrl_C[i] =
new TH2F(TString::Format(
"h_evtrl_C_%d", i),
"Deposited energy [keV] v. track length [cm]", 2000, 0., 2000, 200, 0.,
144 h_evtrl_O[i] =
new TH2F(TString::Format(
"h_evtrl_O_%d", i),
"Deposited energy [keV] v. track length [cm]", 2000, 0., 2000, 200, 0.,
146 h_evtrl_He_pure[i] =
new TH2F(TString::Format(
"h_evtrl_He_pure_%d", i),
"Deposited energy [keV] v. track length [cm]", 2000, 0.,
150 h_tevtrl[i] =
new TH2F(TString::Format(
"h_tevtrl_%d", i),
"t: Deposited energy [keV] v. track length [cm]", 2000, 0., 2000, 200, 0.,
152 h_tevtrl_p[i] =
new TH2F(TString::Format(
"h_tevtrl_p_%d", i),
"t: Deposited energy [keV] v. track length [cm]", 2000, 0., 2000, 200,
155 h_tevtrl_x[i] =
new TH2F(TString::Format(
"h_tevtrl_x_%d", i),
"t: Deposited energy [keV] v. track length [cm]", 2000, 0., 2000, 200,
158 h_tevtrl_Hex[i] =
new TH2F(TString::Format(
"h_tevtrl_Hex_%d", i),
"t: Deposited energy [keV] v. track length [cm]", 2000, 0., 2000,
161 h_tevtrl_He[i] =
new TH2F(TString::Format(
"h_tevtrl_He_%d", i),
"t: Deposited energy [keV] v. track length [cm]", 2000, 0., 2000,
164 h_tevtrl_C[i] =
new TH2F(TString::Format(
"h_tevtrl_C_%d", i),
"t: Deposited energy [keV] v. track length [cm]", 2000, 0., 2000, 200,
167 h_tevtrl_O[i] =
new TH2F(TString::Format(
"h_tevtrl_O_%d", i),
"t: Deposited energy [keV] v. track length [cm]", 2000, 0., 2000, 200,
170 h_tevtrl_He_pure[i] =
new TH2F(TString::Format(
"h_tevtrl_He_pure_%d", i),
"t: Deposited energy [keV] v. track length [cm]", 2000,
174 h_tvp[i] =
new TH2F(TString::Format(
"h_tvp_%d", i),
"Phi [deg] v. theta [deg]", 180, 0., 180, 360, -180., 180.);
175 h_wtvpb[i] =
new TH2F(TString::Format(
"h_wtvpb_%d", i),
"Phi [deg] v. theta [deg]", 180, 0., 180, 360, -180., 180.);
176 h_wtvpc[i] =
new TH2F(TString::Format(
"h_wtvpc_%d", i),
"Phi [deg] v. theta [deg]", 180, 0., 180, 360, -180., 180.);
177 h_wtvpd[i] =
new TH2F(TString::Format(
"h_wtvpd_%d", i),
"Phi [deg] v. theta [deg]", 180, 0., 180, 360, -180., 180.);
179 h_tvpb[i] =
new TH2F(TString::Format(
"h_tvpb_%d", i),
"Phi [deg] v. theta [deg]", 180, 0., 180, 360, -180., 180.);
180 h_tvpc[i] =
new TH2F(TString::Format(
"h_tvpc_%d", i),
"Phi [deg] v. theta [deg]", 180, 0., 180, 360, -180., 180.);
181 h_tvpd[i] =
new TH2F(TString::Format(
"h_tvpd_%d", i),
"Phi [deg] v. theta [deg]", 180, 0., 180, 360, -180., 180.);
182 h_ttvp[i] =
new TH2F(TString::Format(
"h_ttvp_%d", i),
"t: Phi [deg] v. theta [deg]", 180, 0., 180, 360, -180., 180.);
183 h_wtvp[i] =
new TH2F(TString::Format(
"h_wtvp_%d", i),
"Phi [deg] v. theta [deg] - weighted", 180, 0., 180, 360, -180., 180.);
184 h_tvp_x[i] =
new TH2F(TString::Format(
"h_tvp_x_%d", i),
"Phi [deg] v. theta [deg]", 180, 0., 180, 360, -180., 180.);
185 h_ttvp_x[i] =
new TH2F(TString::Format(
"h_ttvp_x_%d", i),
"t: Phi [deg] v. theta [deg]", 180, 0., 180, 360, -180., 180.);
186 h_wtvp_x[i] =
new TH2F(TString::Format(
"h_wtvp_x_%d", i),
"Phi [deg] v. theta [deg] - weighted", 180, 0., 180, 360, -180., 180.);
187 h_tvp_p[i] =
new TH2F(TString::Format(
"h_tvp_p_%d", i),
"Phi [deg] v. theta [deg]", 180, 0., 180, 360, -180., 180.);
188 h_ttvp_p[i] =
new TH2F(TString::Format(
"h_ttvp_p_%d", i),
"t: Phi [deg] v. theta [deg]", 180, 0., 180, 360, -180., 180.);
189 h_wtvp_p[i] =
new TH2F(TString::Format(
"h_wtvp_p_%d", i),
"Phi [deg] v. theta [deg] - weighted", 180, 0., 180, 360, -180., 180.);
190 h_tvp_He[i] =
new TH2F(TString::Format(
"h_tvp_He_%d", i),
"Phi [deg] v. theta [deg]", 180, 0., 180, 360, -180., 180.);
191 h_ttvp_He[i] =
new TH2F(TString::Format(
"h_ttvp_He_%d", i),
"t: Phi [deg] v. theta [deg]", 180, 0., 180, 360, -180., 180.);
192 h_wtvp_He[i] =
new TH2F(TString::Format(
"h_wtvp_He_%d", i),
"Phi [deg] v. theta [deg] - weighted", 180, 0., 180, 360, -180., 180.);
193 h_tvp_Hex[i] =
new TH2F(TString::Format(
"h_tvp_Hex_%d", i),
"Phi [deg] v. theta [deg]", 180, 0., 180, 360, -180., 180.);
194 h_ttvp_Hex[i] =
new TH2F(TString::Format(
"h_ttvp_Hex_%d", i),
"t: Phi [deg] v. theta [deg]", 180, 0., 180, 360, -180., 180.);
195 h_wtvp_Hex[i] =
new TH2F(TString::Format(
"h_wtvp_Hex_%d", i),
"Phi [deg] v. theta [deg] - weighted", 180, 0., 180, 360, -180.,
197 h_tvp_He_pure[i] =
new TH2F(TString::Format(
"h_tvp_He_pure_%d", i),
"Phi [deg] v. theta [deg]", 180, 0., 180, 360, -180., 180.);
198 h_ttvp_He_pure[i] =
new TH2F(TString::Format(
"h_ttvp_He_pure_%d", i),
"t: Phi [deg] v. theta [deg]", 180, 0., 180, 360, -180.,
200 h_wtvp_He_pure[i] =
new TH2F(TString::Format(
"h_wtvp_He_pure_%d", i),
"Phi [deg] v. theta [deg] - weighted", 180, 0., 180, 360,
202 h_twtvp_He_pure[i] =
new TH2F(TString::Format(
"h_twtvp_He_pure_%d", i),
"t: Phi [deg] v. theta [deg] - weighted", 180, 0., 180,
205 h_tvp_C[i] =
new TH2F(TString::Format(
"h_tvp_C_%d", i),
"Phi [deg] v. theta [deg]", 180, 0., 180, 360, -180., 180.);
206 h_ttvp_C[i] =
new TH2F(TString::Format(
"h_ttvp_C_%d", i),
"t: Phi [deg] v. theta [deg]", 180, 0., 180, 360, -180., 180.);
207 h_wtvp_C[i] =
new TH2F(TString::Format(
"h_wtvp_C_%d", i),
"Phi [deg] v. theta [deg] - weighted", 180, 0., 180, 360, -180., 180.);
208 h_tvp_O[i] =
new TH2F(TString::Format(
"h_tvp_O_%d", i),
"Phi [deg] v. theta [deg]", 180, 0., 180, 360, -180., 180.);
209 h_ttvp_O[i] =
new TH2F(TString::Format(
"h_ttvp_O_%d", i),
"t: Phi [deg] v. theta [deg]", 180, 0., 180, 360, -180., 180.);
210 h_wtvp_O[i] =
new TH2F(TString::Format(
"h_wtvp_O_%d", i),
"Phi [deg] v. theta [deg] - weighted", 180, 0., 180, 360, -180., 180.);
223 h_ttvp_x[i]->Sumw2();
225 h_ttvp_p[i]->Sumw2();
226 h_tvp_He[i]->Sumw2();
227 h_ttvp_He[i]->Sumw2();
229 h_wtvp_x[i]->Sumw2();
230 h_wtvp_p[i]->Sumw2();
231 h_wtvp_He[i]->Sumw2();
238 void MicrotpcStudyModule::initialize()
240 B2INFO(
"MicrotpcStudyModule: Initialize");
251 void MicrotpcStudyModule::beginRun()
255 void MicrotpcStudyModule::event()
265 int ring_section = 0;
266 int section_ordering[12] = {1, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2};
267 for (
const auto& sadMetaHit : sadMetaHits) {
268 rate = sadMetaHit.getrate();
269 double ss = sadMetaHit.getss() / 100.;
270 if (ss < 0) ss += 3000.;
271 int section = (int)(ss / 250.);
272 if (section >= 0 && section < 12) ring_section = section_ordering[section];
291 for (
int i = 0; i < 8; i++) {
306 auto phiArray =
new vector<double>[8]();
307 auto thetaArray =
new vector<double>[8]();
308 auto pidArray =
new vector<int>[8]();
310 auto esumArray =
new vector<double>[8]();
311 auto trlArray =
new vector<double>[8]();
315 for (
int i = 0; i < nSimHits; i++) {
318 TVector3 position = aHit->
gettkPos();
319 double xpos = position.X() / 100. - TPCCenter[detNb].X();
320 double ypos = position.Y() / 100. - TPCCenter[detNb].Y();
321 double zpos = position.Z() / 100. - TPCCenter[detNb].Z() + m_z_DG / 2.;
322 if (0. < zpos && zpos < m_z_DG) {
325 if (PDGid == 1000080160) ORec[detNb] =
true;
326 if (PDGid == 1000060120) CRec[detNb] =
true;
327 if (PDGid == 1000020040) HeRec[detNb] =
true;
328 if (PDGid == 2212) pRec[detNb] =
true;
329 if (fabs(PDGid) == 11 || PDGid == 22) xRec[detNb] =
true;
333 double ioni = (edep - niel) * 1e3;
335 double r = sqrt(xpos * xpos + ypos * ypos);
336 h_z[detNb]->Fill(zpos, ioni);
337 h_zr[detNb]->Fill(zpos, r, ioni);
338 h_zx[detNb]->Fill(zpos, xpos, ioni);
339 h_xy[detNb]->Fill(xpos, ypos, ioni);
340 h_zy[detNb]->Fill(zpos, ypos, ioni);
342 double theta = direction.Theta() * TMath::RadToDeg();
343 double phi = direction.Phi() * TMath::RadToDeg();
345 if ((-m_ChipColumnX < xpos && xpos < m_ChipColumnX) &&
346 (-m_ChipRowY < ypos && ypos < m_ChipRowY) &&
347 (0. < zpos && zpos < m_z_DG)) {
354 if (pid_old[detNb] != PDGid) {
355 if (esum[detNb] > 0) {
356 esumArray[detNb].push_back(esum[detNb]);
358 BeginPoint.SetXYZ(xpos, ypos, zpos);
359 double trl0 = BeginPoint * direction.Unit();
360 double trl1 = EndPoint * direction.Unit();
361 trlArray[detNb].push_back(fabs(trl0 - trl1));
397 thetaArray[detNb].push_back(theta);
398 phiArray[detNb].push_back(phi);
399 pidArray[detNb].push_back(PDGid);
402 pid_old[detNb] = PDGid;
407 EndPoint.SetXYZ(xpos, ypos, zpos);
456 for (
const auto& mcpart : mcparts) {
457 const double energy = mcpart.getEnergy();
458 const double mass = mcpart.getMass();
459 double kin = energy - mass;
460 const double PDG = mcpart.getPDG();
461 const TVector3 vtx = mcpart.getProductionVertex();
462 const TVector3 mom = mcpart.getMomentum();
463 double theta = mom.Theta() * TMath::RadToDeg();
464 double phi = mom.Phi() * TMath::RadToDeg();
466 double r = sqrt(vtx.X() * vtx.X() + vtx.Y() * vtx.Y());
467 int partID[9] = {0, 0, 0, 0, 0, 0, 0, 0, 0};
468 if (trID == mcpart.getTrackID())
continue;
469 else trID = mcpart.getTrackID();
472 for (
const auto& shit : SimHits) {
473 if (shit.gettkID() == trID) {
474 detNb = shit.getdetNb(); nhit++;
475 kin = shit.gettkKEnergy() / 1000;
481 double trlen = abs(2. / TMath::Sin(mom.Theta()));
482 if (trlen > 10) trlen = 10.;
484 for (
auto fract : m_maxEnFrac) {
485 double recoil = gRandom->Uniform(fract) * kin * 1e3;
486 double weight = m_intProb[irecoil]->Eval(kin * 1e3) * trlen;
487 if (weight < 0) weight = 0;
488 h_mctpc_recoil[irecoil]->Fill(ring_section, detNb, recoil);
489 h_mctpc_recoilW[irecoil]->Fill(ring_section, detNb, recoil, weight);
496 if (PDG == 11) partID[0] = 1;
497 else if (PDG == -11) partID[1] = 1;
498 else if (PDG == 22) partID[2] = 1;
499 else if (PDG == 2112) partID[3] = 1;
500 else if (PDG == 2212) partID[4] = 1;
501 else if (PDG == 1000080160) partID[5] = 1;
502 else if (PDG == 1000060120) partID[6] = 1;
503 else if (PDG == 1000020040) partID[7] = 1;
509 h_mctpc_kinetic[9]->Fill(detNb, kin);
510 h_mctpc_kinetic_zoom[9]->Fill(detNb, kin * 1e3);
511 h_mctpc_tvp[9]->Fill(theta, phi);
512 h_mctpc_tvpW[9]->Fill(theta, phi, kin);
513 h_mctpc_zr[9]->Fill(z, r);
516 h_mctpc_kinetic[10]->Fill(detNb, kin);
517 h_mctpc_kinetic_zoom[10]->Fill(detNb, kin * 1e3);
518 h_mctpc_tvp[10]->Fill(theta, phi);
519 h_mctpc_tvpW[10]->Fill(theta, phi, kin);
520 h_mctpc_zr[10]->Fill(z, r);
524 for (
int i = 0; i < 9; i++) {
525 if (partID[i] == 1) {
526 h_mctpc_kinetic[i]->Fill(detNb, kin);
527 h_mctpc_kinetic_zoom[i]->Fill(detNb, kin * 1e3);
528 h_mctpc_tvp[i]->Fill(theta, phi);
529 h_mctpc_tvpW[i]->Fill(theta, phi, kin);
530 h_mctpc_zr[i]->Fill(z, r);
539 for (
const auto& aTrack : Tracks) {
540 const int detNb = aTrack.getdetNb();
541 const float phi = aTrack.getphi();
542 const float theta = aTrack.gettheta();
543 const float trl = aTrack.gettrl();
544 const float tesum = aTrack.getesum();
545 const int pixnb = aTrack.getpixnb();
548 for (
int j = 0; j < 16; j++) {
550 side[j] = aTrack.getside()[j];
552 Bool_t EdgeCuts =
false;
553 if (side[0] == 0 && side[1] == 0 && side[2] == 0 && side[3] == 0) EdgeCuts =
true;
554 Bool_t Asource =
false;
555 if (side[4] == 2 && side[5] == 2) Asource =
true;
562 for (
int j = 0; j < 6; j++) partID[j + 1] = aTrack.getpartID()[j];
564 if (ORec[detNb] || CRec[detNb] || HeRec[detNb])
565 h_tpc_rate[0]->Fill(detNb);
567 h_tpc_rate[1]->Fill(detNb);
569 h_tpc_rate[2]->Fill(detNb);
572 if (ORec[detNb] || CRec[detNb] || HeRec[detNb])
573 h_tpc_rate[3]->Fill(detNb);
575 h_tpc_rate[4]->Fill(detNb);
577 h_tpc_rate[5]->Fill(detNb);
580 h_evtrl[detNb]->Fill(tesum, trl);
581 h_tvp[detNb]->Fill(theta, phi);
582 h_wtvp[detNb]->Fill(theta, phi, tesum);
583 h_Wtvp1[detNb][0]->Fill(theta, phi, rate);
584 h_Wevtrl1[detNb][0]->Fill(tesum, trl, rate);
585 h_Wtvp2[detNb][0]->Fill(theta, phi, rate * tesum);
587 if (EdgeCuts && pixnb > 10. && tesum > 10.) {
588 h_evtrlb[detNb]->Fill(tesum, trl);
589 h_tvpb[detNb]->Fill(theta, phi);
590 h_wtvpb[detNb]->Fill(theta, phi, tesum);
591 h_Wtvp1[detNb][1]->Fill(theta, phi, rate);
592 h_Wevtrl1[detNb][1]->Fill(tesum, trl, rate);
593 h_Wtvp2[detNb][1]->Fill(theta, phi, rate * tesum);
596 for (
int j = 0; j < 7; j++) {
597 if (j == 3 && !EdgeCuts && (partID[1] == 1 || partID[2] == 1 || partID[4] == 1 || partID[5] == 1 || partID[6] == 1)) partID[j] = 0;
598 if ((j == 4 || j == 5) && !Asource) partID[j] = 0;
599 if (partID[j] == 1) {
600 h_Wtvp1[detNb][2 + j]->Fill(theta, phi, rate);
601 h_Wevtrl1[detNb][2 + j]->Fill(tesum, trl, rate);
602 h_Wtvp2[detNb][2 + j]->Fill(theta, phi, rate * tesum);
604 h_evtrlc[detNb]->Fill(tesum, trl);
605 h_tvpc[detNb]->Fill(theta, phi);
606 h_wtvpc[detNb]->Fill(theta, phi, tesum);
609 h_evtrld[detNb]->Fill(tesum, trl);
610 h_tvpd[detNb]->Fill(theta, phi);
611 h_wtvpd[detNb]->Fill(theta, phi, tesum);
614 h_evtrl_x[detNb]->Fill(tesum, trl);
615 h_tvp_x[detNb]->Fill(theta, phi);
616 h_wtvp_x[detNb]->Fill(theta, phi, tesum);
619 h_evtrl_p[detNb]->Fill(tesum, trl);
620 h_tvp_p[detNb]->Fill(theta, phi);
621 h_wtvp_p[detNb]->Fill(theta, phi, tesum);
624 h_evtrl_x[detNb]->Fill(tesum, trl);
625 h_tvp_x[detNb]->Fill(theta, phi);
626 h_wtvp_x[detNb]->Fill(theta, phi, tesum);
629 h_evtrl_He[detNb]->Fill(tesum, trl);
630 h_tvp_He[detNb]->Fill(theta, phi);
631 h_wtvp_He[detNb]->Fill(theta, phi, tesum);
634 h_evtrl_Hex[detNb]->Fill(tesum, trl);
635 h_tvp_Hex[detNb]->Fill(theta, phi);
636 h_wtvp_Hex[detNb]->Fill(theta, phi, tesum);
646 delete [] thetaArray;
654 void MicrotpcStudyModule::getXMLData()
656 GearDir content =
GearDir(
"/Detector/DetectorComponent[@name=\"MICROTPC\"]/Content/");
659 BOOST_FOREACH(
const GearDir & activeParams, content.getNodes(
"Active")) {
661 TPCCenter.push_back(TVector3(activeParams.
getLength(
"TPCpos_x"), activeParams.
getLength(
"TPCpos_y"),
666 m_ChipColumnNb = content.getInt(
"ChipColumnNb");
667 m_ChipRowNb = content.getInt(
"ChipRowNb");
668 m_ChipColumnX = content.getDouble(
"ChipColumnX");
669 m_ChipRowY = content.getDouble(
"ChipRowY");
670 m_z_DG = content.getDouble(
"z_DG");
672 content =
GearDir(
"/Detector/DetectorComponent[@name=\"MICROTPC\"]/Content/RecoilProbability");
673 for (
const GearDir& recoil : content.getNodes(
"Recoil")) {
674 m_maxEnFrac.push_back(recoil.getDouble(
"Fraction"));
675 istringstream probstream;
677 probstream.str(recoil.getString(
"Probability"));
678 TGraph* gr =
new TGraph();
680 while (probstream >> e >> prob) {
681 gr->SetPoint(i, e, prob);
684 m_intProb.push_back(gr);
687 B2INFO(
"TpcDigitizer: Aquired tpc locations and gas parameters");
688 B2INFO(
" from MICROTPC.xml. There are " << nTPC <<
" TPCs implemented");
691 void MicrotpcStudyModule::endRun()
701 void MicrotpcStudyModule::terminate()