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 25 of file PFRecoTauMassPlugin.cc.

Constructor & Destructor Documentation

◆ PFRecoTauMassPlugin()

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

Definition at line 37 of file PFRecoTauMassPlugin.cc.

References looper::cfg, and verbosity_.

39  verbosity_ = cfg.getParameter<int>("verbosity");
40  }
RecoTauModifierPlugin(const edm::ParameterSet &pset, edm::ConsumesCollector &&iC)
def move(src, dest)
Definition: eostools.py:511

◆ ~PFRecoTauMassPlugin()

reco::tau::PFRecoTauMassPlugin::~PFRecoTauMassPlugin ( )
override

Definition at line 42 of file PFRecoTauMassPlugin.cc.

42 {}

Member Function Documentation

◆ beginEvent()

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

Reimplemented from reco::tau::RecoTauModifierPlugin.

Definition at line 44 of file PFRecoTauMassPlugin.cc.

44 {}

◆ endEvent()

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

Reimplemented from reco::tau::RecoTauModifierPlugin.

Definition at line 71 of file PFRecoTauMassPlugin.cc.

71 {}

◆ operator()()

void reco::tau::PFRecoTauMassPlugin::operator() ( PFTau tau) const
overridevirtual

Implements reco::tau::RecoTauModifierPlugin.

Definition at line 46 of file PFRecoTauMassPlugin.cc.

References gather_cfg::cout, reco::PFTau::kOneProng0PiZero, and verbosity_.

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

Member Data Documentation

◆ verbosity_

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

Definition at line 34 of file PFRecoTauMassPlugin.cc.

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