56 virtual void endJob()
override ;
87 produces<CaloTowerCollection>();
115 iEvent.
put(std::make_unique<CaloTowerCollection>());
120 iEvent.
put(std::make_unique<CaloTowerCollection>(*regTower));
125 auto output = std::make_unique<CaloTowerCollection>();
133 std::vector<CaloTowerCollection::const_iterator> overlappingTowers;
134 overlappingTowers.reserve(extraTower->
size());
136 for (;rt_it!=rt_end;++rt_it){
138 if (et_it != extraTower->
end()){
148 overlappingTowers.push_back(et_it);
152 output->push_back(*rt_it);
158 for (;et_it!=et_end;++et_it){
159 if (
std::find(overlappingTowers.begin(),overlappingTowers.end(),et_it)==overlappingTowers.end())
162 output->push_back(*et_it);
192 double newOuterE = 0;
209 bool rt_hasEcalConstit =
false;
210 bool et_hasEcalConstit =
false;
212 bool rt_hasHcalConstit =
false;
213 bool et_hasHcalConstit =
false;
218 std::vector<DetId>::const_iterator rc_begin=rt.
constituents().begin();
219 std::vector<DetId>::const_iterator rc_end=rt.
constituents().end();
220 std::vector<DetId>::const_iterator rc_it;
223 for (rc_it=rc_begin; rc_it!=rc_end; ++rc_it) {
224 if (rc_it->det()==
DetId::Hcal) rt_hasHcalConstit=
true;
227 for (rc_it=rc_begin; rc_it!=rc_end; ++rc_it) {
228 if (rc_it->det()==
DetId::Ecal) rt_hasEcalConstit=
true;
232 std::vector<DetId>::const_iterator ec_begin=et.
constituents().begin();
233 std::vector<DetId>::const_iterator ec_end=et.
constituents().end();
234 std::vector<DetId>::const_iterator ec_it;
236 for (ec_it=ec_begin; ec_it!=ec_end; ++ec_it) {
237 if (ec_it->det()==
DetId::Hcal) et_hasHcalConstit=
true;
240 for (ec_it=ec_begin; ec_it!=ec_end; ++ec_it) {
241 if (ec_it->det()==
DetId::Ecal) et_hasEcalConstit=
true;
246 std::vector<DetId> combinedConstituents = rt.
constituents();
247 for (ec_it=ec_begin; ec_it!=ec_end; ++ec_it) {
250 if (
std::find(combinedConstituents.begin(),combinedConstituents.end(), *ec_it)==combinedConstituents.end())
251 combinedConstituents.push_back(*ec_it);
263 if (rt_hasEcalConstit && et_hasEcalConstit) {
272 GlobalPoint weightedEmdPosition(x/sumEmE,y/sumEmE,z/sumEmE);
273 newEmPosition = weightedEmdPosition;
278 else if (rt_hasEcalConstit && !et_hasEcalConstit) {
281 else if (!rt_hasEcalConstit && et_hasEcalConstit) {
288 if (rt_hasHcalConstit) {
291 else if (et_hasHcalConstit) {
299 rt.
p4()+et.
p4(), newEmPosition, newHadPosition);
317 numRecHcalChan, numRecEcalChan,
318 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
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
auto const T2 &decltype(t1.eta()) t2
const std::vector< DetId > & constituents() const
const_iterator end() const
virtual void produce(edm::Event &, const edm::EventSetup &) override
CaloTowerDetId id() const
unsigned int numProblematicEcalCells() const
edm::InputTag regularTowerTag
unsigned int numProblematicHcalCells() const
et
define resolution functions of each parameter
iterator find(key_type k)
double outerEnergy() const
const_iterator begin() const