CMS 3D CMS Logo

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

void beginEvent () override
 
void endEvent () override
 
void operator() (PFTau &) const override
 
 PFRecoTauMassPlugin (const edm::ParameterSet &, edm::ConsumesCollector &&iC)
 
 ~PFRecoTauMassPlugin () override
 
- Public Member Functions inherited from reco::tau::RecoTauModifierPlugin
 RecoTauModifierPlugin (const edm::ParameterSet &pset, edm::ConsumesCollector &&iC)
 
 ~RecoTauModifierPlugin () override
 
- 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 &)
 
 ~RecoTauEventHolderPlugin () override
 
- 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::getParameter(), and verbosity_.

41 {
42  verbosity_ = cfg.getParameter<int>("verbosity");
43 }
T getParameter(std::string const &) const
RecoTauModifierPlugin(const edm::ParameterSet &pset, edm::ConsumesCollector &&iC)
def move(src, dest)
Definition: eostools.py:511
reco::tau::PFRecoTauMassPlugin::~PFRecoTauMassPlugin ( )
override

Definition at line 45 of file PFRecoTauMassPlugin.cc.

46 {}

Member Function Documentation

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

Reimplemented from reco::tau::RecoTauModifierPlugin.

Definition at line 48 of file PFRecoTauMassPlugin.cc.

49 {}
void reco::tau::PFRecoTauMassPlugin::endEvent ( )
overridevirtual

Reimplemented from reco::tau::RecoTauModifierPlugin.

Definition at line 74 of file PFRecoTauMassPlugin.cc.

References DEFINE_EDM_PLUGIN.

75 {}
void reco::tau::PFRecoTauMassPlugin::operator() ( PFTau tau) const
overridevirtual

Implements reco::tau::RecoTauModifierPlugin.

Definition at line 51 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_.

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

Member Data Documentation

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

Definition at line 36 of file PFRecoTauMassPlugin.cc.

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