16 , electronsToken_( iC.consumes< std::vector<
reco::GsfElectron > >( edm::
InputTag(
"pixelMatchGsfElectrons" ) ) )
28 CLHEP::HepLorentzVector theElectronHLV(theElectron.
px(), theElectron.
py(), theElectron.
pz(), theElectron.
energy());
29 return this->
calculate(theElectronHLV, trackHandle, iEvent);
32 CLHEP::HepLorentzVector theMuonHLV(theMuon.
px(), theMuon.
py(), theMuon.
pz(), theMuon.
energy());
33 return this->
calculate(theMuonHLV, trackHandle, iEvent);
47 std::vector<reco::GsfElectron>
electrons = *electronsHandle;
49 std::vector<Electron> isoElectrons;
50 for (
size_t ie=0; ie<electrons.size(); ie++) {
52 if (anElectron.
pt() > 10 &&
54 isoElectrons.push_back(electrons[ie]);
58 std::vector<reco::CaloJet> theJets;
59 for (reco::CaloJetCollection::const_iterator itJet = jetColl.begin(); itJet != jetColl.end(); itJet++) {
61 for (
size_t ie = 0; ie < isoElectrons.size(); ie++) {
62 float dr2 =
::deltaR2(*itJet, isoElectrons[ie]);
63 if (dr2 < mindr2) mindr2 = dr2;
67 if (itJet->et() > 15 && mindr > 0.3) theJets.push_back(
reco::CaloJet(*itJet));
70 float isoAngle = 1000;
71 for (std::vector<reco::CaloJet>::const_iterator itJet = theJets.begin(); itJet != theJets.end(); itJet++) {
72 float curDR = this->
spaceAngle(aLepton, *itJet);
73 if (curDR < isoAngle) isoAngle = curDR;
Jets made from CaloTowers.
TrackerIsolationPt trkIsolator_
virtual double energy() const final
energy
bool getByToken(EDGetToken token, Handle< PROD > &result) const
float spaceAngle(const CLHEP::HepLorentzVector &aLepton, const reco::CaloJet &aJet)
Sin< T >::type sin(const T &t)
virtual double phi() const final
momentum azimuthal angle
Cos< T >::type cos(const T &t)
edm::EDGetTokenT< reco::CaloJetCollection > jetToken_
float calculate(const Electron &anElectron, const edm::Handle< edm::View< reco::Track > > &trackHandle, const edm::Event &iEvent)
virtual double py() const final
y coordinate of momentum vector
~LeptonJetIsolationAngle()
virtual double pz() const final
z coordinate of momentum vector
edm::EDGetTokenT< std::vector< reco::GsfElectron > > electronsToken_
T const * product() const
Analysis-level electron class.
T1 deltaR2(T1 eta1, T2 phi1, T3 eta2, T4 phi2)
float calculate(const Electron &theElectron, const edm::View< reco::Track > &theTracks, float isoConeElectron=0.3) const
calculate the TrackIsoPt for the lepton object
virtual double theta() const final
momentum polar angle
virtual double px() const final
x coordinate of momentum vector
LeptonJetIsolationAngle(edm::ConsumesCollector &&iC)
Analysis-level muon class.
std::vector< CaloJet > CaloJetCollection
collection of CaloJet objects
virtual double pt() const final
transverse momentum