CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Functions
MatchingUtils.h File Reference

Go to the source code of this file.

Functions

template<class C1 , class C2 >
bool matchByCommonParentSuperClusterRef (const C1 &c1, const C2 &c2)
 
template<class C1 , class C2 >
bool matchByCommonSourceCandidatePtr (const C1 &c1, const C2 &c2)
 

Function Documentation

template<class C1 , class C2 >
bool matchByCommonParentSuperClusterRef ( const C1 &  c1,
const C2 &  c2 
)

Definition at line 21 of file MatchingUtils.h.

Referenced by PATObjectCrossLinker::matchElectronToPhoton(), and EGMEnergyVarProducer< T >::produce().

21  {
22  auto c1s = c1.parentSuperCluster();
23  auto c2s = c2.parentSuperCluster();
24  return (c1s == c2s);
25 }
template<class C1 , class C2 >
bool matchByCommonSourceCandidatePtr ( const C1 &  c1,
const C2 &  c2 
)

Definition at line 9 of file MatchingUtils.h.

Referenced by PATObjectCrossLinker::matchOneToMany(), LeptonInJetProducer< T >::produce(), and LeptonJetVarProducer< T >::produce().

9  {
10  for (unsigned int i1 = 0; i1 < c1.numberOfSourceCandidatePtrs(); i1++) {
11  auto c1s = c1.sourceCandidatePtr(i1);
12  for (unsigned int i2 = 0; i2 < c2.numberOfSourceCandidatePtrs(); i2++) {
13  if (c2.sourceCandidatePtr(i2) == c1s)
14  return true;
15  }
16  }
17  return false;
18 }