29 : m_has_intermediates_nTuple(
false)
30 , m_extrapolateTracksToSV_nTuple(
true)
31 , m_constrain_to_vertex_nTuple(
false)
32 , m_get_all_PVs(
false)
33 , m_truth_matching(
false)
34 , m_detector_info(
false)
36 , m_use_intermediate_name(
true)
37 , m_get_charge_conjugate_nTuple(
true)
50 m_tree =
new TTree(
"DecayTree",
"DecayTree");
57 mother_name =
"mother";
67 std::map<std::string, std::string> forbiddenStrings;
68 forbiddenStrings[
"/"] = undrscr;
69 forbiddenStrings[
"("] = undrscr;
70 forbiddenStrings[
")"] = nothing;
71 forbiddenStrings[
"+"] =
"plus";
72 forbiddenStrings[
"-"] =
"minus";
73 forbiddenStrings[
"*"] =
"star";
74 for (
auto const& [badString, goodString] : forbiddenStrings)
76 while ((pos = mother_name.find(badString)) != std::string::npos)
78 mother_name.replace(pos, 1, goodString);
124 std::vector<std::string> intermediateNameMapping;
140 for (
auto const& [badString, goodString] : forbiddenStrings)
142 while ((pos = intermediate_name.find(badString)) != std::string::npos)
144 intermediate_name.replace(pos, 1, goodString);
192 intermediateNameMapping.push_back(intermediate_name +
"_");
197 int num_intermediate_tracks = 0;
209 daughter_number.insert(0, intermediateNameMapping[
i]);
270 std::string dca_leaf_name = dca_branch_name +
"/F";
296 m_tree->Branch(
"secondary_vertex_mass_pionPID", &
m_sv_mass,
"secondary_vertex_mass_pionPID/F");
298 m_tree->Branch(
"nPrimaryVertices", &
m_nPVs,
"nPrimaryVertices/I");
308 std::vector<KFParticle> daughters,
309 std::vector<KFParticle> intermediates,
312 const float speedOfLight = 2.99792458e-2;
317 bool switchTrackPosition;
319 int num_tracks_used_by_intermediates = 0;
324 for (
int j =
i + 1;
j < m_num_tracks_from_intermediate_nTuple[
k]; ++
j)
326 int particleAElement =
i + num_tracks_used_by_intermediates;
327 int particleBElement =
j + num_tracks_used_by_intermediates;
328 int particleAPID = daughterArray[particleAElement].
GetPDG();
329 int particleBPID = daughterArray[particleBElement].
GetPDG();
335 switchTrackPosition = daughterA_mass > daughterB_mass;
339 switchTrackPosition = particleAPID > particleBPID;
341 if (switchTrackPosition)
343 temp = daughterArray[particleAElement];
344 daughterArray[particleAElement] = daughterArray[particleBElement];
345 daughterArray[particleBElement] = temp;
349 num_tracks_used_by_intermediates += m_num_tracks_from_intermediate_nTuple[
k];
354 for (
int i = 0;
i < num_remaining_tracks;
i++)
356 for (
int j =
i + 1;
j < num_remaining_tracks;
j++)
358 int particleAElement =
i + num_tracks_used_by_intermediates;
359 int particleBElement =
j + num_tracks_used_by_intermediates;
360 int particleAPID = daughterArray[particleAElement].
GetPDG();
361 int particleBPID = daughterArray[particleBElement].
GetPDG();
367 switchTrackPosition = daughterA_mass > daughterB_mass;
371 switchTrackPosition = particleAPID > particleBPID;
373 if (switchTrackPosition)
375 temp = daughterArray[particleAElement];
376 daughterArray[particleAElement] = daughterArray[particleBElement];
377 daughterArray[particleBElement] = temp;
384 for (
unsigned int i = 0;
i < daughters.size(); ++
i)
420 for (
int j = 0;
j < 21; ++
j)
427 KFParticle* intermediateArray = &intermediates[0];
462 for (
int j = 0;
j < 21; ++
j)
508 for (
int j = 0;
j < 21; ++
j)
541 for (
int k = 0;
k < num_remaining_tracks;
k++)
562 std::vector<KFParticle> sortedDaughterVector;
563 sortedDaughterVector.reserve(m_num_tracks_nTuple);
566 sortedDaughterVector.push_back(daughterArray[
i]);
568 allPVInfo(topNode,
m_tree, motherParticle, sortedDaughterVector, intermediates);
587 for (
int j = 0;
j < 6; ++
j)
605 EventHeaderv1* evtHeader = findNode::getClass<EventHeaderv1>(topNode,
"EventHeader");
625 KFParticle* daughterArray = &kfp_daughters[0];
630 float f_trackParameters[6], f_trackCovariance[21];
631 for (
int j = 0;
j < 6; ++
j)
635 for (
int j = 0;
j < 21; ++
j)
639 daughter_noPID.
Create(f_trackParameters, f_trackCovariance, daughterArray[
i].
Q(), -1);