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";
38 if (inputCands.size()<2)
return inputCands;
40 vector<DTSegmentCand*>
result = solveConflict(inputCands);
42 result = ghostBuster(result);
48 vector<DTSegmentCand*>
result;
50 vector<DTSegmentCand*> ghosts;
53 for (vector<DTSegmentCand*>::const_iterator cand=inputCands.begin();
54 cand!=inputCands.end(); ++cand) {
55 for (vector<DTSegmentCand*>::const_iterator cand2 = cand+1 ; cand2!=inputCands.end() ; ++cand2) {
59 if (confHits.size()) {
63 if((confHits.size())==((*cand)->nHits()) && (confHits.size())==((*cand2)->nHits())
64 && (fabs((*cand)->chi2()-(*cand2)->chi2())<0.1) ) {
66 if(segmCleanerMode == 2) {
69 if((*cand)->superLayer()->id().superlayer() != 2) {
73 float phi1=(atan((dir1.
x())/(dir1.
z())));
74 float phi2=(atan((dir2.
x())/(dir2.
z())));
76 badCand = (fabs(phi1) > fabs(phi2)) ? (*cand) : (*cand2);
82 GlobalVector cand1GlobDir = (*cand)->superLayer()->toGlobal((*cand)->direction());
83 GlobalPoint cand1GlobPos = (*cand)->superLayer()->toGlobal((*cand)->position());
85 float DAlpha1 = fabs(cand1GlobDir.
theta()-cand1GlobVecIP.
theta());
88 GlobalVector cand2GlobDir = (*cand2)->superLayer()->toGlobal((*cand2)->direction());
89 GlobalPoint cand2GlobPos = (*cand2)->superLayer()->toGlobal((*cand2)->position());
91 float DAlpha2 = fabs(cand2GlobDir.theta()-cand2GlobVecIP.
theta());
93 badCand = (DAlpha1 > DAlpha2) ? (*cand) : (*cand2);
97 for (DTSegmentCand::AssPointCont::const_iterator cHit=confHits.begin() ;
98 cHit!=confHits.end(); ++cHit) {
107 DTSegmentCand* badCand = (**cand) < (**cand2) ? (*cand) : (*cand2);
108 for (DTSegmentCand::AssPointCont::const_iterator cHit=confHits.begin() ;
109 cHit!=confHits.end(); ++cHit) badCand->
removeHit(*cHit);
117 vector<DTSegmentCand*>::const_iterator cand=inputCands.begin();
118 while ( cand < inputCands.end() ) {
119 if ((*cand)->good()) result.push_back(*cand);
121 vector<DTSegmentCand*>::const_iterator badCand=cand;
129 vector<DTSegmentCand*>
131 vector<DTSegmentCand*> ghosts;
132 for (vector<DTSegmentCand*>::const_iterator cand=inputCands.begin();
133 cand!=inputCands.end(); ++cand) {
134 for (vector<DTSegmentCand*>::const_iterator cand2=cand+1;
135 cand2!=inputCands.end(); ++cand2) {
136 unsigned int nSharedHits=(*cand)->nSharedHitPairs(*(*cand2));
139 if ((nSharedHits==((*cand)->nHits())) && (nSharedHits==((*cand2)->nHits()))
140 &&(fabs((*cand)->chi2()-(*cand2)->chi2())<0.1)
141 &&(segmCleanerMode==3))
147 if ((
int)nSharedHits >= nSharedHitsMax ||
148 (int)((*cand)->nHits()-nSharedHits)<=nUnSharedHitsMin ||
149 (
int)((*cand2)->nHits()-nSharedHits)<=nUnSharedHitsMin) {
151 if ((**cand)<(**cand2)) {
152 ghosts.push_back(*cand);
155 ghosts.push_back(*cand2);
163 vector<DTSegmentCand*>
result;
164 for (vector<DTSegmentCand*>::const_iterator cand=inputCands.begin();
165 cand!=inputCands.end(); ++cand) {
167 for (vector<DTSegmentCand*>::const_iterator ghost=ghosts.begin();
168 ghost!=ghosts.end(); ++ghost) {
169 if ((*cand)==(*ghost)) {
174 if (!isGhost) result.push_back(*cand);
T getParameter(std::string const &) const
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
virtual void removeHit(AssPoint hit)
remove hit from the candidate