11 #include <unordered_map>
25 std::unique_ptr<const PhotonSelectorAlgo>
_selector;
38 _selectionChoice = _selectionTypes.at(selChoice);
40 const float minEt = selDef.
getParameter<
double>(
"minEt");
41 const float trackIso_const = selDef.
getParameter<
double>(
"trackIsoConstTerm");
42 const float trackIso_slope = selDef.
getParameter<
double>(
"trackIsoSlopeTerm");
43 const float ecalIso_const = selDef.
getParameter<
double>(
"ecalIsoConstTerm");
44 const float ecalIso_slope = selDef.
getParameter<
double>(
"ecalIsoSlopeTerm");
45 const float hcalIso_const = selDef.
getParameter<
double>(
"hcalIsoConstTerm");
46 const float hcalIso_slope = selDef.
getParameter<
double>(
"hcalIsoSlopeTerm");
48 const float loose_hoe = selDef.
getParameter<
double>(
"LooseHoverE");
49 const float combIso = selDef.
getParameter<
double>(
"combIsoConstTerm");
50 _selector = std::make_unique<PhotonSelectorAlgo>((float)_selectionChoice,
66 elems.reserve(elems.size() +
photons->size());
68 auto SCs_end = std::partition(
71 auto bphoton =
photons->cbegin();
75 for (
auto photon = bphoton; photon != ephoton; ++photon) {
76 if (
_selector->passPhotonSelection(*photon)) {
80 auto sc_elem = std::find_if(elems.begin(), SCs_end, myEqual);
81 if (sc_elem != SCs_end) {
85 scbe->
setTrackIso(photon->trkSumPtHollowConeDR04());
86 scbe->
setEcalIso(photon->ecalRecHitSumEtConeDR04());
87 scbe->
setHcalIso(photon->hcalTowerSumEtConeDR04());
88 scbe->
setHoE(photon->hadronicOverEm());
94 scbe->
setTrackIso(photon->trkSumPtHollowConeDR04());
95 scbe->
setEcalIso(photon->ecalRecHitSumEtConeDR04());
96 scbe->
setHcalIso(photon->hcalTowerSumEtConeDR04());
97 scbe->
setHoE(photon->hadronicOverEm());
98 SCs_end = elems.insert(SCs_end, ElementType(scbe));
103 elems.shrink_to_fit();
const std::unordered_map< std::string, SelectionChoices > _selectionTypes
SelectionChoices _selectionChoice
void setFromPhoton(bool val)
set provenance
void setHcalIso(float val)
set the had Iso
void importToBlock(const edm::Event &, ElementList &) const override
EGPhotonImporter(const edm::ParameterSet &, edm::ConsumesCollector &)
Handle< PROD > getHandle(EDGetTokenT< PROD > token) const
Container::value_type value_type
void setTrackIso(float val)
set the track Iso
void setPhotonRef(const PhotonRef &ref)
set photonRef
void setHoE(float val)
set H/E
ParameterSet const & getParameterSet(std::string const &) const
std::vector< Photon > PhotonCollection
collectin of Photon objects
_superClustersArePF(conf.getParameter< bool >("superClustersArePF"))
edm::Ref< PhotonCollection > PhotonRef
reference to an object in a collection of Photon objects
T getParameter(std::string const &) const
edm::EDGetTokenT< reco::PhotonCollection > _src
#define DEFINE_EDM_PLUGIN(factory, type, name)
std::vector< std::unique_ptr< reco::PFBlockElement > > ElementList
void setEcalIso(float val)
set the ecal Iso
void setFromPFSuperCluster(bool val)
std::unique_ptr< const PhotonSelectorAlgo > _selector