29 <<
"Wrong segmCleanerMode! It must be 1,2 or 3. The default is 1";
37 if (inputCands.size() < 2)
40 vector<DTSegmentCand*>
result = solveConflict(inputCands);
49 vector<DTSegmentCand*>
result;
51 vector<DTSegmentCand*> ghosts;
53 for (vector<DTSegmentCand*>::const_iterator
cand = inputCands.begin();
cand != inputCands.end(); ++
cand) {
54 for (vector<DTSegmentCand*>::const_iterator cand2 =
cand + 1; cand2 != inputCands.end(); ++cand2) {
57 if (!confHits.empty()) {
61 if ((confHits.size()) == ((*cand)->nHits()) && (confHits.size()) == ((*cand2)->nHits()) &&
62 (fabs((*cand)->chi2() - (*cand2)->chi2()) < 0.1)) {
67 if ((*cand)->superLayer()->id().superlayer() != 2) {
71 float phi1 = (atan((
dir1.x()) / (
dir1.z())));
72 float phi2 = (atan((
dir2.x()) / (
dir2.z())));
74 badCand = (fabs(phi1) > fabs(phi2)) ? (*
cand) : (*cand2);
80 GlobalVector cand1GlobDir = (*cand)->superLayer()->toGlobal((*cand)->direction());
81 GlobalPoint cand1GlobPos = (*cand)->superLayer()->toGlobal((*cand)->position());
83 float DAlpha1 = fabs(cand1GlobDir.
theta() - cand1GlobVecIP.
theta());
85 GlobalVector cand2GlobDir = (*cand2)->superLayer()->toGlobal((*cand2)->direction());
86 GlobalPoint cand2GlobPos = (*cand2)->superLayer()->toGlobal((*cand2)->position());
88 float DAlpha2 = fabs(cand2GlobDir.theta() - cand2GlobVecIP.
theta());
90 badCand = (DAlpha1 > DAlpha2) ? (*
cand) : (*cand2);
93 for (DTSegmentCand::AssPointCont::const_iterator cHit = confHits.begin(); cHit != confHits.end(); ++cHit) {
105 if (((*cand)->t0() * (*cand2)->t0() != 0) || ((*cand)->t0() == (*cand2)->t0())) {
106 DTSegmentCand* badCand = (**cand) < (**cand2) ? (*cand) : (*cand2);
108 for (DTSegmentCand::AssPointCont::const_iterator cHit = confHits.begin(); cHit != confHits.end(); ++cHit)
116 vector<DTSegmentCand*>::const_iterator
cand = inputCands.begin();
117 while (
cand < inputCands.end()) {
121 vector<DTSegmentCand*>::const_iterator badCand =
cand;
130 vector<DTSegmentCand*> ghosts;
131 for (vector<DTSegmentCand*>::const_iterator
cand = inputCands.begin();
cand != inputCands.end(); ++
cand) {
132 for (vector<DTSegmentCand*>::const_iterator cand2 =
cand + 1; cand2 != inputCands.end(); ++cand2) {
133 unsigned int nSharedHits = (*cand)->nSharedHitPairs(*(*cand2));
136 if ((nSharedHits == ((*cand)->nHits())) && (nSharedHits == ((*cand2)->nHits())) &&
137 (fabs((*cand)->chi2() - (*cand2)->chi2()) < 0.1) && (
segmCleanerMode == 3)) {
141 if (((*cand)->nHits() == 3 || (*cand2)->nHits() == 3) && (fabs((*cand)->chi2() - (*cand2)->chi2()) < 0.0001)) {
146 if (((*cand2)->nHits() == (*cand)->nHits()) && ((*cand)->t0() * (*cand2)->t0() == 0) &&
147 ((*cand)->t0() != (*cand2)->t0())) {
154 if ((**
cand) < (**cand2)) {
155 ghosts.push_back(*
cand);
157 ghosts.push_back(*cand2);
164 vector<DTSegmentCand*>
result;
165 for (vector<DTSegmentCand*>::const_iterator
cand = inputCands.begin();
cand != inputCands.end(); ++
cand) {
166 bool isGhost =
false;
167 for (vector<DTSegmentCand*>::const_iterator ghost = ghosts.begin(); ghost != ghosts.end(); ++ghost) {
168 if ((*
cand) == (*ghost)) {