CMS 3D CMS Logo

SuperclusTkIsolFromCands.cc
Go to the documentation of this file.
4 
6  const math::XYZPoint& vtx) {
7  using namespace edm::soa::col;
8 
9  float ptSum = 0.;
10  int nrTrks = 0;
11 
12  const float scEta = sc.eta();
13  const float scPhi = sc.phi();
14  const float vtxVz = vtx.z();
15 
16  const bool isBarrelSC = std::abs(scEta) < 1.5;
17 
18  auto const& preselectedTracks = getPreselectedTracks(isBarrelSC);
19  auto const& cuts = isBarrelSC ? cfg_.barrelCuts : cfg_.endcapCuts;
20 
21  for (auto const& trk : preselectedTracks) {
22  const float dR2 = reco::deltaR2(scEta, scPhi, trk.get<Eta>(), trk.get<Phi>());
23  const float dEta = trk.get<Eta>() - scEta;
24  const float dZ = vtxVz - trk.get<Vz>();
25 
26  if (dR2 >= cuts.minDR2 && dR2 <= cuts.maxDR2 && std::abs(dEta) >= cuts.minDEta && std::abs(dZ) < cuts.maxDZ) {
27  ptSum += trk.get<Pt>();
28  nrTrks++;
29  }
30  }
31 
32  return {nrTrks, ptSum};
33 }
double phi() const
azimuthal angle of cluster centroid
Definition: CaloCluster.h:184
ALPAKA_FN_ACC static ALPAKA_FN_INLINE float dR2(Position4 pos1, Position4 pos2)
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
TrackTable const & getPreselectedTracks(bool isBarrel)
constexpr auto deltaR2(const T1 &t1, const T2 &t2) -> decltype(t1.eta())
Definition: deltaR.h:16
XYZPointD XYZPoint
point in space with cartesian internal representation
Definition: Point3D.h:12
Output operator()(const reco::SuperCluster &sc, const math::XYZPoint &vtx)
Configuration const & cfg_
double eta() const
pseudorapidity of cluster centroid
Definition: CaloCluster.h:181