42 std::vector<DetId>& detIdsToStore)
const;
65 ecalPFClustersToken_{consumes(iConfig.getParameter<
edm::InputTag>(
"ecalPFClustersLabel"))},
66 superClustersToken_{consumes(iConfig.getParameter<
edm::InputTag>(
"superClustersLabel"))},
67 elesToken_{consumes(iConfig.getParameter<
edm::InputTag>(
"elesLabel"))},
68 phosToken_{consumes(iConfig.getParameter<
edm::InputTag>(
"phosLabel"))} {
69 minSCEt_ = iConfig.getParameter<
double>(
"minSCEt");
70 minEleEt_ = iConfig.getParameter<
double>(
"minEleEt");
71 minPhoEt_ = iConfig.getParameter<
double>(
"minPhoEt");
73 interestingDetIdCollection_ = iConfig.getParameter<
std::string>(
"interestingDetIdCollection");
75 maxDR_ = iConfig.getParameter<
double>(
"maxDR");
78 produces<DetIdCollection>(interestingDetIdCollection_);
90 std::vector<DetId> indexToStore;
91 indexToStore.reserve(100);
93 if (
eles.isValid() && eeClusToESMap.isValid() && ecalPFClusters.isValid()) {
94 for (
auto& ele : *
eles) {
95 float scEt = ele.superCluster()->energy() *
std::sin(ele.superCluster()->position().theta());
97 addDetIds(*ele.superCluster(), *ecalPFClusters, *eeClusToESMap, indexToStore);
100 if (phos.isValid() && eeClusToESMap.isValid() && ecalPFClusters.isValid()) {
101 for (
auto& pho : *phos) {
102 float scEt = pho.superCluster()->energy() *
std::sin(pho.superCluster()->position().theta());
104 addDetIds(*pho.superCluster(), *ecalPFClusters, *eeClusToESMap, indexToStore);
107 if (
superClusters.isValid() && eeClusToESMap.isValid() && ecalPFClusters.isValid()) {
109 float scEt = sc.energy() *
std::sin(sc.position().theta());
111 addDetIds(sc, *ecalPFClusters, *eeClusToESMap, indexToStore);
116 std::sort(indexToStore.begin(), indexToStore.end());
117 std::unique(indexToStore.begin(), indexToStore.end());
119 auto detIdCollection = std::make_unique<DetIdCollection>(indexToStore);
128 std::vector<DetId>& detIdsToStore)
const {
129 const float scEta = superClus.
eta();
131 const float scPhi = superClus.
phi();
135 for (
size_t clusNr = 0; clusNr <
clusters.size(); clusNr++) {
139 const auto esClusters = std::equal_range(
140 eeClusToESMap.begin(),
146 for (
auto esIt = esClusters.first; esIt != esClusters.second; ++esIt) {
148 for (
const auto& hitAndFrac : esIt->second->hitsAndFractions()) {
149 detIdsToStore.push_back(hitAndFrac.first);
void produce(edm::StreamID, edm::Event &, const edm::EventSetup &) const override
producer
T getParameter(std::string const &) const
Particle flow cluster, see clustering algorithm in PFClusterAlgo.
Sin< T >::type sin(const T &t)
edm::EDGetTokenT< reco::GsfElectronCollection > elesToken_
PFLayer::Layer layer() const
cluster layer, see PFLayer.h in this directory
double phi() const
azimuthal angle of cluster centroid
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
edm::EDGetTokenT< reco::PFCluster::EEtoPSAssociation > eeClusToESMapToken_
edm::EDGetTokenT< reco::PFClusterCollection > ecalPFClustersToken_
Container::value_type value_type
def unique(seq, keepstr=True)
#define DEFINE_FWK_MODULE(type)
constexpr auto deltaR2(const T1 &t1, const T2 &t2) -> decltype(t1.eta())
std::vector< std::pair< CaloClusterPtr::key_type, edm::Ptr< PFCluster > > > EEtoPSAssociation
edm::EDGetTokenT< reco::PhotonCollection > phosToken_
void addDetIds(const reco::SuperCluster &superClus, reco::PFClusterCollection clusters, const reco::PFCluster::EEtoPSAssociation &eeClusToESMap, std::vector< DetId > &detIdsToStore) const
std::vector< PFCluster > PFClusterCollection
collection of PFCluster objects
edm::EDGetTokenT< reco::SuperClusterCollection > superClustersToken_
double eta() const
pseudorapidity of cluster centroid
std::string interestingDetIdCollection_
EgammaIsoESDetIdCollectionProducer(const edm::ParameterSet &)
ctor