21 nSharedHitsMax = pset.
getParameter<
int>(
"nSharedHitsMax");
23 nUnSharedHitsMin = pset.
getParameter<
int>(
"nUnSharedHitsMin");
25 segmCleanerMode = pset.
getParameter<
int>(
"segmCleanerMode");
27 if ((segmCleanerMode != 1) && (segmCleanerMode != 2) && (segmCleanerMode != 3))
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);
43 result = ghostBuster(result);
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)) {
64 if (segmCleanerMode == 2) {
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()) {
119 result.push_back(*cand);
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())) {
152 if ((
int)nSharedHits >= nSharedHitsMax || (int)((*cand)->nHits() - nSharedHits) <= nUnSharedHitsMin ||
153 (
int)((*cand2)->nHits() - nSharedHits) <= nUnSharedHitsMin) {
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)) {
174 result.push_back(*cand);
std::vector< DTSegmentCand * > solveConflict(const std::vector< DTSegmentCand * > &inputCands) const
solve the conflicts
std::vector< DTSegmentCand * > clean(const std::vector< DTSegmentCand * > &inputCands) const
do the cleaning
Geom::Theta< T > theta() const
DTSegmentCleaner(const edm::ParameterSet &pset)
std::set< AssPoint, AssPointLessZ > AssPointCont
std::vector< DTSegmentCand * > ghostBuster(const std::vector< DTSegmentCand * > &inputCands) const
ghost suppression
T getParameter(std::string const &) const
virtual void removeHit(AssPoint hit)
remove hit from the candidate