SND@LHC Software
Loading...
Searching...
No Matches
NeutronGenerator_FLUKA Class Reference

#include <NeutronGenerator_FLUKA.h>

Inheritance diagram for NeutronGenerator_FLUKA:
Collaboration diagram for NeutronGenerator_FLUKA:

Public Member Functions

 NeutronGenerator_FLUKA ()
 
virtual ~NeutronGenerator_FLUKA ()
 
Bool_t ReadEvent (FairPrimaryGenerator *)
 
Bool_t Init (const char *, int)
 
Bool_t Init (const char *)
 
void SetZ (Double_t X)
 

Protected Member Functions

 ClassDef (NeutronGenerator_FLUKA, 1)
 

Protected Attributes

Double_t SND_Z
 
int fNevents
 
int fn
 

Detailed Description

Definition at line 10 of file NeutronGenerator_FLUKA.h.

Constructor & Destructor Documentation

◆ NeutronGenerator_FLUKA()

NeutronGenerator_FLUKA::NeutronGenerator_FLUKA ( )

default constructor

Definition at line 14 of file NeutronGenerator_FLUKA.cxx.

◆ ~NeutronGenerator_FLUKA()

NeutronGenerator_FLUKA::~NeutronGenerator_FLUKA ( )
virtual

destructor

Definition at line 19 of file NeutronGenerator_FLUKA.cxx.

20{
21}

Member Function Documentation

◆ ClassDef()

NeutronGenerator_FLUKA::ClassDef ( NeutronGenerator_FLUKA  ,
 
)
protected

◆ Init() [1/2]

Bool_t NeutronGenerator_FLUKA::Init ( const char *  )
inline

Definition at line 23 of file NeutronGenerator_FLUKA.h.

23{return true;};

◆ Init() [2/2]

Bool_t NeutronGenerator_FLUKA::Init ( const char *  ,
int   
)
inline

Definition at line 22 of file NeutronGenerator_FLUKA.h.

22{return true;};

◆ ReadEvent()

Bool_t NeutronGenerator_FLUKA::ReadEvent ( FairPrimaryGenerator *  cpg)

public method ReadEvent

Definition at line 25 of file NeutronGenerator_FLUKA.cxx.

26{
27 // neutron rate as function of kinetic energy flat in log10(E) in GeV;
28 fn++;
29 if (fn %100000==0) {LOG(INFO)<< "heartbeat event "<<fn;}
30 Double_t Ekin = TMath::Power(10,gRandom->Uniform(-13.,-1.));
31 Double_t P = TMath::Sqrt( Ekin*Ekin+2*Ekin*neutronMass);
32 Double_t phi = gRandom->Uniform(0,2*TMath::Pi());
33 Double_t theta = TMath::ACos(gRandom->Uniform(-1,1));
34 Double_t px = P*TMath::Sin(theta)*TMath::Cos(phi);
35 Double_t py = P*TMath::Sin(theta)*TMath::Sin(phi);
36 Double_t pz = P*TMath::Cos(theta);
37 LOG(DEBUG) << "NeutronGenerator_FLUKA: " << Ekin << " " << P << " " << px<<" "<<py<<" "<<pz;
38 // place neutrons on sphere covering maximum distance, ~ 2m
39 Double_t R = 200;
40 phi = gRandom->Uniform(0,2*TMath::Pi());
41 theta = TMath::ACos(gRandom->Uniform(-1,1));
42 Double_t x = R*TMath::Sin(theta)*TMath::Cos(phi);
43 Double_t y = R*TMath::Sin(theta)*TMath::Sin(phi);
44 Double_t z = R*TMath::Cos(theta);
45
46 cpg->AddTrack(2112,px,py,pz,x,y,z,-1,true,Ekin+neutronMass,0.,1.,(TMCProcess)0);
47
48 return kTRUE;
49}
Double_t neutronMass

◆ SetZ()

void NeutronGenerator_FLUKA::SetZ ( Double_t  X)
inline

Member Data Documentation

◆ fn

int NeutronGenerator_FLUKA::fn
protected

Definition at line 30 of file NeutronGenerator_FLUKA.h.

◆ fNevents

int NeutronGenerator_FLUKA::fNevents
protected

Definition at line 29 of file NeutronGenerator_FLUKA.h.

◆ SND_Z

Double_t NeutronGenerator_FLUKA::SND_Z
protected

Definition at line 28 of file NeutronGenerator_FLUKA.h.


The documentation for this class was generated from the following files: