CMS 3D CMS Logo

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 20 of file MatchingUtils.h.

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

20  {
21  auto c1s = c1.parentSuperCluster();
22  auto c2s = c2.parentSuperCluster();
23  return (c1s == c2s);
24 }
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(), 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) return true;
14  }
15  }
16  return false;
17 }