27 std::vector<edm::InputTag> srcLabels = iConfig.
getParameter<std::vector<edm::InputTag> >(
"srcLabels");
50 if (phiSize_ % 2 == 0 || etaSize_ % 2 == 0)
51 edm::LogError(
"AlCaECALRecHitReducerError") <<
"Size of eta/phi should be odd numbers";
103 auto miniEBRecHitCollection = std::make_unique<EBRecHitCollection>();
104 auto miniEERecHitCollection = std::make_unique<EERecHitCollection>();
107 std::set<DetId> reducedRecHit_EBmap;
108 std::set<DetId> reducedRecHit_EEmap;
112 auto reducedCaloClusterCollection = std::make_unique<reco::CaloClusterCollection>();
116 for (reco::PhotonCollection::const_iterator phoIt = phoHandle->begin(); phoIt != phoHandle->end(); phoIt++) {
128 for (; it != itend; ++it) {
130 reducedCaloClusterCollection->push_back(caloClus);
140 for (
auto eleIt = eleViewHandle->begin(); eleIt != eleViewHandle->end(); eleIt++) {
143 if (fabs(sc.
eta()) < 1.479) {
151 for (; it != itend; ++it) {
153 reducedCaloClusterCollection->push_back(caloClus);
159 for (reco::SuperClusterCollection::const_iterator SC_iter = EESCHandle->begin(); SC_iter != EESCHandle->end();
168 for (; it != itend; ++it) {
170 reducedCaloClusterCollection->push_back(caloClus);
175 for (std::set<DetId>::const_iterator itr = reducedRecHit_EBmap.begin(); itr != reducedRecHit_EBmap.end(); itr++) {
176 if (barrelHitsCollection->find(*itr) != barrelHitsCollection->end())
177 miniEBRecHitCollection->push_back(*(barrelHitsCollection->find(*itr)));
180 for (std::set<DetId>::const_iterator itr = reducedRecHit_EEmap.begin(); itr != reducedRecHit_EEmap.end(); itr++) {
181 if (endcapHitsCollection->find(*itr) != endcapHitsCollection->end())
182 miniEERecHitCollection->push_back(*(endcapHitsCollection->find(*itr)));
193 std::set<DetId>& reducedRecHitMap,
202 std::vector<DetId> recHit_window = caloTopology->
getWindow(seed, phiSize, etaSize);
203 for (
unsigned int i = 0;
i < recHit_window.size();
i++) {
204 reducedRecHitMap.insert(recHit_window[
i]);
207 const std::vector<std::pair<DetId, float> >& scHits = sc.
hitsAndFractions();
208 for (
std::vector<std::pair<DetId, float> >::const_iterator scHit_itr = scHits.begin(); scHit_itr != scHits.end();
211 reducedRecHitMap.insert(scHit_itr->first);
void AddMiniRecHitCollection(const reco::SuperCluster &sc, std::set< DetId > &reducedRecHitMap, const CaloTopology *caloTopology) const
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
void produce(edm::StreamID, edm::Event &, const edm::EventSetup &) const override
producer
bool getByToken(EDGetToken token, Handle< PROD > &result) const
#define DEFINE_FWK_MODULE(type)
~AlCaECALRecHitReducer() override
Log< level::Error, false > LogError
double eta() const
pseudorapidity of cluster centroid
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
bool getData(T &iHolder) const
edm::ESGetToken< CaloTopology, CaloTopologyRecord > caloTopologyToken_
std::string alcaBarrelHitsCollection_
const std::vector< std::pair< DetId, float > > & hitsAndFractions() const
std::vector< DetId > getWindow(const DetId &id, const int &northSouthSize, const int &eastWestSize) const
Get the neighbors of the given cell in a window of given size.
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector's numbering enum) ...
edm::EDGetTokenT< reco::SuperClusterCollection > EESuperClusterToken_
AlCaECALRecHitReducer(const edm::ParameterSet &)
ctor
T getParameter(std::string const &) const
std::string alcaEndcapHitsCollection_
std::string alcaCaloClusterCollection_
edm::EDGetTokenT< reco::PhotonCollection > photonToken_
std::vector< edm::EDGetTokenT< edm::View< reco::RecoCandidate > > > eleViewTokens_
edm::EDGetTokenT< EcalRecHitCollection > eeRecHitsToken_
CaloCluster_iterator clustersBegin() const
fist iterator over BasicCluster constituents
const CaloClusterPtr & seed() const
seed BasicCluster
edm::EDGetTokenT< EcalRecHitCollection > ebRecHitsToken_
CaloCluster_iterator clustersEnd() const
last iterator over BasicCluster constituents