CMS 3D CMS Logo

List of all members | Public Member Functions
GhostBuster Class Reference

#include <GhostBuster.h>

Inheritance diagram for GhostBuster:
IGhostBuster

Public Member Functions

std::vector< AlgoMuonselect (std::vector< AlgoMuon > refHitCands, int charge=0) override
 
 ~GhostBuster () override
 
- Public Member Functions inherited from IGhostBuster
virtual ~IGhostBuster ()
 

Detailed Description

Definition at line 15 of file GhostBuster.h.

Constructor & Destructor Documentation

◆ ~GhostBuster()

GhostBuster::~GhostBuster ( )
inlineoverride

Definition at line 17 of file GhostBuster.h.

17 {};

Member Function Documentation

◆ select()

std::vector< AlgoMuon > GhostBuster::select ( std::vector< AlgoMuon refHitCands,
int  charge = 0 
)
overridevirtual

Implements IGhostBuster.

Definition at line 12 of file GhostBuster.cc.

12  {
13  std::vector<AlgoMuon> refHitCleanCands;
14  // Sort candidates with decreased goodness,
15  // where goodness definied in < operator of AlgoMuon
16  std::sort(refHitCands.rbegin(), refHitCands.rend());
17 
18  for (std::vector<AlgoMuon>::iterator it1 = refHitCands.begin(); it1 != refHitCands.end(); ++it1) {
19  bool isGhost = false;
20  for (std::vector<AlgoMuon>::iterator it2 = refHitCleanCands.begin(); it2 != refHitCleanCands.end(); ++it2) {
21  //do not accept candidates with similar phi (any charge combination)
22  //veto window 5deg(=half of logic cone)=5/360*5760=80"logic strips"
23  //veto window 5 degree in GMT scale is 5/360*576=8 units
24  if (std::abs(phiGMT(it1->getPhi()) - phiGMT(it2->getPhi())) < 8) {
25  // if(std::abs(it1->getPhi() - it2->getPhi())<5/360.0*nPhiBins){
26  isGhost = true;
27  break;
28  //which one candidate is killed depends only on the order in the refHitCands (the one with smaller index is taken), and this order is assured by the sort above
29  //TODO here the candidate that is killed does not kill other candidates - check if the firmware does the same (KB)
30  }
31  }
32  if (it1->getQ() > 0 && !isGhost)
33  refHitCleanCands.push_back(*it1);
34  }
35 
36  refHitCleanCands.resize(3, AlgoMuon(0, 999, 9999, 0, 0, 0, 0, 0)); //FIXME
37  //refHitCleanCands.resize( 3, AlgoMuon() );
38 
39  std::stringstream myStr;
40  bool hasCandidates = false;
41  for (unsigned int iRefHit = 0; iRefHit < refHitCands.size(); ++iRefHit) {
42  if (refHitCands[iRefHit].getQ()) {
43  hasCandidates = true;
44  break;
45  }
46  }
47  for (unsigned int iRefHit = 0; iRefHit < refHitCands.size(); ++iRefHit) {
48  if (refHitCands[iRefHit].getQ())
49  myStr << "Ref hit: " << iRefHit << " " << refHitCands[iRefHit] << std::endl;
50  }
51  myStr << "Selected Candidates with charge: " << charge << std::endl;
52  for (unsigned int iCand = 0; iCand < refHitCleanCands.size(); ++iCand) {
53  myStr << "Cand: " << iCand << " " << refHitCleanCands[iCand] << std::endl;
54  }
55 
56  if (hasCandidates)
57  edm::LogInfo("OMTF Sorter") << myStr.str();
58 
59  // update refHitCands with refHitCleanCands
60  return refHitCleanCands;
61 }

References funct::abs(), ALCARECOTkAlJpsiMuMu_cff::charge, and jetUpdater_cfi::sort.

edm::LogInfo
Log< level::Info, false > LogInfo
Definition: MessageLogger.h:125
AlgoMuon
Definition: AlgoMuon.h:6
ALCARECOTkAlJpsiMuMu_cff.charge
charge
Definition: ALCARECOTkAlJpsiMuMu_cff.py:47
jetUpdater_cfi.sort
sort
Definition: jetUpdater_cfi.py:29
funct::abs
Abs< T >::type abs(const T &t)
Definition: Abs.h:22