10 #include <tracking/ckf/cdc/findlets/CDCCKFEclSeedCreator.h>
12 #include <tracking/trackFindingCDC/utilities/StringManipulation.h>
14 #include <tracking/dataobjects/RecoTrack.h>
15 #include <tracking/ckf/cdc/entities/CDCCKFState.h>
17 #include <framework/core/ModuleParamList.h>
19 #include <framework/gearbox/Const.h>
30 moduleParamList->
addParameter(TrackFindingCDC::prefixed(prefix,
"inputECLshowersStoreArrayName"),
32 "StoreArray name of the input Shower Store Array.");
34 moduleParamList->
addParameter(TrackFindingCDC::prefixed(prefix,
"eclSeedRecoTrackStoreArrayName"),
36 "StoreArray name of the output Track Store Array.");
38 moduleParamList->
addParameter(TrackFindingCDC::prefixed(prefix,
"minimalEnRequirementCluster"),
40 "Minimal energy requirement for the input clusters",
43 moduleParamList->
addParameter(TrackFindingCDC::prefixed(prefix,
"restrictToForwardSeeds"),
45 "Don't do Ecl seeding in central region to save computing time",
48 moduleParamList->
addParameter(TrackFindingCDC::prefixed(prefix,
"tanLambdaForwardNeg"),
50 "Up to which (neg) tanLambda value should the seeding be performed",
53 moduleParamList->
addParameter(TrackFindingCDC::prefixed(prefix,
"tanLambdaForwardPos"),
55 "Up to which (pos) tanLambda value should the seeding be performed",
58 moduleParamList->
addParameter(TrackFindingCDC::prefixed(prefix,
"showerDepth"),
60 "Don't do Ecl seeding in central region to save computing time",
84 const double Eclus = shower.getEnergy();
90 const double thetaClus = shower.getTheta();
91 const double phiClus = shower.getPhi();
92 const double rClus = shower.getR();
94 const double sinTheta = sin(thetaClus);
95 const double cosTheta = cos(thetaClus);
96 const double sinPhi = sin(phiClus);
97 const double cosPhi = cos(phiClus);
99 TVector3 pos(rClus * sinTheta * cosPhi, rClus * sinTheta * sinPhi, rClus * cosTheta);
100 const double tanLambda = pos.Z() / pos.Perp();
112 TVector3 mom = Eclus / pos.Mag() * pos;
120 if (2. * rad < pos.Perp()) {
121 rad = pos.Perp() / 2.0 + 1.0;
125 double q = pos.Perp();
126 double y3 = pos.Y() / 2.0;
127 double x3 = pos.X() / 2.0;
129 double basex = sqrt(rad * rad - q * q / 4.0) * (-pos.Y()) / q;
130 double basey = sqrt(rad * rad - q * q / 4.0) * pos.X() / q;
132 double centerx1 = x3 + basex;
133 double centery1 = y3 + basey;
134 double centerx2 = x3 - basex;
135 double centery2 = y3 - basey;
138 double momx1 = pos.Y() - centery1;
139 double momy1 = - (pos.X() - centerx1);
140 double momx2 = pos.Y() - centery2;
141 double momy2 = - (pos.X() - centerx2);
145 if (momx1 * pos.X() + momy1 * pos.Y() < 0) {
149 if (momx2 * pos.X() + momy2 * pos.Y() < 0) {
155 double mom1abs = sqrt(momx1 * momx1 + momy1 * momy1);
156 double mom2abs = sqrt(momx2 * momx2 + momy2 * momy2);
157 momx1 = momx1 / mom1abs;
158 momy1 = momy1 / mom1abs;
159 momx2 = momx2 / mom2abs;
160 momy2 = momy2 / mom2abs;
162 TVector3 mom1(momx1 * mom.Perp(), momy1 * mom.Perp(), mom.Z());
163 TVector3 mom2(momx2 * mom.Perp(), momy2 * mom.Perp(), mom.Z());
167 bool clockwise1 =
true;
168 bool clockwise2 =
true;
169 if (pos.Y() * mom1.X() - pos.X() * mom1.Y() > 0) {
172 if (pos.Y() * mom2.X() - pos.X() * mom2.Y() > 0) {
176 if (clockwise1 == clockwise2) {
177 B2WARNING(
"Something went wrong during helix extrapolation. Skipping track.");
206 shower.getCovarianceMatrixAsArray(covArray);
209 double dx2 = rClus * cosTheta * cosPhi * rClus * cosTheta * cosPhi * covArray[5]
210 + rClus * sinTheta * sinPhi * rClus * sinTheta * sinPhi * covArray[2];
211 double dy2 = rClus * cosTheta * sinPhi * rClus * cosTheta * sinPhi * covArray[5]
212 + rClus * sinTheta * cosPhi * rClus * sinTheta * cosPhi * covArray[2];
213 double dz2 = rClus * sinTheta * rClus * sinTheta * covArray[5];
215 double dpx2 = std::abs(mom1.X() - mom2.X()) / 4.0 * std::abs(mom1.X() - mom2.X()) / 4.0;
216 double dpy2 = std::abs(mom1.Y() - mom2.Y()) / 4.0 * std::abs(mom1.Y() - mom2.Y()) / 4.0;
217 double dpz2 = 0.25 * 0.25 * mom.Z() * mom.Z();
229 msopNeg.setPosMomCov(pos, momneg, cov);
230 msopNeg.setPlane(planeNeg);
231 msopPos.setPosMomCov(pos, mompos, cov);
232 msopPos.setPlane(planePos);
236 seeds.push_back({seedStateNeg});
238 seeds.push_back({seedStatePos});