35 ,
use_jetcon{_which == TRANSITION::JET_CONTAINER || _which == TRANSITION::BOTH || _which == TRANSITION::PRETEND_BOTH}
36 , use_jetmap{_which == TRANSITION::JET_MAP || _which == TRANSITION::BOTH}
67 std::cout <<
"========================== JetReco::InitRun() =============================" << std::endl;
68 std::cout <<
" Input Selections:" << std::endl;
69 for (
auto &_input : _inputs) _input->identify();
70 std::cout <<
" Algorithms:" << std::endl;
71 for (
auto &_algo : _algos) _algo->identify();
72 std::cout <<
"===========================================================================" << std::endl;
81 if (
Verbosity() > 1) std::cout <<
"JetReco::process_event -- entered" << std::endl;
88 std::vector<Jet *> inputs;
89 for (
auto &_input : _inputs)
91 std::vector<Jet *> parts = _input->get_input(topNode);
92 for (
auto &part : parts)
94 inputs.push_back(part);
95 inputs.back()->set_id(inputs.size() - 1);
102 for (
unsigned int ialgo = 0; ialgo < _algos.size(); ++ialgo)
108 if (
Verbosity() > 5) std::cout <<
" Verbosity>5:: filling JetContainter for " <<
JC_name(
_outputs[ialgo]) << std::endl;
113 if (
Verbosity() > 5) std::cout <<
" Verbosity>5:: filling jetnode for " <<
_outputs[ialgo] << std::endl;
114 std::vector<Jet *> jets = _algos[ialgo]->get_jets(inputs);
123 fout <<
" Printing jet results " << std::endl;
124 JetMap *jetmap = findNode::getClass<JetMap>(topNode,
_outputs[ialgo]);
126 for (
auto _jet = jetmap->
begin(); _jet != jetmap->
end(); ++_jet) {
127 auto jet = _jet->second;
128 fout << Form(
" jet[%2i] ncon:pt:eta:phi [%6i,%6.3f,%6.3f,%6.3f]",
129 ++ifixme, (
int)jet->size_comp(), jet->get_pt(), jet->get_eta(), jet->get_phi()) << std::endl;
130 std::vector<std::pair<int,int>> vconst;
131 for (
auto _comp = jet->begin_comp(); _comp != jet->end_comp(); ++_comp) {
132 vconst.push_back({(int)_comp->first,(
int)_comp->second});
134 std::sort(vconst.begin(), vconst.end(), [](std::pair<int,int>
a, std::pair<int,int>
b)
136 if (a.first ==
b.first)
return a.second <
b.second;
137 else return a.first <
b.first;
139 fout <<
" constituents: ";
141 for (
const auto&
p : vconst) {
142 fout << Form(
" c(%3i) %3i->%3i", iconst++,
p.first,
p.second) << std::endl;
150 fout <<
" Printing jet results" << std::endl;
155 for (
auto jet : *jet_cont) {
156 fout << Form(
" jet[%2i] ncon:pt:eta:phi [%6i,%6.3f,%6.3f,%6.3f]",
157 ++ifixme, (
int)jet->size_comp(), jet->get_pt(), jet->get_eta(), jet->get_phi()) << std::endl;
159 fout <<
" constituents: ";
161 for (
const auto&
p : jet->get_comp_vec()) {
162 fout << Form(
" c(%3i) %3i->%3i", iconst++,
p.first,
p.second) << std::endl;
177 if (
Verbosity() > 1) std::cout <<
"JetReco::process_event -- exited" << std::endl;
190 std::cout <<
PHWHERE <<
"DST Node missing, doing nothing." << std::endl;
219 InputNode->
addNode(JetContainerNode);
224 JetMap *jets = findNode::getClass<JetMap>(topNode, _output);
229 InputNode->
addNode(JetMapNode);
239 JetMap *jetmap = findNode::getClass<JetMap>(topNode, _outputs[ipos]);
242 std::cout <<
PHWHERE <<
" ERROR: Can't find JetMap: " << _outputs[ipos] << std::endl;
247 jetmap->
set_par(_algos[ipos]->get_par());
248 for (
auto &_input : _inputs)
253 for (
auto &jet : jets)
263 JetContainer *jetconn = findNode::getClass<JetContainer>(topNode,
JC_name(_outputs[ipos]));
266 std::cout <<
PHWHERE <<
" ERROR: Can't find JetContainer: " << _outputs[ipos] << std::endl;
269 _algos[ipos]->cluster_and_fill(inputs, jetconn);
270 for (
auto &_input : _inputs)
277 std::cout <<
" Verbosity()>7:: jets in container " << _outputs[ipos] << std::endl;
286 if (_algos.size() == 0)
288 std::cout <<
PHWHERE << std::endl
289 <<
" JetReco has only " << _algos.size() <<
" JetAlgos; cannot get the one indexed " << which_algo << std::endl;
290 assert(which_algo < _algos.size());
293 return _algos[which_algo];