NuTransport Class Reference

A black box for generating nu interaction in a geometry. More...

#include <NuTransport.h>

List of all members.

Public Member Functions

 NuTransport ()
virtual ~NuTransport ()
void GenerateEvent ()
TClonesArray * CreateStdHepList ()
FluxGeneratorAdopt (FluxGenerator *flux)
FlavorModifierAdopt (FlavorModifier *flavor)
InteractionGeneratorAdopt (InteractionGenerator *inter)
void Set (TGeoManager *geom)

Private Attributes

FluxGeneratorfFluxGen
FlavorModifierfFlavorMod
InteractionGeneratorfInterGen
TGeoManager * fGeometry

Detailed Description

A black box for generating nu interaction in a geometry.

Author:
(last to touch it)
Author
rhatcher
Version:
Revision
1.3
Date:
Date
2006/06/06 05:06:26

Contact: rhatcher@fnal.gov

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

Id
NuTransport.h,v 1.3 2006/06/06 05:06:26 rhatcher Exp

Definition at line 33 of file NuTransport.h.


Constructor & Destructor Documentation

NuTransport::NuTransport (  ) 

Definition at line 13 of file NuTransport.cxx.

References Msg::kDebug, and MSG.

00014   : fFluxGen(0), fFlavorMod(0), fInterGen(0), fGeometry(0)
00015 {
00016     MSG("EvtKin",Msg::kDebug)
00017         << "NuTransport ctor" << endl;
00018 }

NuTransport::~NuTransport (  )  [virtual]

Definition at line 22 of file NuTransport.cxx.

References fFlavorMod, fFluxGen, fInterGen, Msg::kDebug, and MSG.

00023 {
00024     MSG("EvtKin",Msg::kDebug)
00025         << "NuTransport dtor" << endl;
00026 
00027     if (fFluxGen)   delete fFluxGen;
00028     if (fFlavorMod) delete fFlavorMod;
00029     if (fInterGen)  delete fInterGen;
00030 }


Member Function Documentation

InteractionGenerator * NuTransport::Adopt ( InteractionGenerator inter  ) 

Definition at line 102 of file NuTransport.cxx.

References fInterGen.

00103 {
00104     // Adopt new flux generator, return old one
00105     InteractionGenerator* old = fInterGen;
00106     fInterGen = inter;
00107     return old;
00108 }

FlavorModifier * NuTransport::Adopt ( FlavorModifier flavor  ) 

Definition at line 94 of file NuTransport.cxx.

References fFlavorMod.

00095 {
00096     // Adopt new flavor modifier, return old one
00097     FlavorModifier* old = fFlavorMod;
00098     fFlavorMod = flavor;
00099     return old;
00100 }

FluxGenerator * NuTransport::Adopt ( FluxGenerator flux  ) 

Definition at line 86 of file NuTransport.cxx.

References fFluxGen.

Referenced by EvtKinNuModule::BeginJob().

00087 {
00088     // Adopt new flux generator, return old one
00089     FluxGenerator* old = fFluxGen;
00090     fFluxGen = flux;
00091     return old;
00092 }

TClonesArray * NuTransport::CreateStdHepList (  ) 

Definition at line 73 of file NuTransport.cxx.

References fInterGen, InteractionGenerator::GetGeneratedParticle(), and InteractionGenerator::GetNumParticles().

Referenced by EvtKinNuModule::Get().

00074 {
00075     // Create a TClonesArray of TParticles from the generator
00076     unsigned int npart = fInterGen->GetNumParticles();
00077     TClonesArray* stdheplist = new TClonesArray("TParticle",npart);
00078     stdheplist->SetName("StdHep");
00079     for (unsigned int ipart = 0; ipart < npart; ++ipart) {
00080         TParticle p = fInterGen->GetGeneratedParticle(ipart);
00081         new((*stdheplist)[ipart]) TParticle(p);
00082     }
00083     return stdheplist;
00084 }

void NuTransport::GenerateEvent (  ) 

Definition at line 33 of file NuTransport.cxx.

References InteractionGenerator::CalcXsec(), fFlavorMod, fFluxGen, fInterGen, InteractionGenerator::Generate(), FluxGenerator::GetParticle(), Msg::kDebug, Msg::kWarning, StdHepUtil::makeIonPDG(), FlavorModifier::ModifyFlavor(), and MSG.

Referenced by EvtKinNuModule::Get().

00034 {
00035     // Generate an event
00036 
00037     // ... original particle from flux generator
00038     TParticle nu_origin = fFluxGen->GetParticle();
00039     // ... flavor mod ..
00040     double distance = 0;
00041     TParticle nu_flvmod = fFlavorMod->ModifyFlavor(nu_origin,distance);
00042     // ... transport ... for now punt
00043     TParticle nu_atvtx = nu_flvmod;
00044 
00045     TDatabasePDG* pdgdb = TDatabasePDG::Instance();
00046 
00047     // target
00048     int ia = 56, iz = 26, ij = 0;
00049     int ipdg_tgt = StdHepUtil::makeIonPDG(ia,iz,ij);
00050     TParticlePDG* partpdg = pdgdb->GetParticle(ipdg_tgt);
00051     double tgt_mass = 0;
00052     if (!partpdg) {
00053         MSG("EvtKin",Msg::kWarning)
00054             << "No particle info for PDG=" << ipdg_tgt << endl;
00055     } else {
00056         tgt_mass = partpdg->Mass();
00057     }
00058 
00059     TLorentzVector p4tgt(0,0,0,tgt_mass);
00060     TLorentzVector xyzt;
00061     nu_atvtx.ProductionVertex(xyzt);
00062     TParticle tgt(ipdg_tgt,1,-1,-1,-1,-1,p4tgt,xyzt);
00063 
00064     double xsec = fInterGen->CalcXsec(nu_atvtx,tgt);
00065     MSG("EvtKin",Msg::kDebug)
00066       << nu_atvtx.GetPDG()->GetName() << " " << nu_atvtx.Energy()
00067       << " + " 
00068       << tgt.GetPDG()->GetName() << " sigma " << xsec << endl;
00069 
00070     fInterGen->Generate(nu_atvtx,tgt);
00071 }

void NuTransport::Set ( TGeoManager *  geom  ) 

Definition at line 110 of file NuTransport.cxx.

References fGeometry.

Referenced by EvtKinNuModule::BeginJob().

00111 {
00112     // Set the geometry to use
00113     fGeometry = geo;
00114 }


Member Data Documentation

Definition at line 50 of file NuTransport.h.

Referenced by Adopt(), GenerateEvent(), and ~NuTransport().

Definition at line 49 of file NuTransport.h.

Referenced by Adopt(), GenerateEvent(), and ~NuTransport().

TGeoManager* NuTransport::fGeometry [private]

Definition at line 52 of file NuTransport.h.

Referenced by Set().

Definition at line 51 of file NuTransport.h.

Referenced by Adopt(), CreateStdHepList(), GenerateEvent(), and ~NuTransport().


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

Generated on 22 Nov 2017 for loon by  doxygen 1.6.1