85 const double Eclus = shower.getEnergy();
91 const double thetaClus = shower.getTheta();
92 const double phiClus = shower.getPhi();
93 const double rClus = shower.getR();
95 const double sinTheta = sin(thetaClus);
96 const double cosTheta = cos(thetaClus);
97 const double sinPhi = sin(phiClus);
98 const double cosPhi = cos(phiClus);
100 ROOT::Math::XYZVector pos(rClus * sinTheta * cosPhi, rClus * sinTheta * sinPhi, rClus * cosTheta);
101 const double tanLambda = pos.Z() / pos.Rho();
113 ROOT::Math::XYZVector mom = Eclus / pos.R() * pos;
121 if (2. * rad < pos.Rho()) {
122 rad = pos.Rho() / 2.0 + 1.0;
126 double q = pos.Rho();
127 double y3 = pos.Y() / 2.0;
128 double x3 = pos.X() / 2.0;
130 double basex =
sqrt(rad * rad - q * q / 4.0) * (-pos.Y()) / q;
131 double basey =
sqrt(rad * rad - q * q / 4.0) * pos.X() / q;
133 double centerx1 = x3 + basex;
134 double centery1 = y3 + basey;
135 double centerx2 = x3 - basex;
136 double centery2 = y3 - basey;
139 double momx1 = pos.Y() - centery1;
140 double momy1 = - (pos.X() - centerx1);
141 double momx2 = pos.Y() - centery2;
142 double momy2 = - (pos.X() - centerx2);
146 if (momx1 * pos.X() + momy1 * pos.Y() < 0) {
150 if (momx2 * pos.X() + momy2 * pos.Y() < 0) {
156 double mom1abs =
sqrt(momx1 * momx1 + momy1 * momy1);
157 double mom2abs =
sqrt(momx2 * momx2 + momy2 * momy2);
158 momx1 = momx1 / mom1abs;
159 momy1 = momy1 / mom1abs;
160 momx2 = momx2 / mom2abs;
161 momy2 = momy2 / mom2abs;
163 ROOT::Math::XYZVector mom1(momx1 * mom.Rho(), momy1 * mom.Rho(), mom.Z());
164 ROOT::Math::XYZVector mom2(momx2 * mom.Rho(), momy2 * mom.Rho(), mom.Z());
168 bool clockwise1 =
true;
169 bool clockwise2 =
true;
170 if (pos.Y() * mom1.X() - pos.X() * mom1.Y() > 0) {
173 if (pos.Y() * mom2.X() - pos.X() * mom2.Y() > 0) {
177 if (clockwise1 == clockwise2) {
178 B2WARNING(
"Something went wrong during helix extrapolation. Skipping track.");
182 ROOT::Math::XYZVector mompos;
183 ROOT::Math::XYZVector momneg;
200 genfit::MeasuredStateOnPlane msopNeg(repNeg);
202 genfit::MeasuredStateOnPlane msopPos(repPos);
207 shower.getCovarianceMatrixAsArray(covArray);
210 double dx2 = rClus * cosTheta * cosPhi * rClus * cosTheta * cosPhi * covArray[5]
211 + rClus * sinTheta * sinPhi * rClus * sinTheta * sinPhi * covArray[2];
212 double dy2 = rClus * cosTheta * sinPhi * rClus * cosTheta * sinPhi * covArray[5]
213 + rClus * sinTheta * cosPhi * rClus * sinTheta * cosPhi * covArray[2];
214 double dz2 = rClus * sinTheta * rClus * sinTheta * covArray[5];
216 double dpx2 = std::abs(mom1.X() - mom2.X()) / 4.0 * std::abs(mom1.X() - mom2.X()) / 4.0;
217 double dpy2 = std::abs(mom1.Y() - mom2.Y()) / 4.0 * std::abs(mom1.Y() - mom2.Y()) / 4.0;
218 double dpz2 = 0.25 * 0.25 * mom.Z() * mom.Z();
231 msopNeg.setPlane(planeNeg);
233 msopPos.setPlane(planePos);
237 seeds.push_back({seedStateNeg});
239 seeds.push_back({seedStatePos});
static void registerRequiredRelations(StoreArray< RecoTrack > &recoTracks, std::string const &pxdHitsStoreArrayName="", std::string const &svdHitsStoreArrayName="", std::string const &cdcHitsStoreArrayName="", std::string const &bklmHitsStoreArrayName="", std::string const &eklmHitsStoreArrayName="", std::string const &recoHitInformationStoreArrayName="")
Convenience method which registers all relations required to fully use a RecoTrack.