27 #include <Math/VectorUtil.h>
42 :
extRadius2_(par.getParameter<double>(
"extRadius")),
43 intRadius_(par.getParameter<double>(
"intRadius")),
44 etLow_(par.getParameter<double>(
"etMin")),
46 depth_(par.getParameter<
int>(
"hcalDepth")) {
52 <<
"hcalDepth passed to EgammaTowerExtractor is invalid " << std::endl;
64 <<
"This extractor " << (
typeid(
this).
name()) <<
" is not made for tracks";
85 using namespace ROOT::Math::VectorUtil;
90 EgammaTowerExtractor::~EgammaTowerExtractor() {}
99 Direction candDir(caloPosition.eta(), caloPosition.phi());
102 deposit.addCandEnergy(sc->energy() *
sin(2 * atan(
exp(-sc->eta()))));
105 for (
auto const& trItr :
iEvent.get(caloTowerToken)) {
112 if (depth_ == AllDepths)
113 depEt = trItr.hadEt();
114 else if (depth_ == Depth1)
115 depEt = trItr.ietaAbs() < 18 || trItr.ietaAbs() > 29 ? trItr.hadEt()
116 : trItr.hadEnergyHeInnerLayer() *
sin(trItr.p4().theta());
117 else if (depth_ == Depth2)
118 depEt = trItr.hadEnergyHeOuterLayer() *
sin(trItr.p4().theta());
123 Direction towerDir(trItr.eta(), trItr.phi());
124 double dR2 = candDir.
deltaR2(towerDir);
126 if (dR2 < extRadius2_) {
127 deposit.addDeposit(towerDir, depEt);