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
edm::Eventevt ()
 
const edm::Eventevt () const
 
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.

39  verbosity_ = cfg.getParameter<int>("verbosity");
40  }

References looper::cfg, and verbosity_.

◆ ~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.

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  }

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

Member Data Documentation

◆ verbosity_

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

Definition at line 34 of file PFRecoTauMassPlugin.cc.

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

metsig::tau
Definition: SignAlgoResolutions.h:49
gather_cfg.cout
cout
Definition: gather_cfg.py:144
reco::PFTau::kOneProng0PiZero
Definition: PFTau.h:40
reco::tau::PFRecoTauMassPlugin::verbosity_
int verbosity_
Definition: PFRecoTauMassPlugin.cc:34
reco::tau::RecoTauModifierPlugin::RecoTauModifierPlugin
RecoTauModifierPlugin(const edm::ParameterSet &pset, edm::ConsumesCollector &&iC)
Definition: RecoTauBuilderPlugins.h:106
looper.cfg
cfg
Definition: looper.py:296
eostools.move
def move(src, dest)
Definition: eostools.py:511
reco::Candidate::LorentzVector
math::XYZTLorentzVector LorentzVector
Lorentz vector.
Definition: Candidate.h:36