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

#include "Py8TauDecayerPhysics.hh"

Inheritance diagram for Py8TauDecayerPhysics:

Public Member Functions

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

Protected Member Functions

virtual void ConstructParticle ()
 
virtual void ConstructProcess ()
 

Detailed Description

Definition at line 41 of file Py8TauDecayerPhysics.hh.

Constructor & Destructor Documentation

Py8TauDecayerPhysics::Py8TauDecayerPhysics ( G4int  verb = 1)

Definition at line 52 of file Py8TauDecayerPhysics.cc.

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

Definition at line 59 of file Py8TauDecayerPhysics.cc.

60 {
61 }

Member Function Documentation

void Py8TauDecayerPhysics::ConstructParticle ( )
protectedvirtual

Definition at line 65 of file Py8TauDecayerPhysics.cc.

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

Definition at line 72 of file Py8TauDecayerPhysics.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) tau's
103  // and replace with external decayer
104  if ( std::abs(particle->GetPDGEncoding()) == 15 )
105  {
106  if ( particle->GetDecayTable() )
107  {
108  delete particle->GetDecayTable();
109  particle->SetDecayTable(nullptr);
110  }
111  decay->SetExtDecayer(extDecayer);
112  }
113  // now set external decayer to all particles
114  // that don't yet have a decay table
115  if ( !particle->GetDecayTable() )
116  {
117  decay->SetExtDecayer(extDecayer);
118  }
119  }
120  }
121  }
122 
123  return;
124 
125 }
constexpr auto abs(T v)
Returns the absolute value of the argument.

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