CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes
ElectronSqPtTkIsolation Class Reference

#include <ElectronSqPtTkIsolation.h>

Public Member Functions

 ElectronSqPtTkIsolation (double extRadius, double intRadius, double ptLow, double lip, const reco::TrackCollection *)
 
int getNumberTracks (const reco::GsfElectron *) const
 
double getPtTracks (const reco::GsfElectron *) const
 
 ~ElectronSqPtTkIsolation ()
 

Private Member Functions

std::pair< int, double > getIso (const reco::GsfElectron *) const
 

Private Attributes

double extRadius_
 
double intRadius_
 
double lip_
 
double ptLow_
 
const reco::TrackCollectiontrackCollection_
 

Detailed Description

Definition at line 16 of file ElectronSqPtTkIsolation.h.

Constructor & Destructor Documentation

◆ ElectronSqPtTkIsolation()

ElectronSqPtTkIsolation::ElectronSqPtTkIsolation ( double  extRadius,
double  intRadius,
double  ptLow,
double  lip,
const reco::TrackCollection trackCollection 
)

◆ ~ElectronSqPtTkIsolation()

ElectronSqPtTkIsolation::~ElectronSqPtTkIsolation ( )

Definition at line 23 of file ElectronSqPtTkIsolation.cc.

23 {}

Member Function Documentation

◆ getIso()

std::pair< int, double > ElectronSqPtTkIsolation::getIso ( const reco::GsfElectron electron) const
private

Definition at line 26 of file ElectronSqPtTkIsolation.cc.

26  {
27  int counter = 0;
28  double ptSum = 0.;
29  //Take the electron track
30  reco::GsfTrackRef tmpTrack = electron->gsfTrack();
31  math::XYZVector tmpElectronMomentumAtVtx = (*tmpTrack).momentum();
32 
33  for (reco::TrackCollection::const_iterator itrTr = (*trackCollection_).begin(); itrTr != (*trackCollection_).end();
34  ++itrTr) {
35  math::XYZVector tmpTrackMomentumAtVtx = (*itrTr).momentum();
36  double this_pt = (*itrTr).pt();
37  if (this_pt < ptLow_)
38  continue;
39  if (fabs((*itrTr).dz() - (*tmpTrack).dz()) > lip_)
40  continue;
41  double dr = DeltaR(tmpTrackMomentumAtVtx, tmpElectronMomentumAtVtx);
42  if (fabs(dr) < extRadius_ && fabs(dr) >= intRadius_) {
43  ++counter;
44  ptSum += this_pt * this_pt; // sum of squared pT
45  }
46  } //end loop over tracks
47 
48  std::pair<int, double> retval;
49  retval.first = counter;
50  retval.second = ptSum;
51 
52  return retval;
53 }

References counter, electronAnalyzer_cfi::DeltaR, flavorHistoryFilter_cfi::dr, HPSPFTauProducerPuppi_cfi::electron, extRadius_, intRadius_, lip_, and ptLow_.

Referenced by getNumberTracks(), and getPtTracks().

◆ getNumberTracks()

int ElectronSqPtTkIsolation::getNumberTracks ( const reco::GsfElectron electron) const

Definition at line 55 of file ElectronSqPtTkIsolation.cc.

55  {
56  //counter for the tracks in the isolation cone
57  return getIso(electron).first;
58 }

References HPSPFTauProducerPuppi_cfi::electron, and getIso().

◆ getPtTracks()

double ElectronSqPtTkIsolation::getPtTracks ( const reco::GsfElectron electron) const

Definition at line 60 of file ElectronSqPtTkIsolation.cc.

60 { return getIso(electron).second; }

References HPSPFTauProducerPuppi_cfi::electron, and getIso().

Referenced by ElectronSqPtTkIsolationProducer::produce().

Member Data Documentation

◆ extRadius_

double ElectronSqPtTkIsolation::extRadius_
private

Definition at line 29 of file ElectronSqPtTkIsolation.h.

Referenced by getIso().

◆ intRadius_

double ElectronSqPtTkIsolation::intRadius_
private

Definition at line 30 of file ElectronSqPtTkIsolation.h.

Referenced by getIso().

◆ lip_

double ElectronSqPtTkIsolation::lip_
private

Definition at line 32 of file ElectronSqPtTkIsolation.h.

Referenced by getIso().

◆ ptLow_

double ElectronSqPtTkIsolation::ptLow_
private

Definition at line 31 of file ElectronSqPtTkIsolation.h.

Referenced by getIso().

◆ trackCollection_

const reco::TrackCollection* ElectronSqPtTkIsolation::trackCollection_
private

Definition at line 34 of file ElectronSqPtTkIsolation.h.

counter
Definition: counter.py:1
electronEcalRecHitIsolationLcone_cfi.extRadius
extRadius
Definition: electronEcalRecHitIsolationLcone_cfi.py:18
ElectronSqPtTkIsolation::lip_
double lip_
Definition: ElectronSqPtTkIsolation.h:32
edm::Ref< GsfTrackCollection >
qcdUeDQM_cfi.lip
lip
Definition: qcdUeDQM_cfi.py:25
ElectronSqPtTkIsolation::intRadius_
double intRadius_
Definition: ElectronSqPtTkIsolation.h:30
ElectronSqPtTkIsolation::extRadius_
double extRadius_
Definition: ElectronSqPtTkIsolation.h:29
duplicaterechits_cfi.trackCollection
trackCollection
Definition: duplicaterechits_cfi.py:4
ElectronSqPtTkIsolation::trackCollection_
const reco::TrackCollection * trackCollection_
Definition: ElectronSqPtTkIsolation.h:34
math::XYZVector
XYZVectorD XYZVector
spatial vector with cartesian internal representation
Definition: Vector3D.h:31
counter
static std::atomic< unsigned int > counter
Definition: SharedResourceNames.cc:15
electronAnalyzer_cfi.DeltaR
DeltaR
Definition: electronAnalyzer_cfi.py:33
HPSPFTauProducerPuppi_cfi.electron
electron
Definition: HPSPFTauProducerPuppi_cfi.py:13
electronHcalTowerIsolationLcone_cfi.intRadius
intRadius
Definition: electronHcalTowerIsolationLcone_cfi.py:5
flavorHistoryFilter_cfi.dr
dr
Definition: flavorHistoryFilter_cfi.py:37
ElectronSqPtTkIsolation::ptLow_
double ptLow_
Definition: ElectronSqPtTkIsolation.h:31
ElectronSqPtTkIsolation::getIso
std::pair< int, double > getIso(const reco::GsfElectron *) const
Definition: ElectronSqPtTkIsolation.cc:26