ECCE @ EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
ML2PrimaryGenerationActionMessenger.cc
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file ML2PrimaryGenerationActionMessenger.cc
1 //
2 // ********************************************************************
3 // * License and Disclaimer *
4 // * *
5 // * The Geant4 software is copyright of the Copyright Holders of *
6 // * the Geant4 Collaboration. It is provided under the terms and *
7 // * conditions of the Geant4 Software License, included in the file *
8 // * LICENSE and available at http://cern.ch/geant4/license . These *
9 // * include a list of copyright holders. *
10 // * *
11 // * Neither the authors of this software system, nor their employing *
12 // * institutes,nor the agencies providing financial support for this *
13 // * work make any representation or warranty, express or implied, *
14 // * regarding this software system or assume any liability for its *
15 // * use. Please see the license in the file LICENSE and URL above *
16 // * for the full disclaimer and the limitation of liability. *
17 // * *
18 // * This code implementation is the result of the scientific and *
19 // * technical work of the GEANT4 collaboration. *
20 // * By using, copying, modifying or distributing the software (or *
21 // * any work based on the software) you agree to acknowledge its *
22 // * use in resulting scientific publications, and indicate your *
23 // * acceptance of all terms of the Geant4 Software license. *
24 // ********************************************************************
25 //
26 // The code was written by :
27 // ^Claudio Andenna claudio.andenna@ispesl.it, claudio.andenna@iss.infn.it
28 // *Barbara Caccia barbara.caccia@iss.it
29 // with the support of Pablo Cirrone (LNS, INFN Catania Italy)
30 // with the contribute of Alessandro Occhigrossi*
31 //
32 // ^INAIL DIPIA - ex ISPESL and INFN Roma, gruppo collegato Sanità, Italy
33 // *Istituto Superiore di Sanità and INFN Roma, gruppo collegato Sanità, Italy
34 // Viale Regina Elena 299, 00161 Roma (Italy)
35 // tel (39) 06 49902246
36 // fax (39) 06 49387075
37 //
38 // more information:
39 // http://g4advancedexamples.lngs.infn.it/Examples/medical-linac
40 //
41 //*******************************************************//
42 
43 
46 #include "G4UIcmdWithAString.hh"
47 #include "G4UIcmdWithAnInteger.hh"
49 
50 CML2PrimaryGenerationActionMessenger::CML2PrimaryGenerationActionMessenger(CML2PrimaryGenerationAction *PML2PrimaryGenerationAction) : pML2PrimaryGenerationAction(PML2PrimaryGenerationAction)
51 {
52  nRecycling=new G4UIcmdWithAnInteger("/primaryParticleData/nIdenticalParticles",this);
54  nRecycling->SetGuidance("number of identical particles generated in the primary generator");
55 
56  calculatedPhaseSpaceFileIN=new G4UIcmdWithAString("/primaryParticleData/calculatedPhaseSpaceFileIN",this);
58  calculatedPhaseSpaceFileIN->SetGuidance("full path and name of the phase space file to be used as particle generator");
59 
60  sourceTypeName=new G4UIcmdWithAString("/primaryParticleData/sourceTypeName",this);
62  sourceTypeName->SetGuidance("type of particle generator source (randomTarget, phaseSpace)");
63 
64  nMaxParticlesInRamPhaseSpace=new G4UIcmdWithAnInteger("/primaryParticleData/nMaxParticlesInRamPhaseSpace",this);
66  nMaxParticlesInRamPhaseSpace->SetGuidance("maximum number of particle loaded from the phase space file each time");
67 
68  GunMeanEnergy=new G4UIcmdWithADoubleAndUnit("/primaryParticleData/GunMeanEnergy", this);
71  GunMeanEnergy->SetGuidance("mean energy of the beam");
72 
73  GunStdEnergy=new G4UIcmdWithADoubleAndUnit("/primaryParticleData/GunStdEnergy", this);
76  GunStdEnergy->SetGuidance("std deviation of energy of the beam");
77 
78  GunRadius=new G4UIcmdWithADoubleAndUnit("/primaryParticleData/GunRadius", this);
81  GunRadius->SetGuidance("radius of the beam");
82 }
83 
85 {
86  delete nRecycling;
88  delete GunMeanEnergy;
89  delete GunStdEnergy;
90  delete GunRadius;
92  delete sourceTypeName;
93 }
95 {
96  if (cmd == GunMeanEnergy)
97  {
98  GunMeanEnergy -> GetNewUnitValue(newValue);
99  pML2PrimaryGenerationAction -> setGunMeanEnergy(GunMeanEnergy->GetNewDoubleValue(newValue));
100  }
101 
102  if (cmd == GunStdEnergy)
103  {
104  GunStdEnergy -> GetNewUnitValue(newValue);
105  pML2PrimaryGenerationAction -> setGunStdEnergy(GunStdEnergy->GetNewDoubleValue(newValue));
106  }
107 
108  if (cmd == GunRadius)
109  {
110  GunRadius -> GetNewUnitValue(newValue);
111  pML2PrimaryGenerationAction -> setGunRadius(GunRadius->GetNewDoubleValue(newValue));
112  }
113 
114  if (cmd == nMaxParticlesInRamPhaseSpace)
115  {
116  pML2PrimaryGenerationAction -> setNMaxParticlesInRamPhaseSpace(nMaxParticlesInRamPhaseSpace->GetNewIntValue(newValue));
117  }
118 
119  if (cmd == nRecycling)
120  {
121  pML2PrimaryGenerationAction -> setNRecycling(nRecycling->GetNewIntValue(newValue));
122  }
123 
124  if (cmd == calculatedPhaseSpaceFileIN)
125  {
126  pML2PrimaryGenerationAction -> setCalculatedPhaseSpaceFileIN(newValue);
127  }
128 
129  if (cmd == sourceTypeName)
130  {
131  pML2PrimaryGenerationAction -> setSourceTypeName(newValue);
132  }
133 
134 
135 }