85 produces<CaloTowerCollection>();
113 iEvent.
put(std::make_unique<CaloTowerCollection>());
118 iEvent.
put(std::make_unique<CaloTowerCollection>(*regTower));
123 auto output = std::make_unique<CaloTowerCollection>();
131 std::vector<CaloTowerCollection::const_iterator> overlappingTowers;
132 overlappingTowers.reserve(extraTower->
size());
134 for (;rt_it!=rt_end;++rt_it){
136 if (et_it != extraTower->
end()){
146 overlappingTowers.push_back(et_it);
150 output->push_back(*rt_it);
156 for (;et_it!=et_end;++et_it){
157 if (
std::find(overlappingTowers.begin(),overlappingTowers.end(),et_it)==overlappingTowers.end())
160 output->push_back(*et_it);
176 double newOuterE = 0;
193 bool rt_hasEcalConstit =
false;
194 bool et_hasEcalConstit =
false;
196 bool rt_hasHcalConstit =
false;
197 bool et_hasHcalConstit =
false;
202 std::vector<DetId>::const_iterator rc_begin=rt.
constituents().begin();
203 std::vector<DetId>::const_iterator rc_end=rt.
constituents().end();
204 std::vector<DetId>::const_iterator rc_it;
207 for (rc_it=rc_begin; rc_it!=rc_end; ++rc_it) {
208 if (rc_it->det()==
DetId::Hcal) rt_hasHcalConstit=
true;
211 for (rc_it=rc_begin; rc_it!=rc_end; ++rc_it) {
212 if (rc_it->det()==
DetId::Ecal) rt_hasEcalConstit=
true;
216 std::vector<DetId>::const_iterator ec_begin=et.
constituents().begin();
217 std::vector<DetId>::const_iterator ec_end=et.
constituents().end();
218 std::vector<DetId>::const_iterator ec_it;
220 for (ec_it=ec_begin; ec_it!=ec_end; ++ec_it) {
221 if (ec_it->det()==
DetId::Hcal) et_hasHcalConstit=
true;
224 for (ec_it=ec_begin; ec_it!=ec_end; ++ec_it) {
225 if (ec_it->det()==
DetId::Ecal) et_hasEcalConstit=
true;
230 std::vector<DetId> combinedConstituents = rt.
constituents();
231 for (ec_it=ec_begin; ec_it!=ec_end; ++ec_it) {
234 if (
std::find(combinedConstituents.begin(),combinedConstituents.end(), *ec_it)==combinedConstituents.end())
235 combinedConstituents.push_back(*ec_it);
247 if (rt_hasEcalConstit && et_hasEcalConstit) {
256 GlobalPoint weightedEmdPosition(x/sumEmE,y/sumEmE,z/sumEmE);
257 newEmPosition = weightedEmdPosition;
262 else if (rt_hasEcalConstit && !et_hasEcalConstit) {
265 else if (!rt_hasEcalConstit && et_hasEcalConstit) {
272 if (rt_hasHcalConstit) {
275 else if (et_hasHcalConstit) {
283 rt.
p4()+et.
p4(), newEmPosition, newHadPosition);
301 numRecHcalChan, numRecEcalChan,
302 numProbHcalChan, numProbEcalChan);
edm::EDGetTokenT< CaloTowerCollection > tok_reg_
unsigned int numRecoveredEcalCells() const
T getParameter(std::string const &) const
CaloTower mergedTower(const CaloTower &t1, const CaloTower &t2)
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
math::PtEtaPhiMLorentzVector p4(double vtxZ) const
CaloTowersMerger(const edm::ParameterSet &)
bool getByToken(EDGetToken token, Handle< PROD > &result) const
void setCaloTowerStatus(unsigned int numBadHcalChan, unsigned int numBadEcalChan, unsigned int numRecHcalChan, unsigned int numRecEcalChan, unsigned int numProbHcalChan, unsigned int numProbEcalChan)
edm::EDGetTokenT< CaloTowerCollection > tok_ext_
std::vector< CaloTower >::const_iterator const_iterator
edm::InputTag extraTowerTag
unsigned int numRecoveredHcalCells() const
unsigned int numBadHcalCells() const
double hottestCellE() const
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
const GlobalPoint & emPosition() const
void setHottestCellE(double e)
unsigned int numBadEcalCells() const
void addConstituents(const std::vector< DetId > &ids)
#define DEFINE_FWK_MODULE(type)
const GlobalPoint & hadPosition() const
const std::vector< DetId > & constituents() const
const_iterator end() const
void produce(edm::Event &, const edm::EventSetup &) override
CaloTowerDetId id() const
unsigned int numProblematicEcalCells() const
edm::InputTag regularTowerTag
unsigned int numProblematicHcalCells() const
~CaloTowersMerger() override
et
define resolution functions of each parameter
iterator find(key_type k)
double outerEnergy() const
const_iterator begin() const