LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
Py8CharmDecayerPhysics Class Reference

#include "Py8CharmDecayerPhysics.hh"

Inheritance diagram for Py8CharmDecayerPhysics:

Public Member Functions

 Py8CharmDecayerPhysics (G4int verb=1)
 
virtual ~Py8CharmDecayerPhysics ()
 

Protected Member Functions

virtual void ConstructParticle ()
 
virtual void ConstructProcess ()
 

Detailed Description

Definition at line 41 of file Py8CharmDecayerPhysics.hh.

Constructor & Destructor Documentation

Py8CharmDecayerPhysics::Py8CharmDecayerPhysics ( G4int  verb = 1)

Definition at line 52 of file Py8CharmDecayerPhysics.cc.

53  : G4VPhysicsConstructor("Py8CharmDecayerPhysics")
54 {
55 }
Py8CharmDecayerPhysics::~Py8CharmDecayerPhysics ( )
virtual

Definition at line 59 of file Py8CharmDecayerPhysics.cc.

60 {
61 }

Member Function Documentation

void Py8CharmDecayerPhysics::ConstructParticle ( )
protectedvirtual

Definition at line 65 of file Py8CharmDecayerPhysics.cc.

66 {
67  // Nothing needs to be done here
68 }
void Py8CharmDecayerPhysics::ConstructProcess ( )
protectedvirtual

Definition at line 72 of file Py8CharmDecayerPhysics.cc.

References util::abs().

73 {
74 
75  // Loop over all particles instantiated and add external decayer
76  // to all decay processes where there's no decay table, plus tau's
77 
78  // Create external decayer for G4Decay process
79  // NOTE: The extDecayer will be deleted in G4Decay destructor
80  Py8Decayer* extDecayer = new Py8Decayer();
81 
82  auto particleIterator=GetParticleIterator();
83  particleIterator->reset();
84  while ((*particleIterator)())
85  {
86  G4ParticleDefinition* particle = particleIterator->value();
87  G4ProcessManager* pmanager = particle->GetProcessManager();
88 /*
89  if ( verboseLevel > 1 ) {
90  G4cout << "Setting ext decayer for: "
91  << particleIterator->value()->GetParticleName()
92  << G4endl;
93  }
94 */
95  G4ProcessVector* processVector = pmanager->GetProcessList();
96  for ( size_t i=0; i<processVector->length(); ++i )
97  {
98  G4Decay* decay = dynamic_cast<G4Decay*>((*processVector)[i]);
99  if ( decay )
100  {
101  // remove native/existing decay table for
102  // a) charm hadrons
103  // b) B hadrons
104  // and replace with external decayer
105  // for taus: if ( std::abs(particle->GetPDGEncoding()) == 15 )
106 #ifdef EXPLICIT_CHARM_LIST
107  std::set<int> abspdglist = { 411, 421, 10411, 10421, 413,
108  423, 10413, 10423, 20413, 20423,
109  415, 425, 431, 10431, 433,
110  10433, 20433, 435, 441, 10441,
111  100441, 443, 10443, 20443,100443,
112  30443, 445,
113  };
114  int abspdg = abs(particle->GetPDGEncoding());
115  if ( abspdglist.find(abspdg) != abspdglist.end() )
116 #else
117  int abspdg = abs(particle->GetPDGEncoding());
118  // PDG encoding: +/-n n_r N-L n_q1 n_q2 n_q3 n_J
119  //int n_q3 = (abspdg/10 )%10;
120  int n_q2 = (abspdg/100 )%10;
121  int n_q1 = (abspdg/1000)%10;
122  // charm mesons have n_q2=4, charm baryons n_q1=4
123  // bottom mesons have n_q2=5, bottom baryons n_q1=5
124  if ( n_q2 == 4 || n_q1 == 4 || n_q2 == 5 || n_q1 == 5 )
125 #endif
126  {
127  if ( particle->GetDecayTable() )
128  {
129  delete particle->GetDecayTable();
130  particle->SetDecayTable(nullptr);
131  }
132  decay->SetExtDecayer(extDecayer);
133  }
134  // now set external decayer to all particles
135  // that don't yet have a decay table
136  if ( !particle->GetDecayTable() )
137  {
138  decay->SetExtDecayer(extDecayer);
139  }
140  }
141  }
142  }
143 
144  return;
145 
146 }
constexpr auto abs(T v)
Returns the absolute value of the argument.

The documentation for this class was generated from the following files: