CMS 3D CMS Logo

List of all members | Classes | Public Types | Public Member Functions | Public Attributes
SimTauCPLink Class Reference

#include <SimTauCPLink.h>

Classes

struct  DecayNav
 

Public Types

enum  decayModes {
  kNull = -1, kOneProng0PiZero, kOneProng1PiZero, kOneProng2PiZero,
  kOneProng3PiZero, kOneProngNPiZero, kTwoProng0PiZero, kTwoProng1PiZero,
  kTwoProng2PiZero, kTwoProng3PiZero, kTwoProngNPiZero, kThreeProng0PiZero,
  kThreeProng1PiZero, kThreeProng2PiZero, kThreeProng3PiZero, kThreeProngNPiZero,
  kRareDecayMode, kElectron, kMuon
}
 

Public Member Functions

int buildDecayModes ()
 
void dump (void) const
 
void dumpDecay (const std::pair< int, int > &entry) const
 
void dumpFullDecay (void) const
 
 SimTauCPLink ()
 
 ~SimTauCPLink ()
 

Public Attributes

CaloParticleRefVector calo_particle_leaves
 
int decayMode
 
std::vector< DecayNavleaves
 
std::vector< std::pair< int, int > > resonances
 

Detailed Description

Definition at line 10 of file SimTauCPLink.h.

Member Enumeration Documentation

◆ decayModes

Enumerator
kNull 
kOneProng0PiZero 
kOneProng1PiZero 
kOneProng2PiZero 
kOneProng3PiZero 
kOneProngNPiZero 
kTwoProng0PiZero 
kTwoProng1PiZero 
kTwoProng2PiZero 
kTwoProng3PiZero 
kTwoProngNPiZero 
kThreeProng0PiZero 
kThreeProng1PiZero 
kThreeProng2PiZero 
kThreeProng3PiZero 
kThreeProngNPiZero 
kRareDecayMode 
kElectron 
kMuon 

Definition at line 32 of file SimTauCPLink.h.

32  {
33  kNull = -1,
50  kElectron,
51  kMuon
52  };

Constructor & Destructor Documentation

◆ SimTauCPLink()

SimTauCPLink::SimTauCPLink ( )
inline

Definition at line 12 of file SimTauCPLink.h.

12 {}

◆ ~SimTauCPLink()

SimTauCPLink::~SimTauCPLink ( )
inline

Definition at line 13 of file SimTauCPLink.h.

13 {}

Member Function Documentation

◆ buildDecayModes()

int SimTauCPLink::buildDecayModes ( )
inline

Definition at line 81 of file SimTauCPLink.h.

References funct::abs(), kElectron, kMuon, kOneProng0PiZero, kOneProng1PiZero, kOneProng2PiZero, kOneProng3PiZero, kOneProngNPiZero, kRareDecayMode, kThreeProng0PiZero, kThreeProng1PiZero, kThreeProng2PiZero, kThreeProng3PiZero, kThreeProngNPiZero, kTwoProng0PiZero, kTwoProng1PiZero, kTwoProng2PiZero, kTwoProng3PiZero, kTwoProngNPiZero, leaves, numHadrons, patZpeak::numMuons, and HiggsValidation_cfi::pdg_id.

81  {
82  int numElectrons = 0;
83  int numMuons = 0;
84  int numHadrons = 0;
85  int numPhotons = 0;
86  for (auto leaf : leaves) {
87  int pdg_id = abs(leaf.pdgId());
88  switch (pdg_id) {
89  case 22:
90  numPhotons++;
91  break;
92  case 11:
93  numElectrons++;
94  break;
95  case 13:
96  numMuons++;
97  break;
98  case 16:
99  break;
100  default:
101  numHadrons++;
102  }
103  }
104 
105  if (numElectrons == 1)
106  return kElectron;
107  else if (numMuons == 1)
108  return kMuon;
109  switch (numHadrons) {
110  case 1:
111  switch (numPhotons) {
112  case 0:
113  return kOneProng0PiZero;
114  case 2:
115  return kOneProng1PiZero;
116  case 4:
117  return kOneProng2PiZero;
118  case 6:
119  return kOneProng3PiZero;
120  default:
121  return kOneProngNPiZero;
122  }
123  case 2:
124  switch (numPhotons) {
125  case 0:
126  return kTwoProng0PiZero;
127  case 2:
128  return kTwoProng1PiZero;
129  case 4:
130  return kTwoProng2PiZero;
131  case 6:
132  return kTwoProng3PiZero;
133  default:
134  return kTwoProngNPiZero;
135  }
136  case 3:
137  switch (numPhotons) {
138  case 0:
139  return kThreeProng0PiZero;
140  case 2:
141  return kThreeProng1PiZero;
142  case 4:
143  return kThreeProng2PiZero;
144  case 6:
145  return kThreeProng3PiZero;
146  default:
147  return kThreeProngNPiZero;
148  }
149  default:
150  return kRareDecayMode;
151  }
152  }
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
static const int numHadrons

◆ dump()

void SimTauCPLink::dump ( void  ) const
inline

Definition at line 54 of file SimTauCPLink.h.

References MainPageGenerator::l, leaves, LogDebug, alignCSCRings::r, and resonances.

54  {
55  for (auto const &l : leaves) {
56  LogDebug("SimTauProducer")
57  .format(
58  "L {} {} CP: {} GenP idx: {}", l.pdgId(), l.resonance_idx(), l.calo_particle_idx(), l.gen_particle_idx());
59  }
60  for (auto const &r : resonances) {
61  LogDebug("SimTauProducer").format("R {} {}", r.first, r.second);
62  }
63  }
#define LogDebug(id)

◆ dumpDecay()

void SimTauCPLink::dumpDecay ( const std::pair< int, int > &  entry) const
inline

Definition at line 65 of file SimTauCPLink.h.

References mps_splice::entry, LogDebug, and resonances.

Referenced by dumpFullDecay().

65  {
66  if (entry.second == -1) { // No intermediate mother.
67  LogDebug("SimTauProducer").format("{} {}", entry.first, entry.second);
68  } else {
69  LogDebug("SimTauProducer").format("{} {} coming from: ", entry.first, entry.second);
70  auto const &mother = resonances[entry.second];
71  dumpDecay(mother);
72  }
73  }
#define LogDebug(id)

◆ dumpFullDecay()

void SimTauCPLink::dumpFullDecay ( void  ) const
inline

Definition at line 75 of file SimTauCPLink.h.

References dumpDecay(), and leaves.

75  {
76  for (auto const &leaf : leaves) {
77  dumpDecay({leaf.pdgId(), leaf.resonance_idx()});
78  }
79  }

Member Data Documentation

◆ calo_particle_leaves

CaloParticleRefVector SimTauCPLink::calo_particle_leaves

Definition at line 29 of file SimTauCPLink.h.

◆ decayMode

int SimTauCPLink::decayMode

Definition at line 30 of file SimTauCPLink.h.

Referenced by Tau.Tau::__str__().

◆ leaves

std::vector<DecayNav> SimTauCPLink::leaves

Definition at line 28 of file SimTauCPLink.h.

Referenced by buildDecayModes(), dump(), and dumpFullDecay().

◆ resonances

std::vector<std::pair<int, int> > SimTauCPLink::resonances

Definition at line 27 of file SimTauCPLink.h.

Referenced by dump(), and dumpDecay().