CosmicGun Class Reference

#include <CosmicGun.h>

List of all members.

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)

Private Member Functions

 CosmicGun (void)

Private Attributes

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

Static Private Attributes

static CosmicGunmpointer = 0


Detailed Description

Definition at line 6 of file CosmicGun.h.


Constructor & Destructor Documentation

CosmicGun::CosmicGun ( void   )  [private]

Definition at line 60 of file CosmicGun.cxx.

References coscut_, coscut::ctcut, genpar_, genpar::LBINWID, genpar::LEMAX, genpar::LEMIN, m_coscut, m_emax, m_emin, m_event, m_printevt, m_printmod, and genpar::NBIN.

Referenced by GetCosmicGun().

00060                         {
00061   m_event    = 0;
00062   m_emin     = 50;
00063   m_emax     = 500;
00064   m_coscut   = 0.35;
00065   m_printevt = 20;
00066   m_printmod = 50;
00067 
00068   coscut_.ctcut = m_coscut;
00069   genpar_.LEMIN = log10(m_emin);
00070   genpar_.LEMAX = log10(m_emax);
00071   genpar_.NBIN  = 100;
00072   genpar_.LBINWID = (genpar_.LEMAX-genpar_.LEMIN)/genpar_.NBIN;
00073 
00074   // cosipr_();
00075   // cosgin_();
00076 
00077 }


Member Function Documentation

HepLorentzVector CosmicGun::GenerateEvent ( void   ) 

Definition at line 109 of file CosmicGun.cxx.

References cosevt::CHRG, cos(), cosevt_, cosgen_(), cosevt::COSTH, cosevt::ENER, m_emax, m_emin, m_event, m_printevt, cosevt::PHI, and sin().

Referenced by CosmicGenerator::execute().

00109                                              {
00110   int iacc = 0;
00111 
00112   while(iacc == 0){
00113     cosgen_(&m_emin, &m_emax, &iacc);
00114   }
00115   m_event++;
00116   
00117   float sinth = sqrt( 1-pow(cosevt_.COSTH,2) );
00118   float e  = cosevt_.ENER;
00119   float px = cosevt_.ENER * sinth * sin( cosevt_.PHI);
00120   float py = cosevt_.ENER * sinth * cos( cosevt_.PHI);
00121   float pz = cosevt_.ENER * cosevt_.COSTH;
00122   HepLorentzVector p(px,py,pz,e);
00123 
00124   //  if(m_event < m_printevt || m_event%m_printmod == 0)
00125   if(m_event < m_printevt)
00126     {
00127         std::cout << "CosmicGun::GenerateEvent: " << std::setw(4) << m_event 
00128                   << " muon charge " << std::setw(2) << cosevt_.CHRG << " with momentum : " << p << std::endl;
00129     }
00130 
00131   return p;
00132 }

HepLorentzVector CosmicGun::GenerateVertex ( void   ) 

CosmicGun * CosmicGun::GetCosmicGun ( void   )  [static]

Definition at line 49 of file CosmicGun.cxx.

References CosmicGun(), and mpointer.

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

00049                                       {
00050   if(!mpointer) mpointer = new CosmicGun();
00051   return mpointer;
00052 }

int CosmicGun::GetMuonCharge ( void   ) 

Definition at line 134 of file CosmicGun.cxx.

References cosevt::CHRG, and cosevt_.

Referenced by CosmicGenerator::execute().

00134                                 {
00135   return (int)cosevt_.CHRG;
00136 }

float CosmicGun::InitializeGenerator (  ) 

Definition at line 81 of file CosmicGun.cxx.

References cosgin_(), cosipr_(), cosmic2_(), flxout::FLUX2, flxout_, m_coscut, m_emax, and m_emin.

Referenced by CosmicGenerator::initialize().

00081                                       {
00082   std::cout << " CosmicGun::InitializeGenerator: E(min,max)=(" << m_emin << "," << m_emax
00083             << ") GeV, and cos(ThetaCut)="<< m_coscut << std::endl;
00084   cosipr_();
00085   cosgin_();
00086   cosmic2_();
00087   return flxout_.FLUX2;
00088 }

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

Definition at line 90 of file CosmicGun.cxx.

References m_printevt, and m_printmod.

Referenced by CosmicGenerator::initialize().

00090                                                    {
00091   if (printevt >= 0)
00092     {
00093       m_printevt = printevt;
00094     }
00095   else
00096     {
00097       std::cerr << "CosmicGun::PrintLevel - warning ignored input printevt = " << printevt << std::endl; 
00098     }
00099   if (printmod >= 1)
00100     {
00101       m_printmod = printmod;
00102     }
00103   else
00104     {
00105       std::cerr << "CosmicGun::PrintLevel - warning ignored input printmod = " << printmod << std::endl; 
00106     }
00107 }

void CosmicGun::SetCosCut ( float  ctcut  ) 

Definition at line 154 of file CosmicGun.cxx.

References coscut_, coscut::ctcut, and m_coscut.

Referenced by CosmicGenerator::initialize().

00154                                     {
00155   m_coscut = ctcut;
00156 
00157   coscut_.ctcut = m_coscut;
00158 }

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

Definition at line 138 of file CosmicGun.cxx.

References genpar_, genpar::LBINWID, genpar::LEMAX, genpar::LEMIN, m_emax, m_emin, and genpar::NBIN.

Referenced by CosmicGenerator::initialize().

00138                                                     {
00139   if(emin >= emax || emin < 0 )
00140     {
00141       std::cout << "Error input energy range : (" << emin << " - " << emax << ") - ignored " << std::endl;
00142       return;
00143     }
00144   m_emin = emin;
00145   m_emax = emax;
00146 
00147   genpar_.LEMIN = log10(m_emin);
00148   genpar_.LEMAX = log10(m_emax);
00149   genpar_.NBIN  = 100;
00150   genpar_.LBINWID = (genpar_.LEMAX-genpar_.LEMIN)/genpar_.NBIN;
00151 
00152 }


Member Data Documentation

float CosmicGun::m_coscut [private]

Definition at line 23 of file CosmicGun.h.

Referenced by CosmicGun(), InitializeGenerator(), and SetCosCut().

float CosmicGun::m_emax [private]

Definition at line 22 of file CosmicGun.h.

Referenced by CosmicGun(), GenerateEvent(), InitializeGenerator(), and SetEnergyRange().

float CosmicGun::m_emin [private]

Definition at line 22 of file CosmicGun.h.

Referenced by CosmicGun(), GenerateEvent(), InitializeGenerator(), and SetEnergyRange().

long int CosmicGun::m_event [private]

Definition at line 20 of file CosmicGun.h.

Referenced by CosmicGun(), and GenerateEvent().

long int CosmicGun::m_printevt [private]

Definition at line 21 of file CosmicGun.h.

Referenced by CosmicGun(), GenerateEvent(), and PrintLevel().

long int CosmicGun::m_printmod [private]

Definition at line 21 of file CosmicGun.h.

Referenced by CosmicGun(), and PrintLevel().

CosmicGun * CosmicGun::mpointer = 0 [static, private]

Definition at line 18 of file CosmicGun.h.

Referenced by GetCosmicGun().


Generated on Tue Nov 29 23:18:09 2016 for BOSS_7.0.2 by  doxygen 1.4.7