56 virtual void endJob()
override ;
87 produces<CaloTowerCollection>();
113 std::auto_ptr<CaloTowerCollection>
output;
130 output->reserve(regTower->size()+extraTower->size());
137 std::vector<CaloTowerCollection::const_iterator> overlappingTowers;
138 overlappingTowers.reserve(extraTower->size());
140 for (;rt_it!=rt_end;++rt_it){
142 if (et_it != extraTower->end()){
151 output->push_back(mt);
152 overlappingTowers.push_back(et_it);
156 output->push_back(*rt_it);
162 for (;et_it!=et_end;++et_it){
163 if (
std::find(overlappingTowers.begin(),overlappingTowers.end(),et_it)==overlappingTowers.end())
166 output->push_back(*et_it);
196 double newOuterE = 0;
213 bool rt_hasEcalConstit =
false;
214 bool et_hasEcalConstit =
false;
216 bool rt_hasHcalConstit =
false;
217 bool et_hasHcalConstit =
false;
222 std::vector<DetId>::const_iterator rc_begin=rt.
constituents().begin();
223 std::vector<DetId>::const_iterator rc_end=rt.
constituents().end();
224 std::vector<DetId>::const_iterator rc_it;
227 for (rc_it=rc_begin; rc_it!=rc_end; ++rc_it) {
228 if (rc_it->det()==
DetId::Hcal) rt_hasHcalConstit=
true;
231 for (rc_it=rc_begin; rc_it!=rc_end; ++rc_it) {
232 if (rc_it->det()==
DetId::Ecal) rt_hasEcalConstit=
true;
236 std::vector<DetId>::const_iterator ec_begin=et.
constituents().begin();
237 std::vector<DetId>::const_iterator ec_end=et.
constituents().end();
238 std::vector<DetId>::const_iterator ec_it;
240 for (ec_it=ec_begin; ec_it!=ec_end; ++ec_it) {
241 if (ec_it->det()==
DetId::Hcal) et_hasHcalConstit=
true;
244 for (ec_it=ec_begin; ec_it!=ec_end; ++ec_it) {
245 if (ec_it->det()==
DetId::Ecal) et_hasEcalConstit=
true;
250 std::vector<DetId> combinedConstituents = rt.
constituents();
251 for (ec_it=ec_begin; ec_it!=ec_end; ++ec_it) {
254 if (
std::find(combinedConstituents.begin(),combinedConstituents.end(), *ec_it)==combinedConstituents.end())
255 combinedConstituents.push_back(*ec_it);
267 if (rt_hasEcalConstit && et_hasEcalConstit) {
276 GlobalPoint weightedEmdPosition(x/sumEmE,y/sumEmE,z/sumEmE);
277 newEmPosition = weightedEmdPosition;
282 else if (rt_hasEcalConstit && !et_hasEcalConstit) {
285 else if (!rt_hasEcalConstit && et_hasEcalConstit) {
292 if (rt_hasHcalConstit) {
295 else if (et_hasHcalConstit) {
303 rt.
p4()+et.
p4(), newEmPosition, newHadPosition);
321 numRecHcalChan, numRecEcalChan,
322 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)
math::PtEtaPhiMLorentzVector p4(double vtxZ) const
CaloTowersMerger(const edm::ParameterSet &)
bool getByToken(EDGetToken token, Handle< PROD > &result) const
virtual void endJob() override
#define DEFINE_FWK_MODULE(type)
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
virtual void beginJob() override
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)
const GlobalPoint & hadPosition() const
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
const std::vector< DetId > & constituents() const
virtual void produce(edm::Event &, const edm::EventSetup &) override
CaloTowerDetId id() const
unsigned int numProblematicEcalCells() const
edm::InputTag regularTowerTag
unsigned int numProblematicHcalCells() const
edm::SortedCollection< CaloTower > CaloTowerCollection
double outerEnergy() const