ATLAS Offline Software
Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | Static Private Attributes | List of all members
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 }

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 }

◆ 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 }

◆ GetMuonCharge()

int CosmicGun::GetMuonCharge ( void  )

Definition at line 137 of file CosmicGun.cxx.

137  {
138  return (int)cosevt_.CHRG;
139 }

◆ 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 }

◆ 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:
AllowedVariables::e
e
Definition: AsgElectronSelectorTool.cxx:37
flxout_
flxout flxout_
test_pyathena.px
px
Definition: test_pyathena.py:18
genpar_
genpar genpar_
Definition: CosmicGun.cxx:30
CosmicGun::s_mpointer
static CosmicGun * s_mpointer
Definition: CosmicGun.h:22
cosevt::ENER
float ENER
Definition: CosmicGun.cxx:38
cosevt_
cosevt cosevt_
CosmicGun::m_emin
float m_emin
Definition: CosmicGun.h:26
cosevt::CHRG
float CHRG
Definition: CosmicGun.cxx:38
cosevt::PHI
float PHI
Definition: CosmicGun.cxx:38
genpar::LEMAX
float LEMAX
Definition: CosmicGun.cxx:26
drawFromPickle.cos
cos
Definition: drawFromPickle.py:36
CosmicGun::CosmicGun
CosmicGun(void)
Definition: CosmicGun.cxx:64
coscut_
coscut coscut_
cosmic2_
void cosmic2_(void)
flxout::FLUX2
float FLUX2
Definition: CosmicGun.cxx:43
genpar::LBINWID
float LBINWID
Definition: CosmicGun.cxx:26
CosmicGun::m_printmod
int m_printmod
Definition: CosmicGun.h:25
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:210
cosevt::COSTH
float COSTH
Definition: CosmicGun.cxx:38
CosmicGun::m_event
int m_event
Definition: CosmicGun.h:24
CosmicGun::m_printevt
int m_printevt
Definition: CosmicGun.h:25
Amg::pz
@ pz
Definition: GeoPrimitives.h:40
genpar::LEMIN
float LEMIN
Definition: CosmicGun.cxx:26
coscut::ctcut
float ctcut
Definition: CosmicGun.cxx:33
genpar::NBIN
int NBIN
Definition: CosmicGun.cxx:27
Amg::py
@ py
Definition: GeoPrimitives.h:39
cosgen_
void cosgen_(float *emin, float *emax, int *iacc)
CosmicGun::m_coscut
float m_coscut
Definition: CosmicGun.h:27
drawFromPickle.sin
sin
Definition: drawFromPickle.py:36
cosgin_
void cosgin_(void)
pow
constexpr int pow(int base, int exp) noexcept
Definition: ap_fixedTest.cxx:15
cosipr_
void cosipr_(void)
CosmicGun::m_emax
float m_emax
Definition: CosmicGun.h:26