192 double newOuterE = 0;
200 if (rt.ietaAbs()<16 && (fabs(rt.outerEnergy()-
et.outerEnergy())<0.00001 ) ) {
202 newOuterE = rt.outerEnergy();
205 newOuterE = rt.outerEnergy()+
et.outerEnergy();
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) {
265 if (rt.emEnergy()>0 &&
et.emEnergy()>0) {
266 double sumEmE = rt.emEnergy()+
et.emEnergy();
268 double x = rt.emEnergy()*rt.emPosition().x() +
et.emEnergy()*
et.emPosition().x();
269 double y = rt.emEnergy()*rt.emPosition().y() +
et.emEnergy()*
et.emPosition().y();
270 double z = rt.emEnergy()*rt.emPosition().z() +
et.emEnergy()*
et.emPosition().z();
272 GlobalPoint weightedEmdPosition(x/sumEmE,y/sumEmE,z/sumEmE);
273 newEmPosition = weightedEmdPosition;
278 else if (rt_hasEcalConstit && !et_hasEcalConstit) {
279 newEmPosition = rt.emPosition();
281 else if (!rt_hasEcalConstit && et_hasEcalConstit) {
282 newEmPosition =
et.emPosition();
288 if (rt_hasHcalConstit) {
289 newHadPosition = rt.hadPosition();
291 else if (et_hasHcalConstit) {
292 newHadPosition =
et.hadPosition();
299 rt.p4()+
et.p4(), newEmPosition, newHadPosition);
303 (rt.hottestCellE() >
et.hottestCellE())?
307 unsigned int numBadHcalChan = rt.numBadHcalCells() -
et.numProblematicHcalCells() - rt.numRecoveredHcalCells();
308 unsigned int numBadEcalChan = rt.numBadEcalCells() -
et.numProblematicEcalCells() - rt.numRecoveredEcalCells();
310 unsigned int numProbHcalChan = rt.numProblematicHcalCells() +
et.numProblematicHcalCells();
311 unsigned int numProbEcalChan = rt.numProblematicEcalCells() +
et.numProblematicEcalCells();
313 unsigned int numRecHcalChan = rt.numRecoveredHcalCells() +
et.numRecoveredHcalCells();
314 unsigned int numRecEcalChan = rt.numRecoveredEcalCells() +
et.numRecoveredEcalCells();
317 numRecHcalChan, numRecEcalChan,
318 numProbHcalChan, numProbEcalChan);
CaloTower mergedTower(const CaloTower &t1, const CaloTower &t2)
void setCaloTowerStatus(unsigned int numBadHcalChan, unsigned int numBadEcalChan, unsigned int numRecHcalChan, unsigned int numRecEcalChan, unsigned int numProbHcalChan, unsigned int numProbEcalChan)
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
void setHottestCellE(double e)
void addConstituents(const std::vector< DetId > &ids)
et
define resolution functions of each parameter