27 #include <Math/VectorUtil.h>
33 namespace egammaisolation {
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;
87 using namespace egammaisolation;
88 using namespace reco::isodeposit;
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);
const edm::EventSetup & c
Sin< T >::type sin(const T &t)
std::vector< Track > TrackCollection
collection of Tracks
auto const & tracks
cannot be loose
Exp< T >::type exp(const T &t)
double deltaR2(const Direction &dir2) const
bool get(ProductID const &oid, Handle< PROD > &result) const
XYZPointD XYZPoint
point in space with cartesian internal representation
T get() const
get a component
#define DEFINE_EDM_PLUGIN(factory, type, name)