25 #include <TDatabasePDG.h>
30 #include <TLorentzVector.h>
35 #include <gsl/gsl_randist.h>
36 #include <gsl/gsl_rng.h>
66 _pdg =
new TDatabasePDG();
68 gaussian =
new TF1(
"gaussian",
"gaus", 0, 20);
111 <<
"\t" <<
f_vx <<
"\t" <<
f_vy <<
"\t" <<
f_vz <<
"\t" <<
f_vt << std::endl;
116 if (
Verbosity()>10 ) std::cout <<
"Processing BBC G4 Hits" << std::endl;
119 unsigned int nhits = 0;
122 for (
auto hit_iter = bbc_hit_range.first; hit_iter != bbc_hit_range.second; hit_iter++)
124 PHG4Hit *this_hit = hit_iter->second;
136 TParticlePDG *partinfo =
_pdg->GetParticle(pid);
140 charge = partinfo->Charge() / 3;
142 else if (part->
isIon())
148 if (this_hit->
get_t(1) < first_time[ch])
150 if (fabs(this_hit->
get_t(1)) < 106.5)
152 first_time[ch] = this_hit->
get_t(1) - vtxp->
get_t();
154 first_time[ch] += dt;
160 std::cout <<
"BAD " << ch <<
"\t" << this_hit->
get_t(1) << std::endl;
169 Double_t beta = v4.Beta();
182 std::cout <<
"Found " << nhits <<
" MBD hits" << std::endl;
183 std::cout <<
"Calculating response and storing in MbdPmtHits" << std::endl;
193 std::cout <<
"ipmt " << ipmt <<
"\t" << len[ipmt] <<
"\t" << edep[ipmt] << std::endl;
197 float npe = len[ipmt] * (120 / 3.0);
204 if (first_time[ipmt] < 9999.)
206 f_pmtt0[ipmt] = first_time[ipmt] - 8.346;
207 f_pmtt1[ipmt] = first_time[ipmt] - 8.346;
213 std::cout <<
"ERROR, have hit but no time" << std::endl;
221 std::cout <<
"Adding " << ipmt <<
", " <<
f_pmtq[ipmt] <<
", " <<
f_pmtt0[ipmt] <<
" , " <<
f_pmtt1[ipmt] << std::endl;
240 std::cout <<
PHWHERE <<
"DST Node missing doing nothing" << std::endl;
253 _bbcpmts = findNode::getClass<MbdPmtContainer>(bbcNode,
"MbdPmtContainer");
258 bbcNode->addNode(BbcPmtNode);
268 _truth_container = findNode::getClass<PHG4TruthInfoContainer>(topNode,
"G4TruthInfo");
271 std::cout <<
PHWHERE <<
" PHG4TruthInfoContainer node not found on node tree" << std::endl;
276 _bbchits = findNode::getClass<PHG4HitContainer>(topNode,
"G4HIT_BBC");
279 std::cout <<
PHWHERE <<
" G4HIT_BBC node not found on node tree" << std::endl;
286 _bbcpmts = findNode::getClass<MbdPmtContainerV1>(topNode,
"MbdPmtContainer");
289 std::cout <<
PHWHERE <<
" MbdPmtContainer node not found on node tree" << std::endl;