72 std::vector<DetId> indexToStore;
73 indexToStore.reserve(100);
76 for(
auto& ele : *eles){
78 float scEt = ele.superCluster()->energy()*
std::sin(ele.superCluster()->position().theta());
83 for(
auto& pho : *phos){
84 float scEt = pho.superCluster()->energy()*
std::sin(pho.superCluster()->position().theta());
89 for(
auto& sc : *superClusters){
90 float scEt = sc.energy()*
std::sin(sc.position().theta());
96 std::sort(indexToStore.begin(),indexToStore.end());
97 std::unique(indexToStore.begin(),indexToStore.end());
99 std::auto_ptr< DetIdCollection > detIdCollection (
new DetIdCollection(indexToStore) ) ;
109 int dEta = iEta1-iEta2;
121 int dPhi = iPhi1-iPhi2;
123 if(dPhi>72/2) dPhi-=72;
124 else if(dPhi<-72/2) dPhi+=72;
136 edm::LogError(
"EgammaIsoHcalDetIdCollectionProducerError") <<
"Somehow the supercluster has a seed which is not ECAL, something is badly wrong";
141 int seedHcalIEta =
towerId.ieta();
142 int seedHcalIPhi =
towerId.iphi();
144 for(
auto& recHit : recHits){
T getParameter(std::string const &) const
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Sin< T >::type sin(const T &t)
int calDIPhi(int iPhi1, int iPhi2)
virtual void beginRun(edm::Run const &, const edm::EventSetup &) overridefinal
edm::EDGetTokenT< reco::SuperClusterCollection > superClustersToken_
double dPhi(double phi1, double phi2)
std::string interestingDetIdCollection_
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
edm::EDGetTokenT< HBHERecHitCollection > recHitsToken_
Abs< T >::type abs(const T &t)
unsigned towerId(DetId const &)
virtual void produce(edm::Event &, const edm::EventSetup &)
producer
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
edm::EDCollection< DetId > DetIdCollection
Detector det() const
get the detector field from this detid
int calDIEta(int iEta1, int iEta2)