CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
DuplicatedPhotonRemover.h
Go to the documentation of this file.
1 #ifndef PhysicsTools_PatUtils_DuplicatedPhotonRemover_h
2 #define PhysicsTools_PatUtils_DuplicatedPhotonRemover_h
3 
6 
11 
13 
15 
16 namespace pat {
17 
19 
20  public:
21  // Checks if two objects share the same supercluster seed
23  template<typename T1, typename T2>
24  bool operator()(const T1 &t1, const T2 &t2) const {
25  return (t1.superCluster()->seed() == t2.superCluster()->seed());
26  }
27  };
28 
29  // Checks if two objects share the same supercluster seed
31  template<typename T1, typename T2>
32  bool operator()(const T1 &t1, const T2 &t2) const {
33  return (t1.superCluster() == t2.superCluster());
34  }
35  };
36 
40  template <typename PhotonCollection>
41  std::auto_ptr< std::vector<size_t> > duplicatesBySuperCluster(const PhotonCollection &photons) const ;
42 
46  template <typename PhotonCollection>
47  std::auto_ptr< std::vector<size_t> > duplicatesBySeed(const PhotonCollection &photons) const ;
48 
50  template <typename PhotonCollection, typename ElectronCollection>
51  std::auto_ptr< pat::OverlapList >
53 
55  template <typename PhotonCollection, typename ElectronCollection>
56  std::auto_ptr< pat::OverlapList >
58 
59  // ===== Concrete versions for users (and to get it compiled, so I can see if there are errors) ===
60  std::auto_ptr< std::vector<size_t> > duplicatesBySeed(const reco::PhotonCollection &photons) const ;
61  std::auto_ptr< std::vector<size_t> > duplicatesBySeed(const edm::View<reco::Photon> &photons) const ;
62  std::auto_ptr< std::vector<size_t> > duplicatesBySuperCluster(const edm::View<reco::Photon> &photons) const ;
63  std::auto_ptr< std::vector<size_t> > duplicatesBySuperCluster(const reco::PhotonCollection &photons) const ;
64  std::auto_ptr< pat::OverlapList > electronsBySeed(const reco::PhotonCollection &photons,
66  std::auto_ptr< pat::OverlapList > electronsBySeed(const edm::View<reco::Photon> &photons,
68  std::auto_ptr< pat::OverlapList > electronsBySuperCluster(const edm::View<reco::Photon> &photons,
70  std::auto_ptr< pat::OverlapList > electronsBySuperCluster(const reco::PhotonCollection &photons,
72  std::auto_ptr< pat::OverlapList > electronsBySeed(const reco::PhotonCollection &photons,
74  std::auto_ptr< pat::OverlapList > electronsBySeed(const edm::View<reco::Photon> &photons,
76  std::auto_ptr< pat::OverlapList > electronsBySuperCluster(const edm::View<reco::Photon> &photons,
78  std::auto_ptr< pat::OverlapList > electronsBySuperCluster(const reco::PhotonCollection &photons,
80  };
81 }
82 
83 template<typename PhotonCollection>
84 std::auto_ptr< std::vector<size_t> >
86  typedef typename PhotonCollection::value_type PhotonType;
88  return dups.duplicates(photons);
89 }
90 
91 template<typename PhotonCollection>
92 std::auto_ptr< std::vector<size_t> >
94  typedef typename PhotonCollection::value_type PhotonType;
96  return dups.duplicates(photons);
97 }
98 
100 template <typename PhotonCollection, typename ElectronCollection>
101 std::auto_ptr< pat::OverlapList >
104  return ovl.find(photons, electrons);
105 }
106 
108 template <typename PhotonCollection, typename ElectronCollection>
109 std::auto_ptr< pat::OverlapList >
112  return ovl.find(photons, electrons);
113 }
114 
115 #endif
std::auto_ptr< std::vector< size_t > > duplicates(const Collection &items) const
std::auto_ptr< pat::OverlapList > electronsBySeed(const PhotonCollection &photons, const ElectronCollection &electrons) const
Indices of photons which happen to be also electrons (that is, they share the same SC seed) ...
std::vector< GsfElectron > GsfElectronCollection
collection of GsfElectron objects
std::vector< Electron > ElectronCollection
Definition: Electron.h:37
bool operator()(const T1 &t1, const T2 &t2) const
Container::value_type value_type
bool operator()(const T1 &t1, const T2 &t2) const
std::auto_ptr< std::vector< size_t > > duplicatesBySuperCluster(const PhotonCollection &photons) const
std::vector< Photon > PhotonCollection
collectin of Photon objects
Definition: PhotonFwd.h:9
std::auto_ptr< std::vector< size_t > > duplicatesBySeed(const PhotonCollection &photons) const
std::auto_ptr< pat::OverlapList > electronsBySuperCluster(const PhotonCollection &photons, const ElectronCollection &electrons) const
Indices of photons which happen to be also electrons (that is, they share the same SC) ...
std::auto_ptr< OverlapList > find(const Collection &items, const OtherCollection &other) const
std::vector< Photon > PhotonCollection
Definition: Photon.h:32