FluxGen_OneOverE Class Reference

A simple FluxGenerator. More...

#include <FluxGen_OneOverE.h>

Inheritance diagram for FluxGen_OneOverE:
FluxGenerator

List of all members.

Public Member Functions

 FluxGen_OneOverE ()
virtual ~FluxGen_OneOverE ()
virtual void Configure (const char *option="")
 public interface goes here
virtual TParticle GetParticle () const
virtual std::vector< int > GetParticleList () const
 Report the list of potential particles that might be returned.
virtual Double_t GetMaxEnergy () const
 Report the maximum energy that will be returned.

Private Attributes

TRandom * fRandom
Int_t fPDGFlavor
Double_t fEmin
Double_t fEmax
Double_t fXlo
Double_t fXhi
Double_t fYlo
Double_t fYhi

Detailed Description

A simple FluxGenerator.

This flux generator produces neutrinos with an energy spectrum of 1/E in the range E_min to E_max over a x-y window with a fixed flavor.

Author:
(last to touch it)
Author
rhatcher
Version:
Revision
1.3
Date:
Date
2006/05/25 00:01:01

Contact: rhatcher@fnal.gov

Created on: Wed Apr 13 18:16:24 2005

Id
FluxGen_OneOverE.h,v 1.3 2006/05/25 00:01:01 rhatcher Exp

Definition at line 33 of file FluxGen_OneOverE.h.


Constructor & Destructor Documentation

FluxGen_OneOverE::FluxGen_OneOverE (  ) 

Definition at line 15 of file FluxGen_OneOverE.cxx.

References Msg::kDebug, and MSG.

00016     : fRandom(new TRandom3)
00017       , fPDGFlavor(14)       // by default nu_mu
00018       , fEmin(0.01)          // lowest energy 10MeV
00019       , fEmax(120.0-0.001)   // highest energy (Neugen doesn't like 120.0)
00020       , fXlo(-1000.)
00021       , fXhi(+1000.)
00022       , fYlo(-1000.)
00023       , fYhi(+1000.)
00024 
00025 {
00026     MSG("EvtKin",Msg::kDebug) << "FluxGen_OneOverE ctor" << endl;
00027 } 

FluxGen_OneOverE::~FluxGen_OneOverE (  )  [virtual]

Definition at line 30 of file FluxGen_OneOverE.cxx.

References fRandom, Msg::kDebug, and MSG.

00031 {
00032     MSG("EvtKin",Msg::kDebug) << "FluxGen_OneOverE dtor" << endl;
00033     if (fRandom) delete fRandom;
00034 } 


Member Function Documentation

void FluxGen_OneOverE::Configure ( const char *  option = ""  )  [virtual]

public interface goes here

Implements FluxGenerator.

Definition at line 37 of file FluxGen_OneOverE.cxx.

References fEmax, fEmin, fPDGFlavor, fRandom, fXhi, fXlo, fYhi, fYlo, Registry::Get(), Msg::kDebug, Msg::kInfo, MSG, and Cfg::StringToRegistry().

00038 {
00039     MSG("EvtKin",Msg::kDebug) 
00040         << "FluxGen_OneOverE::Configure()" << endl
00041         << "   '" << option  << "'" << endl;
00042 
00043     // for now use MINOS code to parse options
00044     Registry r;
00045     Cfg::StringToRegistry(r,option);
00046     r.SetName("FluxGen_OneOverE config");
00047     //r.Print();
00048 
00049     //cout << " .................." << endl;
00050     //r.PrintStream(cout);
00051     //cout << endl << " .................." << endl;
00052 
00053     // set random seed
00054     Int_t seed = 65539;
00055     if (r.Get("seed",seed)) {
00056         MSG("EvtKin",Msg::kDebug) 
00057             << "Set non-default seed " << seed << endl;
00058         fRandom->SetSeed(seed);
00059     }
00060 
00061     //fEmin = 0.01;
00062     //fEmax = 120.0 - 0.001;
00063     //fPDGFlavor = 14;
00064     r.Get("Emin",fEmin);
00065     r.Get("Emax",fEmax);
00066     r.Get("PDGFlavor",fPDGFlavor);
00067 
00068     //fXlo = -1000.;
00069     //fXhi = +1000.;
00070     //fYlo = -1000.;
00071     //fYhi = +1000.;
00072     r.Get("Xlo",fXlo);
00073     r.Get("Xhi",fXhi);
00074     r.Get("Ylo",fYlo);
00075     r.Get("Yhi",fYhi);
00076 
00077     MSG("EvtKin",Msg::kInfo) 
00078         << "FluxGen_OneOverE::Configure() " << endl
00079         << "  PDG=" << fPDGFlavor 
00080         << "  E=[" << fEmin << "," << fEmax << "]" 
00081         << "  x=[" << fXlo << "," << fXhi << "] "
00082         << "  y=[" << fYlo << "," << fYhi << "] "
00083         << endl;
00084 } 

Double_t FluxGen_OneOverE::GetMaxEnergy (  )  const [virtual]

Report the maximum energy that will be returned.

Implements FluxGenerator.

Definition at line 120 of file FluxGen_OneOverE.cxx.

References fEmax, Msg::kDebug, and MSG.

00121 {
00122     MSG("EvtKin",Msg::kDebug) << "FluxGen_OneOverE::GetMaxEnergy()" << endl;
00123 
00124     return fEmax;
00125 } 

TParticle FluxGen_OneOverE::GetParticle (  )  const [virtual]

Return a new particle. Users must be aware that the particle might be weighted (see TParticle::GetWeight()).

Implements FluxGenerator.

Definition at line 87 of file FluxGen_OneOverE.cxx.

References fEmax, fEmin, fPDGFlavor, fRandom, fXhi, fXlo, fYhi, fYlo, Msg::kDebug, and MSG.

00088 {
00089     MSG("EvtKin",Msg::kDebug) << "FluxGen_OneOverE::GetParticle()" << endl;
00090 
00091     // pick energy
00092     Double_t c = TMath::Log(fEmin);
00093     Double_t A = 1.0 / (TMath::Log(fEmax) - c);
00094     Double_t r1 = fRandom->Rndm();
00095     Double_t enu = TMath::Exp(r1/A + c);
00096     TLorentzVector p(0,0,enu,enu);
00097   
00098     // pick position
00099     Double_t x = fRandom->Uniform(fXlo,fXhi);
00100     Double_t y = fRandom->Uniform(fYlo,fYhi);
00101     Double_t z = 0.;        
00102     Double_t t = 0.;
00103     TLorentzVector v(x,y,z,t);
00104 
00105     return TParticle(fPDGFlavor,1,-1,-1,-1,-1,p,v);
00106 } 

std::vector< int > FluxGen_OneOverE::GetParticleList (  )  const [virtual]

Report the list of potential particles that might be returned.

Implements FluxGenerator.

Definition at line 109 of file FluxGen_OneOverE.cxx.

References fPDGFlavor, Msg::kDebug, and MSG.

00110 {
00111     MSG("EvtKin",Msg::kDebug) << "FluxGen_OneOverE::GetParticleList()" << endl;
00112 
00113     std::vector<int> plist;
00114     plist.push_back(fPDGFlavor);
00115 
00116     return plist;
00117 } 


Member Data Documentation

Double_t FluxGen_OneOverE::fEmax [private]

Definition at line 49 of file FluxGen_OneOverE.h.

Referenced by Configure(), GetMaxEnergy(), and GetParticle().

Double_t FluxGen_OneOverE::fEmin [private]

Definition at line 48 of file FluxGen_OneOverE.h.

Referenced by Configure(), and GetParticle().

Definition at line 47 of file FluxGen_OneOverE.h.

Referenced by Configure(), GetParticle(), and GetParticleList().

TRandom* FluxGen_OneOverE::fRandom [private]

Definition at line 46 of file FluxGen_OneOverE.h.

Referenced by Configure(), GetParticle(), and ~FluxGen_OneOverE().

Double_t FluxGen_OneOverE::fXhi [private]

Definition at line 51 of file FluxGen_OneOverE.h.

Referenced by Configure(), and GetParticle().

Double_t FluxGen_OneOverE::fXlo [private]

Definition at line 50 of file FluxGen_OneOverE.h.

Referenced by Configure(), and GetParticle().

Double_t FluxGen_OneOverE::fYhi [private]

Definition at line 53 of file FluxGen_OneOverE.h.

Referenced by Configure(), and GetParticle().

Double_t FluxGen_OneOverE::fYlo [private]

Definition at line 52 of file FluxGen_OneOverE.h.

Referenced by Configure(), and GetParticle().


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

Generated on 22 Nov 2017 for loon by  doxygen 1.6.1