33 :
SubsysReco(
"MyJetAnalysis_" + recojetname +
"_" + truthjetname)
34 , m_recoJetName(recojetname)
35 , m_truthJetName(truthjetname)
36 , m_outputFileName(outputfilename)
39 , m_trackJetMatchingRadius(.7)
40 , m_hInclusiveE(nullptr)
41 , m_hInclusiveEta(nullptr)
42 , m_hInclusivePhi(nullptr)
47 , m_eta(numeric_limits<float>::signaling_NaN())
48 , m_phi(numeric_limits<float>::signaling_NaN())
49 , m_e(numeric_limits<float>::signaling_NaN())
50 , m_pt(numeric_limits<float>::signaling_NaN())
52 , m_truthNComponent(-1)
53 , m_truthEta(numeric_limits<float>::signaling_NaN())
54 , m_truthPhi(numeric_limits<float>::signaling_NaN())
55 , m_truthE(numeric_limits<float>::signaling_NaN())
56 , m_truthPt(numeric_limits<float>::signaling_NaN())
59 m_trackdR.fill(numeric_limits<float>::signaling_NaN());
60 m_trackpT.fill(numeric_limits<float>::signaling_NaN());
77 TString(
m_recoJetName) +
" inclusive jet E;Total jet energy (GeV)", 100, 0, 100);
82 TString(
m_recoJetName) +
" inclusive jet #eta;#eta;Jet energy density", 50, -1, 1);
89 m_T =
new TTree(
"T",
"MyJetAnalysis Tree");
94 m_T->Branch(
"id", &
m_id,
"id/I");
100 m_T->Branch(
"phi", &
m_phi,
"phi/F");
102 m_T->Branch(
"e", &
m_e,
"e/F");
104 m_T->Branch(
"pt", &
m_pt,
"pt/F");
123 m_T->Branch(
"id",
m_trackdR.data(),
"trackdR[nMatchedTrack]/F");
125 m_T->Branch(
"id",
m_trackpT.data(),
"trackpT[nMatchedTrack]/F");
153 cout <<
"MyJetAnalysis::process_event() entered" << endl;
164 <<
"MyJetAnalysis::process_event - Error can not find DST JetMap node "
170 SvtxTrackMap* trackmap = findNode::getClass<SvtxTrackMap>(topNode,
"SvtxTrackMap");
173 trackmap = findNode::getClass<SvtxTrackMap>(topNode,
"TrackMap");
177 <<
"MyJetAnalysis::process_event - Error can not find DST trackmap node SvtxTrackMap" << endl;
183 Jet* jet = iter->second;
188 if ((not eta_cut) or (not pt_cut))
192 cout <<
"MyJetAnalysis::process_event() - jet failed acceptance cut: ";
193 cout <<
"eta cut: " << eta_cut <<
", ptcut: " << pt_cut << endl;
194 cout <<
"jet eta: " << jet->
get_eta() <<
", jet pt: " << jet->
get_pt() << endl;
239 iter != trackmap->
end();
245 const double dEta =
v.Eta() -
m_eta;
246 const double dPhi =
v.Phi() -
m_phi;
247 const double dR = sqrt(dEta * dEta + dPhi * dPhi);
263 cout <<
"MyJetAnalysis::process_event() - reached max track that matching a jet. Quit iterating tracks" << endl;