BOSS 7.1.2
BESIII Offline Software System
Loading...
Searching...
No Matches
CosmicGun Class Reference

#include <CosmicGun.h>

Public Member Functions

HepLorentzVector GenerateEvent (void)
 
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)
 

Detailed Description

Definition at line 6 of file CosmicGun.h.

Member Function Documentation

◆ GenerateEvent()

HepLorentzVector CosmicGun::GenerateEvent ( void )

Definition at line 109 of file CosmicGun.cxx.

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

Referenced by CosmicGenerator::execute().

◆ GenerateVertex()

HepLorentzVector CosmicGun::GenerateVertex ( void )

◆ GetCosmicGun()

CosmicGun * CosmicGun::GetCosmicGun ( void )
static

Definition at line 49 of file CosmicGun.cxx.

49 {
50 if(!mpointer) mpointer = new CosmicGun();
51 return mpointer;
52}

Referenced by CosmicGenerator::execute(), and CosmicGenerator::initialize().

◆ GetMuonCharge()

int CosmicGun::GetMuonCharge ( void )

Definition at line 134 of file CosmicGun.cxx.

134 {
135 return (int)cosevt_.CHRG;
136}

Referenced by CosmicGenerator::execute().

◆ InitializeGenerator()

float CosmicGun::InitializeGenerator ( )

Definition at line 81 of file CosmicGun.cxx.

81 {
82 std::cout << " CosmicGun::InitializeGenerator: E(min,max)=(" << m_emin << "," << m_emax
83 << ") GeV, and cos(ThetaCut)="<< m_coscut << std::endl;
84 cosipr_();
85 cosgin_();
86 cosmic2_();
87 return flxout_.FLUX2;
88}
void cosgin_(void)
void cosmic2_(void)
flxout flxout_
Definition CosmicGun.cxx:41
void cosipr_(void)
float FLUX2
Definition CosmicGun.cxx:39

Referenced by CosmicGenerator::initialize().

◆ PrintLevel()

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

Definition at line 90 of file CosmicGun.cxx.

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

Referenced by CosmicGenerator::initialize().

◆ SetCosCut()

void CosmicGun::SetCosCut ( float ctcut)

Definition at line 154 of file CosmicGun.cxx.

154 {
155 m_coscut = ctcut;
156
157 coscut_.ctcut = m_coscut;
158}
coscut coscut_
Definition CosmicGun.cxx:31
float ctcut
Definition CosmicGun.cxx:29

Referenced by CosmicGenerator::initialize().

◆ SetEnergyRange()

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

Definition at line 138 of file CosmicGun.cxx.

138 {
139 if(emin >= emax || emin < 0 )
140 {
141 std::cout << "Error input energy range : (" << emin << " - " << emax << ") - ignored " << std::endl;
142 return;
143 }
144 m_emin = emin;
145 m_emax = emax;
146
147 genpar_.LEMIN = log10(m_emin);
148 genpar_.LEMAX = log10(m_emax);
149 genpar_.NBIN = 100;
151
152}
genpar genpar_
Definition CosmicGun.cxx:26
int NBIN
Definition CosmicGun.cxx:23
float LEMAX
Definition CosmicGun.cxx:22
float LEMIN
Definition CosmicGun.cxx:22
float LBINWID
Definition CosmicGun.cxx:22

Referenced by CosmicGenerator::initialize().


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