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";
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);
T get() const
get a component
Sin< T >::type sin(const T &t)
std::vector< Track > TrackCollection
collection of Tracks
ALPAKA_FN_ACC static ALPAKA_FN_INLINE float dR2(Position4 pos1, Position4 pos2)
XYZPointD XYZPoint
point in space with cartesian internal representation
#define DEFINE_EDM_PLUGIN(factory, type, name)