10 #include <g4jets/JetMap.h>
51 #include <trackbase_historic/SvtxVertex.h>
52 #include <trackbase_historic/SvtxVertexMap.h>
65 std::cout <<
"jetrtrack::jetrtrack(const std::string &name) Calling ctor" << std::endl;
71 std::cout <<
"jetrtrack::~jetrtrack() Calling dtor" << std::endl;
92 <<
"jetrtrack::get_HistoManager - Making Fun4AllHistoManager jetrtrack_HISTOS"
104 std::cout <<
"jetrtrack::InitRun(PHCompositeNode *topNode) Initializing for Run XXX" << std::endl;
121 TTree*
tree=
new TTree(
"tree",
"tree");
144 tree->Branch(
"zvtx", &
m_zvtx);
147 tree->Branch(
"tp_pt",&
m_tp_pt);
148 tree->Branch(
"tp_px",&
m_tp_px);
149 tree->Branch(
"tp_py",&
m_tp_py);
150 tree->Branch(
"tp_pz",&
m_tp_pz);
156 tree->Branch(
"jc_pt",&
m_jc_pt);
169 double pi = TMath::Pi();
175 JetMap* tjets = findNode::getClass<JetMap>(topNode,
"AntiKt_Truth_r04");
179 <<
"Jetrtrack::process_event - Error can not find DST JetMap node "
185 JetMap* rjets = findNode::getClass<JetMap>(topNode,
"AntiKt_Tower_r04_Sub1");
189 <<
"Jetrtrack::process_event - Error can not find DST JetMap node "
194 SvtxTrackMap* trackmap = findNode::getClass<SvtxTrackMap>(topNode,
"SvtxTrackMap");
198 <<
"Jetrtrack::process_event - Error can not find DST SvtxTrackMap node "
204 CentralityInfo* cent_node = findNode::getClass<CentralityInfo>(topNode,
"CentralityInfo");
208 <<
"Jetrtrack::process_event - Error can not find centrality node "
217 SvtxVertexMap* vertexmap = findNode::getClass<SvtxVertexMap>(topNode,
"SvtxVertexMap");
221 <<
"Jetrtrack::process_event - Error can not find vertex map node "
230 <<
"Jetrtrack::process_event - Error can not find G4TruthInfo map node "
254 if (!vertexmap->
empty())
266 int chargedparticlespids[] = {11,211,321,2212};
274 Jet* tjet = iter->second;
276 float tjet_phi = tjet->
get_phi();
277 float tjet_eta = tjet->
get_eta();
278 float tjet_pt = tjet->
get_pt();
279 if (tjet_pt < 5){
continue;}
292 bool reject_particle =
true;
293 for (
int k = 0 ;
k < 4;
k++)
295 if (abs(truth->
get_pid()) == chargedparticlespids[
k])
297 reject_particle =
false;
300 if (reject_particle) {
continue;}
301 float m_truthpx = truth->
get_px();
302 float m_truthpy = truth->
get_py();
303 float m_truthpz = truth->
get_pz();
304 float m_truthenergy = truth->
get_e();
305 float m_truthpt = sqrt(m_truthpx * m_truthpx + m_truthpy * m_truthpy);
306 float m_truthphi = atan2(m_truthpy , m_truthpx);
307 float m_trutheta = atanh(m_truthpz / m_truthenergy);
312 sumjcpt += m_truthpt;
319 float matched_pt = -999;
320 float matched_eta = -999;
321 float matched_phi = -999;
328 Jet* rjet = riter->second;
329 float rjet_phi = rjet->
get_phi();
330 float rjet_eta = rjet->
get_eta();
331 float rjet_pt = rjet->
get_pt();
333 float deta = fabs(rjet_eta - tjet_eta);
334 float dphi = fabs(rjet_phi - tjet_phi);
340 float dr = TMath::Sqrt(dphi*dphi + deta*deta);
343 matched_pt = rjet_pt;
344 matched_eta = rjet_eta;
345 matched_phi = rjet_phi;
363 m_dr.push_back(drmin);
375 iter != trackmap->
end();
388 if (track->
get_pt() < 1) {
continue;}
407 iter != range.second;
415 float m_truthpx = truth->
get_px();
416 float m_truthpy = truth->
get_py();
417 float m_truthpz = truth->
get_pz();
418 float m_truthenergy = truth->
get_e();
420 float m_truthpt = sqrt(m_truthpx * m_truthpx + m_truthpy * m_truthpy);
421 float m_truthphi = atan2(m_truthpy , m_truthpx);
422 float m_trutheta = atanh(m_truthpz / m_truthenergy);
423 int m_truthpid = truth->
get_pid();
425 if (m_truthpt < 1){
continue;}
429 bool reject_particle =
true;
430 for (
int k = 0 ;
k < 4;
k++)
432 if (abs(truth->
get_pid()) == chargedparticlespids[
k])
434 reject_particle =
false;
437 if (reject_particle) {
continue;}
453 TTree *
tree =
dynamic_cast<TTree *
>(hm->
getHisto(
"tree"));
505 std::cout <<
"jetrtrack::EndRun(const int runnumber) Ending Run for Run " << runnumber << std::endl;
512 std::cout <<
"jetrtrack::End(PHCompositeNode *topNode) This is the End..." << std::endl;
523 for (
unsigned int i = 0;
i < hm->
nHistos();
i++)
533 std::cout <<
"jetrtrack::Reset(PHCompositeNode *topNode) being Reset" << std::endl;
540 std::cout <<
"jetrtrack::Print(const std::string &what) const Printing info for " << what << std::endl;