test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Types | Public Member Functions | Private Member Functions | Private Attributes
pf2pat::PFIsoDepositAlgo Class Reference

#include <PFIsoDepositAlgo.h>

Public Types

typedef std::vector
< reco::IsoDeposit
IsoDeposits
 
typedef reco::PFCandidate Particle
 
typedef std::vector< ParticleParticleCollection
 

Public Member Functions

 PFIsoDepositAlgo (const edm::ParameterSet &)
 
const IsoDepositsproduce (const ParticleCollection &toBeIsolated, const ParticleCollection &forIsolation)
 
 ~PFIsoDepositAlgo ()
 

Private Member Functions

reco::IsoDeposit buildIsoDeposit (const Particle &particle, const ParticleCollection &forIsolation) const
 build the IsoDeposit for "particle" More...
 
bool sameParticle (const Particle &particle1, const Particle &particle2) const
 checks if the 2 particles are in fact the same More...
 

Private Attributes

IsoDeposits isoDeposits_
 IsoDeposits computed in the produce function. More...
 
bool verbose_
 

Detailed Description

Definition at line 26 of file PFIsoDepositAlgo.h.

Member Typedef Documentation

Definition at line 34 of file PFIsoDepositAlgo.h.

Definition at line 30 of file PFIsoDepositAlgo.h.

Definition at line 31 of file PFIsoDepositAlgo.h.

Constructor & Destructor Documentation

PFIsoDepositAlgo::PFIsoDepositAlgo ( const edm::ParameterSet iConfig)
explicit

Definition at line 16 of file PFIsoDepositAlgo.cc.

16  :
17  verbose_ ( iConfig.getUntrackedParameter<bool>("verbose",false) )
18 
19 {}
T getUntrackedParameter(std::string const &, T const &) const
PFIsoDepositAlgo::~PFIsoDepositAlgo ( )

Definition at line 23 of file PFIsoDepositAlgo.cc.

23 { }

Member Function Documentation

IsoDeposit PFIsoDepositAlgo::buildIsoDeposit ( const Particle particle,
const ParticleCollection forIsolation 
) const
private

build the IsoDeposit for "particle"

Definition at line 52 of file PFIsoDepositAlgo.cc.

References gather_cfg::cout, PFRecoTauDiscriminationAgainstElectronDeadECAL_cfi::dR, reco::LeafCandidate::eta(), i, reco::LeafCandidate::p4(), reco::LeafCandidate::phi(), EnergyCorrector::pt, sameParticle(), and verbose_.

Referenced by produce().

53  {
54 
55 
56  reco::isodeposit::Direction pfDir(particle.eta(),
57  particle.phi());
58 // reco::IsoDeposit::Veto veto;
59 // veto.vetoDir = pfDir;
60 // veto.dR = 0.05;
61 
62  IsoDeposit isoDep( pfDir );
63 
64  for( unsigned i=0; i<forIsolation.size(); i++ ) {
65 
66  const reco::PFCandidate& pfc = forIsolation[i];
67 
68  // need to remove "particle"!
69 
70  if( sameParticle( particle, pfc ) ) continue;
71 
72 
73  XYZTLorentzVector pvi(pfc.p4());
74  reco::isodeposit::Direction dirPfc(pfc.eta(), pfc.phi());
75  double dR = pfDir.deltaR(dirPfc);
76 
77  //COLIN make a parameter
78  double maxDeltaRForIsoDep_ = 1;
79  if(dR > maxDeltaRForIsoDep_) {
80  // if( verbose_ ) cout<<"OUT OF CONE"<<endl;
81  continue;
82  }
83  // else if(verbose_) cout<<endl;
84 
85  if(verbose_ )
86  cout<<"\t"<<pfc<<endl;
87 
88  double pt = pvi.Pt();
89  isoDep.addDeposit(dirPfc, pt);
90  }
91 
92  return isoDep;
93 }
int i
Definition: DBlmapReader.cc:9
virtual double phi() const final
momentum azimuthal angle
XYZTLorentzVectorD XYZTLorentzVector
Lorentz vector with cylindrical internal representation using pseudorapidity.
Definition: LorentzVector.h:29
double phi() const
momentum azimuthal angle
Definition: Particle.h:106
bool sameParticle(const Particle &particle1, const Particle &particle2) const
checks if the 2 particles are in fact the same
Particle reconstructed by the particle flow algorithm.
Definition: PFCandidate.h:39
tuple cout
Definition: gather_cfg.py:145
virtual double eta() const final
momentum pseudorapidity
double eta() const
momentum pseudorapidity
Definition: Particle.h:110
virtual const LorentzVector & p4() const final
four-momentum Lorentz vector
Definition: LeafCandidate.h:99
const PFIsoDepositAlgo::IsoDeposits & PFIsoDepositAlgo::produce ( const ParticleCollection toBeIsolated,
const ParticleCollection forIsolation 
)

all the filtering is done before could gain in performance by having a single loop, and by producing all isodeposits at the same time? however, would not gain in ease of maintenance, and in flexibility.

Definition at line 27 of file PFIsoDepositAlgo.cc.

References buildIsoDeposit(), gather_cfg::cout, i, isoDeposits_, and verbose_.

Referenced by JSONExport.JsonExport::export(), HTMLExport.HTMLExport::export(), and HTMLExport.HTMLExportStatic::export().

28  {
29 
30 
31  isoDeposits_.clear();
32  isoDeposits_.reserve( toBeIsolated.size() );
33 
34  for( unsigned i=0; i<toBeIsolated.size(); i++ ) {
35  const reco::PFCandidate& toBeIso = toBeIsolated[i];
36 
37  if(verbose_ )
38  cout<<"to be isolated: "<<toBeIso<<endl;
39 
40  isoDeposits_.push_back( buildIsoDeposit( toBeIso, forIsolation ) );
41  }
42 
43 
44  if(verbose_) {
45  cout<<"PFIsoDepositAlgo "<<endl;
46  }
47 
48  return isoDeposits_;
49 }
int i
Definition: DBlmapReader.cc:9
IsoDeposits isoDeposits_
IsoDeposits computed in the produce function.
reco::IsoDeposit buildIsoDeposit(const Particle &particle, const ParticleCollection &forIsolation) const
build the IsoDeposit for &quot;particle&quot;
Particle reconstructed by the particle flow algorithm.
Definition: PFCandidate.h:39
tuple cout
Definition: gather_cfg.py:145
bool PFIsoDepositAlgo::sameParticle ( const Particle particle1,
const Particle particle2 
) const
private

checks if the 2 particles are in fact the same

Definition at line 96 of file PFIsoDepositAlgo.cc.

References alignCSCRings::e, reco::LeafCandidate::energy(), reco::LeafCandidate::eta(), and reco::PFCandidate::particleId().

Referenced by buildIsoDeposit().

97  {
98 
99  double smallNumber = 1e-15;
100 
101  if( particle1.particleId() != particle2.particleId() ) return false;
102  else if( fabs( particle1.energy() - particle2.energy() ) > smallNumber ) return false;
103  else if( fabs( particle1.eta() - particle2.eta() ) > smallNumber ) return false;
104  else if( fabs( particle1.eta() - particle2.eta() ) > smallNumber ) return false;
105  else return true;
106 
107 }
double energy() const
energy
Definition: Particle.h:83
double eta() const
momentum pseudorapidity
Definition: Particle.h:110

Member Data Documentation

IsoDeposits pf2pat::PFIsoDepositAlgo::isoDeposits_
private

IsoDeposits computed in the produce function.

Definition at line 59 of file PFIsoDepositAlgo.h.

Referenced by produce().

bool pf2pat::PFIsoDepositAlgo::verbose_
private

Definition at line 61 of file PFIsoDepositAlgo.h.

Referenced by buildIsoDeposit(), and produce().