23#ifndef _GNUMI_NEUTRINO_FLUX_H_
24#define _GNUMI_NEUTRINO_FLUX_H_
32#include <TLorentzVector.h>
33#include <TLorentzRotation.h>
88 void Print(
const Option_t* opt =
"")
const;
90 int CalcEnuWgt(
const TLorentzVector& xyz,
double& enu,
double& wgt_xy)
const;
173#ifndef SKIP_MINERVA_MODS
239 void Clear (Option_t * opt);
277 virtual void LoadBeamSimData(
const std::vector<std::string>& filenames,
278 const std::string& det_loc);
280 virtual void GetBranchInfo(std::vector<std::string>& branchNames,
281 std::vector<std::string>& branchClassNames,
282 std::vector<void**>& branchObjPointers);
346 void GetFluxWindow(TVector3& p1, TVector3& p2, TVector3& p3)
const;
356 TLorentzVector& usrxyz )
const;
358 TLorentzVector& usrdir )
const;
360 TLorentzVector& usrp4 )
const;
362 TLorentzVector& beamxyz )
const;
364 TLorentzVector& beamdir )
const;
366 TLorentzVector& beamp4 )
const;
379 void AddFile (TTree* tree,
string fname);
441#ifdef GNUMI_TEST_XY_WGT
444 friend ostream &
operator << (ostream & stream,
const xypartials & info);
447 void ReadStream(std::ifstream& myfile);
448 int Compare(
const xypartials& other)
const;
449 void Print(
const Option_t* opt =
"")
const;
450 static xypartials& GetStaticInstance();
452 double xdet, ydet, zdet;
453 double parent_mass, parentp, parent_energy;
454 double gamma, beta_mag, enuzr, rad;
455 double costh_pardet, theta_pardet, emrat, eneu;
457 double betanu[3], p_nu[3], partial1, p_dcm_nu[4];
458 double muparent_px, muparent_py, muparent_pz;
459 double gammamp, betamp[3], partial2, p_pcm_mp[3], p_pcm;
460 double costhmu, wgt_ratio;
GENIE Interface for user-defined flux classes.
GENIE interface for uniform flux exposure iterface.
PDGCodeList * fPdgCList
list of neutrino pdg-codes to generate
virtual void LoadBeamSimData(const std::vector< std::string > &filenames, const std::string &det_loc)=0
double startz[MAX_N_TRAJ]
int getVolID(TString sval)
GNuMIFluxPassThroughInfo()
virtual ~GNuMIFluxPassThroughInfo()
TLorentzVector fgP4User
generated nu 4-momentum user coord
TLorentzVector fgX4
generated nu 4-position beam coord
double stoppy[MAX_N_TRAJ]
double startx[MAX_N_TRAJ]
friend ostream & operator<<(ostream &stream, const GNuMIFluxPassThroughInfo &info)
double startpz[MAX_N_TRAJ]
double stoppz[MAX_N_TRAJ]
double pprodpy[MAX_N_TRAJ]
int fgPdgC
generated nu pdg-code
double stoppx[MAX_N_TRAJ]
void MakeCopy(const g3numi *)
pull in from g3 ntuple
double startpx[MAX_N_TRAJ]
TLorentzVector fgP4
generated nu 4-momentum beam coord
TLorentzVector fgX4User
generated nu 4-position user coord
double pprodpx[MAX_N_TRAJ]
double pprodpz[MAX_N_TRAJ]
int getProcessID(TString sval)
double starty[MAX_N_TRAJ]
int CalcEnuWgt(const TLorentzVector &xyz, double &enu, double &wgt_xy) const
static const unsigned int MAX_N_TRAJ
Maximum number of trajectories to store.
double startpy[MAX_N_TRAJ]
void Print(const Option_t *opt="") const
TLorentzVector fFluxWindowDir2
extent for flux window (direction 2)
int PdgCode(void)
returns the flux neutrino pdg code
void UseFluxAtFarDetCenter(void)
double fLengthScaleB2U
scale factor beam (cm) --> user
TVector3 fWindowNormal
normal direction for flux window
string fNuFluxGen
"g3numi" "g4numi" or "flugg"
g4numi * fG4NuMI
g4numi ntuple
GNuMIFluxPassThroughInfo * fCurEntry
copy of current ntuple entry info (owned structure)
bool fEnd
end condition reached
TRotation GetBeamRotation() const
rotation to apply from beam->user
void SetApplyWindowTiltWeight(bool apply=true)
double GetDecayDist() const
dist (user units) from dk to current pos
const TLorentzVector & Momentum(void)
returns the flux neutrino 4-momentum
double POT_curr(void)
current average POT (RWH?)
TVector3 fFluxWindowPtUser[3]
user points of flux window
TChain * fNuFluxTree
TTree in g3numi or g4numi // REF ONLY!
long int Index(void)
returns corresponding index for current flux neutrino (e.g. for a flux ntuple returns the current ent...
TLorentzVector fBeamZero
beam origin in user coords
void SetBeamCenter(TVector3 beam0)
Long64_t fIEntry
current flux ntuple entry
virtual long int NFluxNeutrinos() const
long int fNUse
how often to use same entry in a row
void CalcEffPOTsPerNu(void)
void SetMaxWgtScan(double fudge=1.05, long int nentries=2500000)
bool GenerateNext(void)
generate the next flux neutrino (return false in err)
void Beam2UserPos(const TLorentzVector &beamxyz, TLorentzVector &usrxyz) const
Long64_t fNuTot
cummulative # of entries (=fNEntries)
TLorentzRotation fBeamRot
rotation applied beam --> user coord
bool fDetLocIsSet
is a flux location (near/far) set?
void ScanForMaxWeight(void)
scan for max flux weight (before generating unweighted flux neutrinos)
void SetMaxEnergy(double Ev)
specify maximum flx neutrino energy
bool SetFluxWindow(StdFluxWindow_t stdwindow, double padding=0)
return false if unhandled
void SetLengthUnits(double user_units)
Set units assumed by user.
void AddFile(TTree *tree, string fname)
std::vector< string > fNuFluxFilePatterns
(potentially wildcarded) path(s)
void User2BeamP4(const TLorentzVector &usrp4, TLorentzVector &beamp4) const
virtual TTree * GetMetaDataTree()
enum genie::flux::GNuMIFlux::EStdFluxWindow StdFluxWindow_t
double fLengthUnits
units for coord in user exchanges
void SetTreeName(string name)
set input tree name (default: "h10")
double fMaxWgtFudge
fudge factor for estimating max wgt
int fNFiles
number of files in chain
double fWeight
current neutrino weight, =1 if generating unweighted entries
TLorentzVector fgX4dkvtx
decay 4-position beam coord
bool GenerateNext_weighted(void)
double fSumWeight
sum of weights for nus thrown so far
double SumWeight(void) const
integrated weight for flux neutrinos looped so far
const TLorentzVector & Position(void)
returns the flux neutrino 4-position (note: expect SI rather than physical units)
void MoveToZ0(double z0)
move ray origin to user coord Z0
double Weight(void)
returns the flux neutrino weight (if any)
void Beam2UserDir(const TLorentzVector &beamdir, TLorentzVector &usrdir) const
TLorentzRotation fBeamRotInv
Long64_t GetEntryNumber()
index in chain
virtual void GetBranchInfo(std::vector< std::string > &branchNames, std::vector< std::string > &branchClassNames, std::vector< void ** > &branchObjPointers)
double fMaxWeight
max flux neutrino weight in input file
TVector3 FluxWindowNormal()
double MaxEnergy(void)
declare the max flux neutrino energy that can be generated (for init. purposes)
long int fIUse
current # of times an entry has been used
void GetFluxWindow(TVector3 &p1, TVector3 &p2, TVector3 &p3) const
3 points define a plane in beam coordinate
double UsedPOTs(void) const
void Beam2UserP4(const TLorentzVector &beamp4, TLorentzVector &usrp4) const
void PrintCurrent(void)
print current entry from leaves
int fUseFluxAtDetCenter
use flux at near (-1) or far (+1) det center from ntuple?
void SetEntryReuse(long int nuse=1)
bool fApplyTiltWeight
wgt due to window normal not || beam
bool End(void)
true if no more flux nu's can be thrown (eg reaching end of beam sim ntuples)
long int fNNeutrinos
number of flux neutrinos thrown so far
void User2BeamPos(const TLorentzVector &usrxyz, TLorentzVector &beamxyz) const
void PrintConfig()
print the current configuration
void UseFluxAtNearDetCenter(void)
force weights at MINOS detector "center" as found in ntuple
void SetGenWeighted(bool genwgt=false)
toggle whether GenerateNext() returns weight=1 flux (initial default false)
double fEffPOTsPerNu
what a entry is worth ...
double fAccumPOTs
POTs used so far.
string fNuFluxTreeName
Tree name "h10" (g3) or "nudata" (g4)
g3numi * fG3NuMI
g3numi ntuple
double fMaxEv
maximum energy
const GNuMIFluxPassThroughInfo & PassThroughInfo(void)
GNuMIFluxPassThroughInfo.
double fLengthScaleU2B
scale factor beam user --> (cm)
void GenerateWeighted(bool gen_weighted)
set whether to generate weighted or unweighted neutrinos
TLorentzVector fFluxWindowBase
base point for flux window - beam coord
bool LoadConfig(string cfg)
load a named configuration
const PDGCodeList & FluxParticles(void)
declare list of flux neutrinos that can be generated (for init. purposes)
void SetBeamRotation(TRotation beamrot)
< beam (0,0,0) relative to user frame, beam direction in user frame
double fMaxEFudge
fudge factor for estmating max enu (0=> use fixed 120GeV)
bool fGenWeighted
does GenerateNext() give weights?
void Clear(Option_t *opt)
reset state variables based on opt
virtual void LoadBeamSimData(const std::vector< std::string > &filenames, const std::string &det_loc)
std::vector< std::string > GetFileList()
list of files currently part of chain
void SetMaxEFudge(double fudge=1.05)
virtual double GetTotalExposure() const
TLorentzVector fFluxWindowDir1
extent for flux window (direction 1)
flugg * fFlugg
flugg ntuple
Long64_t fNEntries
number of flux ntuple entries
void User2BeamDir(const TLorentzVector &usrdir, TLorentzVector &beamdir) const
TVector3 GetBeamCenter() const
beam origin in user frame
double LengthUnits(void) const
Return user units.
ostream & operator<<(ostream &stream, const TClonesArray *particle_list)
ostream & operator<<(ostream &stream, const genie::flux::GJPARCNuFluxPassThroughInfo &info)
THE MAIN GENIE PROJECT NAMESPACE