51 debug =
pset.getParameter<
bool>(
"DebugMuonSeed");
73 std::vector<TrajectorySeed>&
seeds) {
76 std::vector<TrajectorySeed> FinalSeeds;
82 for (
size_t i = 0;
i < theCollection.size();
i++) {
89 FinalSeeds.push_back(bestSeed);
92 double eta = fabs(seedgp.
eta());
93 if (goodSeeds.size() > 2 &&
eta > 1.5) {
95 FinalSeeds.push_back(anotherSeed);
100 FinalSeeds.push_back(bestSeed);
103 double eta = fabs(seedgp.
eta());
104 if (otherSeeds.size() > 2 &&
eta > 1.5) {
106 FinalSeeds.push_back(anotherSeed);
111 FinalSeeds.push_back(bestSeed);
114 double eta = fabs(seedgp.
eta());
115 if (theCollection.size() > 2 &&
eta > 1.5) {
117 FinalSeeds.push_back(anotherSeed);
125 if (
seeds.size() == 1)
130 double bestChi2 = 99999.;
131 for (
size_t i = 0;
i <
seeds.size();
i++) {
138 double dChi2 = fabs(1. - (theChi2 / bestChi2));
140 int dHits =
theHits - moreHits;
144 if (theChi2 < bestChi2 && dChi2 > 0.05) {
145 winner = static_cast<int>(
i);
150 if (theChi2 >= bestChi2 && dChi2 < 0.05 && dHits > 0) {
151 winner = static_cast<int>(
i);
163 if (
seeds.size() == 1)
166 float biggerProjErr = 9999.;
169 for (
size_t i = 0;
i <
seeds.size();
i++) {
171 mat =
r1->parametersError().similarityT(
r1->projectionMatrix());
175 float ddx = mat[1][1];
176 float ddy = mat[2][2];
177 float dxx = mat[3][3];
178 float dyy = mat[4][4];
179 float projectErr =
sqrt((ddx * 10000.) + (ddy * 10000.) + dxx + dyy);
183 if (projectErr < biggerProjErr)
186 winner = static_cast<int>(
i);
187 biggerProjErr = projectErr;
195 if (
seeds.size() == 1)
198 double highestPt = 0.;
200 for (
size_t i = 0;
i <
seeds.size();
i++) {
202 double pt =
sqrt((mom.
x() * mom.
x()) + (mom.
y() * mom.
y()));
203 if (
pt > highestPt) {
204 winner = static_cast<int>(
i);
214 if (
seeds.size() == 1)
219 double betterChi2 = 99999.;
220 for (
size_t i = 0;
i <
seeds.size();
i++) {
229 if (
theHits == moreHits && theChi2 < betterChi2) {
230 betterChi2 = theChi2;
231 winner = static_cast<int>(
i);
235 betterChi2 = theChi2;
236 winner = static_cast<int>(
i);
247 for (
size_t i = 0;
i <
seeds.size();
i++) {
248 int theLength = static_cast<int>(
seeds[
i].nHits());
249 if (theLength > NSegs) {
252 longSeeds.push_back(
seeds[
i]);
253 }
else if (theLength == NSegs) {
254 longSeeds.push_back(
seeds[
i]);
265 bool findgoodMomentum =
false;
268 for (
size_t i = 0;
i < goodMomentumSeeds.size();
i++) {
270 double pt =
sqrt((mom.
x() * mom.
x()) + (mom.
y() * mom.
y()));
271 if (pt < 6. || pt > 2000.)
275 seeds.push_back(goodMomentumSeeds[
i]);
276 findgoodMomentum =
true;
279 seeds = goodMomentumSeeds;
281 return findgoodMomentum;
286 theCandidate.clear();
288 bool longSeed =
false;
289 bool withFirstLayer =
false;
292 for (
size_t i = 0;
i <
seeds.size();
i++) {
307 if (DT_Id.station() != 1)
309 withFirstLayer =
true;
317 withFirstLayer =
true;
320 bool goodseed = (longSeed && withFirstLayer) ?
true :
false;
322 if (goodseed == good)
323 theCandidate.push_back(
seeds[
i]);
331 std::vector<TrajectorySeed> theGroup;
332 std::vector<bool> usedSeed(
seeds.size(),
false);
335 for (
size_t i = 0;
i <
seeds.size();
i++) {
338 theGroup.push_back(
seeds[
i]);
343 for (
size_t j =
i + 1;
j <
seeds.size();
j++) {
346 if (!usedSeed[
j] && overlapping > 0) {
348 if (
seeds[
i].nHits() == overlapping &&
seeds[
j].nHits() == overlapping) {
352 theGroup.push_back(
seeds[
j]);
360 double dh = pos1.
eta() - pos2.
eta();
361 double df = pos1.
phi() - pos2.
phi();
364 if (
dR > 0.3 &&
seeds[
j].nHits() == 1)
366 if (
dR > 0.2 &&
seeds[
j].nHits() > 1)
368 theGroup.push_back(
seeds[
j]);
380 unsigned int overlapping = 0;
395 double dx = gp1.
x() - gp2.
x();
396 double dy = gp1.
y() - gp2.
y();
397 double dz = gp1.
z() - gp2.
z();
413 theChi2 = theChi2 /
seed.nHits();
461 std::vector<TrackingRecHit*> DThits = theSeg->recHits();
463 for (
size_t j = 0;
j < DThits.size();
j++) {
464 dt1DHits += (DThits[
j]->recHits()).
size();
470 NRechits = (theSeg->recHits()).
size();
480 std::vector<TrackingRecHit*> DThits = rhit->
recHits();
482 for (
size_t j = 0;
j < DThits.size();
j++) {
483 dt1DHits += (DThits[
j]->recHits()).
size();
496 double NChi2 = 999999.;
501 double dof = static_cast<double>(theSeg->degreesOfFreedom());
502 NChi2 = theSeg->chi2() /
dof;