CMS 3D CMS Logo

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::TauDecay_GenParticle ( )

Definition at line 7 of file TauDecay_GenParticle.cc.

7 : TauDecay() {}

◆ ~TauDecay_GenParticle()

TauDecay_GenParticle::~TauDecay_GenParticle ( )

Definition at line 9 of file TauDecay_GenParticle.cc.

9 {}

Member Function Documentation

◆ AddPi0Info()

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

Definition at line 61 of file TauDecay_GenParticle.cc.

61  {
62  if (Particle->status() == 1) {
63  TauDecayProducts.push_back(Particle);
64  MotherIdx.push_back(midx);
65  return;
66  }
67  for (unsigned int i = 0; i < Particle->numberOfDaughters(); i++) {
68  const reco::Candidate *dau = Particle->daughter(i);
69  AddPi0Info(static_cast<const reco::GenParticle *>(dau), midx);
70  }
71 }

References mps_fire::i, MotherIdx, and TauDecayProducts.

Referenced by Analyze().

◆ AddRadInfo()

bool TauDecay_GenParticle::AddRadInfo ( const reco::GenParticle Particle,
unsigned int  midx 
)

Definition at line 73 of file TauDecay_GenParticle.cc.

73  {
74  bool same(false), photon(false);
75  int n = 0;
76  for (unsigned int i = 0; i < Particle->numberOfDaughters(); i++) {
77  const reco::Candidate *dau = Particle->daughter(i);
78  if (Particle->pdgId() == dau->pdgId()) {
79  same = true;
80  }
81  if (dau->pdgId() == PdtPdgMini::gamma)
82  photon = true;
83  n++;
84  }
85  if (same && photon && n == 2) {
86  for (unsigned int i = 0; i < Particle->numberOfDaughters(); i++) {
87  const reco::Candidate *dau = Particle->daughter(i);
88  if (Particle->pdgId() == dau->pdgId()) {
89  if (!AddRadInfo(static_cast<const reco::GenParticle *>(dau), midx)) {
90  TauDecayProducts.push_back(static_cast<const reco::GenParticle *>(dau));
91  MotherIdx.push_back(midx);
92  }
93  }
94  if (dau->pdgId() == PdtPdgMini::gamma) {
95  TauDecayProducts.push_back(static_cast<const reco::GenParticle *>(dau));
96  MotherIdx.push_back(midx);
97  }
98  }
99  return true;
100  }
101  return false;
102 }

References PdtPdgMini::gamma, mps_fire::i, MotherIdx, dqmiodumpmetadata::n, reco::Candidate::pdgId(), muons2muons_cfi::photon, and TauDecayProducts.

Referenced by Analyze().

◆ Analyze()

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

Definition at line 30 of file TauDecay_GenParticle.cc.

30  {
31  unsigned int pdgid = abs(Particle->pdgId());
34  std::cout << "TauDecay_GenParticle::Analyze WARNING: Unknow Final State Particle in Tau Decay... " << std::endl;
35 
36  if (!AddRadInfo(static_cast<const reco::GenParticle *>(Particle), midx)) {
37  TauDecayProducts.push_back(Particle);
38  MotherIdx.push_back(midx);
39  }
40  // store information on pi0 decay products even though a pi0 is a finsal state particle (for 3PiPi0 studies)
41  if (pdgid == PdtPdgMini::pi0 && dopi0) {
42  midx = MotherIdx.size() - 1;
43  for (unsigned int i = 0; i < Particle->numberOfDaughters(); i++) {
44  const reco::Candidate *dau = Particle->daughter(i);
45  AddPi0Info(static_cast<const reco::GenParticle *>(dau), midx);
46  }
47  }
48  return;
49  }
50  if (Particle->status() == 1 || (isTauResonanceCounter(pdgid) && dores)) {
51  TauDecayProducts.push_back(Particle);
52  MotherIdx.push_back(midx);
53  midx = MotherIdx.size() - 1;
54  }
55  for (unsigned int i = 0; i < Particle->numberOfDaughters(); i++) {
56  const reco::Candidate *dau = Particle->daughter(i);
57  Analyze(static_cast<const reco::GenParticle *>(dau), midx, dores, dopi0);
58  }
59 }

References funct::abs(), AddPi0Info(), AddRadInfo(), gather_cfg::cout, mps_fire::i, TauDecay::isTauFinalStateParticle(), TauDecay::isTauParticleCounter(), TauDecay::isTauResonanceCounter(), MotherIdx, EgammaValidation_cff::pdgid, PdtPdgMini::pi0, and TauDecayProducts.

Referenced by AnalyzeTau().

◆ AnalyzeTau()

bool TauDecay_GenParticle::AnalyzeTau ( const reco::GenParticle Tau,
unsigned int &  MODE_ID,
unsigned int &  TauBitMask,
bool  dores,
bool  dopi0 
)

Definition at line 11 of file TauDecay_GenParticle.cc.

12  {
13  Reset();
14  MotherIdx.clear();
15  TauDecayProducts.clear();
16  if (abs(Tau->pdgId()) == PdtPdgMini::tau_minus) { // check that it is a tau
17  unsigned int Tauidx = TauDecayProducts.size();
18  TauDecayProducts.push_back(Tau);
19  MotherIdx.push_back(Tauidx);
20  for (unsigned int i = 0; i < Tau->numberOfDaughters(); i++) {
21  const reco::Candidate *dau = Tau->daughter(i);
22  Analyze(static_cast<const reco::GenParticle *>(dau), Tauidx, dores, dopi0);
23  }
25  return true;
26  }
27  return false;
28 }

References funct::abs(), Analyze(), TauDecay::ClassifyDecayMode(), mps_fire::i, MODE_ID, MotherIdx, TauDecay::Reset(), PdtPdgMini::tau_minus, TauBitMask, and TauDecayProducts.

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

◆ Get_MotherIdx()

std::vector<unsigned int> TauDecay_GenParticle::Get_MotherIdx ( )
inline

Definition at line 32 of file TauDecay_GenParticle.h.

32 { return MotherIdx; }

References MotherIdx.

◆ Get_TauDecayProducts()

std::vector<const reco::GenParticle *> TauDecay_GenParticle::Get_TauDecayProducts ( )
inline

Definition at line 31 of file TauDecay_GenParticle.h.

31 { return TauDecayProducts; }

References TauDecayProducts.

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

Member Data Documentation

◆ MODE_ID

unsigned int TauDecay_GenParticle::MODE_ID
private

Definition at line 42 of file TauDecay_GenParticle.h.

Referenced by AnalyzeTau().

◆ MotherIdx

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().

◆ TauBitMask

unsigned int TauDecay_GenParticle::TauBitMask
private

Definition at line 42 of file TauDecay_GenParticle.h.

Referenced by AnalyzeTau().

◆ TauDecayProducts

std::vector<const reco::GenParticle *> TauDecay_GenParticle::TauDecayProducts
private
muons2muons_cfi.photon
photon
Definition: muons2muons_cfi.py:28
mps_fire.i
i
Definition: mps_fire.py:428
dqmiodumpmetadata.n
n
Definition: dqmiodumpmetadata.py:28
PdtPdgMini::gamma
Definition: PdtPdgMini.h:40
TauDecay::isTauParticleCounter
bool isTauParticleCounter(int pdgid)
Definition: TauDecay.cc:64
gather_cfg.cout
cout
Definition: gather_cfg.py:144
Tau
Definition: Tau.py:1
TauDecay_GenParticle::TauDecayProducts
std::vector< const reco::GenParticle * > TauDecayProducts
Definition: TauDecay_GenParticle.h:40
TauDecay::Reset
void Reset()
Definition: TauDecay.cc:11
TauDecay_GenParticle::Analyze
void Analyze(const reco::GenParticle *Particle, unsigned int midx, bool dores, bool dopi0)
Definition: TauDecay_GenParticle.cc:30
TauDecay_GenParticle::MODE_ID
unsigned int MODE_ID
Definition: TauDecay_GenParticle.h:42
TauDecay_GenParticle::MotherIdx
std::vector< unsigned int > MotherIdx
Definition: TauDecay_GenParticle.h:41
TauDecay::ClassifyDecayMode
void ClassifyDecayMode(unsigned int &MODE_ID, unsigned int &TauBitMask)
Definition: TauDecay.cc:150
TauDecay_GenParticle::TauBitMask
unsigned int TauBitMask
Definition: TauDecay_GenParticle.h:42
PdtPdgMini::pi0
Definition: PdtPdgMini.h:55
TauDecay::TauDecay
TauDecay()
Definition: TauDecay.cc:7
TauDecay::isTauFinalStateParticle
bool isTauFinalStateParticle(int pdgid)
Definition: TauDecay.cc:32
reco::Candidate::pdgId
virtual int pdgId() const =0
PDG identifier.
reco::Candidate
Definition: Candidate.h:27
TauDecay_GenParticle::AddRadInfo
bool AddRadInfo(const reco::GenParticle *Particle, unsigned int midx)
Definition: TauDecay_GenParticle.cc:73
TauDecay_GenParticle::AddPi0Info
void AddPi0Info(const reco::GenParticle *Particle, unsigned int midx)
Definition: TauDecay_GenParticle.cc:61
Particle
Definition: Particle.py:1
TauDecay::isTauResonanceCounter
bool isTauResonanceCounter(int pdgid)
Definition: TauDecay.cc:116
funct::abs
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
EgammaValidation_cff.pdgid
pdgid
Definition: EgammaValidation_cff.py:29
PdtPdgMini::tau_minus
Definition: PdtPdgMini.h:32