90 auto fsrPhotons = std::make_unique<std::vector<pat::GenericParticle>>();
92 for (
auto muon = muons->begin();
muon != muons->end(); ++
muon) {
93 int photonPosition = -1;
94 double distance_metric_min = -1;
103 for (
auto iter_pf = pfcands->begin(); iter_pf != pfcands->end(); iter_pf++) {
104 auto const& pc = *iter_pf;
107 if (
abs(pc.pdgId()) != 22)
114 if (
abs(pc.eta()) > 1.4 and (
abs(pc.eta()) < 1.6))
116 if (
abs(pc.eta()) > 2.5)
120 double dRPhoMu =
deltaR(
muon->eta(),
muon->phi(), pc.eta(), pc.phi());
121 if (dRPhoMu < 0.0001)
126 bool skipPhoton =
false;
129 for (
auto othermuon = muons->begin(); othermuon != muons->end(); ++othermuon) {
132 double dRPhoMuOther =
deltaR(othermuon->eta(), othermuon->phi(), pc.eta(), pc.phi());
133 if (dRPhoMuOther < dRPhoMu) {
144 for (
auto electrons_iter = electrons->begin(); electrons_iter != electrons->end(); ++electrons_iter) {
145 for (
auto const&
cand : electrons_iter->associatedPackedPFCandidates()) {
146 if (!
cand.isAvailable())
148 if (
cand.id() != pfcandRef.
id())
150 <<
"The electron associatedPackedPFCandidates item does not have " 151 <<
"the same ID of packed candidate collection used for cleaning the electron footprint: " <<
cand.id()
152 <<
" (" << pfcandRef.
id() <<
")\n";
153 if (
cand.key() == pfcandRef.
key()) {
167 if (photon_relIso03 >
isoCut)
169 double metric =
deltaR(
muon->eta(),
muon->phi(), pc.eta(), pc.phi()) / (pc.pt() * pc.pt());
173 fsrPhotons->back().addUserFloat(
"relIso03", photon_relIso03);
175 fsrPhotons->back().addUserFloat(
"dROverEt2", metric);
178 if (photonPosition == -1
or metric < distance_metric_min) {
179 distance_metric_min = metric;
180 photonPosition = fsrPhotons->size() - 1;
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
bool getByToken(EDGetToken token, Handle< PROD > &result) const
const edm::EDGetTokenT< pat::PackedCandidateCollection > pfcands_
key_type key() const
Accessor for product key.
ProductID id() const
Accessor for product ID.
Analysis-level Generic Particle class (e.g. for hadron or muon not fully reconstructed) ...
The Signals That Services Can Subscribe To This is based on ActivityRegistry and is current per Services can connect to the signals distributed by the ActivityRegistry in order to monitor the activity of the application Each possible callback has some defined which we here list in angle e< void, edm::EventID const &, edm::Timestamp const & > We also list in braces which AR_WATCH_USING_METHOD_ is used for those or
edm::Ref< pat::PackedCandidateCollection > PackedCandidateRef
Abs< T >::type abs(const T &t)
const edm::EDGetTokenT< edm::View< reco::Muon > > muons_
double deltaR(double eta1, double eta2, double phi1, double phi2)
double computeRelativeIsolation(const pat::PackedCandidate &photon, const pat::PackedCandidateCollection &pfcands, const double &isoConeMax, const double &isoConeMin) const
const edm::EDGetTokenT< pat::ElectronCollection > electrons_