68 std::vector<DetId> indexToStore;
69 indexToStore.reserve(100);
72 for(
auto& ele : *eles){
74 float scEt = ele.superCluster()->energy()*
std::sin(ele.superCluster()->position().theta());
79 for(
auto& pho : *phos){
80 float scEt = pho.superCluster()->energy()*
std::sin(pho.superCluster()->position().theta());
85 for(
auto&
sc : *superClusters){
92 std::sort(indexToStore.begin(),indexToStore.end());
93 std::unique(indexToStore.begin(),indexToStore.end());
95 auto detIdCollection = std::make_unique<DetIdCollection>(indexToStore);
105 int dEta = iEta1-iEta2;
117 int dPhi = iPhi1-iPhi2;
119 if(dPhi>72/2) dPhi-=72;
120 else if(dPhi<-72/2) dPhi+=72;
132 edm::LogError(
"EgammaIsoHcalDetIdCollectionProducerError") <<
"Somehow the supercluster has a seed which is not ECAL, something is badly wrong";
139 int seedHcalIEta =
towerId.ieta();
140 int seedHcalIPhi =
towerId.iphi();
142 for(
auto&
recHit : recHits){
T getParameter(std::string const &) const
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Sin< T >::type sin(const T &t)
void produce(edm::Event &, const edm::EventSetup &) override
producer
int calDIPhi(int iPhi1, int iPhi2)
edm::EDGetTokenT< reco::SuperClusterCollection > superClustersToken_
void beginRun(edm::Run const &, const edm::EventSetup &) final
CaloTowerDetId towerOf(const DetId &id) const
Get the tower id for this det id (or null if not known)
std::string interestingDetIdCollection_
def unique(seq, keepstr=True)
edm::EDGetTokenT< HBHERecHitCollection > recHitsToken_
Abs< T >::type abs(const T &t)
float energy() const
Energy. Note this is taken from the first SimTrack only.
unsigned towerId(DetId const &)
float theta() const
Momentum polar angle. Note this is taken from the first SimTrack only.
edm::EDGetTokenT< reco::GsfElectronCollection > elesToken_
EgammaIsoHcalDetIdCollectionProducer(const edm::ParameterSet &)
ctor
edm::ESHandle< CaloTowerConstituentsMap > towerMap_
edm::EDGetTokenT< reco::PhotonCollection > phosToken_
void addDetIds(const reco::SuperCluster &superClus, const HBHERecHitCollection &recHits, std::vector< DetId > &detIdsToStore)
const CaloClusterPtr & seed() const
seed BasicCluster
Detector det() const
get the detector field from this detid
int calDIEta(int iEta1, int iEta2)