CMS 3D CMS Logo

Public Types | Public Member Functions | Private Attributes

reco::RecoTauPiZero Class Reference

#include <RecoTauPiZero.h>

Inheritance diagram for reco::RecoTauPiZero:
reco::CompositePtrCandidate reco::LeafCandidate reco::Candidate

List of all members.

Public Types

enum  PiZeroAlgorithm { kUndefined = 0, kTrivial = 1, kCombinatoric = 2, kStrips = 3 }

Public Member Functions

PiZeroAlgorithm algo () const
 Algorithm that built this piZero.
bool algoIs (PiZeroAlgorithm algo) const
 Check whether a given algo produced this pi zero.
double maxDeltaEta () const
 Maxmum DeltaEta between a constituent and the four vector.
double maxDeltaPhi () const
 Maximum DeltaPhi between a constituent and the four vector.
size_t numberOfElectrons () const
 Number of electron constituents.
size_t numberOfGammas () const
 Number of PFGamma constituents.
void print (std::ostream &out=std::cout) const
 RecoTauPiZero (Charge q, const LorentzVector &p4, const Point &vtx=Point(0, 0, 0), int pdgId=111, int status=0, bool integerCharge=true, PiZeroAlgorithm algoName=kUndefined)
 constructor from values
 RecoTauPiZero (PiZeroAlgorithm algoName)
 RecoTauPiZero (const Candidate &p, PiZeroAlgorithm algoName=kUndefined)
 constructor from a Candidate
 RecoTauPiZero (Charge q, const PolarLorentzVector &p4, const Point &vtx=Point(0, 0, 0), int pdgId=111, int status=0, bool integerCharge=true, PiZeroAlgorithm algoName=kUndefined)
 constructor from values
 RecoTauPiZero ()
 ~RecoTauPiZero ()
 destructor

Private Attributes

PiZeroAlgorithm algoName_

Detailed Description

Definition at line 7 of file RecoTauPiZero.h.


Member Enumeration Documentation

Enumerator:
kUndefined 
kTrivial 
kCombinatoric 
kStrips 

Definition at line 9 of file RecoTauPiZero.h.

                         {
      // Algorithm where each photon becomes a pi zero
      kUndefined = 0,
      kTrivial = 1,
      kCombinatoric = 2,
      kStrips = 3
    };

Constructor & Destructor Documentation

reco::RecoTauPiZero::RecoTauPiZero ( ) [inline]

Definition at line 17 of file RecoTauPiZero.h.

References reco::LeafCandidate::setPdgId().

reco::RecoTauPiZero::RecoTauPiZero ( PiZeroAlgorithm  algoName) [inline]

Definition at line 20 of file RecoTauPiZero.h.

References reco::LeafCandidate::setPdgId().

                                           :
        CompositePtrCandidate(), algoName_(algoName) { this->setPdgId(111); }
reco::RecoTauPiZero::RecoTauPiZero ( Charge  q,
const LorentzVector p4,
const Point vtx = Point( 0, 0, 0 ),
int  pdgId = 111,
int  status = 0,
bool  integerCharge = true,
PiZeroAlgorithm  algoName = kUndefined 
) [inline]

constructor from values

Definition at line 24 of file RecoTauPiZero.h.

                                                      :
        CompositePtrCandidate(
            q, p4, vtx, pdgId, status, integerCharge ),algoName_(algoName) {}
reco::RecoTauPiZero::RecoTauPiZero ( Charge  q,
const PolarLorentzVector p4,
const Point vtx = Point( 0, 0, 0 ),
int  pdgId = 111,
int  status = 0,
bool  integerCharge = true,
PiZeroAlgorithm  algoName = kUndefined 
) [inline]

constructor from values

Definition at line 32 of file RecoTauPiZero.h.

                                                      :
        CompositePtrCandidate(
            q, p4, vtx, pdgId, status, integerCharge ),algoName_(algoName) {}
reco::RecoTauPiZero::RecoTauPiZero ( const Candidate p,
PiZeroAlgorithm  algoName = kUndefined 
) [inline, explicit]

constructor from a Candidate

Definition at line 40 of file RecoTauPiZero.h.

References reco::LeafCandidate::setPdgId().

                                                                 :
        CompositePtrCandidate(p),algoName_(algoName) { this->setPdgId(111); }
reco::RecoTauPiZero::~RecoTauPiZero ( ) [inline]

destructor

Definition at line 45 of file RecoTauPiZero.h.

{};

Member Function Documentation

RecoTauPiZero::PiZeroAlgorithm reco::RecoTauPiZero::algo ( ) const

Algorithm that built this piZero.

Definition at line 50 of file RecoTauPiZero.cc.

References algoName_.

Referenced by print().

                                                       {
  return algoName_;
}
bool reco::RecoTauPiZero::algoIs ( RecoTauPiZero::PiZeroAlgorithm  algo) const

Check whether a given algo produced this pi zero.

Definition at line 54 of file RecoTauPiZero.cc.

References algoName_.

                                                                  {
  return (algoName_ == algo);
}
double reco::RecoTauPiZero::maxDeltaEta ( ) const

Maxmum DeltaEta between a constituent and the four vector.

Definition at line 38 of file RecoTauPiZero.cc.

References reco::CompositePtrCandidate::daughter(), reco::LeafCandidate::eta(), i, and reco::CompositePtrCandidate::numberOfDaughters().

Referenced by print().

{
  double maxDEta = 0;
  size_t nDaughters = numberOfDaughters();
  for(size_t i = 0; i < nDaughters; ++i) {
    double dEta = std::fabs(eta() - daughter(i)->eta());
    if(dEta > maxDEta)
      maxDEta = dEta;
  }
  return maxDEta;
}
double reco::RecoTauPiZero::maxDeltaPhi ( ) const

Maximum DeltaPhi between a constituent and the four vector.

Definition at line 26 of file RecoTauPiZero.cc.

References reco::CompositePtrCandidate::daughter(), reco::deltaPhi(), dPhi(), i, ExpressReco_HICollisions_FallBack::maxDPhi, and reco::CompositePtrCandidate::numberOfDaughters().

Referenced by print().

{
  double maxDPhi = 0;
  size_t nDaughters = numberOfDaughters();
  for(size_t i = 0; i < nDaughters; ++i) {
    double dPhi = std::fabs(deltaPhi(*this, *daughter(i)));
    if(dPhi > maxDPhi)
      maxDPhi = dPhi;
  }
  return maxDPhi;
}
size_t reco::RecoTauPiZero::numberOfElectrons ( ) const

Number of electron constituents.

Definition at line 16 of file RecoTauPiZero.cc.

References abs, reco::CompositePtrCandidate::daughter(), i, reco::CompositePtrCandidate::numberOfDaughters(), and reco::LeafCandidate::pdgId().

Referenced by print().

{
  size_t nElectrons = 0;
  size_t nDaughters = numberOfDaughters();
  for(size_t i = 0; i < nDaughters; ++i) {
    if(std::abs(daughter(i)->pdgId()) == 11) ++nElectrons;
  }
  return nElectrons;
}
size_t reco::RecoTauPiZero::numberOfGammas ( ) const

Number of PFGamma constituents.

Definition at line 6 of file RecoTauPiZero.cc.

References reco::CompositePtrCandidate::daughter(), i, reco::tau::helpers::nGammas(), reco::CompositePtrCandidate::numberOfDaughters(), and reco::LeafCandidate::pdgId().

Referenced by print().

{
  size_t nGammas = 0;
  size_t nDaughters = numberOfDaughters();
  for(size_t i = 0; i < nDaughters; ++i) {
    if(daughter(i)->pdgId() == 22) ++nGammas;
  }
  return nGammas;
}
void reco::RecoTauPiZero::print ( std::ostream &  out = std::cout) const

Definition at line 68 of file RecoTauPiZero.cc.

References algo(), reco::CompositePtrCandidate::daughterPtr(), i, edm::Ptr< T >::key(), maxDeltaEta(), maxDeltaPhi(), reco::CompositePtrCandidate::numberOfDaughters(), numberOfElectrons(), numberOfGammas(), and reco::LeafCandidate::p4().

Referenced by reco::operator<<().

                                               {
  if (!out) return;

  out << "RecoTauPiZero: " << this->p4() <<
      " nDaughters: " << this->numberOfDaughters() <<
      " (gamma/e) (" << this->numberOfGammas() << "/" << this->numberOfElectrons() << ")" <<
      " maxDeltaPhi: " << std::setprecision(3) << maxDeltaPhi() <<
      " maxDeltaEta: "  << std::setprecision(3) << maxDeltaEta() <<
      " algo: " << algo() <<
      std::endl;

  for(size_t i = 0; i < this->numberOfDaughters(); ++i)
  {
    out << "--- daughter " << i << ": " << daughterPtr(i)->p4() <<
        " key: " << daughterPtr(i).key() << std::endl;
  }
}

Member Data Documentation

Definition at line 68 of file RecoTauPiZero.h.

Referenced by algo(), and algoIs().