29 CLHEP::HepLorentzVector theElectronHLV(theElectron.
px(), theElectron.
py(), theElectron.
pz(), theElectron.
energy());
30 return this->
calculate(theElectronHLV, trackHandle, iEvent);
33 CLHEP::HepLorentzVector theMuonHLV(theMuon.
px(), theMuon.
py(), theMuon.
pz(), theMuon.
energy());
34 return this->
calculate(theMuonHLV, trackHandle, iEvent);
43 iEvent.
getByLabel(
"iterativeCone5CaloJets", jetHandle);
47 iEvent.
getByLabel(
"pixelMatchGsfElectrons", electronsHandle);
48 std::vector<reco::GsfElectron>
electrons = *electronsHandle;
50 std::vector<Electron> isoElectrons;
51 for (
size_t ie=0; ie<electrons.size(); ie++) {
53 if (anElectron.
pt() > 10 &&
55 isoElectrons.push_back(electrons[ie]);
59 std::vector<reco::CaloJet> theJets;
60 for (reco::CaloJetCollection::const_iterator itJet = jetColl.begin(); itJet != jetColl.end(); itJet++) {
62 for (
size_t ie = 0; ie < isoElectrons.size(); ie++) {
63 float dr2 =
::deltaR2(*itJet, isoElectrons[ie]);
64 if (dr2 < mindr2) mindr2 = dr2;
68 if (itJet->et() > 15 && mindr > 0.3) theJets.push_back(
reco::CaloJet(*itJet));
71 float isoAngle = 1000;
72 for (std::vector<reco::CaloJet>::const_iterator itJet = theJets.begin(); itJet != theJets.end(); itJet++) {
73 float curDR = this->
spaceAngle(aLepton, *itJet);
74 if (curDR < isoAngle) isoAngle = curDR;
Jets made from CaloTowers.
TrackerIsolationPt trkIsolator_
float spaceAngle(const CLHEP::HepLorentzVector &aLepton, const reco::CaloJet &aJet)
Sin< T >::type sin(const T &t)
virtual double energy() const
energy
Cos< T >::type cos(const T &t)
float calculate(const Electron &anElectron, const edm::Handle< edm::View< reco::Track > > &trackHandle, const edm::Event &iEvent)
~LeptonJetIsolationAngle()
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
double deltaR2(const Vector1 &v1, const Vector2 &v2)
virtual double theta() const
momentum polar angle
LeptonJetIsolationAngle()
virtual double px() const
x coordinate of momentum vector
virtual double pt() const
transverse momentum
Analysis-level electron class.
T const * product() const
virtual double pz() const
z coordinate of momentum vector
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 phi() const
momentum azimuthal angle
Analysis-level muon class.
virtual double py() const
y coordinate of momentum vector
std::vector< CaloJet > CaloJetCollection
collection of CaloJet objects