Public Types | Public Member Functions | Static Public Member Functions | Protected Attributes | Private Member Functions | Private Attributes | List of all members
genie::flux::GNuMIFlux Class Reference

A GENIE flux driver encapsulating the NuMI neutrino flux. It reads-in the official GNUMI neutrino flux ntuples. Supports both geant3 and geant4 formats. More...

#include "/cvmfs/nova.opensciencegrid.org/externals/genie/v3_00_06_p01/Linux64bit+2.6-2.12-e17-debug/GENIE-Generator/src/Tools/Flux/GNuMIFlux.h"

Inheritance diagram for genie::flux::GNuMIFlux:
genie::GFluxI genie::flux::GFluxExposureI genie::flux::GFluxFileConfigI

Public Types

enum  EStdFluxWindow {
  kMinosNearDet, kMinosFarDet, kMinosNearRock, kMinosFarRock,
  kMinosNearCenter, kMinosFarCenter
}
 
typedef enum genie::flux::GNuMIFlux::EStdFluxWindow StdFluxWindow_t
 

Public Member Functions

 GNuMIFlux ()
 
 ~GNuMIFlux ()
 
const PDGCodeListFluxParticles (void)
 declare list of flux neutrinos that can be generated (for init. purposes) More...
 
double MaxEnergy (void)
 declare the max flux neutrino energy that can be generated (for init. purposes) More...
 
bool GenerateNext (void)
 generate the next flux neutrino (return false in err) More...
 
int PdgCode (void)
 returns the flux neutrino pdg code More...
 
double Weight (void)
 returns the flux neutrino weight (if any) More...
 
const TLorentzVector & Momentum (void)
 returns the flux neutrino 4-momentum More...
 
const TLorentzVector & Position (void)
 returns the flux neutrino 4-position (note: expect SI rather than physical units) More...
 
bool End (void)
 true if no more flux nu's can be thrown (eg reaching end of beam sim ntuples) More...
 
long int Index (void)
 returns corresponding index for current flux neutrino (e.g. for a flux ntuple returns the current entry number) More...
 
void Clear (Option_t *opt)
 reset state variables based on opt More...
 
void GenerateWeighted (bool gen_weighted)
 set whether to generate weighted or unweighted neutrinos More...
 
const GNuMIFluxPassThroughInfoPassThroughInfo (void)
 GNuMIFluxPassThroughInfo. More...
 
Long64_t GetEntryNumber ()
 index in chain More...
 
double GetDecayDist () const
 dist (user units) from dk to current pos More...
 
void MoveToZ0 (double z0)
 move ray origin to user coord Z0 More...
 
virtual double GetTotalExposure () const
 
virtual long int NFluxNeutrinos () const
 

of rays generated

More...
 
double POT_curr (void)
 current average POT (RWH?) More...
 
double UsedPOTs (void) const
 

of protons-on-target used

More...
 
double SumWeight (void) const
 integrated weight for flux neutrinos looped so far More...
 
void PrintCurrent (void)
 print current entry from leaves More...
 
void PrintConfig ()
 print the current configuration More...
 
std::vector< std::stringGetFileList ()
 list of files currently part of chain More...
 
virtual void LoadBeamSimData (const std::vector< std::string > &filenames, const std::string &det_loc)
 
virtual void GetBranchInfo (std::vector< std::string > &branchNames, std::vector< std::string > &branchClassNames, std::vector< void ** > &branchObjPointers)
 
virtual TTree * GetMetaDataTree ()
 
bool LoadConfig (string cfg)
 load a named configuration More...
 
void SetMaxEnergy (double Ev)
 specify maximum flx neutrino energy More...
 
void SetGenWeighted (bool genwgt=false)
 toggle whether GenerateNext() returns weight=1 flux (initial default false) More...
 
void SetEntryReuse (long int nuse=1)
 

of times to use entry before moving to next

More...
 
void SetTreeName (string name)
 set input tree name (default: "h10") More...
 
void ScanForMaxWeight (void)
 scan for max flux weight (before generating unweighted flux neutrinos) More...
 
void SetMaxWgtScan (double fudge=1.05, long int nentries=2500000)
 
void SetMaxEFudge (double fudge=1.05)
 
void SetApplyWindowTiltWeight (bool apply=true)
 
void SetLengthUnits (double user_units)
 Set units assumed by user. More...
 
double LengthUnits (void) const
 Return user units. More...
 
void SetBeamRotation (TRotation beamrot)
 < beam (0,0,0) relative to user frame, beam direction in user frame More...
 
void SetBeamCenter (TVector3 beam0)
 
TRotation GetBeamRotation () const
 rotation to apply from beam->user More...
 
TVector3 GetBeamCenter () const
 beam origin in user frame More...
 
bool SetFluxWindow (StdFluxWindow_t stdwindow, double padding=0)
 return false if unhandled More...
 
void SetFluxWindow (TVector3 p1, TVector3 p2, TVector3 p3)
 3 points define a plane (by default in user coordinates) More...
 
void GetFluxWindow (TVector3 &p1, TVector3 &p2, TVector3 &p3) const
 3 points define a plane in beam coordinate More...
 
void UseFluxAtNearDetCenter (void)
 force weights at MINOS detector "center" as found in ntuple More...
 
void UseFluxAtFarDetCenter (void)
 
void Beam2UserPos (const TLorentzVector &beamxyz, TLorentzVector &usrxyz) const
 
void Beam2UserDir (const TLorentzVector &beamdir, TLorentzVector &usrdir) const
 
void Beam2UserP4 (const TLorentzVector &beamp4, TLorentzVector &usrp4) const
 
void User2BeamPos (const TLorentzVector &usrxyz, TLorentzVector &beamxyz) const
 
void User2BeamDir (const TLorentzVector &usrdir, TLorentzVector &beamdir) const
 
void User2BeamP4 (const TLorentzVector &usrp4, TLorentzVector &beamp4) const
 
TVector3 FluxWindowNormal ()
 
const char * GetExposureUnits () const
 what units are returned by GetTotalExposure? More...
 
genie::flux::Exposure_t GetExposureType () const
 
virtual void LoadBeamSimData (const std::set< std::string > &filenames, const std::string &det_loc)
 
virtual void LoadBeamSimData (const std::string &filename, const std::string &det_loc)
 
virtual void SetXMLFileBase (std::string xmlbasename="")
 
virtual std::string GetXMLFileBase () const
 
virtual void SetFluxParticles (const PDGCodeList &particles)
 specify list of flux neutrino species More...
 
virtual void SetUpstreamZ (double z0)
 
virtual void SetNumOfCycles (long int ncycle)
 limit cycling through input files More...
 

Static Public Member Functions

static const char * AsString (genie::flux::Exposure_t etype)
 
static genie::flux::Exposure_t StringToEnum (const char *chars, int maxChar=0)
 

Protected Attributes

PDGCodeListfPdgCList
 list of neutrino pdg-codes to generate More...
 
PDGCodeListfPdgCListRej
 list of nu pdg-codes seen but rejected More...
 
std::string fXMLbasename
 XML file that might hold config param_sets. More...
 
long int fNCycles
 

times to cycle through the ntuple(s)

More...
 
long int fICycle
 
double fZ0
 

Private Member Functions

bool GenerateNext_weighted (void)
 
void Initialize (void)
 
void SetDefaults (void)
 
void CleanUp (void)
 
void ResetCurrent (void)
 
void AddFile (TTree *tree, string fname)
 
void CalcEffPOTsPerNu (void)
 

Private Attributes

double fMaxEv
 maximum energy More...
 
bool fEnd
 end condition reached More...
 
std::vector< stringfNuFluxFilePatterns
 (potentially wildcarded) path(s) More...
 
string fNuFluxTreeName
 Tree name "h10" (g3) or "nudata" (g4) More...
 
TChain * fNuFluxTree
 TTree in g3numi or g4numi // REF ONLY! More...
 
string fNuFluxGen
 "g3numi" "g4numi" or "flugg" More...
 
g3numifG3NuMI
 g3numi ntuple More...
 
g4numifG4NuMI
 g4numi ntuple More...
 
fluggfFlugg
 flugg ntuple More...
 
int fNFiles
 number of files in chain More...
 
Long64_t fNEntries
 number of flux ntuple entries More...
 
Long64_t fIEntry
 current flux ntuple entry More...
 
Long64_t fNuTot
 cummulative # of entries (=fNEntries) More...
 
Long64_t fFilePOTs
 

of protons-on-target represented by all files

More...
 
double fWeight
 current neutrino weight, =1 if generating unweighted entries More...
 
double fMaxWeight
 max flux neutrino weight in input file More...
 
double fMaxWgtFudge
 fudge factor for estimating max wgt More...
 
long int fMaxWgtEntries
 

of entries in estimating max wgt

More...
 
double fMaxEFudge
 fudge factor for estmating max enu (0=> use fixed 120GeV) More...
 
long int fNUse
 how often to use same entry in a row More...
 
long int fIUse
 current # of times an entry has been used More...
 
double fSumWeight
 sum of weights for nus thrown so far More...
 
long int fNNeutrinos
 number of flux neutrinos thrown so far More...
 
double fEffPOTsPerNu
 what a entry is worth ... More...
 
double fAccumPOTs
 POTs used so far. More...
 
bool fGenWeighted
 does GenerateNext() give weights? More...
 
bool fApplyTiltWeight
 wgt due to window normal not || beam More...
 
bool fDetLocIsSet
 is a flux location (near/far) set? More...
 
int fUseFluxAtDetCenter
 use flux at near (-1) or far (+1) det center from ntuple? More...
 
double fLengthUnits
 units for coord in user exchanges More...
 
double fLengthScaleB2U
 scale factor beam (cm) –> user More...
 
double fLengthScaleU2B
 scale factor beam user –> (cm) More...
 
TLorentzVector fBeamZero
 beam origin in user coords More...
 
TLorentzRotation fBeamRot
 rotation applied beam –> user coord More...
 
TLorentzRotation fBeamRotInv
 
TVector3 fFluxWindowPtUser [3]
 user points of flux window More...
 
TLorentzVector fFluxWindowBase
 base point for flux window - beam coord More...
 
TLorentzVector fFluxWindowDir1
 extent for flux window (direction 1) More...
 
TLorentzVector fFluxWindowDir2
 extent for flux window (direction 2) More...
 
double fFluxWindowLen1
 
double fFluxWindowLen2
 
TVector3 fWindowNormal
 normal direction for flux window More...
 
TLorentzVector fgX4dkvtx
 decay 4-position beam coord More...
 
GNuMIFluxPassThroughInfofCurEntry
 copy of current ntuple entry info (owned structure) More...
 

Detailed Description

A GENIE flux driver encapsulating the NuMI neutrino flux. It reads-in the official GNUMI neutrino flux ntuples. Supports both geant3 and geant4 formats.

GNuMIFlux:

An implementation of the GFluxI interface that provides NuMI flux

http://www.hep.utexas.edu/~zarko/wwwgnumi/v19/

Author
Robert Hatcher <rhatcher fnal.gov> Fermi National Accelerator Laboratory

Jun 27, 2008

Copyright (c) 2003-2019, The GENIE Collaboration For the full text of the license visit http://copyright.genie-mc.org or see $GENIE/LICENSE

Definition at line 217 of file GNuMIFlux.h.

Member Typedef Documentation

Member Enumeration Documentation

Enumerator
kMinosNearDet 
kMinosFarDet 
kMinosNearRock 
kMinosFarRock 
kMinosNearCenter 
kMinosFarCenter 

Definition at line 330 of file GNuMIFlux.h.

330  {
331  kMinosNearDet, // appropriate for Near Detector
332  kMinosFarDet, // appropriate for Far Detector
333  kMinosNearRock, // appropriate for Near rock generation
334  kMinosFarRock, // appropriate for Far rock generation
335  kMinosNearCenter, // point location mimic near value in ntuple
336  kMinosFarCenter // point location mimic far value in ntuple
337  } StdFluxWindow_t;
enum genie::flux::GNuMIFlux::EStdFluxWindow StdFluxWindow_t

Constructor & Destructor Documentation

GNuMIFlux::GNuMIFlux ( )

Definition at line 269 of file GNuMIFlux.cxx.

References TMVAGlob::Initialize().

269  :
271 {
272  this->Initialize();
273 }
GFluxExposureI(genie::flux::Exposure_t etype)
GNuMIFlux::~GNuMIFlux ( )

Definition at line 275 of file GNuMIFlux.cxx.

276 {
277  this->CleanUp();
278 }

Member Function Documentation

void GNuMIFlux::AddFile ( TTree *  tree,
string  fname 
)
private

Definition at line 1289 of file GNuMIFlux.cxx.

References om::cout, allTimeWatchdog::endl, plot_validation_datamc::fname, calib::j, LOG, nentries, nquant, and pNOTICE.

1290 {
1291  // Add a file to the chain
1292 
1293  ULong64_t nentries = thetree->GetEntries();
1294 
1295  // first/last "evtno" are the proton # of the first/last proton
1296  // that generated a neutrino ... not necessarily true first/last #
1297  // estimate we're probably not off by more than 100 ...
1298  // !Important change
1299  // Some files (due to some intermediate flugg issues) list evtno==0
1300  // when it isn't really true, we need to scan nearby values in case the
1301  // last entry is one of these (otherwise file contributes 0 POTs).
1302  // Also assume quantization of 500 (instead of 100).
1303 
1304  thetree->SetMakeClass(1); // need full ntuple decomposition for
1305  // the SetBranchAddress to work on g4numi ntuples. Works fine
1306  // without it on gnumi (geant3) and flugg ntuples [each with their
1307  // own slight differences] but shouldn't harm them either.
1308 
1309  Int_t evtno = 0;
1310  TBranch* br_evtno = 0;
1311  thetree->SetBranchAddress("evtno",&evtno, &br_evtno);
1312  Int_t evt_1 = 0x7FFFFFFF;
1313  Int_t evt_N = 1;
1314 #define OLDGUESS
1315 #ifdef OLDGUESS
1316  for (int j=0; j<50; ++j) {
1317  thetree->GetEntry(j);
1318  if (evtno != 0) evt_1 = TMath::Min(evtno,evt_1);
1319  thetree->GetEntry(nentries-1 -j );
1320  if (evtno != 0) evt_N = TMath::Max(evtno,evt_N);
1321  }
1322  // looks like low counts are due to "evtno" not including
1323  // protons that miss the actual target (hit baffle, etc)
1324  // this will vary with beam conditions parameters
1325  // so we should round way up, those generating flugg files
1326  // aren't going to quantize less than 1000
1327  // though 500 would probably be okay, 100 would not.
1328  const Int_t nquant = 1000; // 500; // 100
1329  const Double_t rquant = nquant;
1330 #else
1331  for (int j=0; j<50; ++j) {
1332  thetree->GetEntry(j);
1333  if (evtno != 0) evt_1 = TMath::Min(evtno,evt_1);
1334  std::cout << "[" << j << "] evtno=" << evtno << " evt_1=" << evt_1 << std::endl;
1335  }
1336  for (int j=0; j<50; ++j) {
1337  thetree->GetEntry(nentries-1 -j );
1338  if (evtno != 0) evt_N = TMath::Max(evtno,evt_N);
1339  std::cout << "[" << (nentries-1-j) << "] evtno=" << evtno << " evt_N=" << evt_N << std::endl;
1340  }
1341 
1342  Int_t nquant = 1000; // 500;
1343  Double_t rquant = nquant;
1344 #endif
1345 
1346  Int_t est_1 = (TMath::FloorNint(evt_1/rquant))*nquant + 1;
1347  Int_t est_N = (TMath::FloorNint((evt_N-1)/rquant)+1)*nquant;
1348  ULong64_t npots = est_N - est_1 + 1;
1349  LOG("Flux",pNOTICE) //INFO)
1350  << fNuFluxTreeName << "->AddFile() of " << nentries << " entries ["
1351  << evt_1 << ":" << evt_N << "%" << nquant
1352  << "(" << est_1 << ":" << est_N << ")="
1353  << npots <<" POTs] in {" << fNuFluxGen << "} file: " << fname;
1354  fNuTot += nentries;
1355  fFilePOTs += npots;
1356  fNFiles++;
1357 
1358  fNuFluxTree->AddFile(fname.c_str());
1359 }
Long64_t fFilePOTs
of protons-on-target represented by all files
Definition: GNuMIFlux.h:398
const int nquant
Definition: getContProf.C:25
TChain * fNuFluxTree
TTree in g3numi or g4numi // REF ONLY!
Definition: GNuMIFlux.h:389
string fNuFluxTreeName
Tree name "h10" (g3) or "nudata" (g4)
Definition: GNuMIFlux.h:388
#define LOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a string (using the FILE...
Definition: Messenger.h:97
Long64_t nentries
const double j
Definition: BetheBloch.cxx:29
int fNFiles
number of files in chain
Definition: GNuMIFlux.h:394
OStream cout
Definition: OStream.cxx:6
#define pNOTICE
Definition: Messenger.h:62
string fNuFluxGen
"g3numi" "g4numi" or "flugg"
Definition: GNuMIFlux.h:390
Long64_t fNuTot
cummulative # of entries (=fNEntries)
Definition: GNuMIFlux.h:397
const char * genie::flux::GFluxExposureI::AsString ( genie::flux::Exposure_t  etype)
staticinherited

Definition at line 20 of file GFluxExposureI.cxx.

References genie::flux::kPOTs, genie::flux::kSeconds, and genie::flux::kUnknown.

Referenced by genie::flux::GFluxExposureI::GetExposureUnits().

21  {
22  switch (etype) {
23  case kUnknown: return "UnknownExposureUnits"; break;
24  case kPOTs: return "POT"; break;
25  case kSeconds: return "Seconds"; break;
26  default: return "?UnknownExposureUnits?"; break;
27  }
28  }
void GNuMIFlux::Beam2UserDir ( const TLorentzVector &  beamdir,
TLorentzVector &  usrdir 
) const

Definition at line 1132 of file GNuMIFlux.cxx.

1134 {
1135  usrdir = fLengthScaleB2U*(fBeamRot*beamdir);
1136 }
double fLengthScaleB2U
scale factor beam (cm) –> user
Definition: GNuMIFlux.h:419
TLorentzRotation fBeamRot
rotation applied beam –> user coord
Definition: GNuMIFlux.h:423
void GNuMIFlux::Beam2UserP4 ( const TLorentzVector &  beamp4,
TLorentzVector &  usrp4 
) const

Definition at line 1137 of file GNuMIFlux.cxx.

1139 {
1140  usrp4 = fBeamRot*beamp4;
1141 }
TLorentzRotation fBeamRot
rotation applied beam –> user coord
Definition: GNuMIFlux.h:423
void GNuMIFlux::Beam2UserPos ( const TLorentzVector &  beamxyz,
TLorentzVector &  usrxyz 
) const

Definition at line 1127 of file GNuMIFlux.cxx.

1129 {
1130  usrxyz = fLengthScaleB2U*(fBeamRot*beamxyz) + fBeamZero;
1131 }
TLorentzVector fBeamZero
beam origin in user coords
Definition: GNuMIFlux.h:422
double fLengthScaleB2U
scale factor beam (cm) –> user
Definition: GNuMIFlux.h:419
TLorentzRotation fBeamRot
rotation applied beam –> user coord
Definition: GNuMIFlux.h:423
void GNuMIFlux::CalcEffPOTsPerNu ( void  )
private

Definition at line 595 of file GNuMIFlux.cxx.

References e, LOG, Mag(), pNOTICE, and pWARN.

596 {
597  // do this if flux window changes or # of files changes
598 
599  if (!fNuFluxTree) return; // not yet fully configured
600 
601  // effpots = mc_pots * (wgtfunction-area) / window-area / wgt-max-est
602  // wgtfunction-area = pi * radius-det-element^2 = pi * (100.cm)^2
603 
604  // this should match what is used in the CalcEnuWgt()
605  const double kRDET = 100.0; // set to flux per 100 cm radius
606  const double kRDET2 = kRDET * kRDET;
607  double flux_area = fFluxWindowDir1.Vect().Cross(fFluxWindowDir2.Vect()).Mag();
608  LOG("Flux",pNOTICE) << "in CalcEffPOTsPerNu, area = " << flux_area;
609 
610  if ( flux_area < 1.0e-30 ) {
611  LOG("Flux", pWARN)
612  << "CalcEffPOTsPerNu called with flux window area effectively zero";
613  flux_area = 1;
614  }
615  double area_ratio = TMath::Pi() * kRDET2 / flux_area;
616  fEffPOTsPerNu = area_ratio * ( (double)fFilePOTs / (double)fNEntries );
617 }
Long64_t fFilePOTs
of protons-on-target represented by all files
Definition: GNuMIFlux.h:398
TLorentzVector fFluxWindowDir2
extent for flux window (direction 2)
Definition: GNuMIFlux.h:429
Long64_t fNEntries
number of flux ntuple entries
Definition: GNuMIFlux.h:395
TChain * fNuFluxTree
TTree in g3numi or g4numi // REF ONLY!
Definition: GNuMIFlux.h:389
#define LOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a string (using the FILE...
Definition: Messenger.h:97
TLorentzVector fFluxWindowDir1
extent for flux window (direction 1)
Definition: GNuMIFlux.h:428
#define pWARN
Definition: Messenger.h:61
float Mag() const
double fEffPOTsPerNu
what a entry is worth ...
Definition: GNuMIFlux.h:410
#define pNOTICE
Definition: Messenger.h:62
Float_t e
Definition: plot.C:35
void GNuMIFlux::CleanUp ( void  )
private

Definition at line 1271 of file GNuMIFlux.cxx.

References LOG, and pNOTICE.

1272 {
1273  LOG("Flux", pNOTICE) << "Cleaning up...";
1274 
1275  if (fPdgCList) delete fPdgCList;
1276  if (fPdgCListRej) delete fPdgCListRej;
1277  if (fCurEntry) delete fCurEntry;
1278 
1279  if ( fG3NuMI ) delete fG3NuMI;
1280  if ( fG4NuMI ) delete fG4NuMI;
1281  if ( fFlugg ) delete fFlugg;
1282 
1283  LOG("Flux", pNOTICE)
1284  << " flux file cycles: " << fICycle << " of " << fNCycles
1285  << ", entry " << fIEntry << " use: " << fIUse << " of " << fNUse;
1286 }
long int fIUse
current # of times an entry has been used
Definition: GNuMIFlux.h:407
Long64_t fIEntry
current flux ntuple entry
Definition: GNuMIFlux.h:396
g4numi * fG4NuMI
g4numi ntuple
Definition: GNuMIFlux.h:392
PDGCodeList * fPdgCList
list of neutrino pdg-codes to generate
#define LOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a string (using the FILE...
Definition: Messenger.h:97
long int fNCycles
times to cycle through the ntuple(s)
flugg * fFlugg
flugg ntuple
Definition: GNuMIFlux.h:393
GNuMIFluxPassThroughInfo * fCurEntry
copy of current ntuple entry info (owned structure)
Definition: GNuMIFlux.h:436
PDGCodeList * fPdgCListRej
list of nu pdg-codes seen but rejected
g3numi * fG3NuMI
g3numi ntuple
Definition: GNuMIFlux.h:391
#define pNOTICE
Definition: Messenger.h:62
long int fNUse
how often to use same entry in a row
Definition: GNuMIFlux.h:406
void GNuMIFlux::Clear ( Option_t *  opt)
virtual

reset state variables based on opt

Implements genie::GFluxI.

Definition at line 1165 of file GNuMIFlux.cxx.

References LOG, and pWARN.

1166 {
1167  // Clear the driver state
1168  //
1169  LOG("Flux", pWARN) << "GSimpleNtpFlux::Clear(" << opt << ") called";
1170  // do it in all cases, but EVGDriver/GMCJDriver will pass "CycleHistory"
1171 
1172  fICycle = 0;
1173 
1174  fSumWeight = 0;
1175  fNNeutrinos = 0;
1176  fAccumPOTs = 0;
1177 }
double fSumWeight
sum of weights for nus thrown so far
Definition: GNuMIFlux.h:408
#define LOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a string (using the FILE...
Definition: Messenger.h:97
double fAccumPOTs
POTs used so far.
Definition: GNuMIFlux.h:411
#define pWARN
Definition: Messenger.h:61
long int fNNeutrinos
number of flux neutrinos thrown so far
Definition: GNuMIFlux.h:409
bool genie::flux::GNuMIFlux::End ( void  )
inlinevirtual

true if no more flux nu's can be thrown (eg reaching end of beam sim ntuples)

Implements genie::GFluxI.

Definition at line 237 of file GNuMIFlux.h.

237 { return fEnd; }
bool fEnd
end condition reached
Definition: GNuMIFlux.h:385
const PDGCodeList& genie::flux::GNuMIFlux::FluxParticles ( void  )
inlinevirtual

declare list of flux neutrinos that can be generated (for init. purposes)

Implements genie::GFluxI.

Definition at line 230 of file GNuMIFlux.h.

Referenced by test_gnumi().

230 { return *fPdgCList; }
PDGCodeList * fPdgCList
list of neutrino pdg-codes to generate
TVector3 genie::flux::GNuMIFlux::FluxWindowNormal ( )
inline
bool GNuMIFlux::GenerateNext ( void  )
virtual

generate the next flux neutrino (return false in err)

Implements genie::GFluxI.

Definition at line 295 of file GNuMIFlux.cxx.

References febshutoff_auto::end, End(), MakeMiniprodValidationCuts::f, genie::RandomGen::Instance(), LOG, genie::utils::print::P4AsShortString(), pERROR, pNOTICE, r(), generate_hists::rnd, genie::RandomGen::RndFlux(), and genie::utils::print::X4AsString().

Referenced by test_gnumi().

296 {
297 // Get next (unweighted) flux ntuple entry on the specified detector location
298 //
300  while ( true ) {
301  // Check for end of flux ntuple
302  bool end = this->End();
303  if ( end ) {
304  LOG("Flux", pNOTICE) << "GenerateNext signaled End() ";
305  return false;
306  }
307 
308  // Get next weighted flux ntuple entry
309  bool nextok = this->GenerateNext_weighted();
310  if ( fGenWeighted ) return nextok;
311  if ( ! nextok ) continue;
312 
313  /* RWH - debug purposes
314  if ( fNCycles == 0 ) {
315  LOG("Flux", pNOTICE)
316  << "Got flux entry: " << fIEntry
317  << " - Cycle: "<< fICycle << "/ infinite";
318  } else {
319  LOG("Flux", pNOTICE)
320  << "Got flux entry: "<< fIEntry
321  << " - Cycle: "<< fICycle << "/"<< fNCycles;
322  }
323  */
324 
325  // Get fractional weight & decide whether to accept curr flux neutrino
326  double f = this->Weight() / fMaxWeight;
327  //LOG("Flux", pNOTICE)
328  // << "Curr flux neutrino fractional weight = " << f;
329  if (f > 1.) {
330  fMaxWeight = this->Weight() * fMaxWgtFudge; // bump the weight
331  LOG("Flux", pERROR)
332  << "** Fractional weight = " << f
333  << " > 1 !! Bump fMaxWeight estimate to " << fMaxWeight
334  << PassThroughInfo();
335  }
336  double r = (f < 1.) ? rnd->RndFlux().Rndm() : 0;
337  bool accept = ( r < f );
338  if ( accept ) {
339 
340 #ifdef __GENIE_LOW_LEVEL_MESG_ENABLED__
341  LOG("Flux", pNOTICE)
342  << "Generated beam neutrino: "
343  << "\n pdg-code: " << fCurEntry->fgPdgC
344  << "\n p4: " << utils::print::P4AsShortString(&(fCurEntry->fgP4))
345  << "\n x4: " << utils::print::X4AsString(&(fCurEntry->fgX4))
347  << "\n x4: " << utils::print::X4AsString(&(fCurEntry->fgX4User));
348 #endif
349 
350  fWeight = 1.;
351  return true;
352  }
353 
354  //LOG("Flux", pNOTICE)
355  // << "** Rejecting current flux neutrino based on the flux weight only";
356  }
357  return false;
358 }
TLorentzVector fgP4
generated nu 4-momentum beam coord
Definition: GNuMIFlux.h:102
string P4AsShortString(const TLorentzVector *p)
Definition: PrintUtils.cxx:52
#define pERROR
Definition: Messenger.h:60
static RandomGen * Instance()
Access instance.
Definition: RandomGen.cxx:79
bool fGenWeighted
does GenerateNext() give weights?
Definition: GNuMIFlux.h:413
TLorentzVector fgX4User
generated nu 4-position user coord
Definition: GNuMIFlux.h:105
A singleton holding random number generator classes. All random number generation in GENIE should tak...
Definition: RandomGen.h:30
double fMaxWgtFudge
fudge factor for estimating max wgt
Definition: GNuMIFlux.h:402
bool End(void)
true if no more flux nu&#39;s can be thrown (eg reaching end of beam sim ntuples)
Definition: GNuMIFlux.h:237
double Weight(void)
returns the flux neutrino weight (if any)
Definition: GNuMIFlux.h:234
TLorentzVector fgX4
generated nu 4-position beam coord
Definition: GNuMIFlux.h:103
#define LOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a string (using the FILE...
Definition: Messenger.h:97
const GNuMIFluxPassThroughInfo & PassThroughInfo(void)
GNuMIFluxPassThroughInfo.
Definition: GNuMIFlux.h:252
bool GenerateNext_weighted(void)
Definition: GNuMIFlux.cxx:360
GNuMIFluxPassThroughInfo * fCurEntry
copy of current ntuple entry info (owned structure)
Definition: GNuMIFlux.h:436
double fMaxWeight
max flux neutrino weight in input file
Definition: GNuMIFlux.h:401
int fgPdgC
generated nu pdg-code
Definition: GNuMIFlux.h:98
TRandom3 r(0)
#define pNOTICE
Definition: Messenger.h:62
TLorentzVector fgP4User
generated nu 4-momentum user coord
Definition: GNuMIFlux.h:104
TRandom3 & RndFlux(void) const
rnd number generator used by flux drivers
Definition: RandomGen.h:72
string X4AsString(const TLorentzVector *x)
Definition: PrintUtils.cxx:64
double fWeight
current neutrino weight, =1 if generating unweighted entries
Definition: GNuMIFlux.h:400
bool GNuMIFlux::GenerateNext_weighted ( void  )
private

user might modify list via SetFluxParticles() in order to reject certain flavors, even if they're found in the file. So don't make a big fuss. Spit out a single message and then stop reporting that flavor as problematic.

Definition at line 360 of file GNuMIFlux.cxx.

References ana::assert(), exit(), genie::RandomGen::Instance(), LOG, genie::utils::print::P4AsShortString(), pDEBUG, pERROR, pFATAL, pINFO, pWARN, generate_hists::rnd, genie::RandomGen::RndFlux(), Unit(), and genie::utils::print::X4AsString().

361 {
362 // Get next (weighted) flux ntuple entry on the specified detector location
363 //
364 
365  // Check whether a flux ntuple has been loaded
366  if ( ! fG3NuMI && ! fG4NuMI && ! fFlugg ) {
367  LOG("Flux", pFATAL)
368  << "The flux driver has not been properly configured";
369  //return false; // don't do this - creates an infinite loop!
370  exit(1);
371  }
372 
373  // Reuse an entry?
374  //std::cout << " ***** iuse " << fIUse << " nuse " << fNUse
375  // << " ientry " << fIEntry << " nentry " << fNEntries
376  // << " icycle " << fICycle << " ncycle " << fNCycles << std::endl;
377  if ( fIUse < fNUse && fIEntry >= 0 ) {
378  // Reuse this entry
379  fIUse++;
380  } else {
381  // Reset previously generated neutrino code / 4-p / 4-x
382  this->ResetCurrent();
383  // Move on, read next flux ntuple entry
384  fIEntry++;
385  if ( fIEntry >= fNEntries ) {
386  // Ran out of entries @ the current cycle of this flux file
387  // Check whether more (or infinite) number of cycles is requested
388  if ( fICycle < fNCycles || fNCycles == 0 ) {
389  fICycle++;
390  fIEntry=0;
391  } else {
392  LOG("Flux", pWARN)
393  << "No more entries in input flux neutrino ntuple, cycle "
394  << fICycle << " of " << fNCycles;
395  fEnd = true;
396  // assert(0);
397  return false;
398  }
399  }
400 
401  if ( fG3NuMI ) {
404  } else if ( fG4NuMI ) {
407  } else if ( fFlugg ) {
410  } else {
411  LOG("Flux", pERROR) << "No ntuple configured";
412  fEnd = true;
413  //assert(0);
414  return false;
415  }
416 #ifdef __GENIE_LOW_LEVEL_MESG_ENABLED__
417  LOG("Flux",pDEBUG)
418  << "got " << fNNeutrinos << " new fIEntry " << fIEntry
419  << " evtno " << fCurEntry->evtno;
420 #endif
421 
422  fIUse = 1;
423  fCurEntry->pcodes = 0; // fetched entry has geant codes
424  fCurEntry->units = 0; // fetched entry has original units
425 
426  // Convert the current gnumi neutrino flavor mode into a neutrino pdg code
427  // Also convert other particle codes in GNuMIFluxPassThroughInfo to PDG
429  // here we might want to do flavor oscillations or simple mappings
431  }
432 
433  // Check neutrino pdg against declared list of neutrino species declared
434  // by the current instance of the NuMI neutrino flux driver.
435  // No undeclared neutrino species will be accepted at this point as GENIE
436  // has already been configured to handle the specified list.
437  // Make sure that the appropriate list of flux neutrino species was set at
438  // initialization via GNuMIFlux::SetFluxParticles(const PDGCodeList &)
439 
440  // update the # POTs, number of neutrinos
441  // do this HERE (before rejecting flavors that users might be weeding out)
442  // in order to keep the POT accounting correct. This allows one to get
443  // the right normalization for generating only events from the intrinsic
444  // nu_e entries.
446  fNNeutrinos++;
447 
449  /// user might modify list via SetFluxParticles() in order to reject certain
450  /// flavors, even if they're found in the file. So don't make a big fuss.
451  /// Spit out a single message and then stop reporting that flavor as problematic.
452  int badpdg = fCurEntry->fgPdgC;
453  if ( ! fPdgCListRej->ExistsInPDGCodeList(badpdg) ) {
454  fPdgCListRej->push_back(badpdg);
455  LOG("Flux", pWARN)
456  << "Encountered neutrino specie (" << badpdg
457  << " pcodes=" << fCurEntry->pcodes << ")"
458  << " that wasn't in SetFluxParticles() list, "
459  << "\nDeclared list of neutrino species: " << *fPdgCList;
460  }
461  return false;
462  }
463 
464  // Update the curr neutrino weight and energy
465 
466  // Check current neutrino energy against the maximum flux neutrino energy
467  // declared by the current instance of the NuMI neutrino flux driver.
468  // No flux neutrino exceeding that maximum energy will be accepted at this
469  // point as that maximum energy has already been used for normalizing the
470  // interaction probabilities.
471  // Make sure that the appropriate maximum flux neutrino energy was set at
472  // initialization via GNuMIFlux::SetMaxEnergy(double Ev)
473 
475 
476  double Ev = 0;
477  double& wgt_xy = fCurEntry->fgXYWgt;
478  switch ( fUseFluxAtDetCenter ) {
479  case -1: // near detector
480  wgt_xy = fCurEntry->nwtnear;
481  Ev = fCurEntry->nenergyn;
482  break;
483  case +1: // far detector
484  wgt_xy = fCurEntry->nwtfar;
485  Ev = fCurEntry->nenergyf;
486  break;
487  default: // recalculate on x-y window
489  fCurEntry->fgX4 += ( rnd->RndFlux().Rndm()*fFluxWindowDir1 +
490  rnd->RndFlux().Rndm()*fFluxWindowDir2 );
491  fCurEntry->CalcEnuWgt(fCurEntry->fgX4,Ev,wgt_xy);
492  break;
493  }
494 
495  if (Ev > fMaxEv) {
496  LOG("Flux", pWARN)
497  << "Flux neutrino energy exceeds declared maximum neutrino energy"
498  << "\nEv = " << Ev << "(> Ev{max} = " << fMaxEv << ")";
499  }
500 
501  // Set the current flux neutrino 4-momentum
502  // this is in *beam* coordinates
503  fgX4dkvtx = TLorentzVector( fCurEntry->vx,
504  fCurEntry->vy,
505  fCurEntry->vz, 0.);
506  // don't use TLorentzVector here for Mag() due to - on metric
507  // normalize direction to 1.0
508  TVector3 dirNu = (fCurEntry->fgX4.Vect() - fgX4dkvtx.Vect()).Unit();
509  fCurEntry->fgP4.SetPxPyPzE( Ev*dirNu.X(),
510  Ev*dirNu.Y(),
511  Ev*dirNu.Z(), Ev);
512 
513  // calculate the weight, potentially includes effect from tilted window
514  // must be done *after* neutrino direction is determined
515  fWeight = fCurEntry->nimpwt * fCurEntry->fgXYWgt; // full weight
516  if ( fApplyTiltWeight ) {
517  double tiltwgt = dirNu.Dot( FluxWindowNormal() );
518  fWeight *= TMath::Abs( tiltwgt );
519  }
520 
521  // update sume of weights
522  fSumWeight += this->Weight();
523 
524  // Set the current flux neutrino 4-position, direction in user coord
527 
528  // if desired, move to user specified user coord z
529  if ( TMath::Abs(fZ0) < 1.0e30 ) this->MoveToZ0(fZ0);
530 
531 #ifdef __GENIE_LOW_LEVEL_MESG_ENABLED__
532  LOG("Flux", pINFO)
533  << "Generated neutrino: " << fIEntry << " " << fCurEntry->evtno
534  << " nenergyn " << fCurEntry->nenergyn
535  << "\n pdg-code: " << fCurEntry->fgPdgC
536  << "\n p4 beam: " << utils::print::P4AsShortString(&fCurEntry->fgP4)
537  << "\n x4 beam: " << utils::print::X4AsString(&fCurEntry->fgX4)
538  << "\n p4 user: " << utils::print::P4AsShortString(&(fCurEntry->fgP4User))
539  << "\n x4 user: " << utils::print::X4AsString(&(fCurEntry->fgX4User));
540 #endif
541  if ( Ev > fMaxEv ) {
542  LOG("Flux", pFATAL)
543  << "Generated neutrino had E_nu = " << Ev << " > " << fMaxEv
544  << " maximum ";
545  assert(0);
546  }
547 
548  return true;
549 }
double fSumWeight
sum of weights for nus thrown so far
Definition: GNuMIFlux.h:408
TLorentzVector fgP4
generated nu 4-momentum beam coord
Definition: GNuMIFlux.h:102
string P4AsShortString(const TLorentzVector *p)
Definition: PrintUtils.cxx:52
long int fIUse
current # of times an entry has been used
Definition: GNuMIFlux.h:407
#define pERROR
Definition: Messenger.h:60
static RandomGen * Instance()
Access instance.
Definition: RandomGen.cxx:79
Long64_t fIEntry
current flux ntuple entry
Definition: GNuMIFlux.h:396
virtual Int_t GetEntry(Long64_t entry)
#define pFATAL
Definition: Messenger.h:57
TLorentzVector fgX4User
generated nu 4-position user coord
Definition: GNuMIFlux.h:105
bool fApplyTiltWeight
wgt due to window normal not || beam
Definition: GNuMIFlux.h:414
TLorentzVector fFluxWindowDir2
extent for flux window (direction 2)
Definition: GNuMIFlux.h:429
bool ExistsInPDGCodeList(int pdg_code) const
Long64_t fNEntries
number of flux ntuple entries
Definition: GNuMIFlux.h:395
void Beam2UserP4(const TLorentzVector &beamp4, TLorentzVector &usrp4) const
Definition: GNuMIFlux.cxx:1137
bool fEnd
end condition reached
Definition: GNuMIFlux.h:385
A singleton holding random number generator classes. All random number generation in GENIE should tak...
Definition: RandomGen.h:30
void MakeCopy(const g3numi *)
pull in from g3 ntuple
Definition: GNuMIFlux.cxx:1632
double Weight(void)
returns the flux neutrino weight (if any)
Definition: GNuMIFlux.h:234
TLorentzVector fgX4
generated nu 4-position beam coord
Definition: GNuMIFlux.h:103
void MoveToZ0(double z0)
move ray origin to user coord Z0
Definition: GNuMIFlux.cxx:559
g4numi * fG4NuMI
g4numi ntuple
Definition: GNuMIFlux.h:392
TLorentzVector fgX4dkvtx
decay 4-position beam coord
Definition: GNuMIFlux.h:434
PDGCodeList * fPdgCList
list of neutrino pdg-codes to generate
virtual Int_t GetEntry(Long64_t entry)
#define LOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a string (using the FILE...
Definition: Messenger.h:97
TLorentzVector fFluxWindowDir1
extent for flux window (direction 1)
Definition: GNuMIFlux.h:428
int CalcEnuWgt(const TLorentzVector &xyz, double &enu, double &wgt_xy) const
Definition: GNuMIFlux.cxx:1885
#define pINFO
Definition: Messenger.h:63
long int fNCycles
times to cycle through the ntuple(s)
flugg * fFlugg
flugg ntuple
Definition: GNuMIFlux.h:393
TVector3 Unit() const
GNuMIFluxPassThroughInfo * fCurEntry
copy of current ntuple entry info (owned structure)
Definition: GNuMIFlux.h:436
double fAccumPOTs
POTs used so far.
Definition: GNuMIFlux.h:411
#define pWARN
Definition: Messenger.h:61
PDGCodeList * fPdgCListRej
list of nu pdg-codes seen but rejected
void Beam2UserPos(const TLorentzVector &beamxyz, TLorentzVector &usrxyz) const
Definition: GNuMIFlux.cxx:1127
double fMaxWeight
max flux neutrino weight in input file
Definition: GNuMIFlux.h:401
virtual Int_t GetEntry(Long64_t entry)
int fgPdgC
generated nu pdg-code
Definition: GNuMIFlux.h:98
g3numi * fG3NuMI
g3numi ntuple
Definition: GNuMIFlux.h:391
exit(0)
assert(nhit_max >=nhit_nbins)
int fUseFluxAtDetCenter
use flux at near (-1) or far (+1) det center from ntuple?
Definition: GNuMIFlux.h:416
double fEffPOTsPerNu
what a entry is worth ...
Definition: GNuMIFlux.h:410
TVector3 FluxWindowNormal()
Definition: GNuMIFlux.h:368
TLorentzVector fgP4User
generated nu 4-momentum user coord
Definition: GNuMIFlux.h:104
TRandom3 & RndFlux(void) const
rnd number generator used by flux drivers
Definition: RandomGen.h:72
string X4AsString(const TLorentzVector *x)
Definition: PrintUtils.cxx:64
double fWeight
current neutrino weight, =1 if generating unweighted entries
Definition: GNuMIFlux.h:400
double fMaxEv
maximum energy
Definition: GNuMIFlux.h:384
TLorentzVector fFluxWindowBase
base point for flux window - beam coord
Definition: GNuMIFlux.h:427
long int fNNeutrinos
number of flux neutrinos thrown so far
Definition: GNuMIFlux.h:409
void push_back(int pdg_code)
Definition: PDGCodeList.cxx:67
#define pDEBUG
Definition: Messenger.h:64
void GNuMIFlux::GenerateWeighted ( bool  gen_weighted)
virtual

set whether to generate weighted or unweighted neutrinos

Implements genie::GFluxI.

Definition at line 1179 of file GNuMIFlux.cxx.

1180 {
1181  // Set whether to generate weighted rays
1182  //
1183  fGenWeighted = gen_weighted;
1184 }
bool fGenWeighted
does GenerateNext() give weights?
Definition: GNuMIFlux.h:413
TVector3 GNuMIFlux::GetBeamCenter ( ) const

beam origin in user frame

Definition at line 1097 of file GNuMIFlux.cxx.

1098 {
1099  TVector3 beam0 = fBeamZero.Vect();
1100  return beam0;
1101 }
TLorentzVector fBeamZero
beam origin in user coords
Definition: GNuMIFlux.h:422
TRotation GNuMIFlux::GetBeamRotation ( ) const

rotation to apply from beam->user

Definition at line 1084 of file GNuMIFlux.cxx.

1085 {
1086  // rotation is really only 3-d vector, but we'll be operating on LorentzV's
1087  // give people back the original TRotation ... not pretty
1088  // ... it think this is right
1089  TRotation rot3;
1090  const TLorentzRotation& rot4 = fBeamRot;
1091  TVector3 newX(rot4.XX(),rot4.XY(),rot4.XZ());
1092  TVector3 newY(rot4.YX(),rot4.YY(),rot4.YZ());
1093  TVector3 newZ(rot4.ZX(),rot4.ZY(),rot4.ZZ());
1094  rot3.RotateAxes(newX,newY,newZ);
1095  return rot3.Inverse();
1096 }
TLorentzRotation fBeamRot
rotation applied beam –> user coord
Definition: GNuMIFlux.h:423
void GNuMIFlux::GetBranchInfo ( std::vector< std::string > &  branchNames,
std::vector< std::string > &  branchClassNames,
std::vector< void ** > &  branchObjPointers 
)
virtual

allow caller to copy current status / ntuple entry info in the output file by providing copies of internal info

Assumes that branch object pointers will not change which may require either a copy be made or, if using the class directly for reading the branch, one must force ROOT to not autodelete: myns::MyClassType* fCurrMyClass = new myns::MyClassType; myTree->SetBranchAddress("bname",&fCurMyClass); //? TBranch* b = myTree->GetBranch("bname"); //? b->SetAutoDelete(false);

ensure vectors are sized sufficiently (or use .push_back()) branchNames[i] = "bname" branchClassNames[i] = "myns::MyClassType" branchObjPointers[i] = (void**)

Reimplemented from genie::flux::GFluxFileConfigI.

Definition at line 819 of file GNuMIFlux.cxx.

822 {
823  // allow flux driver to report back current status and/or ntuple entry
824  // info for possible recording in the output file by supplying
825  // the class name, and a pointer to the object that will be filled
826  // as well as a suggested name for the branch.
827 
828  branchNames.push_back("flux");
829  branchClassNames.push_back("genie::flux::GNuMIFluxPassThroughInfo");
830  branchObjPointers.push_back((void**)&fCurEntry);
831 
832 }
GNuMIFluxPassThroughInfo * fCurEntry
copy of current ntuple entry info (owned structure)
Definition: GNuMIFlux.h:436
double GNuMIFlux::GetDecayDist ( ) const

dist (user units) from dk to current pos

Definition at line 551 of file GNuMIFlux.cxx.

Referenced by fill_simple(), and genie::flux::GFluxBlender::GenerateNext().

552 {
553  // return distance (user units) between dk point and start position
554  // these are in beam units
555  TVector3 x3diff = fCurEntry->fgX4.Vect() - fgX4dkvtx.Vect();
556  return x3diff.Mag() * fLengthScaleB2U;
557 }
TLorentzVector fgX4
generated nu 4-position beam coord
Definition: GNuMIFlux.h:103
TLorentzVector fgX4dkvtx
decay 4-position beam coord
Definition: GNuMIFlux.h:434
GNuMIFluxPassThroughInfo * fCurEntry
copy of current ntuple entry info (owned structure)
Definition: GNuMIFlux.h:436
double fLengthScaleB2U
scale factor beam (cm) –> user
Definition: GNuMIFlux.h:419
Long64_t genie::flux::GNuMIFlux::GetEntryNumber ( )
inline

index in chain

Definition at line 253 of file GNuMIFlux.h.

Referenced by fill_simple().

genie::flux::Exposure_t genie::flux::GFluxExposureI::GetExposureType ( ) const
inherited

Definition at line 56 of file GFluxExposureI.cxx.

References genie::flux::GFluxExposureI::fEType.

57  { return fEType; }
genie::flux::Exposure_t fEType
const char * genie::flux::GFluxExposureI::GetExposureUnits ( ) const
inherited

what units are returned by GetTotalExposure?

Definition at line 59 of file GFluxExposureI.cxx.

References genie::flux::GFluxExposureI::AsString(), and genie::flux::GFluxExposureI::fEType.

Referenced by main().

static const char * AsString(genie::flux::Exposure_t etype)
genie::flux::Exposure_t fEType
std::vector< std::string > GNuMIFlux::GetFileList ( )

list of files currently part of chain

Definition at line 2592 of file GNuMIFlux.cxx.

References modify_metadata_with_upmu_sample_type::flist, and next().

Referenced by fill_simple().

2593 {
2594  std::vector<std::string> flist;
2595  TObjArray *fileElements=fNuFluxTree->GetListOfFiles();
2596  TIter next(fileElements);
2597  TChainElement *chEl=0;
2598  while (( chEl=(TChainElement*)next() )) {
2599  flist.push_back(chEl->GetTitle());
2600  }
2601  return flist;
2602 }
TChain * fNuFluxTree
TTree in g3numi or g4numi // REF ONLY!
Definition: GNuMIFlux.h:389
void next()
Definition: show_event.C:84
void GNuMIFlux::GetFluxWindow ( TVector3 &  p1,
TVector3 &  p2,
TVector3 &  p3 
) const

3 points define a plane in beam coordinate

Definition at line 1060 of file GNuMIFlux.cxx.

Referenced by fill_simple().

1061 {
1062  // return flux window points
1063  p0 = fFluxWindowPtUser[0];
1064  p1 = fFluxWindowPtUser[1];
1065  p2 = fFluxWindowPtUser[2];
1066 
1067 }
TVector3 fFluxWindowPtUser[3]
user points of flux window
Definition: GNuMIFlux.h:426
TTree * GNuMIFlux::GetMetaDataTree ( )
virtual

Reimplemented from genie::flux::GFluxFileConfigI.

Definition at line 833 of file GNuMIFlux.cxx.

833 { return 0; } // there is none
double GNuMIFlux::GetTotalExposure ( ) const
virtual

Implements genie::flux::GFluxExposureI.

Definition at line 281 of file GNuMIFlux.cxx.

282 {
283  // complete the GFluxExposureI interface
284  return UsedPOTs();
285 }
double UsedPOTs(void) const
of protons-on-target used
Definition: GNuMIFlux.cxx:620
virtual std::string genie::flux::GFluxFileConfigI::GetXMLFileBase ( ) const
inlinevirtualinherited
long int genie::flux::GNuMIFlux::Index ( void  )
inlinevirtual

returns corresponding index for current flux neutrino (e.g. for a flux ntuple returns the current entry number)

Implements genie::GFluxI.

Definition at line 238 of file GNuMIFlux.h.

References MECModelEnuComparisons::opt.

238 { return fIEntry; }
Long64_t fIEntry
current flux ntuple entry
Definition: GNuMIFlux.h:396
void GNuMIFlux::Initialize ( void  )
private

Definition at line 1186 of file GNuMIFlux.cxx.

References LOG, pNOTICE, and genie::utils::units::UnitFromString().

1187 {
1188  LOG("Flux", pNOTICE) << "Initializing GNuMIFlux driver";
1189 
1190  fMaxEv = 0;
1191  fEnd = false;
1192 
1194 
1195  fNuFluxTree = 0;
1196  fG3NuMI = 0;
1197  fG4NuMI = 0;
1198  fFlugg = 0;
1199  fNuFluxTreeName = "";
1200  fNuFluxGen = "";
1201  fNFiles = 0;
1202 
1203  fNEntries = 0;
1204  fIEntry = -1;
1205  fICycle = 0;
1206  fNUse = 1;
1207  fIUse = 999999;
1208 
1209  fNuTot = 0;
1210  fFilePOTs = 0;
1211 
1212  fMaxWeight = -1;
1213  fMaxWgtFudge = 1.05;
1214  fMaxWgtEntries = 2500000;
1215  fMaxEFudge = 0;
1216 
1217  fSumWeight = 0;
1218  fNNeutrinos = 0;
1219  fEffPOTsPerNu = 0;
1220  fAccumPOTs = 0;
1221 
1222  fGenWeighted = false;
1223  fApplyTiltWeight = true;
1224  fUseFluxAtDetCenter = 0;
1225  fDetLocIsSet = false;
1226  // by default assume user length is cm
1228 
1229  this->SetDefaults();
1230  this->ResetCurrent();
1231 }
double fSumWeight
sum of weights for nus thrown so far
Definition: GNuMIFlux.h:408
long int fIUse
current # of times an entry has been used
Definition: GNuMIFlux.h:407
Long64_t fFilePOTs
of protons-on-target represented by all files
Definition: GNuMIFlux.h:398
void SetLengthUnits(double user_units)
Set units assumed by user.
Definition: GNuMIFlux.cxx:1362
Long64_t fIEntry
current flux ntuple entry
Definition: GNuMIFlux.h:396
bool fGenWeighted
does GenerateNext() give weights?
Definition: GNuMIFlux.h:413
double fMaxEFudge
fudge factor for estmating max enu (0=> use fixed 120GeV)
Definition: GNuMIFlux.h:404
bool fApplyTiltWeight
wgt due to window normal not || beam
Definition: GNuMIFlux.h:414
Long64_t fNEntries
number of flux ntuple entries
Definition: GNuMIFlux.h:395
bool fEnd
end condition reached
Definition: GNuMIFlux.h:385
double fMaxWgtFudge
fudge factor for estimating max wgt
Definition: GNuMIFlux.h:402
TChain * fNuFluxTree
TTree in g3numi or g4numi // REF ONLY!
Definition: GNuMIFlux.h:389
string fNuFluxTreeName
Tree name "h10" (g3) or "nudata" (g4)
Definition: GNuMIFlux.h:388
g4numi * fG4NuMI
g4numi ntuple
Definition: GNuMIFlux.h:392
#define LOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a string (using the FILE...
Definition: Messenger.h:97
double UnitFromString(string u)
Definition: UnitUtils.cxx:26
bool fDetLocIsSet
is a flux location (near/far) set?
Definition: GNuMIFlux.h:415
int fNFiles
number of files in chain
Definition: GNuMIFlux.h:394
flugg * fFlugg
flugg ntuple
Definition: GNuMIFlux.h:393
GNuMIFluxPassThroughInfo * fCurEntry
copy of current ntuple entry info (owned structure)
Definition: GNuMIFlux.h:436
double fAccumPOTs
POTs used so far.
Definition: GNuMIFlux.h:411
double fMaxWeight
max flux neutrino weight in input file
Definition: GNuMIFlux.h:401
long int fMaxWgtEntries
of entries in estimating max wgt
Definition: GNuMIFlux.h:403
g3numi * fG3NuMI
g3numi ntuple
Definition: GNuMIFlux.h:391
int fUseFluxAtDetCenter
use flux at near (-1) or far (+1) det center from ntuple?
Definition: GNuMIFlux.h:416
double fEffPOTsPerNu
what a entry is worth ...
Definition: GNuMIFlux.h:410
#define pNOTICE
Definition: Messenger.h:62
string fNuFluxGen
"g3numi" "g4numi" or "flugg"
Definition: GNuMIFlux.h:390
long int fNUse
how often to use same entry in a row
Definition: GNuMIFlux.h:406
Long64_t fNuTot
cummulative # of entries (=fNEntries)
Definition: GNuMIFlux.h:397
double fMaxEv
maximum energy
Definition: GNuMIFlux.h:384
long int fNNeutrinos
number of flux neutrinos thrown so far
Definition: GNuMIFlux.h:409
double GNuMIFlux::LengthUnits ( void  ) const

Return user units.

Definition at line 1396 of file GNuMIFlux.cxx.

References Munits::cm, and genie::utils::units::UnitFromString().

1397 {
1398  // Return the scale factor for lengths the user is getting
1399  double cm = genie::utils::units::UnitFromString("cm");
1400  return fLengthScaleB2U * cm ;
1401 }
double UnitFromString(string u)
Definition: UnitUtils.cxx:26
double fLengthScaleB2U
scale factor beam (cm) –> user
Definition: GNuMIFlux.h:419
static constexpr Double_t cm
Definition: Munits.h:140
void genie::flux::GFluxFileConfigI::LoadBeamSimData ( const std::set< std::string > &  filenames,
const std::string det_loc 
)
virtualinherited

Definition at line 34 of file GFluxFileConfigI.cxx.

References genie::flux::GFluxFileConfigI::LoadBeamSimData().

36  {
37  // Loads a beam simulation root file into the GFluxFileConfig driver.
38  // have a set<> want a vector<>
39  std::vector<std::string> filevec;
40  std::copy(fileset.begin(),fileset.end(),std::back_inserter(filevec));
41  LoadBeamSimData(filevec,config); // call the one that takes a vector
42  }
virtual void LoadBeamSimData(const std::vector< std::string > &filenames, const std::string &det_loc)=0
Definition: config.py:1
void genie::flux::GFluxFileConfigI::LoadBeamSimData ( const std::string filename,
const std::string det_loc 
)
virtualinherited

Definition at line 45 of file GFluxFileConfigI.cxx.

References genie::flux::GFluxFileConfigI::LoadBeamSimData().

47  {
48  // Loads a beam simulation root file into the GFluxFileConfig driver.
49  std::vector<std::string> filevec;
50  filevec.push_back(filename);
51  LoadBeamSimData(filevec,config); // call the one that takes a vector
52  }
virtual void LoadBeamSimData(const std::vector< std::string > &filenames, const std::string &det_loc)=0
Definition: config.py:1
string filename
Definition: shutoffs.py:106
void GNuMIFlux::LoadBeamSimData ( const std::vector< std::string > &  filenames,
const std::string det_loc 
)
virtual

first is primary method for loading root flux ntuple files and config others are alternatives that can be overloaded but have sensible defaults to fall back to calling the vector version

Implements genie::flux::GFluxFileConfigI.

Definition at line 640 of file GNuMIFlux.cxx.

References make_static_page::AddFile(), exit(), shutoffs::filename, genie::RandomGen::Instance(), calib::j, LOG, submit_syst::pattern, pERROR, pFATAL, pINFO, pNOTICE, generate_hists::rnd, genie::RandomGen::RndFlux(), and string.

Referenced by fill_simple(), and test_gnumi().

642 {
643 // Loads in a gnumi beam simulation root file (converted from hbook format)
644 // into the GNuMIFlux driver.
645 
646  bool found_cfg = this->LoadConfig(config);
647  if ( ! found_cfg ) {
648  LOG("Flux", pFATAL)
649  << "LoadBeamSimData could not find XML config \"" << config << "\"\n";
650  exit(1);
651  }
652 
653  fNuFluxFilePatterns = patterns;
654  std::vector<int> nfiles_from_pattern;
655 
656  // create a (sorted) set of file names
657  // this also helps ensure that the same file isn't listed multiple times
658  std::set<std::string> fnames;
659 
660  LOG("Flux", pINFO) << "LoadBeamSimData was passed " << patterns.size()
661  << " patterns";
662 
663  for (size_t ipatt = 0; ipatt < patterns.size(); ++ipatt ) {
664  string pattern = patterns[ipatt];
665  nfiles_from_pattern.push_back(0);
666 
667  LOG("Flux", pNOTICE)
668  << "Loading gnumi flux tree from ROOT file pattern ["
669  << std::setw(3) << ipatt << "] \"" << pattern << "\"";
670 
671  // !WILDCARD only works for file name ... NOT directory
672  string dirname = gSystem->UnixPathName(gSystem->WorkingDirectory());
673  size_t slashpos = pattern.find_last_of("/");
674  size_t fbegin;
675  if ( slashpos != std::string::npos ) {
676  dirname = pattern.substr(0,slashpos);
677  LOG("Flux", pINFO) << "Look for flux using directory " << dirname;
678  fbegin = slashpos + 1;
679  } else { fbegin = 0; }
680 
681  void* dirp = gSystem->OpenDirectory(gSystem->ExpandPathName(dirname.c_str()));
682  if ( dirp ) {
683  std::string basename =
684  pattern.substr(fbegin,pattern.size()-fbegin);
685  TRegexp re(basename.c_str(),kTRUE);
686  const char* onefile;
687  while ( ( onefile = gSystem->GetDirEntry(dirp) ) ) {
688  TString afile = onefile;
689  if ( afile=="." || afile==".." ) continue;
690  if ( basename!=afile && afile.Index(re) == kNPOS ) continue;
691  std::string fullname = dirname + "/" + afile.Data();
692  fnames.insert(fullname);
693  nfiles_from_pattern[ipatt]++;
694  }
695  gSystem->FreeDirectory(dirp);
696  } // legal directory
697  } // loop over patterns
698 
699  size_t indx = 0;
700  std::set<string>::const_iterator sitr = fnames.begin();
701  for ( ; sitr != fnames.end(); ++sitr, ++indx ) {
702  string filename = *sitr;
703  //std::cout << " [" << std::setw(3) << indx << "] \""
704  // << filename << "\"" << std::endl;
705  bool isok = true;
706  // this next test only works for local files, so we can't do that
707  // if we want to stream via xrootd
708  // ! (gSystem->AccessPathName(filename.c_str()));
709  if ( isok ) {
710  // open the file to see what it contains
711  // h10 => g3numi _or_ flugg
712  // nudata => g4numi
713  // for now distinguish between g3numi/flugg using file name
714  TFile* tf = TFile::Open(filename.c_str(),"READ");
715  int isflugg = ( filename.find("flugg") != string::npos ) ? 1 : 0;
716  const std::string tnames[] = { "h10", "nudata" };
717  const std::string gnames[] = { "g3numi","g4numi","flugg","g4flugg"};
718  for (int j = 0; j < 2 ; ++j ) {
719  TTree* atree = (TTree*)tf->Get(tnames[j].c_str());
720  if ( atree ) {
721  const std::string tname_this = tnames[j];
722  const std::string gname_this = gnames[j+2*isflugg];
723  // create chain if none exists
724  if ( ! fNuFluxTree ) {
725  this->SetTreeName(tname_this);
726  fNuFluxTree = new TChain(fNuFluxTreeName.c_str());
727  fNuFluxGen = gname_this;
728  // here we should scan for estimated POTs/file
729  // also maybe the check on max weight
730  }
731  // sanity check for mixing g3/g4/flugg files
732  if ( fNuFluxTreeName != tname_this ||
733  fNuFluxGen != gname_this ) {
734  LOG("Flux", pFATAL)
735  << "Inconsistent flux file types\n"
736  << "The input gnumi flux file \"" << filename
737  << "\"\ncontains a '" << tname_this << "' " << gname_this
738  << "numi ntuple "
739  << "but a '" << fNuFluxTreeName << "' " << fNuFluxGen
740  << " numi ntuple has alread been seen in the chain";
741  exit(1);
742  } // sanity mix/match g3/g4
743  // add the file to the chain
744  this->AddFile(atree,filename);
745  } // found a tree
746  } // loop over either g3 or g4
747  tf->Close();
748  delete tf;
749  } // loop over tree type
750  } // loop over sorted file names
751 
752  if ( fNuFluxTreeName == "" ) {
753  LOG("Flux", pFATAL)
754  << "The input gnumi flux file doesn't exist! Initialization failed!";
755  exit(1);
756  }
757  if ( fNuFluxGen == "g3numi" ) fG3NuMI = new g3numi(fNuFluxTree);
758  if ( fNuFluxGen == "g4numi" ) fG4NuMI = new g4numi(fNuFluxTree);
759  if ( fNuFluxGen == "flugg" ) fFlugg = new flugg(fNuFluxTree);
760 
761  // this will open all files and read header!!
762  fNEntries = fNuFluxTree->GetEntries();
763 
764  if ( fNEntries == 0 ) {
765  LOG("Flux", pERROR)
766  << "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!";
767  LOG("Flux", pERROR)
768  << "Loaded flux tree contains " << fNEntries << " entries";
769  LOG("Flux", pERROR)
770  << "Was passed the file patterns: ";
771  for (size_t ipatt = 0; ipatt < patterns.size(); ++ipatt ) {
772  string pattern = patterns[ipatt];
773  LOG("Flux", pERROR)
774  << " [" << std::setw(3) << ipatt <<"] " << pattern;
775  }
776  LOG("Flux", pERROR)
777  << "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!";
778  } else {
779  LOG("Flux", pNOTICE)
780  << "Loaded flux tree contains " << fNEntries << " entries"
781  << " from " << fnames.size() << " unique files";
782  for (size_t ipatt = 0; ipatt < patterns.size(); ++ipatt ) {
783  string pattern = patterns[ipatt];
784  LOG("Flux", pINFO)
785  << " pattern: " << pattern << " yielded "
786  << nfiles_from_pattern[ipatt] << " files";
787  }
788  }
789 
790  // we have a file we can work with
791  if (!fDetLocIsSet) {
792  LOG("Flux", pERROR)
793  << "LoadBeamSimData left detector location unset";
794  }
795  if (fMaxWeight<=0) {
796  LOG("Flux", pINFO)
797  << "Run ScanForMaxWeight() as part of LoadBeamSimData";
798  this->ScanForMaxWeight();
799  }
800 
801  // current ntuple cycle # (flux ntuples may be recycled)
802  fICycle = 0;
803  // pick a starting entry index [0:fNEntries-1]
804  // pretend we just used up the the previous one
806  fIUse = 9999999;
807  fIEntry = rnd->RndFlux().Integer(fNEntries) - 1;
808 
809  // don't count things we used to estimate max weight
810  fSumWeight = 0;
811  fNNeutrinos = 0;
812  fAccumPOTs = 0;
813 
814  LOG("Flux",pNOTICE) << "about to CalcEffPOTsPerNu";
815  this->CalcEffPOTsPerNu();
816 
817 }
double fSumWeight
sum of weights for nus thrown so far
Definition: GNuMIFlux.h:408
Definition: g3numi.h:15
long int fIUse
current # of times an entry has been used
Definition: GNuMIFlux.h:407
#define pERROR
Definition: Messenger.h:60
static RandomGen * Instance()
Access instance.
Definition: RandomGen.cxx:79
Long64_t fIEntry
current flux ntuple entry
Definition: GNuMIFlux.h:396
#define pFATAL
Definition: Messenger.h:57
bool LoadConfig(string cfg)
load a named configuration
Definition: GNuMIFlux.cxx:2480
Definition: g4numi.h:18
Definition: config.py:1
void SetTreeName(string name)
set input tree name (default: "h10")
Definition: GNuMIFlux.cxx:932
Long64_t fNEntries
number of flux ntuple entries
Definition: GNuMIFlux.h:395
string filename
Definition: shutoffs.py:106
Timing fit.
A singleton holding random number generator classes. All random number generation in GENIE should tak...
Definition: RandomGen.h:30
TChain * fNuFluxTree
TTree in g3numi or g4numi // REF ONLY!
Definition: GNuMIFlux.h:389
string fNuFluxTreeName
Tree name "h10" (g3) or "nudata" (g4)
Definition: GNuMIFlux.h:388
g4numi * fG4NuMI
g4numi ntuple
Definition: GNuMIFlux.h:392
std::vector< string > fNuFluxFilePatterns
(potentially wildcarded) path(s)
Definition: GNuMIFlux.h:387
#define LOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a string (using the FILE...
Definition: Messenger.h:97
const double j
Definition: BetheBloch.cxx:29
Definition: flugg.h:15
#define pINFO
Definition: Messenger.h:63
bool fDetLocIsSet
is a flux location (near/far) set?
Definition: GNuMIFlux.h:415
flugg * fFlugg
flugg ntuple
Definition: GNuMIFlux.h:393
double fAccumPOTs
POTs used so far.
Definition: GNuMIFlux.h:411
double fMaxWeight
max flux neutrino weight in input file
Definition: GNuMIFlux.h:401
g3numi * fG3NuMI
g3numi ntuple
Definition: GNuMIFlux.h:391
exit(0)
void ScanForMaxWeight(void)
scan for max flux weight (before generating unweighted flux neutrinos)
Definition: GNuMIFlux.cxx:836
#define pNOTICE
Definition: Messenger.h:62
TRandom3 & RndFlux(void) const
rnd number generator used by flux drivers
Definition: RandomGen.h:72
string fNuFluxGen
"g3numi" "g4numi" or "flugg"
Definition: GNuMIFlux.h:390
void AddFile(TTree *tree, string fname)
Definition: GNuMIFlux.cxx:1289
long int fNNeutrinos
number of flux neutrinos thrown so far
Definition: GNuMIFlux.h:409
void CalcEffPOTsPerNu(void)
Definition: GNuMIFlux.cxx:595
enum BeamMode string
bool GNuMIFlux::LoadConfig ( string  cfg)

load a named configuration

Definition at line 2480 of file GNuMIFlux.cxx.

References genie::flux::GNuMIFluxXMLHelper::LoadConfig().

2481 {
2482  const char* altxml = gSystem->Getenv("GNUMIFLUXXML");
2483  if ( altxml ) {
2484  SetXMLFileBase(altxml);
2485  }
2486  genie::flux::GNuMIFluxXMLHelper helper(this);
2487  return helper.LoadConfig(cfg);
2488 }
virtual void SetXMLFileBase(std::string xmlbasename="")
double genie::flux::GNuMIFlux::MaxEnergy ( void  )
inlinevirtual

declare the max flux neutrino energy that can be generated (for init. purposes)

Implements genie::GFluxI.

Definition at line 231 of file GNuMIFlux.h.

Referenced by test_gnumi().

231 { return fMaxEv; }
double fMaxEv
maximum energy
Definition: GNuMIFlux.h:384
const TLorentzVector& genie::flux::GNuMIFlux::Momentum ( void  )
inlinevirtual

returns the flux neutrino 4-momentum

Implements genie::GFluxI.

Definition at line 235 of file GNuMIFlux.h.

Referenced by test_gnumi().

235 { return fCurEntry->fgP4User; }
GNuMIFluxPassThroughInfo * fCurEntry
copy of current ntuple entry info (owned structure)
Definition: GNuMIFlux.h:436
TLorentzVector fgP4User
generated nu 4-momentum user coord
Definition: GNuMIFlux.h:104
void GNuMIFlux::MoveToZ0 ( double  z0)

move ray origin to user coord Z0

Definition at line 559 of file GNuMIFlux.cxx.

References e, LOG, genie::utils::print::P4AsShortString(), pNOTICE, pWARN, scale, and genie::utils::print::X4AsString().

560 {
561  // move ray origin to specified user z0
562  // move beam coord entry correspondingly
563 
564 #ifdef __GENIE_LOW_LEVEL_MESG_ENABLED__
565  LOG("Flux", pNOTICE)
566  << "MoveToZ0 (z0usr=" << z0usr << ") before:"
567  << "\n p4 user: " << utils::print::P4AsShortString(&(fCurEntry->fgP4User))
568  << "\n x4 user: " << utils::print::X4AsString(&(fCurEntry->fgX4User));
569 #endif
570 
571  double pzusr = fCurEntry->fgP4User.Pz();
572  if ( TMath::Abs(pzusr) < 1.0e-30 ) {
573  // neutrino is moving almost entirely in x-y plane
574  LOG("Flux", pWARN)
575  << "MoveToZ0(" << z0usr << ") not possible due to pz_usr (" << pzusr << ")";
576  return;
577  }
578 
579  double scale = (z0usr - fCurEntry->fgX4User.Z()) / pzusr;
580  fCurEntry->fgX4User += (scale*fCurEntry->fgP4User);
582  // this scaling works for distances, but not the time component
583  fCurEntry->fgX4.SetT(0);
584  fCurEntry->fgX4User.SetT(0);
585 
586 #ifdef __GENIE_LOW_LEVEL_MESG_ENABLED__
587  LOG("Flux", pNOTICE)
588  << "MoveToZ0 (" << z0usr << ") after:"
589  << "\n x4 user: " << utils::print::X4AsString(&(fCurEntry->fgX4User));
590 #endif
591 
592 }
TLorentzVector fgP4
generated nu 4-momentum beam coord
Definition: GNuMIFlux.h:102
string P4AsShortString(const TLorentzVector *p)
Definition: PrintUtils.cxx:52
TLorentzVector fgX4User
generated nu 4-position user coord
Definition: GNuMIFlux.h:105
Double_t scale
Definition: plot.C:25
TLorentzVector fgX4
generated nu 4-position beam coord
Definition: GNuMIFlux.h:103
#define LOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a string (using the FILE...
Definition: Messenger.h:97
GNuMIFluxPassThroughInfo * fCurEntry
copy of current ntuple entry info (owned structure)
Definition: GNuMIFlux.h:436
#define pWARN
Definition: Messenger.h:61
double fLengthScaleU2B
scale factor beam user –> (cm)
Definition: GNuMIFlux.h:420
#define pNOTICE
Definition: Messenger.h:62
TLorentzVector fgP4User
generated nu 4-momentum user coord
Definition: GNuMIFlux.h:104
string X4AsString(const TLorentzVector *x)
Definition: PrintUtils.cxx:64
Float_t e
Definition: plot.C:35
long int GNuMIFlux::NFluxNeutrinos ( void  ) const
virtual

of rays generated

number of flux neutrinos ray generated so far

Implements genie::flux::GFluxExposureI.

Definition at line 288 of file GNuMIFlux.cxx.

Referenced by fill_simple().

289 {
290  /// number of flux neutrinos ray generated so far
291  return fNNeutrinos;
292 }
long int fNNeutrinos
number of flux neutrinos thrown so far
Definition: GNuMIFlux.h:409
const GNuMIFluxPassThroughInfo& genie::flux::GNuMIFlux::PassThroughInfo ( void  )
inline

GNuMIFluxPassThroughInfo.

Definition at line 252 of file GNuMIFlux.h.

Referenced by fill_simple(), and test_gnumi().

int genie::flux::GNuMIFlux::PdgCode ( void  )
inlinevirtual

returns the flux neutrino pdg code

Implements genie::GFluxI.

Definition at line 233 of file GNuMIFlux.h.

233 { return fCurEntry->fgPdgC; }
GNuMIFluxPassThroughInfo * fCurEntry
copy of current ntuple entry info (owned structure)
Definition: GNuMIFlux.h:436
int fgPdgC
generated nu pdg-code
Definition: GNuMIFlux.h:98
const TLorentzVector& genie::flux::GNuMIFlux::Position ( void  )
inlinevirtual

returns the flux neutrino 4-position (note: expect SI rather than physical units)

Implements genie::GFluxI.

Definition at line 236 of file GNuMIFlux.h.

236 { return fCurEntry->fgX4User; }
TLorentzVector fgX4User
generated nu 4-position user coord
Definition: GNuMIFlux.h:105
GNuMIFluxPassThroughInfo * fCurEntry
copy of current ntuple entry info (owned structure)
Definition: GNuMIFlux.h:436
double GNuMIFlux::POT_curr ( void  )

current average POT (RWH?)

Definition at line 633 of file GNuMIFlux.cxx.

633  {
634  // RWH: Not sure what POT_curr is supposed to represent I'll guess for
635  // now that that it means what I mean by UsedPOTs().
636  return UsedPOTs();
637 }
double UsedPOTs(void) const
of protons-on-target used
Definition: GNuMIFlux.cxx:620
void GNuMIFlux::PrintConfig ( void  )
virtual

print the current configuration

Implements genie::flux::GFluxFileConfigI.

Definition at line 2492 of file GNuMIFlux.cxx.

References modify_metadata_with_upmu_sample_type::flist, MECModelEnuComparisons::i, LOG, pNOTICE, genie::utils::print::Vec3AsString(), w, and genie::utils::print::X4AsString().

Referenced by fill_simple().

2493 {
2494 
2495  std::ostringstream s;
2496  PDGCodeList::const_iterator itr = fPdgCList->begin();
2497  for ( ; itr != fPdgCList->end(); ++itr) s << (*itr) << " ";
2498  s << "[rejected: ";
2499  itr = fPdgCListRej->begin();
2500  for ( ; itr != fPdgCListRej->end(); ++itr) s << (*itr) << " ";
2501  s << " ] ";
2502 
2503  std::ostringstream fpattout;
2504  for (size_t i = 0; i < fNuFluxFilePatterns.size(); ++i)
2505  fpattout << "\n [" << std::setw(3) << i << "] " << fNuFluxFilePatterns[i];
2506 
2507  std::ostringstream flistout;
2508  std::vector<std::string> flist = GetFileList();
2509  for (size_t i = 0; i < flist.size(); ++i)
2510  flistout << "\n [" << std::setw(3) << i << "] " << flist[i];
2511 
2512  TLorentzVector usr0(0,0,0,0);
2513  TLorentzVector usr0asbeam;
2514  User2BeamPos(usr0,usr0asbeam);
2515 
2516  const int w=10, p=6;
2517  std::ostringstream beamrot_str, beamrotinv_str;
2518  beamrot_str
2519  << "fBeamRot: " << std::setprecision(p) << "\n"
2520  << " [ "
2521  << std::setw(w) << fBeamRot.XX() << " "
2522  << std::setw(w) << fBeamRot.XY() << " "
2523  << std::setw(w) << fBeamRot.XZ() << " ]\n"
2524  << " [ "
2525  << std::setw(w) << fBeamRot.YX() << " "
2526  << std::setw(w) << fBeamRot.YY() << " "
2527  << std::setw(w) << fBeamRot.YZ() << " ]\n"
2528  << " [ "
2529  << std::setw(w) << fBeamRot.ZX() << " "
2530  << std::setw(w) << fBeamRot.ZY() << " "
2531  << std::setw(w) << fBeamRot.ZZ() << " ]";
2532  beamrotinv_str
2533  << "fBeamRotInv: " << std::setprecision(p) << "\n"
2534  << " [ "
2535  << std::setw(w) << fBeamRotInv.XX() << " "
2536  << std::setw(w) << fBeamRotInv.XY() << " "
2537  << std::setw(w) << fBeamRotInv.XZ() << " ]\n"
2538  << " [ "
2539  << std::setw(w) << fBeamRotInv.YX() << " "
2540  << std::setw(w) << fBeamRotInv.YY() << " "
2541  << std::setw(w) << fBeamRotInv.YZ() << " ]\n"
2542  << " [ "
2543  << std::setw(w) << fBeamRotInv.ZX() << " "
2544  << std::setw(w) << fBeamRotInv.ZY() << " "
2545  << std::setw(w) << fBeamRotInv.ZZ() << " ]";
2546 
2547  LOG("Flux", pNOTICE)
2548  << "GNuMIFlux Config:"
2549  << "\n Enu_max " << fMaxEv
2550  << "\n pdg-codes: " << s.str() << "\n "
2551  << (fG3NuMI?"g3numi":"")
2552  << (fG4NuMI?"g4numi":"")
2553  << (fFlugg?"flugg":"")
2554  << "/" << fNuFluxGen << " "
2555  << "(" << fNuFluxTreeName << "), " << fNEntries << " entries"
2556  << " (FilePOTs " << fFilePOTs << ") "
2557  << "in " << fNFiles << " files: "
2558  << flistout.str()
2559  << "\n from file patterns:"
2560  << fpattout.str()
2561  << "\n wgt max=" << fMaxWeight << " fudge=" << fMaxWgtFudge << " using "
2562  << fMaxWgtEntries << " entries"
2563  << "\n Z0 pushback " << fZ0
2564  << "\n used entry " << fIEntry << " " << fIUse << "/" << fNUse
2565  << " times, in " << fICycle << "/" << fNCycles << " cycles"
2566  << "\n SumWeight " << fSumWeight << " for " << fNNeutrinos << " neutrinos"
2567  << "\n EffPOTsPerNu " << fEffPOTsPerNu << " AccumPOTs " << fAccumPOTs
2568  << "\n GenWeighted \"" << (fGenWeighted?"true":"false") << ", "
2569  << "\", Detector location set \"" << (fDetLocIsSet?"true":"false") << "\""
2570  << "\n LengthUnits " << fLengthUnits << ", scale b2u " << fLengthScaleB2U
2571  << ", scale u2b " << fLengthScaleU2B
2572  << "\n User Flux Window: "
2576  << "\n Flux Window (cm, beam coord): "
2577  << "\n base " << utils::print::X4AsString(&fFluxWindowBase)
2578  << "\n dir1 " << utils::print::X4AsString(&fFluxWindowDir1) << " len " << fFluxWindowLen1
2579  << "\n dir2 " << utils::print::X4AsString(&fFluxWindowDir2) << " len " << fFluxWindowLen2
2580  << "\n normal " << utils::print::Vec3AsString(&(fWindowNormal))
2581  << "\n User Beam Origin: "
2582  << "\n base " << utils::print::X4AsString(&fBeamZero)
2583  << "\n " << beamrot_str.str() << " "
2584  << "\n Detector Origin (beam coord): "
2585  << "\n base " << utils::print::X4AsString(&usr0asbeam)
2586  << "\n " << beamrotinv_str.str() << " "
2587  << "\n UseFluxAtDetCenter " << fUseFluxAtDetCenter;
2588 
2589 }
double fSumWeight
sum of weights for nus thrown so far
Definition: GNuMIFlux.h:408
double fLengthUnits
units for coord in user exchanges
Definition: GNuMIFlux.h:418
long int fIUse
current # of times an entry has been used
Definition: GNuMIFlux.h:407
Long64_t fFilePOTs
of protons-on-target represented by all files
Definition: GNuMIFlux.h:398
Long64_t fIEntry
current flux ntuple entry
Definition: GNuMIFlux.h:396
bool fGenWeighted
does GenerateNext() give weights?
Definition: GNuMIFlux.h:413
const char * p
Definition: xmltok.h:285
TVector3 fFluxWindowPtUser[3]
user points of flux window
Definition: GNuMIFlux.h:426
TLorentzVector fFluxWindowDir2
extent for flux window (direction 2)
Definition: GNuMIFlux.h:429
Long64_t fNEntries
number of flux ntuple entries
Definition: GNuMIFlux.h:395
TLorentzVector fBeamZero
beam origin in user coords
Definition: GNuMIFlux.h:422
double fMaxWgtFudge
fudge factor for estimating max wgt
Definition: GNuMIFlux.h:402
const XML_Char * s
Definition: expat.h:262
string fNuFluxTreeName
Tree name "h10" (g3) or "nudata" (g4)
Definition: GNuMIFlux.h:388
void User2BeamPos(const TLorentzVector &usrxyz, TLorentzVector &beamxyz) const
Definition: GNuMIFlux.cxx:1143
g4numi * fG4NuMI
g4numi ntuple
Definition: GNuMIFlux.h:392
std::vector< string > fNuFluxFilePatterns
(potentially wildcarded) path(s)
Definition: GNuMIFlux.h:387
PDGCodeList * fPdgCList
list of neutrino pdg-codes to generate
std::vector< std::string > GetFileList()
list of files currently part of chain
Definition: GNuMIFlux.cxx:2592
#define LOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a string (using the FILE...
Definition: Messenger.h:97
TLorentzVector fFluxWindowDir1
extent for flux window (direction 1)
Definition: GNuMIFlux.h:428
bool fDetLocIsSet
is a flux location (near/far) set?
Definition: GNuMIFlux.h:415
int fNFiles
number of files in chain
Definition: GNuMIFlux.h:394
long int fNCycles
times to cycle through the ntuple(s)
flugg * fFlugg
flugg ntuple
Definition: GNuMIFlux.h:393
double fAccumPOTs
POTs used so far.
Definition: GNuMIFlux.h:411
PDGCodeList * fPdgCListRej
list of nu pdg-codes seen but rejected
double fMaxWeight
max flux neutrino weight in input file
Definition: GNuMIFlux.h:401
double fLengthScaleB2U
scale factor beam (cm) –> user
Definition: GNuMIFlux.h:419
long int fMaxWgtEntries
of entries in estimating max wgt
Definition: GNuMIFlux.h:403
g3numi * fG3NuMI
g3numi ntuple
Definition: GNuMIFlux.h:391
TVector3 fWindowNormal
normal direction for flux window
Definition: GNuMIFlux.h:432
double fLengthScaleU2B
scale factor beam user –> (cm)
Definition: GNuMIFlux.h:420
int fUseFluxAtDetCenter
use flux at near (-1) or far (+1) det center from ntuple?
Definition: GNuMIFlux.h:416
double fEffPOTsPerNu
what a entry is worth ...
Definition: GNuMIFlux.h:410
#define pNOTICE
Definition: Messenger.h:62
TLorentzRotation fBeamRotInv
Definition: GNuMIFlux.h:424
string fNuFluxGen
"g3numi" "g4numi" or "flugg"
Definition: GNuMIFlux.h:390
string X4AsString(const TLorentzVector *x)
Definition: PrintUtils.cxx:64
TLorentzRotation fBeamRot
rotation applied beam –> user coord
Definition: GNuMIFlux.h:423
long int fNUse
how often to use same entry in a row
Definition: GNuMIFlux.h:406
Float_t w
Definition: plot.C:20
string Vec3AsString(const TVector3 *vec)
Definition: PrintUtils.cxx:87
double fMaxEv
maximum energy
Definition: GNuMIFlux.h:384
TLorentzVector fFluxWindowBase
base point for flux window - beam coord
Definition: GNuMIFlux.h:427
long int fNNeutrinos
number of flux neutrinos thrown so far
Definition: GNuMIFlux.h:409
void GNuMIFlux::PrintCurrent ( void  )

print current entry from leaves

Definition at line 1160 of file GNuMIFlux.cxx.

References LOG, and pNOTICE.

1161 {
1162  LOG("Flux", pNOTICE) << "CurrentEntry:" << *fCurEntry;
1163 }
#define LOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a string (using the FILE...
Definition: Messenger.h:97
GNuMIFluxPassThroughInfo * fCurEntry
copy of current ntuple entry info (owned structure)
Definition: GNuMIFlux.h:436
#define pNOTICE
Definition: Messenger.h:62
void GNuMIFlux::ResetCurrent ( void  )
private

Definition at line 1262 of file GNuMIFlux.cxx.

1263 {
1264 // reset running values of neutrino pdg-code, 4-position & 4-momentum
1265 // and the input ntuple leaves
1266 
1268  fCurEntry->ResetCopy();
1269 }
GNuMIFluxPassThroughInfo * fCurEntry
copy of current ntuple entry info (owned structure)
Definition: GNuMIFlux.h:436
void GNuMIFlux::ScanForMaxWeight ( void  )

scan for max flux weight (before generating unweighted flux neutrinos)

Definition at line 836 of file GNuMIFlux.cxx.

References enu, exit(), compare_h5_caf::idx, LOG, pERROR, pFATAL, pNOTICE, confusionMatrixTree::t, and wgt.

Referenced by test_gnumi().

837 {
838  if (!fDetLocIsSet) {
839  LOG("Flux", pERROR)
840  << "Specify a detector location before scanning for max weight";
841  return;
842  }
843 
844  // scan for the maximum weight
845  int ipos_estimator = fUseFluxAtDetCenter;
846  if ( ipos_estimator == 0 ) {
847  // within 100m of a known point?
848  double zbase = fFluxWindowBase.Z();
849  if ( TMath::Abs(zbase-103648.837) < 10000. ) ipos_estimator = -1; // use NearDet
850  if ( TMath::Abs(zbase-73534000. ) < 10000. ) ipos_estimator = +1; // use FarDet
851  }
852  if ( ipos_estimator != 0 ) {
853 
854  //// one can't really be sure which Nwtfar/Nwtnear this refers to
855  //// some gnumi files have "NOvA" weights
856  const char* ntwgtstrv[4] = { "Nimpwt*Nwtnear",
857  "Nimpwt*Nwtfar",
858  "Nimpwt*NWtNear[0]",
859  "Nimpwt*NWtFar[0]" };
860  int strindx = 0;
861  if ( ipos_estimator > 0 ) strindx = 1;
862  if ( fG4NuMI ) strindx += 2;
863  // set upper limit on how many entries to scan
864  Long64_t nscan = TMath::Min(fNEntries,200000LL);
865 
866  fNuFluxTree->Draw(ntwgtstrv[strindx],"","goff",nscan);
867  //std::cout << " Draw \"" << ntwgtstrv[strindx] << "\"" << std::endl;
868  //std::cout << " SelectedRows " << fNuFluxTree->GetSelectedRows()
869  // << " V1 " << fNuFluxTree->GetV1() << std::endl;
870 
871  Long64_t idx = TMath::LocMax(fNuFluxTree->GetSelectedRows(),
872  fNuFluxTree->GetV1());
873  //std::cout << "idx " << idx << " of " << fNuFluxTree->GetSelectedRows() << std::endl;
874  fMaxWeight = fNuFluxTree->GetV1()[idx];
875  LOG("Flux", pNOTICE) << "Maximum flux weight from Nwt in ntuple = "
876  << fMaxWeight;
877  if ( fMaxWeight <= 0 ) {
878  LOG("Flux", pFATAL) << "Non-positive maximum flux weight!";
879  exit(1);
880  }
881  }
882  // the above works only for things close to the MINOS stored weight
883  // values. otherwise we need to work out our own estimate.
884  double wgtgenmx = 0, enumx = 0;
885  TStopwatch t;
886  t.Start();
887  for (int itry=0; itry < fMaxWgtEntries; ++itry) {
888  this->GenerateNext_weighted();
889  double wgt = this->Weight();
890  if ( wgt > wgtgenmx ) wgtgenmx = wgt;
891  double enu = fCurEntry->fgP4.Energy();
892  if ( enu > enumx ) enumx = enu;
893  }
894  t.Stop();
895  t.Print("u");
896  LOG("Flux", pNOTICE) << "Maximum flux weight for spin = "
897  << wgtgenmx << ", energy = " << enumx
898  << " (" << fMaxWgtEntries << ")";
899 
900  if (wgtgenmx > fMaxWeight ) fMaxWeight = wgtgenmx;
901  // apply a fudge factor to estimated weight
902  fMaxWeight *= fMaxWgtFudge;
903  // adjust max energy?
904  if ( enumx*fMaxEFudge > fMaxEv ) {
905  LOG("Flux", pNOTICE) << "Adjust max: was=" << fMaxEv
906  << " now " << enumx << "*" << fMaxEFudge
907  << " = " << enumx*fMaxEFudge;
908  fMaxEv = enumx * fMaxEFudge;
909  }
910 
911  LOG("Flux", pNOTICE) << "Maximum flux weight = " << fMaxWeight
912  << ", energy = " << fMaxEv;
913 
914 }
TLorentzVector fgP4
generated nu 4-momentum beam coord
Definition: GNuMIFlux.h:102
#define pERROR
Definition: Messenger.h:60
double fMaxEFudge
fudge factor for estmating max enu (0=> use fixed 120GeV)
Definition: GNuMIFlux.h:404
#define pFATAL
Definition: Messenger.h:57
Long64_t fNEntries
number of flux ntuple entries
Definition: GNuMIFlux.h:395
double fMaxWgtFudge
fudge factor for estimating max wgt
Definition: GNuMIFlux.h:402
TChain * fNuFluxTree
TTree in g3numi or g4numi // REF ONLY!
Definition: GNuMIFlux.h:389
double Weight(void)
returns the flux neutrino weight (if any)
Definition: GNuMIFlux.h:234
double enu
Definition: runWimpSim.h:113
g4numi * fG4NuMI
g4numi ntuple
Definition: GNuMIFlux.h:392
#define LOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a string (using the FILE...
Definition: Messenger.h:97
bool GenerateNext_weighted(void)
Definition: GNuMIFlux.cxx:360
bool fDetLocIsSet
is a flux location (near/far) set?
Definition: GNuMIFlux.h:415
GNuMIFluxPassThroughInfo * fCurEntry
copy of current ntuple entry info (owned structure)
Definition: GNuMIFlux.h:436
const ana::Var wgt
double fMaxWeight
max flux neutrino weight in input file
Definition: GNuMIFlux.h:401
long int fMaxWgtEntries
of entries in estimating max wgt
Definition: GNuMIFlux.h:403
exit(0)
int fUseFluxAtDetCenter
use flux at near (-1) or far (+1) det center from ntuple?
Definition: GNuMIFlux.h:416
#define pNOTICE
Definition: Messenger.h:62
double fMaxEv
maximum energy
Definition: GNuMIFlux.h:384
TLorentzVector fFluxWindowBase
base point for flux window - beam coord
Definition: GNuMIFlux.h:427
void genie::flux::GNuMIFlux::SetApplyWindowTiltWeight ( bool  apply = true)
inline
Parameters
applyapply wgt due to tilt of flux window relative to beam

Definition at line 302 of file GNuMIFlux.h.

References g4zmq::apply().

303  { fApplyTiltWeight = apply; }
def apply(command)
Definition: g4zmq.py:38
bool fApplyTiltWeight
wgt due to window normal not || beam
Definition: GNuMIFlux.h:414
void GNuMIFlux::SetBeamCenter ( TVector3  beam0)

Definition at line 1076 of file GNuMIFlux.cxx.

1077 {
1078  // set coord transform between detector and beam
1079  // NOTE: internally these are in "cm", but user might have set a preference
1080  fBeamZero = TLorentzVector(beam0,0); // no time shift
1081 }
TLorentzVector fBeamZero
beam origin in user coords
Definition: GNuMIFlux.h:422
void GNuMIFlux::SetBeamRotation ( TRotation  beamrot)

< beam (0,0,0) relative to user frame, beam direction in user frame

Definition at line 1069 of file GNuMIFlux.cxx.

1070 {
1071  // rotation is really only 3-d vector, but we'll be operating on LorentzV's
1072  fBeamRot = TLorentzRotation(beamrot);
1073  fBeamRotInv = fBeamRot.Inverse();
1074 }
TLorentzRotation fBeamRotInv
Definition: GNuMIFlux.h:424
TLorentzRotation fBeamRot
rotation applied beam –> user coord
Definition: GNuMIFlux.h:423
void GNuMIFlux::SetDefaults ( void  )
private

Definition at line 1233 of file GNuMIFlux.cxx.

References genie::kPdgAntiNuE, genie::kPdgAntiNuMu, genie::kPdgNuE, genie::kPdgNuMu, LOG, pNOTICE, and genie::PDGCodeList::push_back().

1234 {
1235 // - Set default neutrino species list (nue, nuebar, numu, numubar) and
1236 // maximum energy (120 GeV).
1237 // These defaults can be overwritten by user calls (at the driver init) to
1238 // GNuMIlux::SetMaxEnergy(double Ev) and
1239 // GNuMIFlux::SetFluxParticles(const PDGCodeList & particles)
1240 // - Set the default file normalization to 1E+21 POT
1241 // - Set the default flux neutrino start z position at -5m (z=0 is the
1242 // detector centre).
1243 // - Set number of cycles to 1
1244 
1245  LOG("Flux", pNOTICE) << "Setting default GNuMIFlux driver options";
1246 
1247  PDGCodeList particles;
1248  particles.push_back(kPdgNuMu);
1249  particles.push_back(kPdgAntiNuMu);
1250  particles.push_back(kPdgNuE);
1251  particles.push_back(kPdgAntiNuE);
1252 
1253  this->SetFluxParticles (particles);
1254  this->SetMaxEnergy (120./*GeV*/); // was 200, but that would be wasteful
1255  this->SetUpstreamZ (-3.4e38); // way upstream ==> use flux window
1256  this->SetNumOfCycles (0);
1257  this->SetEntryReuse (1);
1258 
1259  this->SetXMLFileBase("GNuMIFlux.xml");
1260 }
void SetEntryReuse(long int nuse=1)
of times to use entry before moving to next
Definition: GNuMIFlux.cxx:924
const int kPdgNuE
Definition: PDGCodes.h:28
const int kPdgAntiNuE
Definition: PDGCodes.h:29
const int kPdgNuMu
Definition: PDGCodes.h:30
virtual void SetNumOfCycles(long int ncycle)
limit cycling through input files
A list of PDG codes.
Definition: PDGCodeList.h:33
virtual void SetXMLFileBase(std::string xmlbasename="")
virtual void SetUpstreamZ(double z0)
#define LOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a string (using the FILE...
Definition: Messenger.h:97
const int kPdgAntiNuMu
Definition: PDGCodes.h:31
virtual void SetFluxParticles(const PDGCodeList &particles)
specify list of flux neutrino species
void SetMaxEnergy(double Ev)
specify maximum flx neutrino energy
Definition: GNuMIFlux.cxx:916
#define pNOTICE
Definition: Messenger.h:62
void push_back(int pdg_code)
Definition: PDGCodeList.cxx:67
void GNuMIFlux::SetEntryReuse ( long int  nuse = 1)

of times to use entry before moving to next

Definition at line 924 of file GNuMIFlux.cxx.

References CLHEP::L.

Referenced by fill_simple().

925 {
926 // With nuse > 1 then the same entry in the file is used "nuse" times
927 // before moving on to the next entry in the ntuple
928 
929  fNUse = TMath::Max(1L, nuse);
930 }
static constexpr double L
long int fNUse
how often to use same entry in a row
Definition: GNuMIFlux.h:406
void genie::flux::GFluxFileConfigI::SetFluxParticles ( const PDGCodeList particles)
virtualinherited

specify list of flux neutrino species

Definition at line 100 of file GFluxFileConfigI.cxx.

References genie::PDGCodeList::Copy(), genie::flux::GFluxFileConfigI::fPdgCList, LOG, and pINFO.

Referenced by genie::flux::GFluxFileConfigI::GetXMLFileBase(), main(), and genie::flux::GDk2NuFlux::SetDefaults().

101  {
102  fPdgCList->Copy(particles);
103 
104  LOG("Flux", pINFO)
105  << "Declared list of neutrino species: " << *fPdgCList;
106  }
PDGCodeList * fPdgCList
list of neutrino pdg-codes to generate
#define LOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a string (using the FILE...
Definition: Messenger.h:97
#define pINFO
Definition: Messenger.h:63
void Copy(const PDGCodeList &list)
copy / print
bool GNuMIFlux::SetFluxWindow ( GNuMIFlux::StdFluxWindow_t  stdwindow,
double  padding = 0 
)

return false if unhandled

Definition at line 957 of file GNuMIFlux.cxx.

References makeTrainCVSamples::int, kPosCenterFarBeam(), LOG, pERROR, pNOTICE, and genie::utils::units::UnitFromString().

958 {
959  // set some standard flux windows
960  // rwh: should also set detector coord transform
961  // rwh: padding allows add constant padding to pre-existing set
962  double padbeam = padding / fLengthScaleB2U; // user might set different units
963  LOG("Flux",pNOTICE)
964  << "SetBeamFluxWindow " << (int)stdwindow << " padding " << padbeam << " cm";
965 
966 
967  switch ( stdwindow ) {
968 #ifdef THIS_IS_NOT_YET_IMPLEMENTED
969  case kMinosNearDet:
970  SetBeamFluxWindow(103648.837);
971  break;
972  case kMinosFarDear:
973  SetBeamFluxWindow(73534000.);
974  break;
975  case kMinosNearRock:
976  SetBeamFluxWindow();
977  break;
978  case kMinosFarRock:
979  SetBeamFluxWindow();
980  break;
981 #endif
982  case kMinosNearCenter:
983  {
985  fFluxWindowBase = kPosCenterNearBeam;
986  fFluxWindowDir1 = TLorentzVector(); // no extent
987  fFluxWindowDir2 = TLorentzVector();
988  TLorentzVector usrpos;
989  Beam2UserPos(fFluxWindowBase, usrpos);
990  fFluxWindowPtUser[0] = usrpos.Vect();
993  fFluxWindowLen1 = 0;
994  fFluxWindowLen2 = 0;
995  break;
996  }
997  case kMinosFarCenter:
998  {
1001  fFluxWindowDir1 = TLorentzVector(); // no extent
1002  fFluxWindowDir2 = TLorentzVector();
1003  TLorentzVector usrpos;
1004  Beam2UserPos(fFluxWindowBase, usrpos);
1005  fFluxWindowPtUser[0] = usrpos.Vect();
1008  fFluxWindowLen1 = 0;
1009  fFluxWindowLen2 = 0;
1010  break;
1011  }
1012  default:
1013  LOG("Flux", pERROR)
1014  << "SetBeamFluxWindow - StdFluxWindow " << stdwindow
1015  << " not yet implemented";
1016  return false;
1017  }
1018  LOG("Flux",pNOTICE) << "about to CalcEffPOTsPerNu";
1019  this->CalcEffPOTsPerNu();
1020  return true;
1021 }
#define pERROR
Definition: Messenger.h:60
void SetLengthUnits(double user_units)
Set units assumed by user.
Definition: GNuMIFlux.cxx:1362
TVector3 fFluxWindowPtUser[3]
user points of flux window
Definition: GNuMIFlux.h:426
TLorentzVector fFluxWindowDir2
extent for flux window (direction 2)
Definition: GNuMIFlux.h:429
#define LOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a string (using the FILE...
Definition: Messenger.h:97
TLorentzVector fFluxWindowDir1
extent for flux window (direction 1)
Definition: GNuMIFlux.h:428
double UnitFromString(string u)
Definition: UnitUtils.cxx:26
void Beam2UserPos(const TLorentzVector &beamxyz, TLorentzVector &usrxyz) const
Definition: GNuMIFlux.cxx:1127
const TLorentzVector kPosCenterFarBeam(0., 0., 735340.00, 0.)
double fLengthScaleB2U
scale factor beam (cm) –> user
Definition: GNuMIFlux.h:419
#define pNOTICE
Definition: Messenger.h:62
TLorentzVector fFluxWindowBase
base point for flux window - beam coord
Definition: GNuMIFlux.h:427
void CalcEffPOTsPerNu(void)
Definition: GNuMIFlux.cxx:595
void GNuMIFlux::SetFluxWindow ( TVector3  p1,
TVector3  p2,
TVector3  p3 
)

3 points define a plane (by default in user coordinates)

Definition at line 1023 of file GNuMIFlux.cxx.

References stan::math::dot(), e, LOG, PandAna.Demos.pi0_spectra::p0, plot_validation_datamc::p1, plot_validation_datamc::p2, pNOTICE, pWARN, and Unit().

1025 {
1026  // set flux window
1027  // NOTE: internally these are in "cm", but user might have set a preference
1028  fUseFluxAtDetCenter = 0;
1029  fDetLocIsSet = true;
1030 
1031  fFluxWindowPtUser[0] = p0;
1032  fFluxWindowPtUser[1] = p1;
1033  fFluxWindowPtUser[2] = p2;
1034 
1035  // convert from user to beam coord and from 3 points to base + 2 directions
1036  // apply units conversion
1037  TLorentzVector ptbm0, ptbm1, ptbm2;
1038  User2BeamPos(TLorentzVector(fFluxWindowPtUser[0],0),ptbm0);
1039  User2BeamPos(TLorentzVector(fFluxWindowPtUser[1],0),ptbm1);
1040  User2BeamPos(TLorentzVector(fFluxWindowPtUser[2],0),ptbm2);
1041 
1042  fFluxWindowBase = ptbm0;
1043  fFluxWindowDir1 = ptbm1 - ptbm0;
1044  fFluxWindowDir2 = ptbm2 - ptbm0;
1045 
1048  fWindowNormal = fFluxWindowDir1.Vect().Cross(fFluxWindowDir2.Vect()).Unit();
1049 
1050  double dot = fFluxWindowDir1.Dot(fFluxWindowDir2);
1051  if ( TMath::Abs(dot) > 1.0e-8 )
1052  LOG("Flux",pWARN) << "Dot product between window direction vectors was "
1053  << dot << "; please check for orthoganality";
1054 
1055  LOG("Flux",pNOTICE) << "about to CalcEffPOTsPerNu";
1056  this->CalcEffPOTsPerNu();
1057 }
TVector3 fFluxWindowPtUser[3]
user points of flux window
Definition: GNuMIFlux.h:426
TLorentzVector fFluxWindowDir2
extent for flux window (direction 2)
Definition: GNuMIFlux.h:429
void User2BeamPos(const TLorentzVector &usrxyz, TLorentzVector &beamxyz) const
Definition: GNuMIFlux.cxx:1143
#define LOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a string (using the FILE...
Definition: Messenger.h:97
TLorentzVector fFluxWindowDir1
extent for flux window (direction 1)
Definition: GNuMIFlux.h:428
bool fDetLocIsSet
is a flux location (near/far) set?
Definition: GNuMIFlux.h:415
TVector3 Unit() const
#define pWARN
Definition: Messenger.h:61
double dot(const std::vector< double > &x, const std::vector< double > &y)
Definition: dot.hpp:10
TVector3 fWindowNormal
normal direction for flux window
Definition: GNuMIFlux.h:432
int fUseFluxAtDetCenter
use flux at near (-1) or far (+1) det center from ntuple?
Definition: GNuMIFlux.h:416
#define pNOTICE
Definition: Messenger.h:62
Float_t e
Definition: plot.C:35
TLorentzVector fFluxWindowBase
base point for flux window - beam coord
Definition: GNuMIFlux.h:427
void CalcEffPOTsPerNu(void)
Definition: GNuMIFlux.cxx:595
void genie::flux::GNuMIFlux::SetGenWeighted ( bool  genwgt = false)
inline

toggle whether GenerateNext() returns weight=1 flux (initial default false)

Definition at line 292 of file GNuMIFlux.h.

Referenced by test_gnumi().

void GNuMIFlux::SetLengthUnits ( double  user_units)

Set units assumed by user.

Definition at line 1362 of file GNuMIFlux.cxx.

References Munits::cm, and genie::utils::units::UnitFromString().

Referenced by test_gnumi().

1363 {
1364  // Set the scale factor for lengths going from beam (cm) to user coordinates
1365 
1366  // GNuMIFlux uses "cm" as the length unit consistently internally (this is
1367  // the length units used by both the g3 and g4 ntuples). User interactions
1368  // setting the beam-to-detector coordinate transform, flux window, and the
1369  // returned position might need to be in other units. Use:
1370  // double scale = genie::utils::units::UnitFromString("cm");
1371  // ( #include "Utils/UnitUtils.h for declaration )
1372  // to get the correct scale factor to pass in.
1373 
1374  double rescale = fLengthUnits / user_units;
1375  fLengthUnits = user_units;
1376  double cm = genie::utils::units::UnitFromString("cm");
1377  fLengthScaleB2U = cm / user_units;
1378  fLengthScaleU2B = user_units / cm;
1379 
1380  // in case we're changing units without resetting transform/window
1381  // not recommended, but should work
1382  fCurEntry->fgX4User *= rescale;
1383  fBeamZero *= rescale;
1384  fFluxWindowPtUser[0] *= rescale;
1385  fFluxWindowPtUser[1] *= rescale;
1386  fFluxWindowPtUser[2] *= rescale;
1387 
1388  // case GNuMIFlux::kmeter: fLengthScaleB2U = 0.01 ; break;
1389  // case GNuMIFlux::kcm: fLengthScaleB2U = 1. ; break;
1390  // case GNuMIFlux::kmm: fLengthScaleB2U = 10. ; break;
1391  // case GNuMIFlux::kfm: fLengthScaleB2U = 1.e13 ; break; // 10e-2m -> 10e-15m
1392 
1393 }
double fLengthUnits
units for coord in user exchanges
Definition: GNuMIFlux.h:418
TVector3 fFluxWindowPtUser[3]
user points of flux window
Definition: GNuMIFlux.h:426
TLorentzVector fgX4User
generated nu 4-position user coord
Definition: GNuMIFlux.h:105
TLorentzVector fBeamZero
beam origin in user coords
Definition: GNuMIFlux.h:422
double UnitFromString(string u)
Definition: UnitUtils.cxx:26
GNuMIFluxPassThroughInfo * fCurEntry
copy of current ntuple entry info (owned structure)
Definition: GNuMIFlux.h:436
double fLengthScaleB2U
scale factor beam (cm) –> user
Definition: GNuMIFlux.h:419
double fLengthScaleU2B
scale factor beam user –> (cm)
Definition: GNuMIFlux.h:420
static constexpr Double_t cm
Definition: Munits.h:140
void genie::flux::GNuMIFlux::SetMaxEFudge ( double  fudge = 1.05)
inline
Parameters
fudgeextra fudge factor in estimating maximum energy

Definition at line 300 of file GNuMIFlux.h.

301  { fMaxEFudge = fudge; }
double fMaxEFudge
fudge factor for estmating max enu (0=> use fixed 120GeV)
Definition: GNuMIFlux.h:404
void GNuMIFlux::SetMaxEnergy ( double  Ev)

specify maximum flx neutrino energy

Definition at line 916 of file GNuMIFlux.cxx.

References LOG, and pINFO.

917 {
918  fMaxEv = TMath::Max(0.,Ev);
919 
920  LOG("Flux", pINFO)
921  << "Declared maximum flux neutrino energy: " << fMaxEv;
922 }
#define LOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a string (using the FILE...
Definition: Messenger.h:97
#define pINFO
Definition: Messenger.h:63
double fMaxEv
maximum energy
Definition: GNuMIFlux.h:384
void genie::flux::GNuMIFlux::SetMaxWgtScan ( double  fudge = 1.05,
long int  nentries = 2500000 
)
inline
Parameters
nentriesconfiguration when estimating max weight

Definition at line 298 of file GNuMIFlux.h.

References nentries.

299  { fMaxWgtFudge = fudge; fMaxWgtEntries = nentries; }
double fMaxWgtFudge
fudge factor for estimating max wgt
Definition: GNuMIFlux.h:402
Long64_t nentries
long int fMaxWgtEntries
of entries in estimating max wgt
Definition: GNuMIFlux.h:403
void genie::flux::GFluxFileConfigI::SetNumOfCycles ( long int  ncycle)
virtualinherited

limit cycling through input files

Definition at line 86 of file GFluxFileConfigI.cxx.

References genie::flux::GFluxFileConfigI::fNCycles, and CLHEP::L.

Referenced by genie::flux::GFluxFileConfigI::GetXMLFileBase(), main(), genie::flux::GDk2NuFlux::SetDefaults(), and genie::flux::GSimpleNtpFlux::SetDefaults().

87  {
88  // The flux ntuples can be recycled for a number of times to boost
89  // generated event statistics without requiring enormous beam simulation
90  // statistics.
91  // That option determines how many times the driver is going to cycle
92  // through the input flux ntuple.
93  // With ncycle=0 the flux ntuple will be recycled an infinite amount of
94  // times so that the event generation loop can exit only on a POT or
95  // event num check.
96 
97  fNCycles = TMath::Max(0L, ncycle);
98  }
static constexpr double L
long int fNCycles
times to cycle through the ntuple(s)
void GNuMIFlux::SetTreeName ( string  name)

set input tree name (default: "h10")

Definition at line 932 of file GNuMIFlux.cxx.

933 {
935 }
const XML_Char * name
Definition: expat.h:151
string fNuFluxTreeName
Tree name "h10" (g3) or "nudata" (g4)
Definition: GNuMIFlux.h:388
void genie::flux::GFluxFileConfigI::SetUpstreamZ ( double  z0)
virtualinherited

set flux neutrino initial z position (upstream of the detector) pushed back from the normal flux window

Definition at line 74 of file GFluxFileConfigI.cxx.

References genie::flux::GFluxFileConfigI::fZ0.

Referenced by fill_simple(), genie::flux::GFluxFileConfigI::GetXMLFileBase(), main(), genie::flux::GDk2NuFlux::SetDefaults(), and genie::flux::GSimpleNtpFlux::SetDefaults().

75  {
76  // The flux neutrino position (x,y) is given on the user specified
77  // flux window. This method sets the preferred user coord starting z
78  // position upstream of detector face. Each flux neutrino will be
79  // backtracked from the initial flux window to the input z0.
80  // If the value is unreasonable (> 10^30) then the ray is left on
81  // the flux window.
82 
83  fZ0 = z0;
84  }
void genie::flux::GFluxFileConfigI::SetXMLFileBase ( std::string  xmlbasename = "")
virtualinherited

Definition at line 30 of file GFluxFileConfigI.cxx.

References genie::flux::GFluxFileConfigI::fXMLbasename.

Referenced by genie::flux::GDk2NuFlux::SetDefaults().

31  { fXMLbasename = xmlbasename; }
std::string fXMLbasename
XML file that might hold config param_sets.
genie::flux::Exposure_t genie::flux::GFluxExposureI::StringToEnum ( const char *  chars,
int  maxChar = 0 
)
staticinherited

Definition at line 31 of file GFluxExposureI.cxx.

References MECModelEnuComparisons::i, genie::flux::kPOTs, genie::flux::kSeconds, and genie::flux::kUnknown.

32  {
33  int len = strlen(chars);
34  if (maxChar == 0 ) maxChar = len;
35  if (maxChar > len) maxChar = len;
36  if (maxChar <= 0 ) return genie::flux::kUnknown;
37 
38  char* lowchars = new char [maxChar];
39  for (int i=0; i<maxChar; ++i) lowchars[i] = tolower(chars[i]);
40 
42  if ( 0 == strncmp(lowchars,"pot",TMath::Min(maxChar,3))) {
43  etype = genie::flux::kPOTs;
44  } else if ( 0 == strncmp(lowchars,"sec",TMath::Min(maxChar,3))) {
45  etype = genie::flux::kSeconds;
46  }
47  delete [] lowchars;
48  return etype;
49  }
const XML_Char int len
Definition: expat.h:262
enum genie::flux::EExposure Exposure_t
double genie::flux::GNuMIFlux::SumWeight ( void  ) const
inline

integrated weight for flux neutrinos looped so far

Definition at line 267 of file GNuMIFlux.h.

References site_stats_from_log::filenames, genie::flux::GFluxFileConfigI::LoadBeamSimData(), and string.

double GNuMIFlux::UsedPOTs ( void  ) const

of protons-on-target used

Definition at line 620 of file GNuMIFlux.cxx.

References LOG, and pWARN.

Referenced by fill_simple().

621 {
622 // Compute current number of flux POTs
623 
624  if (!fNuFluxTree) {
625  LOG("Flux", pWARN)
626  << "The flux driver has not been properly configured";
627  return 0;
628  }
629  return fAccumPOTs;
630 }
TChain * fNuFluxTree
TTree in g3numi or g4numi // REF ONLY!
Definition: GNuMIFlux.h:389
#define LOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a string (using the FILE...
Definition: Messenger.h:97
double fAccumPOTs
POTs used so far.
Definition: GNuMIFlux.h:411
#define pWARN
Definition: Messenger.h:61
void GNuMIFlux::UseFluxAtFarDetCenter ( void  )

Definition at line 947 of file GNuMIFlux.cxx.

References kPosCenterFarBeam(), and genie::utils::units::UnitFromString().

948 {
951  fFluxWindowDir1 = TLorentzVector(); // no extent
952  fFluxWindowDir2 = TLorentzVector();
953  fUseFluxAtDetCenter = +1;
954  fDetLocIsSet = true;
955 }
void SetLengthUnits(double user_units)
Set units assumed by user.
Definition: GNuMIFlux.cxx:1362
TLorentzVector fFluxWindowDir2
extent for flux window (direction 2)
Definition: GNuMIFlux.h:429
TLorentzVector fFluxWindowDir1
extent for flux window (direction 1)
Definition: GNuMIFlux.h:428
double UnitFromString(string u)
Definition: UnitUtils.cxx:26
bool fDetLocIsSet
is a flux location (near/far) set?
Definition: GNuMIFlux.h:415
const TLorentzVector kPosCenterFarBeam(0., 0., 735340.00, 0.)
int fUseFluxAtDetCenter
use flux at near (-1) or far (+1) det center from ntuple?
Definition: GNuMIFlux.h:416
TLorentzVector fFluxWindowBase
base point for flux window - beam coord
Definition: GNuMIFlux.h:427
void GNuMIFlux::UseFluxAtNearDetCenter ( void  )

force weights at MINOS detector "center" as found in ntuple

Definition at line 937 of file GNuMIFlux.cxx.

References genie::utils::units::UnitFromString().

938 {
940  fFluxWindowBase = kPosCenterNearBeam;
941  fFluxWindowDir1 = TLorentzVector(); // no extent
942  fFluxWindowDir2 = TLorentzVector();
943  fUseFluxAtDetCenter = -1;
944  fDetLocIsSet = true;
945 }
void SetLengthUnits(double user_units)
Set units assumed by user.
Definition: GNuMIFlux.cxx:1362
TLorentzVector fFluxWindowDir2
extent for flux window (direction 2)
Definition: GNuMIFlux.h:429
TLorentzVector fFluxWindowDir1
extent for flux window (direction 1)
Definition: GNuMIFlux.h:428
double UnitFromString(string u)
Definition: UnitUtils.cxx:26
bool fDetLocIsSet
is a flux location (near/far) set?
Definition: GNuMIFlux.h:415
int fUseFluxAtDetCenter
use flux at near (-1) or far (+1) det center from ntuple?
Definition: GNuMIFlux.h:416
TLorentzVector fFluxWindowBase
base point for flux window - beam coord
Definition: GNuMIFlux.h:427
void GNuMIFlux::User2BeamDir ( const TLorentzVector &  usrdir,
TLorentzVector &  beamdir 
) const

Definition at line 1148 of file GNuMIFlux.cxx.

1150 {
1151  beamdir = fLengthScaleU2B*(fBeamRotInv*usrdir);
1152 }
double fLengthScaleU2B
scale factor beam user –> (cm)
Definition: GNuMIFlux.h:420
TLorentzRotation fBeamRotInv
Definition: GNuMIFlux.h:424
void GNuMIFlux::User2BeamP4 ( const TLorentzVector &  usrp4,
TLorentzVector &  beamp4 
) const

Definition at line 1153 of file GNuMIFlux.cxx.

1155 {
1156  beamp4 = fBeamRotInv*usrp4;
1157 }
TLorentzRotation fBeamRotInv
Definition: GNuMIFlux.h:424
void GNuMIFlux::User2BeamPos ( const TLorentzVector &  usrxyz,
TLorentzVector &  beamxyz 
) const

Definition at line 1143 of file GNuMIFlux.cxx.

1145 {
1146  beamxyz = fLengthScaleU2B*(fBeamRotInv*(usrxyz-fBeamZero));
1147 }
TLorentzVector fBeamZero
beam origin in user coords
Definition: GNuMIFlux.h:422
double fLengthScaleU2B
scale factor beam user –> (cm)
Definition: GNuMIFlux.h:420
TLorentzRotation fBeamRotInv
Definition: GNuMIFlux.h:424
double genie::flux::GNuMIFlux::Weight ( void  )
inlinevirtual

returns the flux neutrino weight (if any)

Implements genie::GFluxI.

Definition at line 234 of file GNuMIFlux.h.

Referenced by fill_simple(), and test_gnumi().

234 { return fWeight; }
double fWeight
current neutrino weight, =1 if generating unweighted entries
Definition: GNuMIFlux.h:400

Member Data Documentation

double genie::flux::GNuMIFlux::fAccumPOTs
private

POTs used so far.

Definition at line 411 of file GNuMIFlux.h.

bool genie::flux::GNuMIFlux::fApplyTiltWeight
private

wgt due to window normal not || beam

Definition at line 414 of file GNuMIFlux.h.

TLorentzRotation genie::flux::GNuMIFlux::fBeamRot
private

rotation applied beam –> user coord

Definition at line 423 of file GNuMIFlux.h.

TLorentzRotation genie::flux::GNuMIFlux::fBeamRotInv
private

Definition at line 424 of file GNuMIFlux.h.

TLorentzVector genie::flux::GNuMIFlux::fBeamZero
private

beam origin in user coords

Definition at line 422 of file GNuMIFlux.h.

GNuMIFluxPassThroughInfo* genie::flux::GNuMIFlux::fCurEntry
private

copy of current ntuple entry info (owned structure)

Definition at line 436 of file GNuMIFlux.h.

bool genie::flux::GNuMIFlux::fDetLocIsSet
private

is a flux location (near/far) set?

Definition at line 415 of file GNuMIFlux.h.

double genie::flux::GNuMIFlux::fEffPOTsPerNu
private

what a entry is worth ...

Definition at line 410 of file GNuMIFlux.h.

bool genie::flux::GNuMIFlux::fEnd
private

end condition reached

Definition at line 385 of file GNuMIFlux.h.

Long64_t genie::flux::GNuMIFlux::fFilePOTs
private

of protons-on-target represented by all files

Definition at line 398 of file GNuMIFlux.h.

flugg* genie::flux::GNuMIFlux::fFlugg
private

flugg ntuple

Definition at line 393 of file GNuMIFlux.h.

TLorentzVector genie::flux::GNuMIFlux::fFluxWindowBase
private

base point for flux window - beam coord

Definition at line 427 of file GNuMIFlux.h.

TLorentzVector genie::flux::GNuMIFlux::fFluxWindowDir1
private

extent for flux window (direction 1)

Definition at line 428 of file GNuMIFlux.h.

TLorentzVector genie::flux::GNuMIFlux::fFluxWindowDir2
private

extent for flux window (direction 2)

Definition at line 429 of file GNuMIFlux.h.

double genie::flux::GNuMIFlux::fFluxWindowLen1
private

Definition at line 430 of file GNuMIFlux.h.

double genie::flux::GNuMIFlux::fFluxWindowLen2
private

Definition at line 431 of file GNuMIFlux.h.

TVector3 genie::flux::GNuMIFlux::fFluxWindowPtUser[3]
private

user points of flux window

Definition at line 426 of file GNuMIFlux.h.

g3numi* genie::flux::GNuMIFlux::fG3NuMI
private

g3numi ntuple

Definition at line 391 of file GNuMIFlux.h.

g4numi* genie::flux::GNuMIFlux::fG4NuMI
private

g4numi ntuple

Definition at line 392 of file GNuMIFlux.h.

bool genie::flux::GNuMIFlux::fGenWeighted
private

does GenerateNext() give weights?

Definition at line 413 of file GNuMIFlux.h.

TLorentzVector genie::flux::GNuMIFlux::fgX4dkvtx
private

decay 4-position beam coord

Definition at line 434 of file GNuMIFlux.h.

long int genie::flux::GFluxFileConfigI::fICycle
protectedinherited
Long64_t genie::flux::GNuMIFlux::fIEntry
private

current flux ntuple entry

Definition at line 396 of file GNuMIFlux.h.

long int genie::flux::GNuMIFlux::fIUse
private

current # of times an entry has been used

Definition at line 407 of file GNuMIFlux.h.

double genie::flux::GNuMIFlux::fLengthScaleB2U
private

scale factor beam (cm) –> user

Definition at line 419 of file GNuMIFlux.h.

double genie::flux::GNuMIFlux::fLengthScaleU2B
private

scale factor beam user –> (cm)

Definition at line 420 of file GNuMIFlux.h.

double genie::flux::GNuMIFlux::fLengthUnits
private

units for coord in user exchanges

Definition at line 418 of file GNuMIFlux.h.

double genie::flux::GNuMIFlux::fMaxEFudge
private

fudge factor for estmating max enu (0=> use fixed 120GeV)

Definition at line 404 of file GNuMIFlux.h.

double genie::flux::GNuMIFlux::fMaxEv
private

maximum energy

Definition at line 384 of file GNuMIFlux.h.

double genie::flux::GNuMIFlux::fMaxWeight
private

max flux neutrino weight in input file

Definition at line 401 of file GNuMIFlux.h.

long int genie::flux::GNuMIFlux::fMaxWgtEntries
private

of entries in estimating max wgt

Definition at line 403 of file GNuMIFlux.h.

double genie::flux::GNuMIFlux::fMaxWgtFudge
private

fudge factor for estimating max wgt

Definition at line 402 of file GNuMIFlux.h.

long int genie::flux::GFluxFileConfigI::fNCycles
protectedinherited
Long64_t genie::flux::GNuMIFlux::fNEntries
private

number of flux ntuple entries

Definition at line 395 of file GNuMIFlux.h.

int genie::flux::GNuMIFlux::fNFiles
private

number of files in chain

Definition at line 394 of file GNuMIFlux.h.

long int genie::flux::GNuMIFlux::fNNeutrinos
private

number of flux neutrinos thrown so far

Definition at line 409 of file GNuMIFlux.h.

std::vector<string> genie::flux::GNuMIFlux::fNuFluxFilePatterns
private

(potentially wildcarded) path(s)

Definition at line 387 of file GNuMIFlux.h.

string genie::flux::GNuMIFlux::fNuFluxGen
private

"g3numi" "g4numi" or "flugg"

Definition at line 390 of file GNuMIFlux.h.

TChain* genie::flux::GNuMIFlux::fNuFluxTree
private

TTree in g3numi or g4numi // REF ONLY!

Definition at line 389 of file GNuMIFlux.h.

string genie::flux::GNuMIFlux::fNuFluxTreeName
private

Tree name "h10" (g3) or "nudata" (g4)

Definition at line 388 of file GNuMIFlux.h.

long int genie::flux::GNuMIFlux::fNUse
private

how often to use same entry in a row

Definition at line 406 of file GNuMIFlux.h.

Long64_t genie::flux::GNuMIFlux::fNuTot
private

cummulative # of entries (=fNEntries)

Definition at line 397 of file GNuMIFlux.h.

PDGCodeList* genie::flux::GFluxFileConfigI::fPdgCList
protectedinherited
PDGCodeList* genie::flux::GFluxFileConfigI::fPdgCListRej
protectedinherited
double genie::flux::GNuMIFlux::fSumWeight
private

sum of weights for nus thrown so far

Definition at line 408 of file GNuMIFlux.h.

int genie::flux::GNuMIFlux::fUseFluxAtDetCenter
private

use flux at near (-1) or far (+1) det center from ntuple?

Definition at line 416 of file GNuMIFlux.h.

double genie::flux::GNuMIFlux::fWeight
private

current neutrino weight, =1 if generating unweighted entries

Definition at line 400 of file GNuMIFlux.h.

TVector3 genie::flux::GNuMIFlux::fWindowNormal
private

normal direction for flux window

Definition at line 432 of file GNuMIFlux.h.

std::string genie::flux::GFluxFileConfigI::fXMLbasename
protectedinherited

XML file that might hold config param_sets.

Definition at line 96 of file GFluxFileConfigI.h.

Referenced by genie::flux::GFluxFileConfigI::GetXMLFileBase(), and genie::flux::GFluxFileConfigI::SetXMLFileBase().

double genie::flux::GFluxFileConfigI::fZ0
protectedinherited

configurable starting z position for each flux neutrino (in detector coord system)

Definition at line 100 of file GFluxFileConfigI.h.

Referenced by genie::flux::GDk2NuFlux::GenerateNext_weighted(), genie::flux::GSimpleNtpFlux::GenerateNext_weighted(), genie::flux::GDk2NuFlux::PrintConfig(), and genie::flux::GFluxFileConfigI::SetUpstreamZ().


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