CMS 3D CMS Logo

TauDecay_CMSSW.cc
Go to the documentation of this file.
3 
4 #include <iomanip>
5 #include <cstdlib>
6 
8 
10 
12  HepMC::GenParticle *Tau, unsigned int &MODE_ID, unsigned int &TauBitMask, bool dores, bool dopi0) {
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 }
31 
32 void TauDecay_CMSSW::Analyze(HepMC::GenParticle *Particle, unsigned int midx, bool dores, bool dopi0) {
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 }
55 
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 }
PdtPdgMini.h
TauDecay_CMSSW.h
TauDecay::isTauParticleCounter
bool isTauParticleCounter(int pdgid)
Definition: TauDecay.cc:64
TauDecay_CMSSW::TauBitMask
unsigned int TauBitMask
Definition: TauDecay_CMSSW.h:49
class-composition.children
children
Definition: class-composition.py:98
gather_cfg.cout
cout
Definition: gather_cfg.py:144
TauDecay_CMSSW::Analyze
void Analyze(HepMC::GenParticle *Particle, unsigned int midx, bool dores, bool dopi0)
Definition: TauDecay_CMSSW.cc:32
Tau
Definition: Tau.py:1
TauDecay
Definition: TauDecay.h:21
TauDecay_CMSSW::TauDecayProducts
std::vector< HepMC::GenParticle * > TauDecayProducts
Definition: TauDecay_CMSSW.h:47
TauDecay::Reset
void Reset()
Definition: TauDecay.cc:11
TauDecay_CMSSW::~TauDecay_CMSSW
~TauDecay_CMSSW()
Definition: TauDecay_CMSSW.cc:9
TauDecay::ClassifyDecayMode
void ClassifyDecayMode(unsigned int &MODE_ID, unsigned int &TauBitMask)
Definition: TauDecay.cc:150
TauDecay::isTauFinalStateParticle
bool isTauFinalStateParticle(int pdgid)
Definition: TauDecay.cc:32
TauDecay_CMSSW::MODE_ID
unsigned int MODE_ID
Definition: TauDecay_CMSSW.h:49
GenParticle.GenParticle
GenParticle
Definition: GenParticle.py:18
TauDecay_CMSSW::MotherIdx
std::vector< unsigned int > MotherIdx
Definition: TauDecay_CMSSW.h:48
TauDecay_CMSSW::TauDecay_CMSSW
TauDecay_CMSSW()
Definition: TauDecay_CMSSW.cc:7
TauDecay_CMSSW::AddPi0Info
void AddPi0Info(HepMC::GenParticle *Particle, unsigned int midx)
Definition: TauDecay_CMSSW.cc:56
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
TauDecay_CMSSW::AnalyzeTau
bool AnalyzeTau(HepMC::GenParticle *Tau, unsigned int &MODE_ID, unsigned int &TauBitMask, bool dores=true, bool dopi0=true)
Definition: TauDecay_CMSSW.cc:11
PdtPdgMini::tau_minus
Definition: PdtPdgMini.h:32