ATLAS Offline Software
Loading...
Searching...
No Matches
CosmicGun Class Reference

#include <CosmicGun.h>

Collaboration diagram for CosmicGun:

Public Member Functions

CLHEP::HepLorentzVector GenerateEvent (void)
CLHEP::HepLorentzVector GenerateVertex (void)
void SetEnergyRange (float emin, float emax)
void SetCosCut (float ctcut)
void PrintLevel (int printevt, int printmod)
int GetMuonCharge (void)
float InitializeGenerator ()

Static Public Member Functions

static CosmicGunGetCosmicGun (void)

Private Member Functions

 CosmicGun (void)

Private Attributes

int m_event
int m_printevt
int m_printmod
float m_emin
float m_emax
float m_coscut

Static Private Attributes

static CosmicGuns_mpointer = 0

Detailed Description

Definition at line 10 of file CosmicGun.h.

Constructor & Destructor Documentation

◆ CosmicGun()

CosmicGun::CosmicGun ( void )
private

Definition at line 64 of file CosmicGun.cxx.

64 {
65 m_event = 0;
66 m_emin = 50;
67 m_emax = 500;
68 m_coscut = 0.35;
69 m_printevt = 20;
70 m_printmod = 50;
71
73 genpar_.LEMIN = std::log10(m_emin);
74 genpar_.LEMAX = std::log10(m_emax);
75 genpar_.NBIN = 100;
77
78 // cosipr_();
79 // cosgin_();
80
81}
genpar genpar_
Definition CosmicGun.cxx:30
coscut coscut_
float m_emin
Definition CosmicGun.h:26
float m_emax
Definition CosmicGun.h:26
int m_event
Definition CosmicGun.h:24
int m_printmod
Definition CosmicGun.h:25
float m_coscut
Definition CosmicGun.h:27
int m_printevt
Definition CosmicGun.h:25
float ctcut
Definition CosmicGun.cxx:33
int NBIN
Definition CosmicGun.cxx:27
float LEMAX
Definition CosmicGun.cxx:26
float LEMIN
Definition CosmicGun.cxx:26
float LBINWID
Definition CosmicGun.cxx:26

Member Function Documentation

◆ GenerateEvent()

CLHEP::HepLorentzVector CosmicGun::GenerateEvent ( void )

Definition at line 113 of file CosmicGun.cxx.

113 {
114 int iacc = 0;
115
116 while(iacc == 0){
117 cosgen_(&m_emin, &m_emax, &iacc);
118 }
119 m_event++;
120
121 float sinth = std::sqrt( 1-std::pow(cosevt_.COSTH,2) );
122 float e = cosevt_.ENER;
123 float px = cosevt_.ENER * sinth * std::sin( cosevt_.PHI);
124 float py = cosevt_.ENER * sinth * std::cos( cosevt_.PHI);
125 float pz = cosevt_.ENER * cosevt_.COSTH;
126 CLHEP::HepLorentzVector p(px,py,pz,e);
127
128// if(m_event < m_printevt || m_event%m_printmod == 0)
129// {
130// std::cout << "CosmicGun::GenerateEvent: " << std::setw(4) << m_event
131// << " muon charge " << std::setw(2) << cosevt_.CHRG << " with momentum : " << p << std::endl;
132// }
133
134 return p;
135}
cosevt cosevt_
void cosgen_(float *emin, float *emax, int *iacc)
float COSTH
Definition CosmicGun.cxx:38
float PHI
Definition CosmicGun.cxx:38
float ENER
Definition CosmicGun.cxx:38

◆ GenerateVertex()

CLHEP::HepLorentzVector CosmicGun::GenerateVertex ( void )

◆ GetCosmicGun()

CosmicGun * CosmicGun::GetCosmicGun ( void )
static

Definition at line 53 of file CosmicGun.cxx.

53 {
54 if(!s_mpointer) s_mpointer = new CosmicGun();
55 return s_mpointer;
56}
static CosmicGun * s_mpointer
Definition CosmicGun.h:22
CosmicGun(void)
Definition CosmicGun.cxx:64

◆ GetMuonCharge()

int CosmicGun::GetMuonCharge ( void )

Definition at line 137 of file CosmicGun.cxx.

137 {
138 return (int)cosevt_.CHRG;
139}
float CHRG
Definition CosmicGun.cxx:38

◆ InitializeGenerator()

float CosmicGun::InitializeGenerator ( )

Definition at line 85 of file CosmicGun.cxx.

85 {
86 std::cout << " CosmicGun::InitializeGenerator: E(min,max)=(" << m_emin << "," << m_emax
87 << ") GeV, and cos(ThetaCut)="<< m_coscut << std::endl;
88 cosipr_();
89 cosgin_();
90 cosmic2_();
91 return flxout_.FLUX2;
92}
void cosgin_(void)
void cosmic2_(void)
flxout flxout_
void cosipr_(void)
float FLUX2
Definition CosmicGun.cxx:43

◆ PrintLevel()

void CosmicGun::PrintLevel ( int printevt,
int printmod )

Definition at line 94 of file CosmicGun.cxx.

94 {
95 if (printevt >= 0)
96 {
97 m_printevt = printevt;
98 }
99 else
100 {
101 std::cerr << "CosmicGun::PrintLevel - warning ignored input printevt = " << printevt << std::endl;
102 }
103 if (printmod >= 1)
104 {
105 m_printmod = printmod;
106 }
107 else
108 {
109 std::cerr << "CosmicGun::PrintLevel - warning ignored input printmod = " << printmod << std::endl;
110 }
111}

◆ SetCosCut()

void CosmicGun::SetCosCut ( float ctcut)

Definition at line 157 of file CosmicGun.cxx.

157 {
158 m_coscut = ctcut;
159
161}

◆ SetEnergyRange()

void CosmicGun::SetEnergyRange ( float emin,
float emax )

Definition at line 141 of file CosmicGun.cxx.

141 {
142 if(emin >= emax || emin < 0 )
143 {
144 std::cout << "Error input energy range : (" << emin << " - " << emax << ") - ignored " << std::endl;
145 return;
146 }
147 m_emin = emin;
148 m_emax = emax;
149
150 genpar_.LEMIN = std::log10(m_emin);
151 genpar_.LEMAX = std::log10(m_emax);
152 genpar_.NBIN = 100;
154
155}

Member Data Documentation

◆ m_coscut

float CosmicGun::m_coscut
private

Definition at line 27 of file CosmicGun.h.

◆ m_emax

float CosmicGun::m_emax
private

Definition at line 26 of file CosmicGun.h.

◆ m_emin

float CosmicGun::m_emin
private

Definition at line 26 of file CosmicGun.h.

◆ m_event

int CosmicGun::m_event
private

Definition at line 24 of file CosmicGun.h.

◆ m_printevt

int CosmicGun::m_printevt
private

Definition at line 25 of file CosmicGun.h.

◆ m_printmod

int CosmicGun::m_printmod
private

Definition at line 25 of file CosmicGun.h.

◆ s_mpointer

CosmicGun * CosmicGun::s_mpointer = 0
staticprivate

Definition at line 22 of file CosmicGun.h.


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