CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions
Phase2L1GMT::Tauto3Mu Class Reference

#include <Tauto3Mu.h>

Inheritance diagram for Phase2L1GMT::Tauto3Mu:
Phase2L1GMT::TopoAlgo

Public Member Functions

bool GetTau3Mu (std::vector< l1t::TrackerMuon > &trkMus, std::vector< ConvertedTTTrack > &convertedTracks)
 
 Tauto3Mu (const edm::ParameterSet &iConfig)
 
 Tauto3Mu (const Tauto3Mu &cpy)
 
 ~Tauto3Mu ()
 
- Public Member Functions inherited from Phase2L1GMT::TopoAlgo
int deltaEta (const int eta1, const int eta2)
 
int deltaPhi (int phi1, int phi2)
 
int deltaZ0 (const int Z01, const int Z02)
 
void DumpInputs ()
 
void load (std::vector< l1t::TrackerMuon > &trkMus, std::vector< ConvertedTTTrack > &convertedTracks)
 
 TopoAlgo ()
 
 TopoAlgo (const TopoAlgo &cpy)
 
 ~TopoAlgo ()
 

Private Member Functions

bool Find3MuComb (std::vector< l1t::TrackerMuon > &trkMus)
 
bool FindCloset3Mu (std::vector< std::pair< int, unsigned int > > &mu_phis, std::vector< std::pair< unsigned, unsigned > > &nearby3mu)
 
int Get3MuDphi (unsigned target, unsigned obj1, unsigned obj2)
 
int Get3MuMass (unsigned target, unsigned obj1, unsigned obj2)
 
int GetDiMass (const l1t::TrackerMuon &mu1, const l1t::TrackerMuon &mu2)
 

Additional Inherited Members

- Protected Attributes inherited from Phase2L1GMT::TopoAlgo
std::vector< ConvertedTTTrack > * convertedTracks
 
std::ofstream dumpInput
 
std::vector< l1t::TrackerMuon > * trkMus
 

Detailed Description

Definition at line 23 of file Tauto3Mu.h.

Constructor & Destructor Documentation

◆ Tauto3Mu() [1/2]

Phase2L1GMT::Tauto3Mu::Tauto3Mu ( const edm::ParameterSet iConfig)
inline

Definition at line 44 of file Tauto3Mu.h.

44 {}

◆ ~Tauto3Mu()

Phase2L1GMT::Tauto3Mu::~Tauto3Mu ( )
inline

Definition at line 46 of file Tauto3Mu.h.

46 {}

◆ Tauto3Mu() [2/2]

Phase2L1GMT::Tauto3Mu::Tauto3Mu ( const Tauto3Mu cpy)
inline

Definition at line 48 of file Tauto3Mu.h.

Member Function Documentation

◆ Find3MuComb()

bool Phase2L1GMT::Tauto3Mu::Find3MuComb ( std::vector< l1t::TrackerMuon > &  trkMus)
inlineprivate

Definition at line 64 of file Tauto3Mu.h.

References FindCloset3Mu(), Get3MuMass(), mps_fire::i, jetUpdater_cfi::sort, and Phase2L1GMT::TopoAlgo::trkMus.

Referenced by GetTau3Mu().

64  {
65  // vector< phi, index of trackerMuon >
66  std::vector<std::pair<int, unsigned int> > mu_phis;
67  for (unsigned i = 0; i < trkMus.size(); ++i) {
68  mu_phis.push_back(std::make_pair(trkMus.at(i).hwPhi(), i));
69  }
70 
71  std::sort(mu_phis.begin(), mu_phis.end());
72 
73  std::vector<std::pair<unsigned, unsigned> > nearby3mu;
74  std::vector<int> mu3mass;
75  FindCloset3Mu(mu_phis, nearby3mu);
76 
77  for (unsigned i = 0; i < trkMus.size(); ++i) {
78  int trimass = Get3MuMass(i, nearby3mu.at(i).first, nearby3mu.at(i).second);
79  mu3mass.push_back(trimass);
80  }
81 
82  return true;
83  } // ----- end of function Tauto3Mu::Find3MuComb -----
int Get3MuMass(unsigned target, unsigned obj1, unsigned obj2)
Definition: Tauto3Mu.h:89
std::vector< l1t::TrackerMuon > * trkMus
bool FindCloset3Mu(std::vector< std::pair< int, unsigned int > > &mu_phis, std::vector< std::pair< unsigned, unsigned > > &nearby3mu)
Definition: Tauto3Mu.h:112

◆ FindCloset3Mu()

bool Phase2L1GMT::Tauto3Mu::FindCloset3Mu ( std::vector< std::pair< int, unsigned int > > &  mu_phis,
std::vector< std::pair< unsigned, unsigned > > &  nearby3mu 
)
inlineprivate

Definition at line 112 of file Tauto3Mu.h.

References Get3MuDphi(), mps_fire::i, edm::second(), and groupFilesInBlocks::temp.

Referenced by Find3MuComb().

113  {
114  nearby3mu.clear();
115 
116  std::vector<std::pair<int, unsigned int> > temp(mu_phis);
117 
118  // Round the last 2 to first element of vector
119  temp.insert(temp.begin(), mu_phis.back());
120  temp.insert(temp.begin(), *(mu_phis.rbegin() - 1));
121  // Append the first two element to vector
122  temp.push_back(mu_phis.front());
123  temp.push_back(*(mu_phis.begin() + 1));
124 
125  for (unsigned i = 2; i < temp.size() - 2; ++i) {
126  int combleft = Get3MuDphi(temp[i].second, temp[i - 1].second, temp[i - 2].second);
127  std::pair<unsigned, unsigned> neighbors(temp[i - 1].second, temp[i - 2].second);
128  int mincomb(combleft);
129 
130  int combcenter = Get3MuDphi(temp[i].second, temp[i - 1].second, temp[i + 1].second);
131  if (combcenter < mincomb) {
132  neighbors = std::make_pair(temp[i - 1].second, temp[i + 1].second);
133  mincomb = combcenter;
134  }
135 
136  int combright = Get3MuDphi(temp[i].second, temp[i + 1].second, temp[i + 2].second);
137  if (combright < mincomb) {
138  neighbors = std::make_pair(temp[i + 1].second, temp[i + 2].second);
139  }
140 
141  nearby3mu.push_back(neighbors);
142  }
143 
144  return true;
145  } // ----- end of function Tauto3Mu::FindCloset3Mu -----
U second(std::pair< T, U > const &p)
int Get3MuDphi(unsigned target, unsigned obj1, unsigned obj2)
Definition: Tauto3Mu.h:147

◆ Get3MuDphi()

int Phase2L1GMT::Tauto3Mu::Get3MuDphi ( unsigned  target,
unsigned  obj1,
unsigned  obj2 
)
inlineprivate

Definition at line 147 of file Tauto3Mu.h.

References Phase2L1GMT::TopoAlgo::deltaPhi(), filterCSVwithJSON::target, and Phase2L1GMT::TopoAlgo::trkMus.

Referenced by FindCloset3Mu().

147  {
148  int dPhi1 = deltaPhi(trkMus->at(target).hwPhi(), trkMus->at(obj1).hwPhi());
149  int dPhi2 = deltaPhi(trkMus->at(target).hwPhi(), trkMus->at(obj2).hwPhi());
150  return dPhi1 + dPhi2;
151  }
std::vector< l1t::TrackerMuon > * trkMus
int deltaPhi(int phi1, int phi2)

◆ Get3MuMass()

int Phase2L1GMT::Tauto3Mu::Get3MuMass ( unsigned  target,
unsigned  obj1,
unsigned  obj2 
)
inlineprivate

Definition at line 89 of file Tauto3Mu.h.

References GetDiMass(), filterCSVwithJSON::target, and Phase2L1GMT::TopoAlgo::trkMus.

Referenced by Find3MuComb().

89  {
90  int mass12 = GetDiMass(trkMus->at(target), trkMus->at(obj1));
91  int mass23 = GetDiMass(trkMus->at(obj1), trkMus->at(obj2));
92  int mass31 = GetDiMass(trkMus->at(obj2), trkMus->at(target));
93 
94  return mass12 + mass23 + mass31;
95  } // ----- end of function Tauto3Mu::Get3MuMass -----
int GetDiMass(const l1t::TrackerMuon &mu1, const l1t::TrackerMuon &mu2)
Definition: Tauto3Mu.h:101
std::vector< l1t::TrackerMuon > * trkMus

◆ GetDiMass()

int Phase2L1GMT::Tauto3Mu::GetDiMass ( const l1t::TrackerMuon mu1,
const l1t::TrackerMuon mu2 
)
inlineprivate

Definition at line 101 of file Tauto3Mu.h.

References funct::cos(), Phase2L1GMT::TopoAlgo::deltaEta(), Phase2L1GMT::TopoAlgo::deltaPhi(), l1t::L1Candidate::hwEta(), l1t::L1Candidate::hwPhi(), l1t::L1Candidate::hwPt(), and EgHLTOffHistBins_cfi::mass.

Referenced by Get3MuMass().

101  {
102  int deta = deltaEta(mu1.hwEta(), mu2.hwEta());
103  int dphi = deltaPhi(mu1.hwPhi(), mu2.hwPhi());
104  int mass = 2 * mu1.hwPt() * mu2.hwPt() * (cosh(deta) - cos(dphi));
105  return mass;
106  } // ----- end of function Tauto3Mu::GetDiMass -----
int hwPhi() const
Definition: L1Candidate.h:37
int deltaEta(const int eta1, const int eta2)
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
int hwEta() const
Definition: L1Candidate.h:36
int hwPt() const
Definition: L1Candidate.h:35
int deltaPhi(int phi1, int phi2)

◆ GetTau3Mu()

bool Phase2L1GMT::Tauto3Mu::GetTau3Mu ( std::vector< l1t::TrackerMuon > &  trkMus,
std::vector< ConvertedTTTrack > &  convertedTracks 
)
inline

Definition at line 54 of file Tauto3Mu.h.

References Find3MuComb(), and Phase2L1GMT::TopoAlgo::trkMus.

55  {
57  return true;
58  } // ----- end of function Tauto3Mu::GetTau3Mu -----
bool Find3MuComb(std::vector< l1t::TrackerMuon > &trkMus)
Definition: Tauto3Mu.h:64
std::vector< l1t::TrackerMuon > * trkMus