41 std::cout <<
"DST node added" << std::endl;
45 std::string trackNodeName;
46 std::string particleNodeName;
49 baseName =
"reconstructedParticles";
55 std::string undrscr =
"_";
56 std::string nothing =
"";
57 std::map<std::string, std::string> forbiddenStrings;
58 forbiddenStrings[
"/"] = undrscr;
59 forbiddenStrings[
"("] = undrscr;
60 forbiddenStrings[
")"] = nothing;
61 forbiddenStrings[
"+"] =
"plus";
62 forbiddenStrings[
"-"] =
"minus";
63 forbiddenStrings[
"*"] =
"star";
64 for (
auto const& [badString, goodString] : forbiddenStrings)
66 while ((pos = baseName.find(badString)) != std::string::npos) baseName.replace(pos, 1, goodString);
69 trackNodeName = baseName +
"_SvtxTrackMap";
70 particleNodeName = baseName +
"_KFParticle_Container";
77 std::cout << trackNodeName <<
" node added" << std::endl;
84 lowerNode->
addNode(particleNode);
85 std::cout << particleNodeName <<
" node added" << std::endl;
90 std::cout <<
"You have asked to put your selection on the node tree but disabled both the SvtxTrackMap and KFParticle_Container\n";
91 std::cout <<
"Check your options" << std::endl;
99 const std::vector<KFParticle>& daughters,
100 const std::vector<KFParticle>& intermediates)
113 std::vector<KFParticle> daughters,
114 std::vector<KFParticle> intermediates)
116 std::string baseName;
117 std::string trackNodeName;
120 baseName =
"reconstructedParticles";
126 std::string undrscr =
"_";
127 std::string nothing =
"";
128 std::map<std::string, std::string> forbiddenStrings;
129 forbiddenStrings[
"/"] = undrscr;
130 forbiddenStrings[
"("] = undrscr;
131 forbiddenStrings[
")"] = nothing;
132 forbiddenStrings[
"+"] =
"plus";
133 forbiddenStrings[
"-"] =
"minus";
134 forbiddenStrings[
"*"] =
"star";
135 for (
auto const& [badString, goodString] : forbiddenStrings)
137 while ((pos = baseName.find(badString)) != std::string::npos) baseName.replace(pos, 1, goodString);
140 trackNodeName = baseName +
"_SvtxTrackMap";
142 m_recoTrackMap = findNode::getClass<SvtxTrackMap>(topNode, trackNodeName.c_str());
148 m_recoTrack->
Reset();
152 KFParticle* intermediateArray = &intermediates[0];
154 for (
unsigned int k = 0;
k < intermediates.size(); ++
k)
158 m_recoTrack->
Reset();
162 SvtxTrackMap* originalTrackMap = findNode::getClass<SvtxTrackMap>(topNode,
"SvtxTrackMap");
163 KFParticle* daughterArray = &daughters[0];
165 for (
unsigned int k = 0;
k < daughters.size(); ++
k)
167 if (originalTrackMap->
size() == 0)
169 std::cout <<
"There was no original track map found, the tracks will have no cluster information!" << std::endl;
174 m_recoTrack = kfpTruthTools_DST.
getTrack(daughterArray[
k].Id(), originalTrackMap);
182 std::vector<KFParticle> daughters,
183 std::vector<KFParticle> intermediates)
185 std::string baseName;
186 std::string particleNodeName;
189 baseName =
"reconstructedParticles";
195 std::string undrscr =
"_";
196 std::string nothing =
"";
197 std::map<std::string, std::string> forbiddenStrings;
198 forbiddenStrings[
"/"] = undrscr;
199 forbiddenStrings[
"("] = undrscr;
200 forbiddenStrings[
")"] = nothing;
201 forbiddenStrings[
"+"] =
"plus";
202 forbiddenStrings[
"-"] =
"minus";
203 forbiddenStrings[
"*"] =
"star";
204 for (
auto const& [badString, goodString] : forbiddenStrings)
206 while ((pos = baseName.find(badString)) != std::string::npos) baseName.replace(pos, 1, goodString);
209 particleNodeName = baseName +
"_KFParticle_Container";
211 m_recoParticleMap = findNode::getClass<KFParticle_Container>(topNode, particleNodeName.c_str());
217 KFParticle* intermediateArray = &intermediates[0];
219 for (
unsigned int k = 0;
k < intermediates.size(); ++
k)
223 KFParticle* daughterArray = &daughters[0];
224 for (
unsigned int k = 0;
k < daughters.size(); ++
k)
235 track->
set_ndf(particle.GetNDF());
237 track->
set_x(particle.GetX());
238 track->
set_y(particle.GetY());
239 track->
set_z(particle.GetZ());
241 track->
set_px(particle.GetPx());
242 track->
set_py(particle.GetPy());
243 track->
set_pz(particle.GetPz());
245 for (
int i = 0; i < 6; ++i)
246 for (
int j = 0; j < 6; ++j)
247 track->
set_error(i, j, particle.GetCovariance(i, j));
254 std::string baseName;
255 std::string trackNodeName;
256 std::string particleNodeName;
259 baseName =
"reconstructedParticles";
265 std::string undrscr =
"_";
266 std::string nothing =
"";
267 std::map<std::string, std::string> forbiddenStrings;
268 forbiddenStrings[
"/"] = undrscr;
269 forbiddenStrings[
"("] = undrscr;
270 forbiddenStrings[
")"] = nothing;
271 forbiddenStrings[
"+"] =
"plus";
272 forbiddenStrings[
"-"] =
"minus";
273 forbiddenStrings[
"*"] =
"star";
274 for (
auto const& [badString, goodString] : forbiddenStrings)
276 while ((pos = baseName.find(badString)) != std::string::npos) baseName.replace(pos, 1, goodString);
281 trackNodeName = baseName +
"_SvtxTrackMap";
282 std::cout <<
"----------------";
283 std::cout <<
" KFParticle_DST: " << trackNodeName <<
" information ";
284 std::cout <<
"----------------" << std::endl;
285 SvtxTrackMap* trackmap = findNode::getClass<SvtxTrackMap>(topNode, trackNodeName.c_str());
291 std::cout <<
"--------------------------------------------------------------------------------------------------" << std::endl;
296 particleNodeName = baseName +
"_KFParticle_Container";
297 std::cout <<
"----------------";
298 std::cout <<
" KFParticle_DST: " << particleNodeName <<
" information ";
299 std::cout <<
"----------------" << std::endl;
300 KFParticle_Container* particlemap = findNode::getClass<KFParticle_Container>(topNode, particleNodeName.c_str());
303 KFParticle*
particle = iter->second;
304 kfpTupleTools_DST.
identify(*particle);
306 std::cout <<
"--------------------------------------------------------------------------------------------------" << std::endl;