11 #include <unordered_map>
26 std::unique_ptr<const PhotonSelectorAlgo>
_selector;
44 _selectionChoice = _selectionTypes.at(selChoice);
46 conf.getParameterSet(
"SelectionDefinition");
47 const float minEt = selDef.
getParameter<
double>(
"minEt");
48 const float trackIso_const = selDef.
getParameter<
double>(
"trackIsoConstTerm");
49 const float trackIso_slope = selDef.
getParameter<
double>(
"trackIsoSlopeTerm");
50 const float ecalIso_const = selDef.
getParameter<
double>(
"ecalIsoConstTerm");
51 const float ecalIso_slope = selDef.
getParameter<
double>(
"ecalIsoSlopeTerm");
52 const float hcalIso_const = selDef.
getParameter<
double>(
"hcalIsoConstTerm");
53 const float hcalIso_slope = selDef.
getParameter<
double>(
"hcalIsoSlopeTerm");
55 const float loose_hoe = selDef.
getParameter<
double>(
"LooseHoverE");
56 const float combIso = selDef.
getParameter<
double>(
"combIsoConstTerm");
59 trackIso_const, trackIso_slope,
60 ecalIso_const, ecalIso_slope,
61 hcalIso_const, hcalIso_slope,
73 elems.reserve(elems.size()+photons->size());
75 auto SCs_end = std::partition(elems.begin(),elems.end(),
76 [](
const ElementType&
a){
80 auto bphoton = photons->cbegin();
81 auto ephoton = photons->cend();
84 for(
auto photon = bphoton; photon != ephoton; ++photon ) {
85 if(
_selector->passPhotonSelection(*photon) ) {
89 auto sc_elem = std::find_if(elems.begin(),SCs_end,myEqual);
90 if( sc_elem != SCs_end ) {
94 scbe->
setTrackIso(photon->trkSumPtHollowConeDR04());
95 scbe->
setEcalIso(photon->ecalRecHitSumEtConeDR04());
96 scbe->
setHcalIso(photon->hcalTowerSumEtConeDR04());
97 scbe->
setHoE(photon->hadronicOverEm());
103 scbe->
setTrackIso(photon->trkSumPtHollowConeDR04());
104 scbe->
setEcalIso(photon->ecalRecHitSumEtConeDR04());
105 scbe->
setHcalIso(photon->hcalTowerSumEtConeDR04());
106 scbe->
setHoE(photon->hadronicOverEm());
107 SCs_end = elems.insert(SCs_end,ElementType(scbe));
112 elems.shrink_to_fit();
T getParameter(std::string const &) const
bool getByToken(EDGetToken token, Handle< PROD > &result) const
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 &)
void setTrackIso(float val)
set the track Iso
void setPhotonRef(const PhotonRef &ref)
set photonRef
Container::value_type value_type
void setHoE(float val)
set H/E
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
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
const std::unordered_map< std::string, SelectionChoices > _selectionTypes