38 {
39
40
43
44
47
48
49 std::vector<char> track_pass_map(trackParticleContainer->
size());
50 std::vector<char> vertex_pass_map(D0Container->
size());
51
52
54
55
56
57 bool passed_D0_or_D0b = (flag_D0(*vertex) || flag_D0b(*vertex));
58
59
60
61 if(!passed_D0_or_D0b) continue;
62
65
66 if(!track1) {
ATH_MSG_WARNING(
"Could not find track at D0 vertex (index 0)");
continue; }
67 if(!track2) {
ATH_MSG_WARNING(
"Could not find track at D0 vertex (index 1)");
continue; }
68
69
70
71 const std::vector<float>& reFit_Px = acc_reFit_Px(*vertex);
72 const std::vector<float>& reFit_Py = acc_reFit_Py(*vertex);
73 const std::vector<float>& reFit_Pz = acc_reFit_Pz(*vertex);
74
75 TLorentzVector track1_pion, track1_kaon;
76 track1_pion.SetXYZM(reFit_Px.at(0),reFit_Py.at(0),reFit_Pz.at(0),
m_pionMass);
77 track1_kaon.SetXYZM(reFit_Px.at(0),reFit_Py.at(0),reFit_Pz.at(0),
m_kaonMass);
78
79 TLorentzVector track2_pion, track2_kaon;
80 track2_pion.SetXYZM(reFit_Px.at(1),reFit_Py.at(1),reFit_Pz.at(1),
m_pionMass);
81 track2_kaon.SetXYZM(reFit_Px.at(1),reFit_Py.at(1),reFit_Pz.at(1),
m_kaonMass);
82
83
84 TLorentzVector D0_hypo1 = track1_pion + track2_kaon;
85 TLorentzVector D0_hypo2 = track1_kaon + track2_pion;
86
87 bool passed_Dstar = false;
88
89
91
92
93 if( track1->index() == track3->index() ) continue;
94 if( track2->index() == track3->index() ) continue;
95
96 TLorentzVector track3_pion= track3->p4();
97
98 const double deltaM_hypo1 = (D0_hypo1 + track3_pion).M() - D0_hypo1.M();
99 const double deltaM_hypo2 = (D0_hypo2 + track3_pion).M() - D0_hypo2.M();
100
101
102
104
105 passed_Dstar = true;
106
107
108 track_pass_map[track1->index()] = true;
109 track_pass_map[track2->index()] = true;
110 track_pass_map[track3->index()] = true;
111
112 }
113
114 }
115
116
117 if(passed_Dstar) {
118 vertex_pass_map[
vertex->index()] =
true;
119 }
120
121 }
122
123
124
125 SG::WriteDecorHandle<xAOD::TrackParticleContainer, int> flagTrackPass(
m_trackDecoKey,ctx);
126
128
129 flagTrackPass(*track) = track_pass_map[
track->index()] ;
130
131 }
132
133
134 SG::WriteDecorHandle<xAOD::VertexContainer, Char_t> flagVertexPass(
m_vertexDecoKey,ctx);
135
136
138
139
140 flagVertexPass(*vertex) = vertex_pass_map[
vertex->index()];
141
142 }
143
144 return StatusCode::SUCCESS;
145}
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_WARNING(x)
size_type size() const noexcept
Returns the number of elements in the collection.
const T * get(const ReadCondHandleKey< T > &key, const EventContext &ctx)
Convenience function to retrieve an object given a ReadCondHandleKey.
TrackParticle_v1 TrackParticle
Reference the current persistent version:
VertexContainer_v1 VertexContainer
Definition of the current "Vertex container version".
Vertex_v1 Vertex
Define the latest version of the vertex class.
TrackParticleContainer_v1 TrackParticleContainer
Definition of the current "TrackParticle container version".