82 produces<CaloTowerCollection>();
108 std::auto_ptr<CaloTowerCollection>
output;
125 output->reserve(regTower->size()+extraTower->size());
132 std::vector<CaloTowerCollection::const_iterator> overlappingTowers;
133 overlappingTowers.reserve(extraTower->size());
135 for (;rt_it!=rt_end;++rt_it){
137 if (et_it != extraTower->end()){
146 output->push_back(mt);
147 overlappingTowers.push_back(et_it);
151 output->push_back(*rt_it);
157 for (;et_it!=et_end;++et_it){
158 if (
std::find(overlappingTowers.begin(),overlappingTowers.end(),et_it)==overlappingTowers.end())
161 output->push_back(*et_it);
191 double newOuterE = 0;
208 bool rt_hasEcalConstit =
false;
209 bool et_hasEcalConstit =
false;
211 bool rt_hasHcalConstit =
false;
212 bool et_hasHcalConstit =
false;
217 std::vector<DetId>::const_iterator rc_begin=rt.
constituents().begin();
218 std::vector<DetId>::const_iterator rc_end=rt.
constituents().end();
219 std::vector<DetId>::const_iterator rc_it;
222 for (rc_it=rc_begin; rc_it!=rc_end; ++rc_it) {
223 if (rc_it->det()==
DetId::Hcal) rt_hasHcalConstit=
true;
226 for (rc_it=rc_begin; rc_it!=rc_end; ++rc_it) {
227 if (rc_it->det()==
DetId::Ecal) rt_hasEcalConstit=
true;
231 std::vector<DetId>::const_iterator ec_begin=et.
constituents().begin();
232 std::vector<DetId>::const_iterator ec_end=et.
constituents().end();
233 std::vector<DetId>::const_iterator ec_it;
235 for (ec_it=ec_begin; ec_it!=ec_end; ++ec_it) {
236 if (ec_it->det()==
DetId::Hcal) et_hasHcalConstit=
true;
239 for (ec_it=ec_begin; ec_it!=ec_end; ++ec_it) {
240 if (ec_it->det()==
DetId::Ecal) et_hasEcalConstit=
true;
245 std::vector<DetId> combinedConstituents = rt.
constituents();
246 for (ec_it=ec_begin; ec_it!=ec_end; ++ec_it) {
249 if (
std::find(combinedConstituents.begin(),combinedConstituents.end(), *ec_it)==combinedConstituents.end())
250 combinedConstituents.push_back(*ec_it);
262 if (rt_hasEcalConstit && et_hasEcalConstit) {
271 GlobalPoint weightedEmdPosition(x/sumEmE,y/sumEmE,z/sumEmE);
272 newEmPosition = weightedEmdPosition;
277 else if (rt_hasEcalConstit && !et_hasEcalConstit) {
280 else if (!rt_hasEcalConstit && et_hasEcalConstit) {
287 if (rt_hasHcalConstit) {
290 else if (et_hasHcalConstit) {
298 rt.
p4()+et.
p4(), newEmPosition, newHadPosition);
316 numRecHcalChan, numRecEcalChan,
317 numProbHcalChan, numProbEcalChan);
unsigned int numRecoveredEcalCells() const
T getParameter(std::string const &) const
CaloTower mergedTower(CaloTower t1, CaloTower t2)
math::PtEtaPhiMLorentzVector p4(double vtxZ) const
CaloTowersMerger(const edm::ParameterSet &)
#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)
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)
virtual void produce(edm::Event &, const edm::EventSetup &)
unsigned int numBadEcalCells() const
void addConstituents(const std::vector< DetId > &ids)
const GlobalPoint & hadPosition() const
auto const T2 &decltype(t1.eta()) t2
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
const std::vector< DetId > & constituents() const
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
CaloTowerDetId id() const
unsigned int numProblematicEcalCells() const
edm::InputTag regularTowerTag
unsigned int numProblematicHcalCells() const
edm::SortedCollection< CaloTower > CaloTowerCollection
double outerEnergy() const