A GENIE flux driver using a simple ntuple format. More...
#include <GSimpleNtpFlux.h>
Public Member Functions | |
GSimpleNtpFlux () | |
~GSimpleNtpFlux () | |
const PDGCodeList & | FluxParticles (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 genie::flux::GSimpleNtpEntry * | GetCurrentEntry (void) |
GSimpleNtpEntry. More... | |
const genie::flux::GSimpleNtpNuMI * | GetCurrentNuMI (void) |
GSimpleNtpNuMI. More... | |
const genie::flux::GSimpleNtpAux * | GetCurrentAux (void) |
GSimpleNtpAux. More... | |
const genie::flux::GSimpleNtpMeta * | GetCurrentMeta (void) |
GSimpleNtpMeta. More... | |
TChain * | GetFluxTChain (void) |
double | GetDecayDist () const |
dist (user units) from dk to current pos More... | |
void | MoveToZ0 (double z0) |
move ray origin to user coord Z0 More... | |
void | SetIncludeVtxt (bool it=true) |
should X4 include CurEntry.vtxt More... | |
bool | GetIncludeVtxt () |
virtual double | GetTotalExposure () const |
GFluxExposureI interface. More... | |
virtual long int | NFluxNeutrinos () const |
of rays generatedMore... | |
double | UsedPOTs (void) const |
of protons-on-target usedMore... | |
long int | NEntriesUsed (void) const |
number of entries read from files 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::string > | GetFileList () |
list of files currently part of chain More... | |
virtual void | LoadBeamSimData (const std::vector< 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 () |
void | SetRequestedBranchList (string blist="entry,numi,aux") |
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 nextMore... | |
void | ProcessMeta (void) |
scan for max flux energy, weight More... | |
void | GetFluxWindow (TVector3 &p1, TVector3 &p2, TVector3 &p3) const |
3 points define a plane in beam coordinate More... | |
Public Member Functions inherited from genie::GFluxI | |
virtual | ~GFluxI () |
Public Member Functions inherited from genie::flux::GFluxExposureI | |
GFluxExposureI (genie::flux::Exposure_t etype) | |
virtual | ~GFluxExposureI () |
const char * | GetExposureUnits () const |
what units are returned by GetTotalExposure? More... | |
genie::flux::Exposure_t | GetExposureType () const |
Public Member Functions inherited from genie::flux::GFluxFileConfigI | |
GFluxFileConfigI () | |
virtual | ~GFluxFileConfigI () |
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... | |
Private Member Functions | |
bool | GenerateNext_weighted (void) |
void | Initialize (void) |
void | SetDefaults (void) |
void | CleanUp (void) |
void | ResetCurrent (void) |
void | AddFile (TTree *fluxtree, TTree *metatree, string fname) |
bool | OptionalAttachBranch (std::string bname) |
void | CalcEffPOTsPerNu (void) |
void | ScanMeta (void) |
Private Attributes | |
double | fMaxEv |
maximum energy More... | |
bool | fEnd |
end condition reached More... | |
std::vector< string > | fNuFluxFilePatterns |
(potentially wildcarded) path(s) More... | |
string | fNuFluxBranchRequest |
list of requested branches "entry,numi,au" More... | |
TChain * | fNuFluxTree |
TTree // REF ONLY. More... | |
TChain * | fNuMetaTree |
TTree // REF ONLY. 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... | |
Int_t | fIFileNumber |
which file for the current entry More... | |
Double_t | fFilePOTs |
of protons-on-target represented by all filesMore... | |
double | fWeight |
current neutrino weight More... | |
double | fMaxWeight |
max flux neutrino weight in input file 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... | |
long int | fNEntriesUsed |
number of entries read from files More... | |
double | fEffPOTsPerNu |
what a entry is worth ... More... | |
double | fAccumPOTs |
POTs used so far. More... | |
bool | fGenWeighted |
does GenerateNext() give weights? More... | |
bool | fAlreadyUnwgt |
are input files already unweighted More... | |
bool | fAllFilesMeta |
do all files in chain have meta data More... | |
GSimpleNtpEntry * | fCurEntry |
current entry More... | |
GSimpleNtpNuMI * | fCurNuMI |
current "numi" branch extra info More... | |
GSimpleNtpAux * | fCurAux |
current "aux" branch extra info More... | |
TLorentzVector | fP4 |
reconstituted p4 vector More... | |
TLorentzVector | fX4 |
reconstituted position vector More... | |
GSimpleNtpMeta * | fCurMeta |
current meta data More... | |
GSimpleNtpEntry * | fCurEntryCopy |
current entry More... | |
GSimpleNtpNuMI * | fCurNuMICopy |
current "numi" branch extra info More... | |
GSimpleNtpAux * | fCurAuxCopy |
current "aux" branch extra info More... | |
bool | fIncludeVtxt |
does fX4 include CurEntry.vtxt or 0 More... | |
Additional Inherited Members | |
Static Public Member Functions inherited from genie::flux::GFluxExposureI | |
static const char * | AsString (genie::flux::Exposure_t etype) |
static genie::flux::Exposure_t | StringToEnum (const char *chars, int maxChar=0) |
Protected Member Functions inherited from genie::GFluxI | |
GFluxI () | |
Protected Attributes inherited from genie::flux::GFluxFileConfigI | |
PDGCodeList * | fPdgCList |
list of neutrino pdg-codes to generate More... | |
PDGCodeList * | fPdgCListRej |
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 |
A GENIE flux driver using a simple ntuple format.
An implementation of the GFluxI interface that provides NuMI flux
Jan 25, 2010
Copyright (c) 2003-2020, The GENIE Collaboration For the full text of the license visit http://copyright.genie-mc.org
Definition at line 199 of file GSimpleNtpFlux.h.
genie::flux::GSimpleNtpFlux::GSimpleNtpFlux | ( | ) |
GSimpleNtpFlux::~GSimpleNtpFlux | ( | ) |
Definition at line 72 of file GSimpleNtpFlux.cxx.
|
private |
Definition at line 791 of file GSimpleNtpFlux.cxx.
|
private |
Definition at line 351 of file GSimpleNtpFlux.cxx.
|
private |
Definition at line 771 of file GSimpleNtpFlux.cxx.
|
virtual |
reset state variables based on opt
Implements genie::GFluxI.
Definition at line 674 of file GSimpleNtpFlux.cxx.
|
inlinevirtual |
true if no more flux nu's can be thrown (eg reaching end of beam sim ntuples)
Implements genie::GFluxI.
Definition at line 219 of file GSimpleNtpFlux.h.
|
inlinevirtual |
declare list of flux neutrinos that can be generated (for init. purposes)
Implements genie::GFluxI.
Definition at line 212 of file GSimpleNtpFlux.h.
|
virtual |
generate the next flux neutrino (return false in err)
Implements genie::GFluxI.
Definition at line 89 of file GSimpleNtpFlux.cxx.
|
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 154 of file GSimpleNtpFlux.cxx.
|
virtual |
set whether to generate weighted or unweighted neutrinos
Implements genie::GFluxI.
Definition at line 689 of file GSimpleNtpFlux.cxx.
|
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 553 of file GSimpleNtpFlux.cxx.
|
inline |
Definition at line 238 of file GSimpleNtpFlux.h.
|
inline |
Definition at line 234 of file GSimpleNtpFlux.h.
|
inline |
Definition at line 240 of file GSimpleNtpFlux.h.
|
inline |
Definition at line 236 of file GSimpleNtpFlux.h.
double GSimpleNtpFlux::GetDecayDist | ( | ) | const |
dist (user units) from dk to current pos
Definition at line 315 of file GSimpleNtpFlux.cxx.
std::vector< std::string > GSimpleNtpFlux::GetFileList | ( | ) |
list of files currently part of chain
Definition at line 1109 of file GSimpleNtpFlux.cxx.
|
inline |
Definition at line 244 of file GSimpleNtpFlux.h.
void GSimpleNtpFlux::GetFluxWindow | ( | TVector3 & | p1, |
TVector3 & | p2, | ||
TVector3 & | p3 | ||
) | const |
3 points define a plane in beam coordinate
Definition at line 652 of file GSimpleNtpFlux.cxx.
|
inline |
Definition at line 250 of file GSimpleNtpFlux.h.
|
virtual |
Reimplemented from genie::flux::GFluxFileConfigI.
Definition at line 580 of file GSimpleNtpFlux.cxx.
|
virtual |
GFluxExposureI interface.
Implements genie::flux::GFluxExposureI.
Definition at line 77 of file GSimpleNtpFlux.cxx.
|
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 220 of file GSimpleNtpFlux.h.
|
private |
Definition at line 696 of file GSimpleNtpFlux.cxx.
|
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 374 of file GSimpleNtpFlux.cxx.
|
inlinevirtual |
declare the max flux neutrino energy that can be generated (for init. purposes)
Implements genie::GFluxI.
Definition at line 213 of file GSimpleNtpFlux.h.
|
inlinevirtual |
returns the flux neutrino 4-momentum
Implements genie::GFluxI.
Definition at line 217 of file GSimpleNtpFlux.h.
void GSimpleNtpFlux::MoveToZ0 | ( | double | z0 | ) |
move ray origin to user coord Z0
Definition at line 322 of file GSimpleNtpFlux.cxx.
|
inline |
number of entries read from files
Definition at line 260 of file GSimpleNtpFlux.h.
|
virtual |
< number of flux neutrinos looped so far
Implements genie::flux::GFluxExposureI.
Definition at line 83 of file GSimpleNtpFlux.cxx.
|
private |
Definition at line 816 of file GSimpleNtpFlux.cxx.
|
inlinevirtual |
returns the flux neutrino pdg code
Implements genie::GFluxI.
Definition at line 215 of file GSimpleNtpFlux.h.
|
inlinevirtual |
returns the flux neutrino 4-position (note: expect SI rather than physical units)
Implements genie::GFluxI.
Definition at line 218 of file GSimpleNtpFlux.h.
|
virtual |
print the current configuration
Implements genie::flux::GFluxFileConfigI.
Definition at line 1065 of file GSimpleNtpFlux.cxx.
void GSimpleNtpFlux::PrintCurrent | ( | void | ) |
print current entry from leaves
Definition at line 669 of file GSimpleNtpFlux.cxx.
void GSimpleNtpFlux::ProcessMeta | ( | void | ) |
scan for max flux energy, weight
Definition at line 583 of file GSimpleNtpFlux.cxx.
|
private |
Definition at line 760 of file GSimpleNtpFlux.cxx.
|
private |
|
private |
Definition at line 747 of file GSimpleNtpFlux.cxx.
void GSimpleNtpFlux::SetEntryReuse | ( | long int | nuse = 1 | ) |
Definition at line 644 of file GSimpleNtpFlux.cxx.
|
inline |
toggle whether GenerateNext() returns weight=1 flux (initial default false)
Definition at line 287 of file GSimpleNtpFlux.h.
void genie::flux::GSimpleNtpFlux::SetIncludeVtxt | ( | bool | it = true | ) |
should X4 include CurEntry.vtxt
void GSimpleNtpFlux::SetMaxEnergy | ( | double | Ev | ) |
specify maximum flx neutrino energy
Definition at line 636 of file GSimpleNtpFlux.cxx.
|
inline |
Definition at line 283 of file GSimpleNtpFlux.h.
|
inline |
integrated weight for flux neutrinos looped so far
Definition at line 261 of file GSimpleNtpFlux.h.
double GSimpleNtpFlux::UsedPOTs | ( | void | ) | const |
Definition at line 361 of file GSimpleNtpFlux.cxx.
|
inlinevirtual |
returns the flux neutrino weight (if any)
Implements genie::GFluxI.
Definition at line 216 of file GSimpleNtpFlux.h.
|
private |
POTs used so far.
Definition at line 335 of file GSimpleNtpFlux.h.
|
private |
do all files in chain have meta data
Definition at line 340 of file GSimpleNtpFlux.h.
|
private |
are input files already unweighted
Definition at line 338 of file GSimpleNtpFlux.h.
|
private |
current "aux" branch extra info
Definition at line 344 of file GSimpleNtpFlux.h.
|
private |
current "aux" branch extra info
Definition at line 351 of file GSimpleNtpFlux.h.
|
private |
current entry
Definition at line 342 of file GSimpleNtpFlux.h.
|
private |
current entry
Definition at line 349 of file GSimpleNtpFlux.h.
|
private |
current meta data
Definition at line 347 of file GSimpleNtpFlux.h.
|
private |
current "numi" branch extra info
Definition at line 343 of file GSimpleNtpFlux.h.
|
private |
current "numi" branch extra info
Definition at line 350 of file GSimpleNtpFlux.h.
|
private |
what a entry is worth ...
Definition at line 334 of file GSimpleNtpFlux.h.
|
private |
end condition reached
Definition at line 312 of file GSimpleNtpFlux.h.
|
private |
Definition at line 324 of file GSimpleNtpFlux.h.
|
private |
does GenerateNext() give weights?
Definition at line 337 of file GSimpleNtpFlux.h.
|
private |
current flux ntuple entry
Definition at line 321 of file GSimpleNtpFlux.h.
|
private |
which file for the current entry
Definition at line 322 of file GSimpleNtpFlux.h.
|
private |
does fX4 include CurEntry.vtxt or 0
Definition at line 353 of file GSimpleNtpFlux.h.
|
private |
current # of times an entry has been used
Definition at line 330 of file GSimpleNtpFlux.h.
|
private |
maximum energy
Definition at line 311 of file GSimpleNtpFlux.h.
|
private |
max flux neutrino weight in input file
Definition at line 327 of file GSimpleNtpFlux.h.
|
private |
number of flux ntuple entries
Definition at line 320 of file GSimpleNtpFlux.h.
|
private |
number of entries read from files
Definition at line 333 of file GSimpleNtpFlux.h.
|
private |
number of files in chain
Definition at line 319 of file GSimpleNtpFlux.h.
|
private |
number of flux neutrinos thrown so far
Definition at line 332 of file GSimpleNtpFlux.h.
|
private |
list of requested branches "entry,numi,au"
Definition at line 315 of file GSimpleNtpFlux.h.
|
private |
(potentially wildcarded) path(s)
Definition at line 314 of file GSimpleNtpFlux.h.
|
private |
TTree // REF ONLY.
Definition at line 316 of file GSimpleNtpFlux.h.
|
private |
TTree // REF ONLY.
Definition at line 317 of file GSimpleNtpFlux.h.
|
private |
how often to use same entry in a row
Definition at line 329 of file GSimpleNtpFlux.h.
|
private |
reconstituted p4 vector
Definition at line 345 of file GSimpleNtpFlux.h.
|
private |
sum of weights for nus thrown so far
Definition at line 331 of file GSimpleNtpFlux.h.
|
private |
current neutrino weight
Definition at line 326 of file GSimpleNtpFlux.h.
|
private |
reconstituted position vector
Definition at line 346 of file GSimpleNtpFlux.h.