GENIEGenerator
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Functions | Variables
gT2KEvGen.cxx File Reference
#include <cassert>
#include <cstdlib>
#include <string>
#include <sstream>
#include <vector>
#include <map>
#include <TSystem.h>
#include <TTree.h>
#include <TFile.h>
#include <TH1D.h>
#include <TMath.h>
#include <TGeoVolume.h>
#include <TGeoShape.h>
#include <TList.h>
#include <TObject.h>
#include "Framework/Conventions/Units.h"
#include "Framework/EventGen/EventRecord.h"
#include "Framework/EventGen/GFluxI.h"
#include "Framework/EventGen/GMCJDriver.h"
#include "Framework/EventGen/GMCJMonitor.h"
#include "Framework/Messenger/Messenger.h"
#include "Framework/Ntuple/NtpWriter.h"
#include "Framework/ParticleData/PDGLibrary.h"
#include "Framework/ParticleData/PDGCodes.h"
#include "Framework/ParticleData/PDGCodeList.h"
#include "Framework/Ntuple/NtpMCFormat.h"
#include "Framework/Numerical/RandomGen.h"
#include "Framework/Utils/XSecSplineList.h"
#include "Framework/Utils/StringUtils.h"
#include "Framework/Utils/UnitUtils.h"
#include "Framework/Utils/AppInit.h"
#include "Framework/Utils/RunOpt.h"
#include "Framework/Utils/CmdLnArgParser.h"
#include "Framework/Utils/T2KEvGenMetaData.h"
#include "Framework/Utils/SystemUtils.h"
#include "Framework/Utils/PrintUtils.h"
Include dependency graph for gT2KEvGen.cxx:

Go to the source code of this file.

Functions

void GetCommandLineArgs (int argc, char **argv)
 
void PrintSyntax (void)
 
int main (int argc, char **argv)
 

Variables

string kDefOptGeomLUnits = "mm"
 
string kDefOptGeomDUnits = "g_cm3"
 
NtpMCFormat_t kDefOptNtpFormat = kNFGHEP
 
double kDefOptFluxNorm = 1E+21
 
string kDefOptEvFilePrefix = "gntp"
 
Long_t gOptRunNu
 
bool gOptUsingRootGeom = false
 
bool gOptUsingHistFlux = false
 
map< int, double > gOptTgtMix
 
map< int, TH1D * > gOptFluxHst
 
string gOptRootGeom
 
string gOptRootGeomTopVol = ""
 
double gOptGeomLUnits = 0
 
double gOptGeomDUnits = 0
 
string gOptExtMaxPlXml
 
string gOptFluxFile
 
string gOptDetectorLocation
 
double gOptFluxNorm
 
PDGCodeList gOptFluxNtpNuList (false)
 
int gOptFluxNCycles
 
int gOptNev
 
double gOptPOT
 
bool gOptExitAtEndOfFullFluxCycles
 
string gOptEvFilePrefix
 
bool gOptUseFluxProbs = false
 
bool gOptSaveFluxProbsFile = false
 
string gOptFluxProbFileName
 
string gOptSaveFluxProbsFileName
 
bool gOptRandomFluxOffset = false
 
long int gOptRanSeed
 
string gOptInpXSecFile
 

Function Documentation

void GetCommandLineArgs ( int  argc,
char **  argv 
)
int main ( int  argc,
char **  argv 
)

Definition at line 524 of file gT2KEvGen.cxx.

References genie::flux::GCylindTH1Flux::AddEnergySpectrum(), genie::NtpWriter::AddEventRecord(), genie::RunOpt::BuildTune(), genie::utils::app_init::CacheFile(), genie::GMCJDriver::Configure(), genie::NtpWriter::CustomizeFilenamePrefix(), genie::flux::GJPARCNuFlux::DisableOffset(), genie::flux::GJPARCNuFlux::End(), genie::NtpWriter::EventTree(), genie::GMCJDriver::ForceSingleProbScale(), genie::GMCJDriver::GenerateEvent(), GetCommandLineArgs(), genie::geometry::ROOTGeomAnalyzer::GetGeometry(), genie::GMCJDriver::GlobProbScale(), gOptDetectorLocation, gOptEvFilePrefix, gOptExitAtEndOfFullFluxCycles, gOptExtMaxPlXml, gOptFluxFile, gOptFluxHst, gOptFluxNCycles, gOptFluxNorm, gOptFluxNtpNuList, gOptFluxProbFileName, gOptGeomDUnits, gOptGeomLUnits, gOptInpXSecFile, gOptNev, gOptPOT, gOptRandomFluxOffset, gOptRanSeed, gOptRootGeom, gOptRootGeomTopVol, gOptRunNu, gOptSaveFluxProbsFile, gOptSaveFluxProbsFileName, gOptTgtMix, gOptUseFluxProbs, gOptUsingHistFlux, gOptUsingRootGeom, genie::NtpWriter::Initialize(), genie::RunOpt::Instance(), kDefOptNtpFormat, genie::geometry::ROOTGeomAnalyzer::LengthUnits(), genie::flux::GJPARCNuFlux::LoadBeamSimData(), genie::GMCJDriver::LoadFluxProbabilities(), LOG, genie::utils::app_init::MesgThresholds(), genie::flux::GJPARCNuFlux::PassThroughInfo(), pERROR, pFATAL, pINFO, pNOTICE, genie::flux::GJPARCNuFlux::POT_1cycle(), genie::flux::GJPARCNuFlux::POT_curravg(), genie::GMCJDriver::PreCalcFluxProbabilities(), genie::utils::app_init::RandGen(), genie::utils::geometry::RecursiveExhaust(), genie::NtpWriter::Save(), genie::GMCJDriver::SaveFluxProbabilities(), genie::flux::GCylindTH1Flux::SetBeamSpot(), genie::GMCJDriver::SetEventGeneratorList(), genie::flux::GJPARCNuFlux::SetFilePOT(), genie::flux::GJPARCNuFlux::SetFluxParticles(), genie::flux::GCylindTH1Flux::SetNuDirection(), genie::flux::GJPARCNuFlux::SetNumOfCycles(), genie::GHepRecord::SetPrintLevel(), genie::GMCJMonitor::SetRefreshRate(), genie::flux::GCylindTH1Flux::SetTransverseRadius(), genie::flux::GJPARCNuFlux::SetUpstreamZ(), genie::GMCJDriver::SumFluxIntProbs(), genie::GMCJMonitor::Update(), genie::GMCJDriver::UseFluxDriver(), genie::GMCJDriver::UseGeomAnalyzer(), genie::GMCJDriver::UseMaxPathLengths(), genie::GMCJDriver::UseSplines(), and genie::utils::app_init::XSecTable().

525 {
526  // Parse command line arguments
527  GetCommandLineArgs(argc,argv);
528 
529 
530  if ( ! RunOpt::Instance()->Tune() ) {
531  LOG("gmkspl", pFATAL) << " No TuneId in RunOption";
532  exit(-1);
533  }
534  RunOpt::Instance()->BuildTune();
535 
536  // Initialization of random number generators, cross-section table,
537  // messenger thresholds, cache file
538  utils::app_init::MesgThresholds(RunOpt::Instance()->MesgThresholdFiles());
539  utils::app_init::CacheFile(RunOpt::Instance()->CacheFile());
542 
543  // Set GHEP print level
544  GHepRecord::SetPrintLevel(RunOpt::Instance()->EventRecordPrintLevel());
545 
546  // *************************************************************************
547  // * Create / configure the geometry driver
548  // *************************************************************************
549  GeomAnalyzerI * geom_driver = 0;
550  double zmin=0, zmax=0;
551 
552  if(gOptUsingRootGeom) {
553  //
554  // *** Using a realistic root-based detector geometry description
555  //
556 
557  // creating & configuring a root geometry driver
560  rgeom -> SetLengthUnits (gOptGeomLUnits);
561  rgeom -> SetDensityUnits (gOptGeomDUnits);
562  // getting the bounding box dimensions, before setting topvolume,
563  // along z so as to set the appropriate upstream generation surface
564  // for the JPARC flux driver
565  TGeoVolume * topvol = rgeom->GetGeometry()->GetTopVolume();
566  TGeoShape * bounding_box = topvol->GetShape();
567  bounding_box->GetAxisRange(3, zmin, zmax);
568  zmin *= rgeom->LengthUnits();
569  zmax *= rgeom->LengthUnits();
570  // now update to the requested topvolume for use in recursive exhaust method
571  rgeom -> SetTopVolName (gOptRootGeomTopVol);
572  topvol = rgeom->GetGeometry()->GetTopVolume();
573  if(!topvol) {
574  LOG("gevgen_t2k", pFATAL) << "Null top ROOT geometry volume!";
575  exit(1);
576  }
577  // switch on/off volumes as requested
578  if ( (gOptRootGeomTopVol[0] == '+') || (gOptRootGeomTopVol[0] == '-') ) {
579  bool exhaust = (*gOptRootGeomTopVol.c_str() == '+');
581  }
582 
583  // casting to the GENIE geometry driver interface
584  geom_driver = dynamic_cast<GeomAnalyzerI *> (rgeom);
585  }
586  else {
587  //
588  // *** Using a 'point' geometry with the specified target mix
589  // *** ( = a list of targets with their corresponding weight fraction)
590  //
591 
592  // creating & configuring a point geometry driver
595  // casting to the GENIE geometry driver interface
596  geom_driver = dynamic_cast<GeomAnalyzerI *> (pgeom);
597  }
598 
599  // *************************************************************************
600  // * Create / configure the flux driver
601  // *************************************************************************
602  GFluxI * flux_driver = 0;
603 
604  flux::GJPARCNuFlux * jparc_flux_driver = 0;
605  flux::GCylindTH1Flux * hst_flux_driver = 0;
606 
607  if(!gOptUsingHistFlux) {
608  //
609  // *** Using the detailed JPARC neutrino flux desription by feeding-in
610  // *** the JNUBEAM flux simulation ntuples
611  //
612 
613  // creating JPARC neutrino flux driver
614  jparc_flux_driver = new flux::GJPARCNuFlux;
615  // before loading the beam sim data set whether to use a random offset when looping
616  if(gOptRandomFluxOffset == false) jparc_flux_driver->DisableOffset();
617  // specify input JNUBEAM file & detector location
618  bool beam_sim_data_success = jparc_flux_driver->LoadBeamSimData(gOptFluxFile, gOptDetectorLocation);
619  if(!beam_sim_data_success) {
620  LOG("gevgen_t2k", pFATAL)
621  << "The flux driver has not been properly configured. Exiting";
622  exit(1);
623  }
624  // specify JNUBEAM normalization
625  jparc_flux_driver->SetFilePOT(gOptFluxNorm);
626  // specify upstream generation surface
627  jparc_flux_driver->SetUpstreamZ(zmin);
628  // specify which flavours to consider -
629  // if no neutrino list was specified then the MC job will consider all flavours
630  if( gOptFluxNtpNuList.size() > 0 ) {
631  jparc_flux_driver->SetFluxParticles(gOptFluxNtpNuList);
632  }
633 
634  // casting to the GENIE flux driver interface
635  flux_driver = dynamic_cast<GFluxI *> (jparc_flux_driver);
636  }
637  else {
638  //
639  // *** Using fluxes from histograms (for all specified neutrino species)
640  //
641 
642  // creating & configuring a generic GCylindTH1Flux flux driver
643  TVector3 bdir (0,0,1); // dir along +z
644  TVector3 bspot(0,0,0);
645  hst_flux_driver = new flux::GCylindTH1Flux;
646  hst_flux_driver->SetNuDirection (bdir);
647  hst_flux_driver->SetBeamSpot (bspot);
648  hst_flux_driver->SetTransverseRadius (-1);
649  map<int,TH1D*>::iterator it = gOptFluxHst.begin();
650  for( ; it != gOptFluxHst.end(); ++it) {
651  int pdg_code = it->first;
652  TH1D * spectrum = new TH1D(*(it->second));
653  hst_flux_driver->AddEnergySpectrum(pdg_code, spectrum);
654  }
655  // casting to the GENIE flux driver interface
656  flux_driver = dynamic_cast<GFluxI *> (hst_flux_driver);
657  }
658 
659  // *************************************************************************
660  // * Create/configure the event generation driver
661  // *************************************************************************
662  GMCJDriver * mcj_driver = new GMCJDriver;
663  mcj_driver->SetEventGeneratorList(RunOpt::Instance()->EventGeneratorList());
664  mcj_driver->UseFluxDriver(flux_driver);
665  mcj_driver->UseGeomAnalyzer(geom_driver);
666  mcj_driver->UseMaxPathLengths(gOptExtMaxPlXml);
667  // do not calculate probability scales if using pre-generated flux probs
668  bool calc_prob_scales = (gOptSaveFluxProbsFile || gOptUseFluxProbs) ? false : true;
669  mcj_driver->Configure(calc_prob_scales);
670  mcj_driver->UseSplines();
671  mcj_driver->ForceSingleProbScale();
672 
673  // *************************************************************************
674  // * If specified use pre-calculated flux interaction probabilities instead
675  // * of preselecting based on max path lengths
676  // *************************************************************************
677 
679 
680  bool success = false;
681 
682  // set flux probs output file name
684  // default output name is ${FLUFILENAME}.${TOPVOL}.flxprobs.root
685  string basename = gOptFluxFile.substr(gOptFluxFile.rfind("/")+1);
686  string name = basename.substr(0, basename.rfind("."));
687  if(gOptRootGeomTopVol.length()>0)
688  name += "."+gOptRootGeomTopVol+".flxprobs.root";
689  else
690  name += ".master.flxprobs.root";
691  // if specified override with cmd line option
693  // Tell the driver save pre-generated probabilities to an output file
694  mcj_driver->SaveFluxProbabilities(name);
695  }
696 
697  // Either load pre-generated flux probabilities
698  if(gOptFluxProbFileName.size() > 0){
699  success = mcj_driver->LoadFluxProbabilities(gOptFluxProbFileName);
700  }
701  // Or pre-calculate them
702  else success = mcj_driver->PreCalcFluxProbabilities();
703 
704  if(success){
705  LOG("gevgen_t2k", pNOTICE)
706  << "Successfully calculated/loaded flux interaction probabilities!";
707  // Print out a list of expected number of events per POT and per cycle
708  // based on the pre-generated flux interaction probabilities
709  map<int, double> sum_probs_map = mcj_driver->SumFluxIntProbs();
710  map<int, double>::const_iterator sum_probs_it = sum_probs_map.begin();
711  double ntot_per_pot = 0.0;
712  double ntot_per_cycle = 0.0;
713  double pscale = mcj_driver->GlobProbScale();
714  double pot_1cycle = jparc_flux_driver->POT_1cycle();
715  LOG("T2KProdInfo", pNOTICE) <<
716  "Expected event rates based on flux interaction probabilities:";
717  for(; sum_probs_it != sum_probs_map.end(); sum_probs_it++){
718  double sum_probs = sum_probs_it->second;
719  double nevts_per_cycle = sum_probs / pscale; // take into account rescale
720  double nevts_per_pot = sum_probs/pot_1cycle; // == (sum_probs*pscale)/(pot_1cycle*pscale)
721  ntot_per_pot += nevts_per_pot;
722  ntot_per_cycle += nevts_per_cycle;
723  LOG("T2KProdInfo", pNOTICE) <<
724  " PDG "<< sum_probs_it->first << ": " << nevts_per_cycle <<
725  " Events/Cycle, "<< nevts_per_pot << " Events/POT";
726  }
727  LOG("T2KProdInfo", pNOTICE) << " -----------";
728  LOG("T2KProdInfo", pNOTICE) <<
729  " All neutrino species: " << ntot_per_cycle <<
730  " Events/Cycle, "<< ntot_per_pot << " Events/POT";
731  LOG("T2KProdInfo", pNOTICE) <<
732  "N.B. This assumes input flux file corresponds to "<< pot_1cycle <<
733  "POT, ensure this is correct if using these numbers!";
734  }
735  else {
736  LOG("gevgen_t2k", pFATAL)
737  << "Failed to calculated/loaded flux interaction probabilities!";
738  return 1;
739  }
740 
741  // Exit now if just pre-generating interaction probabilities
743  LOG("gevgen_t2k", pNOTICE)
744  << "Will not generate events - just pre-calculating flux interaction"
745  << "probabilities";
746  return 0;
747  }
748  } // Pre-calculated flux interaction probabilities
749 
750  // *************************************************************************
751  // * Work out number of cycles for current exposure settings
752  // *************************************************************************
753 
754  if(!gOptUsingHistFlux) {
755  // If a number of POT was requested, then work out how many flux ntuple
756  // cycles are required for accumulating those statistics
757  if(gOptPOT>0) {
758  double fpot_1c = jparc_flux_driver->POT_1cycle(); // flux POT / cycle
759  double psc = mcj_driver->GlobProbScale(); // interaction prob. scale
760  double pot_1c = fpot_1c / psc; // actual POT / cycle
761  int ncycles = (int) TMath::Max(1., TMath::Ceil(gOptPOT/pot_1c));
762 
763  LOG("gevgen_t2k", pNOTICE)
764  << " *** POT/cycle: " << pot_1c;
765  LOG("gevgen_t2k", pNOTICE)
766  << " *** Requested POT will be accumulated in: "
767  << ncycles << " flux ntuple cycles";
768 
769  jparc_flux_driver->SetNumOfCycles(ncycles);
770  }
771  // If a number of events was requested, then set the number of flux
772  // ntuple cycles to 'infinite'
773  else if(gOptNev>0) {
774  jparc_flux_driver->SetNumOfCycles(0);
775  }
776  // Just set the number of cycles to the requested value
777  else {
778  jparc_flux_driver->SetNumOfCycles(gOptFluxNCycles);
779  }
780  }
781 
782  // *************************************************************************
783  // * Prepare for writing the output event tree & status file
784  // *************************************************************************
785 
786  // Initialize an Ntuple Writer to save GHEP records into a TTree
788  ntpw.CustomizeFilenamePrefix(gOptEvFilePrefix);
789  ntpw.Initialize();
790 
791  // Add a custom-branch at the standard GENIE event tree so that
792  // info on the flux neutrino parent particle can be passed-through
793  flux::GJPARCNuFluxPassThroughInfo * flux_info = 0;
794  if(!gOptUsingHistFlux) {
795  TBranch * flux = ntpw.EventTree()->Branch("flux",
796  "genie::flux::GJPARCNuFluxPassThroughInfo", &flux_info, 32000, 1);
797  assert(flux);
798  flux->SetAutoDelete(kFALSE);
799  }
800 
801  // Create a MC job monitor for a periodically updated status file
802  GMCJMonitor mcjmonitor(gOptRunNu);
803  mcjmonitor.SetRefreshRate(RunOpt::Instance()->MCJobStatusRefreshRate());
804 
805  // *************************************************************************
806  // * Event generation loop
807  // *************************************************************************
808 
809  int ievent = 0;
810  while (1)
811  {
812  LOG("gevgen_t2k", pNOTICE)
813  << " *** Generating event............ " << ievent;
814 
815  // In case the required statistics was expressed as 'number of events'
816  // then quit if that number has been generated
817  if(ievent == gOptNev) break;
818 
819  // In case the required statistics was expressed as 'number of POT' and
820  // the user does not want to wait till the end of the flux cycle to exit
821  // the event loop, then quit if the requested POT has been generated.
822  // In this case the computed POT may not be as accurate as if the program
823  // was waiting for the current flux cycle to be completed.
825  double fpot = jparc_flux_driver->POT_curravg(); // current POT in flux file
826  double psc = mcj_driver->GlobProbScale(); // interaction prob. scale
827  double pot = fpot / psc; // POT for generated sample
828  if(pot >= gOptPOT) break;
829  }
830 
831  // Generate a single event using neutrinos coming from the specified flux
832  // and hitting the specified geometry or target mix
833  EventRecord * event = mcj_driver->GenerateEvent();
834 
835  // Check whether a null event was returned due to the flux driver reaching
836  // the end of the input flux ntuple - exit the event generation loop
837  if(!event && jparc_flux_driver->End()) {
838  LOG("gevgen_t2k", pNOTICE)
839  << "** The JPARC flux driver read all the input flux ntuple entries";
840  break;
841  }
842  if(!event) {
843  LOG("gevgen_t2k", pERROR)
844  << "Got a null generated neutino event! Retrying ...";
845  continue;
846  }
847  LOG("gevgen_t2k", pINFO)
848  << "Generated event: " << *event;
849 
850  // A valid event was generated: extract flux info (parent decay/prod
851  // position/kinematics) for that simulated event so that it can be
852  // passed-through.
853  // Can only do so if I am generating events using the JNUBEAM flux
854  // ntuples, not simple histograms
855  if(!gOptUsingHistFlux) {
856  flux_info = new flux::GJPARCNuFluxPassThroughInfo(
857  jparc_flux_driver->PassThroughInfo());
858  LOG("gevgen_t2k", pINFO)
859  << "Pass-through flux info associated with generated event: "
860  << *flux_info;
861  }
862 
863  // Add event at the output ntuple, refresh the mc job monitor & clean-up
864  ntpw.AddEventRecord(ievent, event);
865  mcjmonitor.Update(ievent,event);
866  delete event;
867  if(flux_info) delete flux_info;
868  ievent++;
869  } //1
870 
871  LOG("gevgen_t2k", pNOTICE)
872  << "The GENIE MC job is done generaing events - Cleaning up & exiting...";
873 
874  // *************************************************************************
875  // * Print job statistics &
876  // * calculate normalization factor for the generated sample
877  // *************************************************************************
879  {
880  // POT normalization will only be calculated if event generation was based
881  // on beam simulation outputs (not just histograms) & a detailed detector
882  // geometry description.
883  double fpot = jparc_flux_driver->POT_curravg(); // current POT in flux file
884  double psc = mcj_driver->GlobProbScale(); // interaction prob. scale
885  double pot = fpot / psc; // POT for generated sample
886  // Get nunber of flux neutrinos read-in by flux friver, number of flux
887  // neutrinos actually thrown to the event generation driver and number
888  // of neutrino interactions actually generated
889  long int nflx_evg = mcj_driver -> NFluxNeutrinos();
890  long int nflx = jparc_flux_driver -> NFluxNeutrinos();
891  long int nev = ievent;
892 
893  LOG("gevgen_t2k", pNOTICE)
894  << "\n >> Actual JNUBEAM flux file normalization: " << fpot
895  << " POT * " << ((gOptDetectorLocation == "sk") ? "cm^2" : "det")
896  << "\n >> Interaction probability scaling factor: " << psc
897  << "\n >> N of flux v read-in by flux driver: " << nflx
898  << "\n >> N of flux v thrown to event gen driver: " << nflx_evg
899  << "\n >> N of generated v interactions: " << nev
900  << "\n ** Normalization for generated sample: " << pot
901  << " POT * " << ((gOptDetectorLocation == "sk") ? "cm^2" : "det");
902 
903  ntpw.EventTree()->SetWeight(pot); // POT
904  }
905 
906  // *************************************************************************
907  // * MC job meta-data
908  // *************************************************************************
909 
911 
912  metadata -> jnubeam_file = gOptFluxFile;
913  metadata -> detector_location = gOptDetectorLocation;
914  metadata -> geom_file = gOptRootGeom;
915  metadata -> geom_top_volume = gOptRootGeomTopVol;
916  metadata -> geom_length_units = gOptGeomLUnits;
917  metadata -> geom_density_units = gOptGeomDUnits;
918  metadata -> using_root_geom = gOptUsingRootGeom;
919  metadata -> target_mix = gOptTgtMix;
920  metadata -> using_hist_flux = gOptUsingHistFlux;
921  metadata -> flux_hists = gOptFluxHst;
922 
923  ntpw.EventTree()->GetUserInfo()->Add(metadata);
924 
925  // *************************************************************************
926  // * Save & clean-up
927  // *************************************************************************
928 
929  // Save the generated event tree & close the output file
930  ntpw.Save();
931 
932  // Clean-up
933  delete geom_driver;
934  delete flux_driver;
935  delete mcj_driver;
936  map<int,TH1D*>::iterator it = gOptFluxHst.begin();
937  for( ; it != gOptFluxHst.end(); ++it) {
938  TH1D * spectrum = it->second;
939  if(spectrum) delete spectrum;
940  }
941  gOptFluxHst.clear();
942 
943  LOG("gevgen_t2k", pNOTICE) << "Done!";
944 
945  return 0;
946 }
void RandGen(long int seed)
Definition: AppInit.cxx:30
double gOptFluxNorm
Definition: gT2KEvGen.cxx:508
double POT_curravg(void)
current average POT
void XSecTable(string inpfile, bool require_table)
Definition: AppInit.cxx:38
bool PreCalcFluxProbabilities(void)
Definition: GMCJDriver.cxx:192
map< int, double > SumFluxIntProbs(void) const
Definition: GMCJDriver.h:78
string gOptEvFilePrefix
Definition: gAtmoEvGen.cxx:310
bool LoadBeamSimData(string filename, string det_loc)
load a jnubeam root flux ntuple
bool End(void)
true if no more flux nu&#39;s can be thrown (eg reaching end of beam sim ntuples)
Definition: GJPARCNuFlux.h:66
#define pERROR
Definition: Messenger.h:59
void SetUpstreamZ(double z0)
set flux neutrino initial z position (upstream of the detector)
void SetEventGeneratorList(string listname)
Definition: GMCJDriver.cxx:66
double POT_1cycle(void)
flux POT per cycle
#define pFATAL
Definition: Messenger.h:56
double gOptGeomDUnits
Definition: gAtmoEvGen.cxx:303
string gOptDetectorLocation
map< int, double > gOptTgtMix
Definition: gAtmoEvGen.cxx:299
void SetFluxParticles(const PDGCodeList &particles)
specify list of flux neutrino species
string gOptFluxProbFileName
Definition: gT2KEvGen.cxx:517
A GENIE flux driver encapsulating the JPARC neutrino flux. It reads-in the official JPARC neutrino fl...
Definition: GJPARCNuFlux.h:50
void UseFluxDriver(GFluxI *flux)
Definition: GMCJDriver.cxx:83
bool gOptRandomFluxOffset
Definition: gT2KEvGen.cxx:519
Simple class to create &amp; update MC job status files and env. vars. This is used to be able to keep tr...
Definition: GMCJMonitor.h:31
A GENIE `MC Job Driver&#39;. Can be used for setting up complicated event generation cases involving deta...
Definition: GMCJDriver.h:46
double GlobProbScale(void) const
Definition: GMCJDriver.h:76
string gOptInpXSecFile
Definition: gAtmoEvGen.cxx:313
#define LOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a string (using the FILE...
Definition: Messenger.h:96
string gOptRootGeomTopVol
Definition: gAtmoEvGen.cxx:301
void ForceSingleProbScale(void)
Definition: GMCJDriver.cxx:172
void SetFilePOT(double pot)
flux file norm is in /N POT/det [ND] or /N POT/cm^2 [FD]. Specify N (typically 1E+21) ...
virtual double LengthUnits(void) const
A generic GENIE flux driver. Generates a &#39;cylindrical&#39; neutrino beam along the input direction...
bool gOptUseFluxProbs
Definition: gT2KEvGen.cxx:515
bool UseMaxPathLengths(string xml_filename)
Definition: GMCJDriver.cxx:99
int gOptNev
Definition: gAtmoEvGen.cxx:305
void Configure(bool calc_prob_scales=true)
Definition: GMCJDriver.cxx:399
A ROOT/GEANT4 geometry driver.
#define pINFO
Definition: Messenger.h:62
void SetTransverseRadius(double Rt)
void DisableOffset(void)
switch off random offset, must be called before LoadBeamSimData to have any effect ...
Definition: GJPARCNuFlux.h:83
void SetNuDirection(const TVector3 &direction)
string gOptRootGeom
Definition: gAtmoEvGen.cxx:300
PDGCodeList gOptFluxNtpNuList(false)
string gOptSaveFluxProbsFileName
Definition: gT2KEvGen.cxx:518
EventRecord * GenerateEvent(void)
Definition: GMCJDriver.cxx:815
Long_t gOptRunNu
Definition: gAtmoEvGen.cxx:295
Generated Event Record. It is a GHepRecord object that can accept / be visited by EventRecordVisitorI...
Definition: EventRecord.h:37
bool gOptSaveFluxProbsFile
Definition: gT2KEvGen.cxx:516
A utility class to facilitate creating the GENIE MC Ntuple from the output GENIE GHEP event records...
Definition: NtpWriter.h:39
int gOptFluxNCycles
Definition: gT2KEvGen.cxx:510
string gOptFluxFile
bool LoadFluxProbabilities(string filename)
Definition: GMCJDriver.cxx:343
void SetNumOfCycles(int n)
set how many times to cycle through the ntuple (default: 1 / n=0 means &#39;infinite&#39;) ...
NtpMCFormat_t kDefOptNtpFormat
Definition: gAtmoEvGen.cxx:319
A vector of EventGeneratorI objects.
void SetBeamSpot(const TVector3 &spot)
void MesgThresholds(string inpfile)
Definition: AppInit.cxx:99
void AddEnergySpectrum(int nu_pdgc, TH1D *spectrum)
Utility class to store MC job meta-data.
#define pNOTICE
Definition: Messenger.h:61
bool gOptExitAtEndOfFullFluxCycles
Definition: gT2KEvGen.cxx:513
void GetCommandLineArgs(int argc, char **argv)
Definition: gAtmoEvGen.cxx:563
double gOptPOT
Defines the GENIE Geometry Analyzer Interface.
Definition: GeomAnalyzerI.h:29
void RecursiveExhaust(TGeoVolume *topvol, string volnames, bool exhaust)
Definition: GeoUtils.cxx:16
double gOptGeomLUnits
Definition: gAtmoEvGen.cxx:302
void UseGeomAnalyzer(GeomAnalyzerI *geom)
Definition: GMCJDriver.cxx:88
void UseSplines(bool useLogE=true)
Definition: GMCJDriver.cxx:93
The PointGeomAnalyzer class is the simplest implementation of the GeomAnalyserI interface and defines...
void CacheFile(string inpfile)
Definition: AppInit.cxx:117
void SaveFluxProbabilities(string outfilename)
Definition: GMCJDriver.cxx:390
string gOptExtMaxPlXml
Definition: gAtmoEvGen.cxx:304
const GJPARCNuFluxPassThroughInfo & PassThroughInfo(void)
GJPARCNuFluxPassThroughInfo.
Definition: GJPARCNuFlux.h:92
bool gOptUsingRootGeom
Definition: gAtmoEvGen.cxx:298
map< int, TH1D * > gOptFluxHst
virtual TGeoManager * GetGeometry(void) const
GENIE Interface for user-defined flux classes.
Definition: GFluxI.h:29
long int gOptRanSeed
Definition: gAtmoEvGen.cxx:312
bool gOptUsingHistFlux
void PrintSyntax ( void  )

Variable Documentation

string gOptDetectorLocation

Definition at line 507 of file gT2KEvGen.cxx.

string gOptEvFilePrefix

Definition at line 514 of file gT2KEvGen.cxx.

bool gOptExitAtEndOfFullFluxCycles

Definition at line 513 of file gT2KEvGen.cxx.

Referenced by main().

string gOptExtMaxPlXml

Definition at line 505 of file gT2KEvGen.cxx.

string gOptFluxFile

Definition at line 506 of file gT2KEvGen.cxx.

map<int,TH1D*> gOptFluxHst

Definition at line 500 of file gT2KEvGen.cxx.

int gOptFluxNCycles

Definition at line 510 of file gT2KEvGen.cxx.

Referenced by main().

double gOptFluxNorm

Definition at line 508 of file gT2KEvGen.cxx.

Referenced by main().

PDGCodeList gOptFluxNtpNuList(false)

Referenced by main().

string gOptFluxProbFileName

Definition at line 517 of file gT2KEvGen.cxx.

Referenced by main().

double gOptGeomDUnits = 0

Definition at line 504 of file gT2KEvGen.cxx.

double gOptGeomLUnits = 0

Definition at line 503 of file gT2KEvGen.cxx.

string gOptInpXSecFile

Definition at line 521 of file gT2KEvGen.cxx.

int gOptNev

Definition at line 511 of file gT2KEvGen.cxx.

double gOptPOT

Definition at line 512 of file gT2KEvGen.cxx.

bool gOptRandomFluxOffset = false

Definition at line 519 of file gT2KEvGen.cxx.

Referenced by main().

long int gOptRanSeed

Definition at line 520 of file gT2KEvGen.cxx.

string gOptRootGeom

Definition at line 501 of file gT2KEvGen.cxx.

string gOptRootGeomTopVol = ""

Definition at line 502 of file gT2KEvGen.cxx.

Long_t gOptRunNu

Definition at line 496 of file gT2KEvGen.cxx.

bool gOptSaveFluxProbsFile = false

Definition at line 516 of file gT2KEvGen.cxx.

Referenced by main().

string gOptSaveFluxProbsFileName

Definition at line 518 of file gT2KEvGen.cxx.

Referenced by main().

map<int,double> gOptTgtMix

Definition at line 499 of file gT2KEvGen.cxx.

bool gOptUseFluxProbs = false

Definition at line 515 of file gT2KEvGen.cxx.

Referenced by main().

bool gOptUsingHistFlux = false

Definition at line 498 of file gT2KEvGen.cxx.

bool gOptUsingRootGeom = false

Definition at line 497 of file gT2KEvGen.cxx.

string kDefOptEvFilePrefix = "gntp"

Definition at line 492 of file gT2KEvGen.cxx.

double kDefOptFluxNorm = 1E+21

Definition at line 491 of file gT2KEvGen.cxx.

string kDefOptGeomDUnits = "g_cm3"

Definition at line 489 of file gT2KEvGen.cxx.

string kDefOptGeomLUnits = "mm"

Definition at line 488 of file gT2KEvGen.cxx.

NtpMCFormat_t kDefOptNtpFormat = kNFGHEP

Definition at line 490 of file gT2KEvGen.cxx.