CMS 3D CMS Logo

L1AnalysisRecoPhoton.cc
Go to the documentation of this file.
2 
3 using namespace std;
4 
6 
8 
10  const edm::EventSetup& setup,
12  std::vector<edm::Handle<edm::ValueMap<bool> > > phoVIDDecisionHandles,
13  const unsigned& maxPhoton)
14 
15 {
16  recoPhoton_.nPhotons = 0;
17 
18  for (reco::PhotonCollection::const_iterator ph = photons->begin();
19  ph != photons->end() && recoPhoton_.nPhotons < maxPhoton;
20  ++ph) {
21  recoPhoton_.e.push_back(ph->energy());
22  recoPhoton_.pt.push_back(ph->pt());
23  recoPhoton_.et.push_back(ph->et());
24  recoPhoton_.eta.push_back(ph->eta());
25  recoPhoton_.phi.push_back(ph->phi());
26  recoPhoton_.r9.push_back(ph->r9());
27  recoPhoton_.hasPixelSeed.push_back(ph->hasPixelSeed());
28 
29  edm::Ref<reco::PhotonCollection> photonEdmRef(photons, recoPhoton_.nPhotons);
30 
31  recoPhoton_.isTightPhoton.push_back((*(phoVIDDecisionHandles[0]))[photonEdmRef]);
32  recoPhoton_.isLoosePhoton.push_back((*(phoVIDDecisionHandles[1]))[photonEdmRef]);
33 
34  recoPhoton_.nPhotons++;
35  }
36 }
void SetPhoton(const edm::Event &event, const edm::EventSetup &setup, const edm::Handle< reco::PhotonCollection > photons, const std::vector< edm::Handle< edm::ValueMap< bool > > > phoVIDDecisionHandles, const unsigned &maxPhoton)
Definition: event.py:1