CMS 3D CMS Logo

DecayChannel.cc
Go to the documentation of this file.
1 /*
2  Copyright : The FASTMC and SPHMC Collaboration
3  Author : Ionut Cristian Arsene
4  Affiliation : Oslo University, Norway & Institute for Space Sciences, Bucharest, Romania
5  e-mail : i.c.arsene@fys.uio.no
6  Date : 2007/05/30
7 
8  This class is using the particle and decay lists provided by the
9  THERMINATOR (Computer Physics Communications 174 669 (2006)) and
10  SHARE (Computer Physics Communications 167 229 (2005)) collaborations.
11 */
12 
13 #ifndef DECAY_CHANNEL
15 #endif
16 #include <iostream>
17 
18 using namespace std;
19 
21  fMotherPDG = kNonsensePDG;
22  fBranchingRatio = 0.0;
23  fNDaughters = 0;
24  for (int i = 0; i < kMaxDaughters; i++)
25  fDaughtersPDG[i] = kNonsensePDG;
26 }
27 
29  fMotherPDG = copy.fMotherPDG;
30  fBranchingRatio = copy.fBranchingRatio;
31  fNDaughters = copy.fNDaughters;
32  for (int i = 0; i < fNDaughters; i++)
33  fDaughtersPDG[i] = copy.fDaughtersPDG[i];
34 }
35 
36 DecayChannel::DecayChannel(int mother, double branching, int nDaughters, int *daughters) {
37  fMotherPDG = mother;
38  fBranchingRatio = branching;
39  fNDaughters = 0;
40  for (int i = 0; i < nDaughters; i++) {
41  if (i >= kMaxDaughters) {
42  edm::LogError("DecayChannel")
43  << "From explicit constructor: Number of daughters bigger than the maximum allowed one (" << kMaxDaughters
44  << ") !!";
45  }
46  fDaughtersPDG[fNDaughters++] = *(daughters + i);
47  }
48 }
49 
51  for (int i = 0; i < n; i++) {
52  if (i >= kMaxDaughters) {
53  edm::LogError("DecayChannel") << "From SetDaughters(): Number of daughters bigger than the maximum allowed one ("
54  << kMaxDaughters << ") !!";
55  }
56  fDaughtersPDG[fNDaughters++] = *(daughters + i);
57  }
58 }
59 
61  if (fNDaughters >= kMaxDaughters) {
62  edm::LogError("DecayChannel")
63  << "From AddDaughter(): Number of daughters is already >= than the maximum allowed one (" << kMaxDaughters
64  << ") !!";
65  }
66  fDaughtersPDG[fNDaughters++] = pdg;
67 }
68 
70  if ((i >= fNDaughters) || (i < 0)) {
71  edm::LogError("DecayChannel")
72  << "From GetDaughterPDG(): Daughter index required is too big or less than zero!! There are only "
73  << fNDaughters << " secondaries in this channel !!";
74  return kNonsensePDG;
75  }
76  return fDaughtersPDG[i];
77 }
mps_fire.i
i
Definition: mps_fire.py:355
dqmiodumpmetadata.n
n
Definition: dqmiodumpmetadata.py:28
filterCSVwithJSON.copy
copy
Definition: filterCSVwithJSON.py:36
DecayChannel::GetDaughterPDG
int GetDaughterPDG(int i)
Definition: DecayChannel.cc:69
dileptonTrigSettings_cff.pdg
pdg
Definition: dileptonTrigSettings_cff.py:6
DecayChannel::SetDaughters
void SetDaughters(int *values, int n)
Definition: DecayChannel.cc:50
kMaxDaughters
const int kMaxDaughters
Definition: DecayChannel.h:19
BPhysicsValidation_cfi.daughters
daughters
Definition: BPhysicsValidation_cfi.py:11
DecayChannel
Definition: DecayChannel.h:22
DecayChannel::AddDaughter
void AddDaughter(int pdg)
Definition: DecayChannel.cc:60
edm::LogError
Definition: MessageLogger.h:183
DecayChannel.h
DecayChannel::DecayChannel
DecayChannel()
Definition: DecayChannel.cc:20
kNonsensePDG
const int kNonsensePDG
Definition: DecayChannel.h:20
std
Definition: JetResolutionObject.h:76
Particle::fNDaughters
int fNDaughters
Definition: Particle.h:35
pdg
Definition: pdg_functions.h:28