CMS 3D CMS Logo

List of all members | Public Member Functions
SuperclusTkIsolFromCands Class Reference

#include <SuperclusTkIsolFromCands.h>

Inheritance diagram for SuperclusTkIsolFromCands:
EleTkIsolFromCands

Public Member Functions

Output operator() (const reco::SuperCluster &sc, const math::XYZPoint &vtx)
 
 SuperclusTkIsolFromCands (Configuration const &cfg, reco::TrackCollection const &tracks)
 
 SuperclusTkIsolFromCands (Configuration const &cfg, pat::PackedCandidateCollection const &cands, PIDVeto pidVeto=PIDVeto::NONE)
 
- Public Member Functions inherited from EleTkIsolFromCands
 EleTkIsolFromCands (Configuration const &cfg, reco::TrackCollection const &tracks)
 
 EleTkIsolFromCands (Configuration const &cfg, pat::PackedCandidateCollection const &cands, PIDVeto pidVeto=PIDVeto::NONE)
 
Output operator() (const reco::TrackBase &electronTrack)
 

Additional Inherited Members

- Public Types inherited from EleTkIsolFromCands
enum  PIDVeto { PIDVeto::NONE = 0, PIDVeto::ELES, PIDVeto::NONELES }
 
- Static Public Member Functions inherited from EleTkIsolFromCands
static PIDVeto pidVetoFromStr (const std::string &vetoStr)
 
static edm::ParameterSetDescription pSetDescript ()
 
- Protected Types inherited from EleTkIsolFromCands
using TrackTable = edm::soa::Table< edm::soa::col::Pt, edm::soa::col::Eta, edm::soa::col::Phi, edm::soa::col::Vz >
 
- Protected Member Functions inherited from EleTkIsolFromCands
TrackTable const & getPreselectedTracks (bool isBarrel)
 
- Protected Attributes inherited from EleTkIsolFromCands
Configuration const & cfg_
 

Detailed Description

Definition at line 15 of file SuperclusTkIsolFromCands.h.

Constructor & Destructor Documentation

◆ SuperclusTkIsolFromCands() [1/2]

SuperclusTkIsolFromCands::SuperclusTkIsolFromCands ( Configuration const &  cfg,
reco::TrackCollection const &  tracks 
)
inlineexplicit

Definition at line 17 of file SuperclusTkIsolFromCands.h.

EleTkIsolFromCands(Configuration const &cfg, reco::TrackCollection const &tracks)

◆ SuperclusTkIsolFromCands() [2/2]

SuperclusTkIsolFromCands::SuperclusTkIsolFromCands ( Configuration const &  cfg,
pat::PackedCandidateCollection const &  cands,
PIDVeto  pidVeto = PIDVeto::NONE 
)
inlineexplicit

Definition at line 19 of file SuperclusTkIsolFromCands.h.

22  : EleTkIsolFromCands(cfg, cands, pidVeto) {}
EleTkIsolFromCands(Configuration const &cfg, reco::TrackCollection const &tracks)

Member Function Documentation

◆ operator()()

SuperclusTkIsolFromCands::Output SuperclusTkIsolFromCands::operator() ( const reco::SuperCluster sc,
const math::XYZPoint vtx 
)

Definition at line 5 of file SuperclusTkIsolFromCands.cc.

References funct::abs(), EleTkIsolFromCands::Configuration::barrelCuts, EleTkIsolFromCands::cfg_, reco::deltaR2(), HLT_2024v14_cff::dEta, ALPAKA_ACCELERATOR_NAMESPACE::dR2(), l1ctLayer1_cff::dZ, EleTkIsolFromCands::Configuration::endcapCuts, reco::CaloCluster::eta(), EleTkIsolFromCands::getPreselectedTracks(), reco::CaloCluster::phi(), and L1BJetProducer_cff::vtx.

6  {
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
Configuration const & cfg_
double eta() const
pseudorapidity of cluster centroid
Definition: CaloCluster.h:181