Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

CosmicGun Class Reference

#include <CosmicGun.h>

List of all members.

Public Member Functions

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

Static Public Member Functions

CosmicGunGetCosmicGun (void)
CosmicGunGetCosmicGun (void)

Private Member Functions

 CosmicGun (void)
 CosmicGun (void)

Private Attributes

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

Static Private Attributes

CosmicGunmpointer
CosmicGunmpointer = 0


Constructor & Destructor Documentation

CosmicGun::CosmicGun void   )  [private]
 

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 }

CosmicGun::CosmicGun void   )  [private]
 


Member Function Documentation

HepLorentzVector CosmicGun::GenerateEvent void   ) 
 

HepLorentzVector CosmicGun::GenerateEvent void   ) 
 

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   ) 
 

HepLorentzVector CosmicGun::GenerateVertex void   ) 
 

CosmicGun* CosmicGun::GetCosmicGun void   )  [static]
 

CosmicGun * CosmicGun::GetCosmicGun void   )  [static]
 

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

int CosmicGun::GetMuonCharge void   ) 
 

int CosmicGun::GetMuonCharge void   ) 
 

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

float CosmicGun::InitializeGenerator  ) 
 

float CosmicGun::InitializeGenerator  ) 
 

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
 

void CosmicGun::PrintLevel int  printevt,
int  printmod
 

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  ) 
 

void CosmicGun::SetCosCut float  ctcut  ) 
 

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

void CosmicGun::SetEnergyRange float  emin,
float  emax
 

void CosmicGun::SetEnergyRange float  emin,
float  emax
 

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]
 

float CosmicGun::m_emax [private]
 

float CosmicGun::m_emin [private]
 

long int CosmicGun::m_event [private]
 

long int CosmicGun::m_printevt [private]
 

long int CosmicGun::m_printmod [private]
 

CosmicGun* CosmicGun::mpointer [static, private]
 

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


The documentation for this class was generated from the following files:
Generated on Wed Feb 2 15:56:36 2011 for BOSS6.5.5 by  doxygen 1.3.9.1