CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes
TauDecay_CMSSW Class Reference

#include <TauDecay_CMSSW.h>

Inheritance diagram for TauDecay_CMSSW:
TauDecay

Public Member Functions

bool AnalyzeTau (HepMC::GenParticle *Tau, unsigned int &MODE_ID, unsigned int &TauBitMask, bool dores=true, bool dopi0=true)
 
std::vector< unsigned int > Get_MotherIdx ()
 
std::vector< HepMC::GenParticle * > Get_TauDecayProducts ()
 
 TauDecay_CMSSW ()
 
 ~TauDecay_CMSSW ()
 
- 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 (HepMC::GenParticle *Particle, unsigned int midx)
 
void Analyze (HepMC::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< HepMC::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 30 of file TauDecay_CMSSW.h.

Constructor & Destructor Documentation

◆ TauDecay_CMSSW()

TauDecay_CMSSW::TauDecay_CMSSW ( )

Definition at line 7 of file TauDecay_CMSSW.cc.

7 : TauDecay() {}
TauDecay()
Definition: TauDecay.cc:7

◆ ~TauDecay_CMSSW()

TauDecay_CMSSW::~TauDecay_CMSSW ( )

Definition at line 9 of file TauDecay_CMSSW.cc.

9 {}

Member Function Documentation

◆ AddPi0Info()

void TauDecay_CMSSW::AddPi0Info ( HepMC::GenParticle *  Particle,
unsigned int  midx 
)
private

Definition at line 56 of file TauDecay_CMSSW.cc.

References class-composition::children, MotherIdx, and TauDecayProducts.

56  {
57  if (Particle->status() == 1) {
58  TauDecayProducts.push_back(Particle);
59  MotherIdx.push_back(midx);
60  return;
61  }
62  HepMC::GenVertex::particle_iterator des;
63  for (des = Particle->end_vertex()->particles_begin(HepMC::children);
64  des != Particle->end_vertex()->particles_end(HepMC::children);
65  ++des) {
66  AddPi0Info((*des), midx);
67  }
68 }
std::vector< HepMC::GenParticle * > TauDecayProducts
std::vector< unsigned int > MotherIdx
void AddPi0Info(HepMC::GenParticle *Particle, unsigned int midx)

◆ Analyze()

void TauDecay_CMSSW::Analyze ( HepMC::GenParticle *  Particle,
unsigned int  midx,
bool  dores,
bool  dopi0 
)
private

Definition at line 32 of file TauDecay_CMSSW.cc.

References funct::abs(), class-composition::children, gather_cfg::cout, TauDecay::isTauFinalStateParticle(), TauDecay::isTauParticleCounter(), TauDecay::isTauResonanceCounter(), MotherIdx, EgammaValidation_cff::pdgid, and TauDecayProducts.

Referenced by AnalyzeTau().

32  {
33  unsigned int pdgid = abs(Particle->pdg_id());
37  std::cout << "TauDecay_CMSSW::Analyze WARNING: Unknow Final State Particle in Tau Decay... " << pdgid
38  << std::endl;
39  TauDecayProducts.push_back(Particle);
40  MotherIdx.push_back(midx);
41  return;
42  }
43  HepMC::GenVertex::particle_iterator des;
44  if (Particle->end_vertex()) {
45  for (des = Particle->end_vertex()->particles_begin(HepMC::children);
46  des != Particle->end_vertex()->particles_end(HepMC::children) &&
47  Particle->end_vertex()->particles_out_size() > 0;
48  ++des) {
49  Analyze((*des), midx, dores, dopi0);
50  }
51  } else {
52  std::cout << "Unstable particle that is undecayed in Tau decay tree. PDG ID: " << pdgid << std::endl;
53  }
54 }
bool isTauFinalStateParticle(int pdgid)
Definition: TauDecay.cc:32
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
std::vector< HepMC::GenParticle * > TauDecayProducts
bool isTauResonanceCounter(int pdgid)
Definition: TauDecay.cc:116
void Analyze(HepMC::GenParticle *Particle, unsigned int midx, bool dores, bool dopi0)
std::vector< unsigned int > MotherIdx
bool isTauParticleCounter(int pdgid)
Definition: TauDecay.cc:64

◆ AnalyzeTau()

bool TauDecay_CMSSW::AnalyzeTau ( HepMC::GenParticle *  Tau,
unsigned int &  MODE_ID,
unsigned int &  TauBitMask,
bool  dores = true,
bool  dopi0 = true 
)

Definition at line 11 of file TauDecay_CMSSW.cc.

References funct::abs(), Analyze(), class-composition::children, TauDecay::ClassifyDecayMode(), MODE_ID, MotherIdx, TauDecay::Reset(), PdtPdgMini::tau_minus, TauBitMask, and TauDecayProducts.

12  {
13  Reset();
14  MotherIdx.clear();
15  TauDecayProducts.clear();
16  if (abs(Tau->pdg_id()) == PdtPdgMini::tau_minus) { // check that it is a tau
17  unsigned int Tauidx = TauDecayProducts.size();
18  HepMC::GenVertex::particle_iterator des;
19  if (Tau->end_vertex()) {
20  for (des = Tau->end_vertex()->particles_begin(HepMC::children);
21  des != Tau->end_vertex()->particles_end(HepMC::children);
22  ++des) {
23  Analyze((*des), Tauidx, dores, dopi0);
24  }
26  return true;
27  }
28  }
29  return false;
30 }
void Reset()
Definition: TauDecay.cc:11
unsigned int TauBitMask
unsigned int MODE_ID
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
std::vector< HepMC::GenParticle * > TauDecayProducts
void ClassifyDecayMode(unsigned int &MODE_ID, unsigned int &TauBitMask)
Definition: TauDecay.cc:150
Definition: Tau.py:1
void Analyze(HepMC::GenParticle *Particle, unsigned int midx, bool dores, bool dopi0)
std::vector< unsigned int > MotherIdx

◆ Get_MotherIdx()

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

Definition at line 40 of file TauDecay_CMSSW.h.

References MotherIdx.

40 { return MotherIdx; }
std::vector< unsigned int > MotherIdx

◆ Get_TauDecayProducts()

std::vector<HepMC::GenParticle *> TauDecay_CMSSW::Get_TauDecayProducts ( )
inline

Definition at line 39 of file TauDecay_CMSSW.h.

References TauDecayProducts.

39 { return TauDecayProducts; }
std::vector< HepMC::GenParticle * > TauDecayProducts

Member Data Documentation

◆ MODE_ID

unsigned int TauDecay_CMSSW::MODE_ID
private

Definition at line 49 of file TauDecay_CMSSW.h.

Referenced by AnalyzeTau().

◆ MotherIdx

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

Definition at line 48 of file TauDecay_CMSSW.h.

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

◆ TauBitMask

unsigned int TauDecay_CMSSW::TauBitMask
private

Definition at line 49 of file TauDecay_CMSSW.h.

Referenced by AnalyzeTau().

◆ TauDecayProducts

std::vector<HepMC::GenParticle *> TauDecay_CMSSW::TauDecayProducts
private

Definition at line 47 of file TauDecay_CMSSW.h.

Referenced by AddPi0Info(), Analyze(), AnalyzeTau(), and Get_TauDecayProducts().