CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Private Attributes
PtIsolationAlgo< T, C > Class Template Reference

#include <PtIsolationAlgo.h>

Public Types

typedef double value_type
 

Public Member Functions

double operator() (const T &, const C &) const
 
 PtIsolationAlgo ()
 
 PtIsolationAlgo (double dRMin, double dRMax, double dzMax, double d0Max, double ptMin)
 

Private Attributes

double d0Max_
 
double dRMax_
 
double dRMin_
 
double dzMax_
 
double ptMin_
 

Detailed Description

template<typename T, typename C>
class PtIsolationAlgo< T, C >

Definition at line 10 of file PtIsolationAlgo.h.

Member Typedef Documentation

template<typename T, typename C>
typedef double PtIsolationAlgo< T, C >::value_type

Definition at line 12 of file PtIsolationAlgo.h.

Constructor & Destructor Documentation

template<typename T, typename C>
PtIsolationAlgo< T, C >::PtIsolationAlgo ( )
inline

Definition at line 13 of file PtIsolationAlgo.h.

13 { }
template<typename T, typename C>
PtIsolationAlgo< T, C >::PtIsolationAlgo ( double  dRMin,
double  dRMax,
double  dzMax,
double  d0Max,
double  ptMin 
)
inline

Member Function Documentation

template<typename T, typename C>
double PtIsolationAlgo< T, C >::operator() ( const T cand,
const C &  elements 
) const

Definition at line 25 of file PtIsolationAlgo.h.

References PtIsolationAlgo< T, C >::d0Max_, boostedElectronIsolation_cff::deltaR, PtIsolationAlgo< T, C >::dRMax_, PtIsolationAlgo< T, C >::dRMin_, PVValHelper::dz, PtIsolationAlgo< T, C >::dzMax_, HTMLExport::elem(), PtIsolationAlgo< T, C >::ptMin_, and mathSSE::sqrt().

Referenced by PtIsolationAlgo< reco::Candidate, reco::CandidateCollection >::PtIsolationAlgo().

25  {
26  double ptSum = 0;
27  double candVz = cand.vz();
28  double candEta = cand.eta();
29  double candPhi = cand.phi();
30  for( typename C::const_iterator elem = elements.begin(); elem != elements.end(); ++ elem ) {
31  double elemPt = elem->pt();
32  if ( elemPt < ptMin_ ) continue;
33  double elemVx = elem->vx();
34  double elemVy = elem->vy();
35  double elemD0 = sqrt( elemVx * elemVx + elemVy * elemVy );
36  if ( elemD0 > d0Max_ ) continue;
37  double dz = fabs( elem->vz() - candVz );
38  if ( dz > dzMax_ ) continue;
39  double dR = deltaR( elem->eta(), elem->phi(), candEta, candPhi );
40  if ( (dR > dRMax_) || (dR < dRMin_) ) continue;
41  ptSum += elemPt;
42  }
43  return ptSum;
44 }
T sqrt(T t)
Definition: SSEVec.h:18
def elem(elemtype, innerHTML='', html_class='', kwargs)
Definition: HTMLExport.py:19

Member Data Documentation

template<typename T, typename C>
double PtIsolationAlgo< T, C >::d0Max_
private

Definition at line 21 of file PtIsolationAlgo.h.

Referenced by PtIsolationAlgo< T, C >::operator()().

template<typename T, typename C>
double PtIsolationAlgo< T, C >::dRMax_
private

Definition at line 21 of file PtIsolationAlgo.h.

Referenced by PtIsolationAlgo< T, C >::operator()().

template<typename T, typename C>
double PtIsolationAlgo< T, C >::dRMin_
private

Definition at line 21 of file PtIsolationAlgo.h.

Referenced by PtIsolationAlgo< T, C >::operator()().

template<typename T, typename C>
double PtIsolationAlgo< T, C >::dzMax_
private

Definition at line 21 of file PtIsolationAlgo.h.

Referenced by PtIsolationAlgo< T, C >::operator()().

template<typename T, typename C>
double PtIsolationAlgo< T, C >::ptMin_
private

Definition at line 21 of file PtIsolationAlgo.h.

Referenced by PtIsolationAlgo< T, C >::operator()().