71 std::vector<DetId> indexToStore;
72 indexToStore.reserve(100);
75 for(
auto& ele : *eles){
77 float scEt = ele.superCluster()->energy()*
std::sin(ele.superCluster()->position().theta());
82 for(
auto& pho : *phos){
83 float scEt = pho.superCluster()->energy()*
std::sin(pho.superCluster()->position().theta());
88 for(
auto& sc : *superClusters){
89 float scEt = sc.energy()*
std::sin(sc.position().theta());
95 std::sort(indexToStore.begin(),indexToStore.end());
96 std::unique(indexToStore.begin(),indexToStore.end());
98 std::auto_ptr< DetIdCollection > detIdCollection (
new DetIdCollection(indexToStore) ) ;
108 int dEta = iEta1-iEta2;
120 int dPhi = iPhi1-iPhi2;
122 if(dPhi>72/2) dPhi-=72;
123 else if(dPhi<-72/2) dPhi+=72;
135 edm::LogError(
"EgammaIsoHcalDetIdCollectionProducerError") <<
"Somehow the supercluster has a seed which is not ECAL, something is badly wrong";
140 int seedHcalIEta =
towerId.ieta();
141 int seedHcalIPhi =
towerId.iphi();
143 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)