test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Attributes
OMTFGhostBuster Class Reference

#include <GhostBuster.h>

Public Member Functions

void select (std::vector< AlgoMuon > &refHitCands, int charge=0)
 
void setNphiBins (unsigned int phiBins)
 

Private Attributes

unsigned int nPhiBins
 

Detailed Description

Definition at line 14 of file GhostBuster.h.

Member Function Documentation

void OMTFGhostBuster::select ( std::vector< AlgoMuon > &  refHitCands,
int  charge = 0 
)

Definition at line 12 of file GhostBuster.cc.

References funct::abs().

Referenced by OMTFReconstruction::getProcessorCandidates().

12  {
13 
14  std::vector<AlgoMuon> refHitCleanCands;
15  // Sort candidates with decreased goodness,
16  // where goodness definied in < operator of AlgoMuon
17  std::sort( refHitCands.rbegin(), refHitCands.rend() );
18 
19  for(std::vector<AlgoMuon>::iterator it1 = refHitCands.begin();
20  it1 != refHitCands.end(); ++it1){
21  bool isGhost=false;
22  for(std::vector<AlgoMuon>::iterator it2 = refHitCleanCands.begin();
23  it2 != refHitCleanCands.end(); ++it2){
24  //do not accept candidates with similar phi (any charge combination)
25  //veto window 5deg(=half of logic cone)=5/360*5760=80"logic strips"
26  //veto window 5 degree in GMT scale is 5/360*576=8 units
27  if (std::abs( phiGMT(it1->getPhi()) - phiGMT(it2->getPhi()) ) < 8 ) {
28 // if(std::abs(it1->getPhi() - it2->getPhi())<5/360.0*nPhiBins){
29  isGhost=true;
30  break;
31  }
32  }
33  if(it1->getQ()>0 && !isGhost) refHitCleanCands.push_back(*it1);
34  }
35 
36  refHitCleanCands.resize( 3, AlgoMuon(0,999,9999,0,0,0,0,0) );
37 
38  std::stringstream myStr;
39  bool hasCandidates = false;
40  for(unsigned int iRefHit=0;iRefHit<refHitCands.size();++iRefHit){
41  if(refHitCands[iRefHit].getQ()){
42  hasCandidates=true;
43  break;
44  }
45  }
46  for(unsigned int iRefHit=0;iRefHit<refHitCands.size();++iRefHit){
47  if(refHitCands[iRefHit].getQ()) myStr<<"Ref hit: "<<iRefHit<<" "<<refHitCands[iRefHit]<<std::endl;
48  }
49  myStr<<"Selected Candidates with charge: "<<charge<<std::endl;
50  for(unsigned int iCand=0; iCand<refHitCleanCands.size(); ++iCand){
51  myStr<<"Cand: "<<iCand<<" "<<refHitCleanCands[iCand]<<std::endl;
52  }
53 
54  if(hasCandidates) edm::LogInfo("OMTF Sorter")<<myStr.str();
55 
56  // update refHitCands with refHitCleanCands
57  refHitCands = refHitCleanCands;
58 }
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
void OMTFGhostBuster::setNphiBins ( unsigned int  phiBins)
inline

Definition at line 20 of file GhostBuster.h.

References nPhiBins.

Referenced by OMTFReconstruction::beginRun().

20 {nPhiBins = phiBins;};
unsigned int nPhiBins
Definition: GhostBuster.h:20

Member Data Documentation

unsigned int OMTFGhostBuster::nPhiBins
private

Definition at line 20 of file GhostBuster.h.

Referenced by setNphiBins().