CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions
DummyChargeFlipProcess Class Reference

#include <DummyChargeFlipProcess.h>

Inheritance diagram for DummyChargeFlipProcess:

Public Member Functions

void BuildPhysicsTable (const G4ParticleDefinition &aParticleType) override
 
 DummyChargeFlipProcess (const G4String &processName="Dummy")
 
void DumpPhysicsTable (const G4ParticleDefinition &aParticleType)
 
G4bool IsApplicable (const G4ParticleDefinition &aParticleType) override
 
G4VParticleChange * PostStepDoIt (const G4Track &aTrack, const G4Step &aStep) override
 
 ~DummyChargeFlipProcess () override
 

Private Member Functions

G4double GetMicroscopicCrossSection (const G4DynamicParticle *aParticle, const G4Element *anElement, G4double aTemp)
 

Detailed Description

Definition at line 17 of file DummyChargeFlipProcess.h.

Constructor & Destructor Documentation

DummyChargeFlipProcess::DummyChargeFlipProcess ( const G4String &  processName = "Dummy")

Definition at line 9 of file DummyChargeFlipProcess.cc.

9  : G4HadronicProcess(processName) {
10  AddDataSet(new G4HadronElasticDataSet);
11 }
DummyChargeFlipProcess::~DummyChargeFlipProcess ( )
override

Definition at line 13 of file DummyChargeFlipProcess.cc.

13 {}

Member Function Documentation

void DummyChargeFlipProcess::BuildPhysicsTable ( const G4ParticleDefinition &  aParticleType)
override

Definition at line 15 of file DummyChargeFlipProcess.cc.

15  {
16  if (!G4HadronicProcess::GetCrossSectionDataStore()) {
17  return;
18  }
19  G4HadronicProcess::GetCrossSectionDataStore()->BuildPhysicsTable(aParticleType);
20 }
void DummyChargeFlipProcess::DumpPhysicsTable ( const G4ParticleDefinition &  aParticleType)

Definition at line 35 of file DummyChargeFlipProcess.cc.

35 {}
G4double DummyChargeFlipProcess::GetMicroscopicCrossSection ( const G4DynamicParticle *  aParticle,
const G4Element *  anElement,
G4double  aTemp 
)
private

Definition at line 22 of file DummyChargeFlipProcess.cc.

24  {
25  return 30 * millibarn * element->GetN();
26 }
G4bool DummyChargeFlipProcess::IsApplicable ( const G4ParticleDefinition &  aParticleType)
override

Definition at line 28 of file DummyChargeFlipProcess.cc.

28  {
29  if (aParticleType.GetParticleType() == "rhadron")
30  return true;
31  else
32  return false;
33 }
G4VParticleChange * DummyChargeFlipProcess::PostStepDoIt ( const G4Track &  aTrack,
const G4Step &  aStep 
)
override

Definition at line 37 of file DummyChargeFlipProcess.cc.

References ecalTB2006H4_GenSimDigiReco_cfg::G4cout.

37  {
38  G4ParticleChange* pc = new G4ParticleChange();
39  pc->Initialize(aTrack);
40  const G4DynamicParticle* aParticle = aTrack.GetDynamicParticle();
41  //G4ParticleDefinition* aParticleDef = aParticle->GetDefinition();
42 
43  G4double ParentEnergy = aParticle->GetTotalEnergy();
44  const G4ThreeVector& ParentDirection(aParticle->GetMomentumDirection());
45 
46  G4double energyDeposit = 0.0;
47  G4double finalGlobalTime = aTrack.GetGlobalTime();
48 
49  G4int numberOfSecondaries = 1;
50  pc->SetNumberOfSecondaries(numberOfSecondaries);
51  const G4TouchableHandle& thand = aTrack.GetTouchableHandle();
52 
53  // get current position of the track
54  aTrack.GetPosition();
55  // create a new track object
56  G4ParticleTable* particleTable = G4ParticleTable::GetParticleTable();
57  float randomParticle = G4UniformRand();
58  G4ParticleDefinition* newType;
59  if (randomParticle < 0.333)
60  newType = particleTable->FindParticle(1009213);
61  else if (randomParticle > 0.667)
62  newType = particleTable->FindParticle(-1009213);
63  else
64  newType = particleTable->FindParticle(1009113);
65 
66  G4cout << "RHADRON: New charge = " << newType->GetPDGCharge() << G4endl;
67 
68  G4DynamicParticle* newP = new G4DynamicParticle(newType, ParentDirection, ParentEnergy);
69  G4Track* secondary = new G4Track(newP, finalGlobalTime, aTrack.GetPosition());
70  // switch on good for tracking flag
71  secondary->SetGoodForTrackingFlag();
72  secondary->SetTouchableHandle(thand);
73  // add the secondary track in the List
74  pc->AddSecondary(secondary);
75 
76  // Kill the parent particle
77  pc->ProposeTrackStatus(fStopAndKill);
78  pc->ProposeLocalEnergyDeposit(energyDeposit);
79  pc->ProposeGlobalTime(finalGlobalTime);
80  // Clear NumberOfInteractionLengthLeft
81  ClearNumberOfInteractionLengthLeft();
82 
83  return pc;
84 }