CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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)
 
 DummyChargeFlipProcess (const G4String &processName="Dummy")
 
void DumpPhysicsTable (const G4ParticleDefinition &aParticleType)
 
G4bool IsApplicable (const G4ParticleDefinition &aParticleType)
 
G4VParticleChange * PostStepDoIt (const G4Track &aTrack, const G4Step &aStep)
 
 ~DummyChargeFlipProcess ()
 

Private Member Functions

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

Detailed Description

Definition at line 18 of file DummyChargeFlipProcess.h.

Constructor & Destructor Documentation

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

Definition at line 8 of file DummyChargeFlipProcess.cc.

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

Definition at line 14 of file DummyChargeFlipProcess.cc.

15 {
16 }

Member Function Documentation

void DummyChargeFlipProcess::BuildPhysicsTable ( const G4ParticleDefinition &  aParticleType)

Definition at line 20 of file DummyChargeFlipProcess.cc.

21 {
22  if (!G4HadronicProcess::GetCrossSectionDataStore()) {
23  return;
24  }
25  G4HadronicProcess::GetCrossSectionDataStore()->BuildPhysicsTable(aParticleType);
26 }
void DummyChargeFlipProcess::DumpPhysicsTable ( const G4ParticleDefinition &  aParticleType)

Definition at line 51 of file DummyChargeFlipProcess.cc.

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

Definition at line 30 of file DummyChargeFlipProcess.cc.

32 {
33 
34  return 30*millibarn*element->GetN();
35 }
G4bool DummyChargeFlipProcess::IsApplicable ( const G4ParticleDefinition &  aParticleType)

Definition at line 40 of file DummyChargeFlipProcess.cc.

41 {
42  if(aParticleType.GetParticleType() == "rhadron")
43  return true;
44  else
45  return false;
46 }
G4VParticleChange * DummyChargeFlipProcess::PostStepDoIt ( const G4Track &  aTrack,
const G4Step &  aStep 
)

Definition at line 57 of file DummyChargeFlipProcess.cc.

References gather_cfg::cout.

59 {
60  G4ParticleChange * pc = new G4ParticleChange();
61  pc->Initialize(aTrack);
62  const G4DynamicParticle* aParticle = aTrack.GetDynamicParticle();
63  G4ParticleDefinition* aParticleDef = aParticle->GetDefinition();
64 
65  G4double ParentEnergy = aParticle->GetTotalEnergy();
66  G4ThreeVector ParentDirection(aParticle->GetMomentumDirection());
67 
68  G4double energyDeposit = 0.0;
69  G4double finalGlobalTime = aTrack.GetGlobalTime();
70 
71  G4int numberOfSecondaries = 1;
72  pc->SetNumberOfSecondaries(numberOfSecondaries);
73  const G4TouchableHandle thand = aTrack.GetTouchableHandle();
74 
75  // get current position of the track
76  aTrack.GetPosition();
77  // create a new track object
78  G4ParticleTable* particleTable = G4ParticleTable::GetParticleTable();
79  float randomParticle = G4UniformRand();
80  G4ParticleDefinition * newType = aParticleDef;
81  if(randomParticle < 0.333)
82  newType=particleTable->FindParticle(1009213);
83  else if(randomParticle > 0.667)
84  newType=particleTable->FindParticle(-1009213);
85  else
86  newType=particleTable->FindParticle(1009113);
87 
88  std::cout << "RHADRON: New charge = " << newType->GetPDGCharge() << std::endl;
89 
90  G4DynamicParticle * newP = new G4DynamicParticle(newType,ParentDirection,ParentEnergy);
91  G4Track* secondary = new G4Track( newP ,
92  finalGlobalTime ,
93  aTrack.GetPosition()
94  );
95  // switch on good for tracking flag
96  secondary->SetGoodForTrackingFlag();
97  secondary->SetTouchableHandle(thand);
98  // add the secondary track in the List
99  pc->AddSecondary(secondary);
100 
101  // Kill the parent particle
102  pc->ProposeTrackStatus( fStopAndKill ) ;
103  pc->ProposeLocalEnergyDeposit(energyDeposit);
104  pc->ProposeGlobalTime( finalGlobalTime );
105  // Clear NumberOfInteractionLengthLeft
106  ClearNumberOfInteractionLengthLeft();
107 
108 
109 
110  return pc;
111 
112 }
tuple cout
Definition: gather_cfg.py:121