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 Member Functions | Private Attributes
TauDecay_GenParticle Class Reference

#include <TauDecay_GenParticle.h>

Inheritance diagram for TauDecay_GenParticle:
TauDecay

Public Member Functions

bool AddRadInfo (const reco::GenParticle *Particle, unsigned int midx)
 
bool AnalyzeTau (const reco::GenParticle *Tau, unsigned int &MODE_ID, unsigned int &TauBitMask, bool dores, bool dopi0)
 
std::vector< unsigned int > Get_MotherIdx ()
 
std::vector< const
reco::GenParticle * > 
Get_TauDecayProducts ()
 
 TauDecay_GenParticle ()
 
 ~TauDecay_GenParticle ()
 
- Public Member Functions inherited from TauDecay
void ClassifyDecayMode (unsigned int &MODE_ID, unsigned int &TauBitMask)
 
bool hasResonance (unsigned int &TauBitMask, int pdgid)
 
bool isTauFinalStateParticle (int pdgid)
 
bool isTauParticleCounter (int pdgid)
 
bool isTauResonanceCounter (int pdgid)
 
unsigned int nPi0 (unsigned int &TauBitMask)
 
unsigned int nProng (unsigned int &TauBitMask)
 
void Reset ()
 
 TauDecay ()
 
 ~TauDecay ()
 

Private Member Functions

void AddPi0Info (const reco::GenParticle *Particle, unsigned int midx)
 
void Analyze (const reco::GenParticle *Particle, unsigned int midx, bool dores, bool dopi0)
 

Private Attributes

unsigned int MODE_ID
 
std::vector< unsigned int > MotherIdx
 
unsigned int TauBitMask
 
std::vector< const
reco::GenParticle * > 
TauDecayProducts
 

Additional Inherited Members

- Public Types inherited from TauDecay
enum  MODE {
  MODE_UNKNOWN =0, MODE_ELECTRON, MODE_MUON, MODE_PION,
  MODE_PIPI0, MODE_3PI, MODE_PI2PI0, MODE_KAON,
  MODE_K0PI, MODE_KPI0, MODE_3PIPI0, MODE_PI3PI0,
  MODE_3PI2PI0, MODE_5PI, MODE_5PIPI0, MODE_3PI3PI0,
  MODE_KPIK, MODE_K0BK0PI, MODE_KK0BPI0, MODE_K2PI0,
  MODE_KPIPI, MODE_PIK0PI0, MODE_ETAPIPI0, MODE_PIPI0GAM,
  MODE_KK0B, MODE_PI4PI0, MODE_3PIETA, MODE_PI2PI0ETA,
  MODE_PI2PI0OMEGA, MODE_3PIOMEGA, MODE_KOMEGA, MODE_K3PI0,
  MODE_K2PIPI0, MODE_KETA, MODE_K0PI2PI0, MODE_K03PI,
  MODE_2K0PIPI0, MODE_KPIKPI0, NMODEID
}
 
enum  TauDecayStructure {
  other =0, OneProng =1, ThreeProng =2, FiveProng =4,
  OnePi0 =8, TwoPi0 =32, ThreePi0 =64, Res_a1_pm =128,
  Res_a1_0 =256, Res_rho_pm =512, Res_rho_0 =1024, Res_eta =2048,
  Res_omega =4096, Res_Kstar_pm =8192, Res_Kstar_0 =16384, KS0_to_pipi =32768
}
 
- Static Public Member Functions inherited from TauDecay
static std::string DecayMode (unsigned int &MODE_ID)
 

Detailed Description

Definition at line 23 of file TauDecay_GenParticle.h.

Constructor & Destructor Documentation

TauDecay_GenParticle::TauDecay_GenParticle ( )

Definition at line 7 of file TauDecay_GenParticle.cc.

7  :
8  TauDecay()
9 {
10 
11 }
TauDecay()
Definition: TauDecay.cc:7
TauDecay_GenParticle::~TauDecay_GenParticle ( )

Definition at line 13 of file TauDecay_GenParticle.cc.

13  {
14 
15 }

Member Function Documentation

void TauDecay_GenParticle::AddPi0Info ( const reco::GenParticle Particle,
unsigned int  midx 
)
private

Definition at line 68 of file TauDecay_GenParticle.cc.

References reco::CompositeRefCandidateT< D >::daughter(), i, MotherIdx, reco::CompositeRefCandidateT< D >::numberOfDaughters(), reco::LeafCandidate::status(), and TauDecayProducts.

Referenced by Analyze().

68  {
69  if(Particle->status()==1){
70  TauDecayProducts.push_back(Particle);
71  MotherIdx.push_back(midx);
72  return;
73  }
74  for (unsigned int i=0; i< Particle->numberOfDaughters(); i++){
75  const reco::Candidate *dau=Particle->daughter(i);
76  AddPi0Info(static_cast<const reco::GenParticle*>(dau),midx);
77  }
78 }
int i
Definition: DBlmapReader.cc:9
std::vector< const reco::GenParticle * > TauDecayProducts
virtual int status() const
status word
void AddPi0Info(const reco::GenParticle *Particle, unsigned int midx)
virtual size_t numberOfDaughters() const
number of daughters
virtual const Candidate * daughter(size_type) const
return daughter at a given position, i = 0, ... numberOfDaughters() - 1 (read only mode) ...
std::vector< unsigned int > MotherIdx
bool TauDecay_GenParticle::AddRadInfo ( const reco::GenParticle Particle,
unsigned int  midx 
)

Definition at line 80 of file TauDecay_GenParticle.cc.

References reco::CompositeRefCandidateT< D >::daughter(), PdtPdgMini::gamma, i, MotherIdx, n, reco::CompositeRefCandidateT< D >::numberOfDaughters(), reco::Candidate::pdgId(), reco::LeafCandidate::pdgId(), and TauDecayProducts.

Referenced by Analyze().

80  {
81  bool same(false), photon(false);
82  int n=0;
83  for (unsigned int i=0; i< Particle->numberOfDaughters(); i++){
84  const reco::Candidate *dau=Particle->daughter(i);
85  if(Particle->pdgId()==dau->pdgId()){ same=true;}
86  if(dau->pdgId()==PdtPdgMini::gamma) photon=true;
87  n++;
88  }
89  if(same && photon && n==2){
90  for (unsigned int i=0; i< Particle->numberOfDaughters(); i++){
91  const reco::Candidate *dau=Particle->daughter(i);
92  if(Particle->pdgId()==dau->pdgId()){
93  if(!AddRadInfo(static_cast<const reco::GenParticle*>(dau),midx)){
94  TauDecayProducts.push_back(static_cast<const reco::GenParticle*>(dau));
95  MotherIdx.push_back(midx);
96  }
97  }
98  if(dau->pdgId()==PdtPdgMini::gamma){
99  TauDecayProducts.push_back(static_cast<const reco::GenParticle*>(dau));
100  MotherIdx.push_back(midx);
101  }
102  }
103  return true;
104  }
105  return false;
106 }
int i
Definition: DBlmapReader.cc:9
virtual int pdgId() const
PDG identifier.
std::vector< const reco::GenParticle * > TauDecayProducts
virtual size_t numberOfDaughters() const
number of daughters
virtual const Candidate * daughter(size_type) const
return daughter at a given position, i = 0, ... numberOfDaughters() - 1 (read only mode) ...
std::vector< unsigned int > MotherIdx
bool AddRadInfo(const reco::GenParticle *Particle, unsigned int midx)
virtual int pdgId() const =0
PDG identifier.
void TauDecay_GenParticle::Analyze ( const reco::GenParticle Particle,
unsigned int  midx,
bool  dores,
bool  dopi0 
)
private

Definition at line 38 of file TauDecay_GenParticle.cc.

References funct::abs(), AddPi0Info(), AddRadInfo(), gather_cfg::cout, reco::CompositeRefCandidateT< D >::daughter(), i, TauDecay::isTauFinalStateParticle(), TauDecay::isTauParticleCounter(), TauDecay::isTauResonanceCounter(), MotherIdx, reco::CompositeRefCandidateT< D >::numberOfDaughters(), reco::LeafCandidate::pdgId(), PdtPdgMini::pi0, reco::LeafCandidate::status(), and TauDecayProducts.

Referenced by AnalyzeTau().

38  {
39  unsigned int pdgid=abs(Particle->pdgId());
40  if(isTauFinalStateParticle(pdgid)){
41  if(!isTauParticleCounter(pdgid)) std::cout << "TauDecay_GenParticle::Analyze WARNING: Unknow Final State Particle in Tau Decay... " << std::endl;
42 
43  if(!AddRadInfo(static_cast<const reco::GenParticle*>(Particle),midx)){
44  TauDecayProducts.push_back(Particle);
45  MotherIdx.push_back(midx);
46  }
47  if(pdgid==PdtPdgMini::pi0 && dopi0){// store information on pi0 decay products even though a pi0 is a finsal state particle (for 3PiPi0 studies)
48  midx=MotherIdx.size()-1;
49  for (unsigned int i=0; i< Particle->numberOfDaughters(); i++){
50  const reco::Candidate *dau=Particle->daughter(i);
51  AddPi0Info(static_cast<const reco::GenParticle*>(dau),midx);
52  }
53  }
54  return;
55  }
56  if(Particle->status()==1 || (isTauResonanceCounter(pdgid) && dores)){
57  TauDecayProducts.push_back(Particle);
58  MotherIdx.push_back(midx);
59  midx=MotherIdx.size()-1;
60  }
61  for (unsigned int i=0; i< Particle->numberOfDaughters(); i++){
62  const reco::Candidate *dau=Particle->daughter(i);
63  Analyze(static_cast<const reco::GenParticle*>(dau),midx,dores,dopi0);
64  }
65 }
int i
Definition: DBlmapReader.cc:9
virtual int pdgId() const
PDG identifier.
std::vector< const reco::GenParticle * > TauDecayProducts
virtual int status() const
status word
bool isTauFinalStateParticle(int pdgid)
Definition: TauDecay.cc:36
void AddPi0Info(const reco::GenParticle *Particle, unsigned int midx)
virtual size_t numberOfDaughters() const
number of daughters
virtual const Candidate * daughter(size_type) const
return daughter at a given position, i = 0, ... numberOfDaughters() - 1 (read only mode) ...
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
std::vector< unsigned int > MotherIdx
bool AddRadInfo(const reco::GenParticle *Particle, unsigned int midx)
void Analyze(const reco::GenParticle *Particle, unsigned int midx, bool dores, bool dopi0)
bool isTauResonanceCounter(int pdgid)
Definition: TauDecay.cc:75
tuple cout
Definition: gather_cfg.py:121
bool isTauParticleCounter(int pdgid)
Definition: TauDecay.cc:55
bool TauDecay_GenParticle::AnalyzeTau ( const reco::GenParticle Tau,
unsigned int &  MODE_ID,
unsigned int &  TauBitMask,
bool  dores,
bool  dopi0 
)

Definition at line 17 of file TauDecay_GenParticle.cc.

References funct::abs(), Analyze(), TauDecay::ClassifyDecayMode(), reco::CompositeRefCandidateT< D >::daughter(), i, MotherIdx, reco::CompositeRefCandidateT< D >::numberOfDaughters(), reco::LeafCandidate::pdgId(), TauDecay::Reset(), PdtPdgMini::tau_minus, and TauDecayProducts.

Referenced by TauValidation::analyze(), and TauValidation::spinEffectsZH().

17  {
18  Reset();
19  MotherIdx.clear();
20  TauDecayProducts.clear();
21  if(abs(Tau->pdgId())==PdtPdgMini::tau_minus){ // check that it is a tau
22  unsigned int Tauidx=TauDecayProducts.size();
23  TauDecayProducts.push_back(Tau);
24  MotherIdx.push_back(Tauidx);
25  for (unsigned int i=0; i< Tau->numberOfDaughters(); i++){
26  const reco::Candidate *dau=Tau->daughter(i);
27  Analyze(static_cast<const reco::GenParticle*>(dau),Tauidx,dores,dopi0);
28  }
30  return true;
31  }
32  return false;
33 }
int i
Definition: DBlmapReader.cc:9
virtual int pdgId() const
PDG identifier.
void Reset()
Definition: TauDecay.cc:15
std::vector< const reco::GenParticle * > TauDecayProducts
virtual size_t numberOfDaughters() const
number of daughters
virtual const Candidate * daughter(size_type) const
return daughter at a given position, i = 0, ... numberOfDaughters() - 1 (read only mode) ...
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
std::vector< unsigned int > MotherIdx
void Analyze(const reco::GenParticle *Particle, unsigned int midx, bool dores, bool dopi0)
void ClassifyDecayMode(unsigned int &MODE_ID, unsigned int &TauBitMask)
Definition: TauDecay.cc:89
std::vector<unsigned int> TauDecay_GenParticle::Get_MotherIdx ( )
inline

Definition at line 32 of file TauDecay_GenParticle.h.

References MotherIdx.

32 {return MotherIdx;}
std::vector< unsigned int > MotherIdx
std::vector<const reco::GenParticle* > TauDecay_GenParticle::Get_TauDecayProducts ( )
inline

Definition at line 31 of file TauDecay_GenParticle.h.

References TauDecayProducts.

Referenced by TauValidation::analyze(), and TauValidation::spinEffectsZH().

31 {return TauDecayProducts;}
std::vector< const reco::GenParticle * > TauDecayProducts

Member Data Documentation

unsigned int TauDecay_GenParticle::MODE_ID
private

Definition at line 42 of file TauDecay_GenParticle.h.

std::vector<unsigned int> TauDecay_GenParticle::MotherIdx
private

Definition at line 41 of file TauDecay_GenParticle.h.

Referenced by AddPi0Info(), AddRadInfo(), Analyze(), AnalyzeTau(), and Get_MotherIdx().

unsigned int TauDecay_GenParticle::TauBitMask
private

Definition at line 42 of file TauDecay_GenParticle.h.

std::vector<const reco::GenParticle*> TauDecay_GenParticle::TauDecayProducts
private