test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Attributes
reco::tau::PFRecoTauMassPlugin Class Reference
Inheritance diagram for reco::tau::PFRecoTauMassPlugin:
reco::tau::RecoTauModifierPlugin reco::tau::RecoTauEventHolderPlugin reco::tau::RecoTauNamedPlugin

Public Member Functions

virtual void beginEvent ()
 
virtual void endEvent ()
 
void operator() (PFTau &) const
 
 PFRecoTauMassPlugin (const edm::ParameterSet &, edm::ConsumesCollector &&iC)
 
virtual ~PFRecoTauMassPlugin ()
 
- Public Member Functions inherited from reco::tau::RecoTauModifierPlugin
 RecoTauModifierPlugin (const edm::ParameterSet &pset, edm::ConsumesCollector &&iC)
 
virtual ~RecoTauModifierPlugin ()
 
- Public Member Functions inherited from reco::tau::RecoTauEventHolderPlugin
const edm::Eventevt () const
 
edm::Eventevt ()
 
const edm::EventSetupevtSetup () const
 
 RecoTauEventHolderPlugin (const edm::ParameterSet &pset)
 
void setup (edm::Event &, const edm::EventSetup &)
 
virtual ~RecoTauEventHolderPlugin ()
 
- Public Member Functions inherited from reco::tau::RecoTauNamedPlugin
const std::string & name () const
 
 RecoTauNamedPlugin (const edm::ParameterSet &pset)
 
virtual ~RecoTauNamedPlugin ()
 

Private Attributes

int verbosity_
 

Detailed Description

Definition at line 24 of file PFRecoTauMassPlugin.cc.

Constructor & Destructor Documentation

reco::tau::PFRecoTauMassPlugin::PFRecoTauMassPlugin ( const edm::ParameterSet cfg,
edm::ConsumesCollector &&  iC 
)
explicit

Definition at line 39 of file PFRecoTauMassPlugin.cc.

References edm::ParameterSet::exists(), edm::ParameterSet::getParameter(), and verbosity_.

41 {
42  verbosity_ = ( cfg.exists("verbosity") ) ?
43  cfg.getParameter<int>("verbosity") : 0;
44 }
T getParameter(std::string const &) const
bool exists(std::string const &parameterName) const
checks if a parameter exists
def move
Definition: eostools.py:510
RecoTauModifierPlugin(const edm::ParameterSet &pset, edm::ConsumesCollector &&iC)
reco::tau::PFRecoTauMassPlugin::~PFRecoTauMassPlugin ( )
virtual

Definition at line 46 of file PFRecoTauMassPlugin.cc.

47 {}

Member Function Documentation

void reco::tau::PFRecoTauMassPlugin::beginEvent ( )
virtual

Reimplemented from reco::tau::RecoTauModifierPlugin.

Definition at line 49 of file PFRecoTauMassPlugin.cc.

50 {}
void reco::tau::PFRecoTauMassPlugin::endEvent ( )
virtual

Reimplemented from reco::tau::RecoTauModifierPlugin.

Definition at line 75 of file PFRecoTauMassPlugin.cc.

76 {}
void reco::tau::PFRecoTauMassPlugin::operator() ( PFTau tau) const
virtual

Implements reco::tau::RecoTauModifierPlugin.

Definition at line 52 of file PFRecoTauMassPlugin.cc.

References gather_cfg::cout, reco::PFTau::decayMode(), reco::LeafCandidate::energy(), reco::LeafCandidate::eta(), reco::PFTau::kOneProng0PiZero, reco::LeafCandidate::mass(), reco::LeafCandidate::phi(), reco::LeafCandidate::pt(), reco::LeafCandidate::setP4(), reco::LeafCandidate::theta(), and verbosity_.

53 {
54  if ( verbosity_ ) {
55  std::cout << "<PFRecoTauMassPlugin::operator()>:" << std::endl;
56  std::cout << "tau: Pt = " << tau.pt() << ", eta = " << tau.eta() << ", phi = " << tau.phi() << ", mass = " << tau.mass() << " (decayMode = " << tau.decayMode() << ")" << std::endl;
57  }
58 
59  if ( tau.decayMode() == reco::PFTau::kOneProng0PiZero ) {
60  double tauEn = tau.energy();
61  const double chargedPionMass = 0.13957; // GeV
62  if ( tauEn < chargedPionMass ) tauEn = chargedPionMass;
63  double tauP_modified = TMath::Sqrt(tauEn*tauEn - chargedPionMass*chargedPionMass);
64  double tauPx_modified = TMath::Cos(tau.phi())*TMath::Sin(tau.theta())*tauP_modified;
65  double tauPy_modified = TMath::Sin(tau.phi())*TMath::Sin(tau.theta())*tauP_modified;
66  double tauPz_modified = TMath::Cos(tau.theta())*tauP_modified;
67  reco::Candidate::LorentzVector tauP4_modified(tauPx_modified, tauPy_modified, tauPz_modified, tauEn);
68  if ( verbosity_ ) {
69  std::cout << "--> setting tauP4: Pt = " << tauP4_modified.pt() << ", eta = " << tauP4_modified.eta() << ", phi = " << tauP4_modified.phi() << ", mass = " << tauP4_modified.mass() << std::endl;
70  }
71  tau.setP4(tauP4_modified);
72  }
73 }
math::XYZTLorentzVector LorentzVector
Lorentz vector.
Definition: Candidate.h:37
tuple cout
Definition: gather_cfg.py:145

Member Data Documentation

int reco::tau::PFRecoTauMassPlugin::verbosity_
private

Definition at line 36 of file PFRecoTauMassPlugin.cc.

Referenced by operator()(), and PFRecoTauMassPlugin().