23 #ifndef _GNUMI_NEUTRINO_FLUX_H_ 24 #define _GNUMI_NEUTRINO_FLUX_H_ 32 #include <TLorentzVector.h> 33 #include <TLorentzRotation.h> 56 class GNuMIFluxPassThroughInfo;
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 232 bool GenerateNext (
void);
233 int PdgCode (
void) {
return fCurEntry->fgPdgC; }
235 const TLorentzVector &
Momentum (
void) {
return fCurEntry->fgP4User; }
236 const TLorentzVector &
Position (
void) {
return fCurEntry->fgX4User; }
237 bool End (
void) {
return fEnd; }
238 long int Index (
void) {
return fIEntry; }
239 void Clear (Option_t *
opt);
240 void GenerateWeighted (
bool gen_weighted);
255 double GetDecayDist()
const;
256 void MoveToZ0(
double z0);
261 virtual double GetTotalExposure()
const;
262 virtual long int NFluxNeutrinos()
const;
264 double POT_curr(
void);
265 double UsedPOTs(
void)
const;
269 void PrintCurrent(
void);
272 std::vector<std::string> GetFileList();
277 virtual void LoadBeamSimData(
const std::vector<std::string>& filenames,
280 virtual void GetBranchInfo(std::vector<std::string>& branchNames,
281 std::vector<std::string>& branchClassNames,
282 std::vector<void**>& branchObjPointers);
283 virtual TTree* GetMetaDataTree();
289 bool LoadConfig(
string cfg);
290 void SetMaxEnergy(
double Ev);
294 void SetEntryReuse(
long int nuse=1);
296 void SetTreeName(
string name);
297 void ScanForMaxWeight(
void);
299 { fMaxWgtFudge = fudge; fMaxWgtEntries =
nentries; }
301 { fMaxEFudge = fudge; }
303 { fApplyTiltWeight = apply; }
315 void SetLengthUnits(
double user_units);
316 double LengthUnits(
void)
const;
323 void SetBeamRotation(TRotation beamrot);
324 void SetBeamCenter(TVector3 beam0);
325 TRotation GetBeamRotation()
const;
326 TVector3 GetBeamCenter()
const;
341 bool SetFluxWindow(StdFluxWindow_t stdwindow,
double padding=0);
345 void SetFluxWindow(TVector3 p1, TVector3 p2, TVector3 p3);
346 void GetFluxWindow(TVector3& p1, TVector3& p2, TVector3& p3)
const;
349 void UseFluxAtNearDetCenter(
void);
350 void UseFluxAtFarDetCenter(
void);
355 void Beam2UserPos(
const TLorentzVector& beamxyz,
356 TLorentzVector& usrxyz )
const;
357 void Beam2UserDir(
const TLorentzVector& beamdir,
358 TLorentzVector& usrdir )
const;
359 void Beam2UserP4 (
const TLorentzVector& beamp4,
360 TLorentzVector& usrp4 )
const;
361 void User2BeamPos(
const TLorentzVector& usrxyz,
362 TLorentzVector& beamxyz )
const;
363 void User2BeamDir(
const TLorentzVector& usrdir,
364 TLorentzVector& beamdir )
const;
365 void User2BeamP4 (
const TLorentzVector& usrp4,
366 TLorentzVector& beamp4 )
const;
374 bool GenerateNext_weighted (
void);
376 void SetDefaults (
void);
379 void AddFile (TTree*
tree,
string fname);
380 void CalcEffPOTsPerNu (
void);
426 TVector3 fFluxWindowPtUser[3];
441 #ifdef GNUMI_TEST_XY_WGT 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;
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;
469 #endif // _GNUMI_NEUTRINO_FLUX_H_
double fSumWeight
sum of weights for nus thrown so far
long int Index(void)
returns corresponding index for current flux neutrino (e.g. for a flux ntuple returns the current ent...
static constexpr double rad
TLorentzVector fgP4
generated nu 4-momentum beam coord
virtual void LoadBeamSimData(const std::vector< std::string > &filenames, const std::string &det_loc)=0
double fLengthUnits
units for coord in user exchanges
void SetApplyWindowTiltWeight(bool apply=true)
long int fIUse
current # of times an entry has been used
Long64_t fFilePOTs
of protons-on-target represented by all files
static const unsigned int MAX_N_TRAJ
Maximum number of trajectories to store.
THE MAIN GENIE PROJECT NAMESPACE
Long64_t GetEntryNumber()
index in chain
double pprodpx[MAX_N_TRAJ]
Long64_t fIEntry
current flux ntuple entry
bool fGenWeighted
does GenerateNext() give weights?
double fMaxEFudge
fudge factor for estmating max enu (0=> use fixed 120GeV)
TLorentzVector fgX4User
generated nu 4-position user coord
double stoppz[MAX_N_TRAJ]
bool fApplyTiltWeight
wgt due to window normal not || beam
virtual ~GNuMIFluxPassThroughInfo()
TLorentzVector fFluxWindowDir2
extent for flux window (direction 2)
double stoppy[MAX_N_TRAJ]
Long64_t fNEntries
number of flux ntuple entries
double SumWeight(void) const
integrated weight for flux neutrinos looped so far
double startx[MAX_N_TRAJ]
bool fEnd
end condition reached
double pprodpy[MAX_N_TRAJ]
TLorentzVector fBeamZero
beam origin in user coords
void MakeCopy(const g3numi *)
pull in from g3 ntuple
double fMaxWgtFudge
fudge factor for estimating max wgt
friend ostream & operator<<(ostream &stream, const GNuMIFluxPassThroughInfo &info)
TChain * fNuFluxTree
TTree in g3numi or g4numi // REF ONLY!
bool End(void)
true if no more flux nu's can be thrown (eg reaching end of beam sim ntuples)
ostream & operator<<(ostream &stream, const genie::flux::GJPARCNuFluxPassThroughInfo &info)
A GENIE flux driver encapsulating the NuMI neutrino flux. It reads-in the official GNUMI neutrino flu...
double Weight(void)
returns the flux neutrino weight (if any)
string fNuFluxTreeName
Tree name "h10" (g3) or "nudata" (g4)
TLorentzVector fgX4
generated nu 4-position beam coord
double MaxEnergy(void)
declare the max flux neutrino energy that can be generated (for init. purposes)
g4numi * fG4NuMI
g4numi ntuple
TLorentzVector fgX4dkvtx
decay 4-position beam coord
std::vector< string > fNuFluxFilePatterns
(potentially wildcarded) path(s)
TLorentzVector fFluxWindowDir1
extent for flux window (direction 1)
const TLorentzVector & Position(void)
returns the flux neutrino 4-position (note: expect SI rather than physical units) ...
const GNuMIFluxPassThroughInfo & PassThroughInfo(void)
GNuMIFluxPassThroughInfo.
int PdgCode(void)
returns the flux neutrino pdg code
void SetMaxWgtScan(double fudge=1.05, long int nentries=2500000)
GENIE interface for uniform flux exposure iterface.
double pprodpz[MAX_N_TRAJ]
int CalcEnuWgt(const TLorentzVector &xyz, double &enu, double &wgt_xy) const
const PDGCodeList & FluxParticles(void)
declare list of flux neutrinos that can be generated (for init. purposes)
int getVolID(TString sval)
bool fDetLocIsSet
is a flux location (near/far) set?
GNuMIFluxPassThroughInfo()
int fNFiles
number of files in chain
flugg * fFlugg
flugg ntuple
GNuMIFluxPassThroughInfo * fCurEntry
copy of current ntuple entry info (owned structure)
double fAccumPOTs
POTs used so far.
double gamma(double KE, const simb::MCParticle *part)
double startpz[MAX_N_TRAJ]
double startz[MAX_N_TRAJ]
void Print(const Option_t *opt="") const
double fMaxWeight
max flux neutrino weight in input file
double startpx[MAX_N_TRAJ]
double startpy[MAX_N_TRAJ]
double fLengthScaleB2U
scale factor beam (cm) –> user
long int fMaxWgtEntries
of entries in estimating max wgt
int fgPdgC
generated nu pdg-code
enum genie::flux::GNuMIFlux::EStdFluxWindow StdFluxWindow_t
g3numi * fG3NuMI
g3numi ntuple
const TLorentzVector & Momentum(void)
returns the flux neutrino 4-momentum
double stoppx[MAX_N_TRAJ]
TVector3 fWindowNormal
normal direction for flux window
double fLengthScaleU2B
scale factor beam user –> (cm)
void SetMaxEFudge(double fudge=1.05)
int fUseFluxAtDetCenter
use flux at near (-1) or far (+1) det center from ntuple?
double fEffPOTsPerNu
what a entry is worth ...
int getProcessID(TString sval)
TLorentzRotation fBeamRotInv
TVector3 FluxWindowNormal()
TLorentzVector fgP4User
generated nu 4-momentum user coord
string fNuFluxGen
"g3numi" "g4numi" or "flugg"
double starty[MAX_N_TRAJ]
double fWeight
current neutrino weight, =1 if generating unweighted entries
TLorentzRotation fBeamRot
rotation applied beam –> user coord
long int fNUse
how often to use same entry in a row
Long64_t fNuTot
cummulative # of entries (=fNEntries)
double fMaxEv
maximum energy
TLorentzVector fFluxWindowBase
base point for flux window - beam coord
long int fNNeutrinos
number of flux neutrinos thrown so far
void SetGenWeighted(bool genwgt=false)
toggle whether GenerateNext() returns weight=1 flux (initial default false)
GENIE Interface for user-defined flux classes.