42 std::vector<DetId>& detIdsToStore)
const;
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);
PFLayer::Layer layer() const
cluster layer, see PFLayer.h in this directory
void produce(edm::StreamID, edm::Event &, const edm::EventSetup &) const override
producer
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Particle flow cluster, see clustering algorithm in PFClusterAlgo.
#define DEFINE_FWK_MODULE(type)
Sin< T >::type sin(const T &t)
edm::EDGetTokenT< reco::GsfElectronCollection > elesToken_
double eta() const
pseudorapidity of cluster centroid
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
edm::EDGetTokenT< reco::PFCluster::EEtoPSAssociation > eeClusToESMapToken_
Handle< PROD > getHandle(EDGetTokenT< PROD > token) const
edm::EDGetTokenT< reco::PFClusterCollection > ecalPFClustersToken_
Container::value_type value_type
constexpr auto deltaR2(const T1 &t1, const T2 &t2) -> decltype(t1.eta())
std::vector< std::pair< CaloClusterPtr::key_type, edm::Ptr< PFCluster > > > EEtoPSAssociation
T getParameter(std::string const &) const
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 phi() const
azimuthal angle of cluster centroid
std::string interestingDetIdCollection_
EgammaIsoESDetIdCollectionProducer(const edm::ParameterSet &)
ctor