39 {
40
41
44
45
48
49
50 std::vector<char> track_pass_map(trackParticleContainer->
size());
51 std::vector<char> vertex_pass_map(D0Container->
size());
52
53
55
56
57
58 bool passed_D0_or_D0b = (flag_D0(*vertex) || flag_D0b(*vertex));
59
60
61
62 if(!passed_D0_or_D0b) continue;
63
66
67 if(!track1) {
ATH_MSG_WARNING(
"Could not find track at D0 vertex (index 0)");
continue; }
68 if(!track2) {
ATH_MSG_WARNING(
"Could not find track at D0 vertex (index 1)");
continue; }
69
70
71
72 const std::vector<float>& reFit_Px = acc_reFit_Px(*vertex);
73 const std::vector<float>& reFit_Py = acc_reFit_Py(*vertex);
74 const std::vector<float>& reFit_Pz = acc_reFit_Pz(*vertex);
75
76 TLorentzVector track1_pion, track1_kaon;
77 track1_pion.SetXYZM(reFit_Px.at(0),reFit_Py.at(0),reFit_Pz.at(0),
m_pionMass);
78 track1_kaon.SetXYZM(reFit_Px.at(0),reFit_Py.at(0),reFit_Pz.at(0),
m_kaonMass);
79
80 TLorentzVector track2_pion, track2_kaon;
81 track2_pion.SetXYZM(reFit_Px.at(1),reFit_Py.at(1),reFit_Pz.at(1),
m_pionMass);
82 track2_kaon.SetXYZM(reFit_Px.at(1),reFit_Py.at(1),reFit_Pz.at(1),
m_kaonMass);
83
84
85 TLorentzVector D0_hypo1 = track1_pion + track2_kaon;
86 TLorentzVector D0_hypo2 = track1_kaon + track2_pion;
87
88 bool passed_Dstar = false;
89
90
92
93
94 if( track1->
index() == track3->index() )
continue;
95 if( track2->
index() == track3->index() )
continue;
96
97 TLorentzVector track3_pion= track3->p4();
98
99 const double deltaM_hypo1 = (D0_hypo1 + track3_pion).M() - D0_hypo1.M();
100 const double deltaM_hypo2 = (D0_hypo2 + track3_pion).M() - D0_hypo2.M();
101
102
103
105
106 passed_Dstar = true;
107
108
109 track_pass_map[track1->
index()] =
true;
110 track_pass_map[track2->
index()] =
true;
111 track_pass_map[track3->index()] = true;
112
113 }
114
115 }
116
117
118 if(passed_Dstar) {
119 vertex_pass_map[
vertex->index()] =
true;
120 }
121
122 }
123
124
125
126 SG::WriteDecorHandle<xAOD::TrackParticleContainer, int> flagTrackPass(
m_trackDecoKey,ctx);
127
129
130 flagTrackPass(*track) = track_pass_map[
track->index()] ;
131
132 }
133
134
135 SG::WriteDecorHandle<xAOD::VertexContainer, Char_t> flagVertexPass(
m_vertexDecoKey,ctx);
136
137
139
140
141 flagVertexPass(*vertex) = vertex_pass_map[
vertex->index()];
142
143 }
144
145 return StatusCode::SUCCESS;
146}
#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.
size_t index() const
Return the index of this element within its container.
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".