GENIEGenerator
Loading...
Searching...
No Matches
CollinsSpillerFragm.cxx
Go to the documentation of this file.
1//____________________________________________________________________________
2/*
3 Copyright (c) 2003-2025, The GENIE Collaboration
4 For the full text of the license visit http://copyright.genie-mc.org
5
6 Costas Andreopoulos <c.andreopoulos \at cern.ch>
7 University of Liverpool
8*/
9//____________________________________________________________________________
10
13
14using namespace genie;
15
16//___________________________________________________________________________
18FragmentationFunctionI("genie::CollinsSpillerFragm")
19{
20
21}
22//___________________________________________________________________________
24FragmentationFunctionI("genie::CollinsSpillerFragm", config)
25{
26
27}
28//___________________________________________________________________________
33//___________________________________________________________________________
34double CollinsSpillerFragm::Value(double z) const
35{
36// Evaluate the fragmentation function
37
38 if(z<0 || z>1) return 0;
39 return fFunc->Eval(z);
40}
41//___________________________________________________________________________
43{
44// Return a random number using the fragmentation function as PDF
45
46 return fFunc->GetRandom();
47}
48//___________________________________________________________________________
50{
52 this->BuildFunction();
53}
54//___________________________________________________________________________
56{
58 this->BuildFunction();
59}
60//___________________________________________________________________________
62{
64
65 fFunc->SetParNames("Norm","Epsilon");
66
67 double N = -1. ;
68 GetParam( "CSFrag-Norm", N, false ) ;
69
70 double e = 0. ;
71 GetParam( "CSFrag-Epsilon", e, false ) ;
72
73 // if the normalization parameter was left negative, explicitly normalize
74 // the fragmentation function
75 if(N<0) {
76 N=1;
77 fFunc->SetParameters(N,e);
78 double I = fFunc->Integral(0,1);
79 assert(I>0);
80 N = 1./I;
81 }
82 fFunc->SetParameters(N,e);
83}
84//___________________________________________________________________________
bool GetParam(const RgKey &name, T &p, bool is_top_call=true) const
virtual void Configure(const Registry &config)
Definition Algorithm.cxx:62
void Configure(const Registry &config)
double Value(double z) const
implements the FragmentationFunctionI interface
A registry. Provides the container for algorithm configuration parameters.
Definition Registry.h:65
const double e
double collins_spiller_func(double *x, double *par)
The Collins-Spiller fragmentation function.
THE MAIN GENIE PROJECT NAMESPACE
Definition AlgCmp.h:25