Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
nptool
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
np
nptool
Commits
ebf72bd7
Commit
ebf72bd7
authored
15 years ago
by
deserevi
Browse files
Options
Downloads
Plain Diff
merge of '584af2a6e520fc6803fc7ee09032cdb183c88731'
and 'c70ad64463e94b7dcba25478005ebabfaefb8888'
parents
6ef38183
cbed9a6d
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
Inputs/EventGenerator/11Li.beam
+1
-1
1 addition, 1 deletion
Inputs/EventGenerator/11Li.beam
NPSimulation/include/VEventGenerator.hh
+1
-6
1 addition, 6 deletions
NPSimulation/include/VEventGenerator.hh
NPSimulation/src/VEventGenerator.cc
+6
-35
6 additions, 35 deletions
NPSimulation/src/VEventGenerator.cc
with
8 additions
and
42 deletions
Inputs/EventGenerator/11Li.beam
+
1
−
1
View file @
ebf72bd7
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%% An Isotropic Source to be used as EventGenerator %%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
Energy are given in MeV , Position in mm
%
%
Energy are given in MeV , Position in mm
, Angle is deg
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Beam
ParticleZ= 3
...
...
This diff is collapsed.
Click to expand it.
NPSimulation/include/VEventGenerator.hh
+
1
−
6
View file @
ebf72bd7
...
...
@@ -35,9 +35,6 @@
#include
"G4ParticleGun.hh"
#include
"G4Event.hh"
// ROOT headers
#include
"TRandom3.h"
#include
"Randomize.hh"
using
namespace
CLHEP
;
using
namespace
std
;
...
...
@@ -60,10 +57,8 @@ public:
virtual
void
SetTargetCoordinate
(
G4double
,
G4double
,
G4double
)
{};
// Used to simulate beam emmitance effect
void
RandomGaussian2D
(
double
MeanX
,
double
MeanY
,
double
SigmaX
,
double
SigmaY
,
double
&
X
,
double
&
Y
,
double
NumberOfSigma
=
7
);
void
RandomGaussian2D
(
double
MeanX
,
double
MeanY
,
double
SigmaX
,
double
SigmaY
,
double
&
X
,
double
&
Y
,
double
NumberOfSigma
=
10000
);
private
:
// Random Engine used by RandomGaussian2D
TRandom3
m_RandomEngine
;
};
...
...
This diff is collapsed.
Click to expand it.
NPSimulation/src/VEventGenerator.cc
+
6
−
35
View file @
ebf72bd7
...
...
@@ -25,16 +25,16 @@
*****************************************************************************/
#include
"VEventGenerator.hh"
//
Root
//
ROOT headers
#include
"TMath.h"
// CLHEP headers
#include
"Randomize.hh"
VEventGenerator
::
VEventGenerator
()
{
}
VEventGenerator
::~
VEventGenerator
()
{
}
...
...
@@ -44,51 +44,22 @@ void VEventGenerator::RandomGaussian2D(double MeanX,double MeanY,double SigmaX,d
if
(
SigmaX
!=
0
)
{
X
=
100
*
SigmaX
;
X
=
2
*
NumberOfSigma
*
SigmaX
;
while
(
X
>
NumberOfSigma
*
SigmaX
)
// X = m_RandomEngine.Gaus( MeanX , SigmaX) ;
X
=
RandGauss
::
shoot
(
MeanX
,
SigmaX
);
G4cout
<<
MeanX
<<
" "
<<
SigmaX
<<
G4endl
;
double
a
=
NumberOfSigma
*
SigmaX
/
2
;
double
b
=
NumberOfSigma
*
SigmaY
/
2
;
double
SigmaYPrim
=
b
*
sqrt
(
1
-
X
*
X
/
(
a
*
a
)
)
;
SigmaYPrim
=
2
*
SigmaYPrim
/
NumberOfSigma
;
// Y = m_RandomEngine.Gaus( MeanY , SigmaYPrim) ;
Y
=
RandGauss
::
shoot
(
MeanY
,
SigmaYPrim
)
;
}
else
{
X
=
MeanX
;
Y
=
m_
Rand
omEngine
.
Gaus
(
MeanY
,
SigmaY
)
;
X
=
MeanX
;
Y
=
Rand
Gauss
::
shoot
(
MeanY
,
SigmaY
)
;
}
/* if(SigmaX!=0)
{
X = m_RandomEngine.Gaus( MeanX , SigmaX) ;
double NumberOfSigma ;
double a = SigmaX / 2. ;
double b = SigmaY / 2. ;
NumberOfSigma = ( X / a ) ;
NumberOfSigma = TMath::Floor( sqrt(NumberOfSigma*NumberOfSigma)+1) ;
double SigmaYPrim = NumberOfSigma*b * sqrt( 1 - X*X / (a*NumberOfSigma*a*NumberOfSigma) ) ;
SigmaYPrim = 2*SigmaYPrim / NumberOfSigma ;
Y = m_RandomEngine.Gaus( MeanY , SigmaYPrim) ;
}
else
{
X= MeanX;
Y = m_RandomEngine.Gaus( MeanY , SigmaY) ;
}*/
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment