49 v0Info.dau1px = p.GetField<
float>(
fV0Container->GetFieldIds().dau1px);
50 v0Info.dau1py = p.GetField<
float>(
fV0Container->GetFieldIds().dau1py);
51 v0Info.dau1pz = p.GetField<
float>(
fV0Container->GetFieldIds().dau1pz);
52 v0Info.dau1x = p.GetField<
float>(
fV0Container->GetFieldIds().dau1x);
53 v0Info.dau1y = p.GetField<
float>(
fV0Container->GetFieldIds().dau1y);
54 v0Info.dau1z = p.GetField<
float>(
fV0Container->GetFieldIds().dau1z);
56 v0Info.dau2px = p.GetField<
float>(
fV0Container->GetFieldIds().dau2px);
57 v0Info.dau2py = p.GetField<
float>(
fV0Container->GetFieldIds().dau2py);
58 v0Info.dau2pz = p.GetField<
float>(
fV0Container->GetFieldIds().dau2pz);
59 v0Info.dau2x = p.GetField<
float>(
fV0Container->GetFieldIds().dau2x);
60 v0Info.dau2y = p.GetField<
float>(
fV0Container->GetFieldIds().dau2y);
61 v0Info.dau2z = p.GetField<
float>(
fV0Container->GetFieldIds().dau2z);
107 int nv0s =
fV0Container->GetParticles()->GetNumberOfChannels();
112 fV0Temp->ExpandCreateFast(nv0s);
115 ent =
fV0Temp->GetEntriesFast();
116 fV0Temp->ExpandCreateFast(ent + nv0s);
118 for (
int i = 0; i < nv0s; i++) {
119 auto particleV0 =
fV0Container->GetParticles()->GetChannel(i);
120 auto v0struct =
Convert(particleV0);
121 auto dau1 = recoCont->GetChannel(v0struct.dau1id);
122 auto dau2 = recoCont->GetChannel(v0struct.dau2id);
123 int ch1 = dau1.GetField<
int>(charge_field);
124 int ch2 = dau2.GetField<
int>(charge_field);
125 AnalysisTree::Track daupos = dau1, dauneg = dau2;
126 if (ch1 < 0 && ch2 > 0) {
129 int temp = v0struct.dau1id;
130 v0struct.dau1id = v0struct.dau2id;
131 v0struct.dau2id = temp;
134 v0Track->GetTrack().SetVertexChi2(v0struct.chi2_topo);
135 double e = TMath::Sqrt(v0struct.px * v0struct.px + v0struct.py * v0struct.py + v0struct.pz * v0struct.pz
136 + v0struct.mass * v0struct.mass);
137 v0Track->GetTrack().SetMomentum(v0struct.px, v0struct.py, v0struct.pz, e);
138 v0Track->GetTrack().SetDCA(v0struct.x, v0struct.y, v0struct.z);
141 v0Track->GetTrack().SetNMvdHits(daupos.GetField<
int>(field_hit) + dauneg.GetField<
int>(field_hit));
142 v0Track->GetTrack().SetNStsHits(daupos.GetField<
int>(field_sts) + dauneg.GetField<
int>(field_sts)
143 - daupos.GetField<
int>(field_hit) - dauneg.GetField<
int>(field_hit));
145 v0Track->GetV0().SetPosId(v0struct.dau1id);
146 v0Track->GetV0().SetNegId(v0struct.dau2id);
147 v0Track->GetV0().SetDecLenght(v0struct.l);
148 v0Track->GetV0().SetDecDl(v0struct.l_dl);
149 v0Track->GetV0().SetDauDist(v0struct.distance);
152 v0Track->GetV0().SetMomentumPos(TVector3(v0struct.dau1px, v0struct.dau1py, v0struct.dau1pz));
153 v0Track->GetV0().SetMomentumNeg(TVector3(v0struct.dau2px, v0struct.dau2py, v0struct.dau2pz));
155 v0Track->GetV0().SetMomentumPos(TVector3(daupos.GetPx(), daupos.GetPy(), daupos.GetPz()));
156 v0Track->GetV0().SetMomentumNeg(TVector3(dauneg.GetPx(), dauneg.GetPy(), dauneg.GetPz()));
158 v0Track->GetV0().SetMcId(v0struct.pid);
159 v0Track->SetMcId(-1);
161 if (!recoMatch)
continue;
162 int mc1 = recoMatch->GetMatchDirect(v0struct.dau1id);
163 int mc2 = recoMatch->GetMatchDirect(v0struct.dau2id);
165 if (mc1 >= 0 && mc2 >= 0) {
166 auto mctrack1 = sim->GetChannel(mc1);
167 auto mctrack2 = sim->GetChannel(mc2);
168 int mom1 = mctrack1.GetField<
int>(mother_field);
169 v0Track->SetMcId(mom1);
172 auto mctrack = sim->GetChannel(mc1);
173 v0Track->SetMcId(mctrack.GetField<
int>(mother_field));
176 auto mctrack = sim->GetChannel(mc2);
177 v0Track->SetMcId(mctrack.GetField<
int>(mother_field));
181 if (mc1 < 0)
continue;
182 if (mc2 < 0)
continue;
183 auto mctrack1 = sim->GetChannel(mc1);
184 auto mctrack2 = sim->GetChannel(mc2);
185 int mom1 = mctrack1.GetField<
int>(mother_field);
186 int mom2 = mctrack2.GetField<
int>(mother_field);
188 v0Track->SetMcId(mom1);