All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Private Attributes | List of all members
fluxr::GSimpleInterface Class Reference

#include <GSimpleInterface.h>

Inheritance diagram for fluxr::GSimpleInterface:
fluxr::FluxInterface

Public Member Functions

 GSimpleInterface ()
 
 ~GSimpleInterface ()
 
const Long64_t GetEntries ()
 
const int GetRun ()
 
const void SetRun (int run)
 
const float GetPOT ()
 
const TLorentzVector GetNuPosition ()
 
const TLorentzVector GetNuMomentum ()
 
void SetRootFile (TFile *rootFileName)
 
bool FillMCFlux (Long64_t ientry, simb::MCFlux &mcflux)
 

Private Attributes

TTree * fFluxTree
 
TTree * fMetaTree
 
genie::flux::GSimpleNtpEntry * fGSimpleEntry
 
genie::flux::GSimpleNtpNuMI * fGSimpleNuMI
 
genie::flux::GSimpleNtpAux * fGSimpleAux
 
genie::flux::GSimpleNtpMeta * fGSimpleMeta
 
Long64_t fNEntries
 
int fRun
 
float fPOT
 
TLorentzVector fNuPos
 
TLorentzVector fNuMom
 

Detailed Description

Definition at line 13 of file GSimpleInterface.h.

Constructor & Destructor Documentation

fluxr::GSimpleInterface::GSimpleInterface ( )

Definition at line 6 of file GSimpleInterface.cxx.

7  {
8  }
fluxr::GSimpleInterface::~GSimpleInterface ( )

Definition at line 10 of file GSimpleInterface.cxx.

11  {
12  }

Member Function Documentation

bool fluxr::GSimpleInterface::FillMCFlux ( Long64_t  ientry,
simb::MCFlux &  mcflux 
)
virtual

Implements fluxr::FluxInterface.

Definition at line 42 of file GSimpleInterface.cxx.

43  {
44  if (!fFluxTree->GetEntry(ientry))
45  return false;
46 
47  fNuPos=TLorentzVector(fGSimpleEntry->vtxx*100,fGSimpleEntry->vtxy*100,fGSimpleEntry->vtxz*100,0);
48  fNuMom=TLorentzVector(fGSimpleEntry->px ,fGSimpleEntry->py ,fGSimpleEntry->pz ,fGSimpleEntry->E);
49 
50  //stealing code from GenieHelper (nutools/EventGeneratorBase/GENIE/GENIEHelper.cxx)
51  flux.fntype = fGSimpleEntry->pdg;
52  flux.fnimpwt = fGSimpleEntry->wgt;
53  flux.fdk2gen = fGSimpleEntry->dist;
54  flux.fnenergyn = flux.fnenergyf = fGSimpleEntry->E;
55 
56  if ( fGSimpleNuMI ) {
57  flux.frun = fGSimpleNuMI->run;
58  flux.fevtno = fGSimpleNuMI->evtno;
59  flux.ftpx = fGSimpleNuMI->tpx;
60  flux.ftpy = fGSimpleNuMI->tpy;
61  flux.ftpz = fGSimpleNuMI->tpz;
62  flux.ftptype = fGSimpleNuMI->tptype; // converted to PDG
63  flux.fvx = fGSimpleNuMI->vx;
64  flux.fvy = fGSimpleNuMI->vy;
65  flux.fvz = fGSimpleNuMI->vz;
66 
67  flux.fndecay = fGSimpleNuMI->ndecay;
68  flux.fppmedium = fGSimpleNuMI->ppmedium;
69 
70  flux.fpdpx = fGSimpleNuMI->pdpx;
71  flux.fpdpy = fGSimpleNuMI->pdpy;
72  flux.fpdpz = fGSimpleNuMI->pdpz;
73 
74  double apppz = fGSimpleNuMI->pppz;
75  if ( TMath::Abs(fGSimpleNuMI->pppz) < 1.0e-30 ) apppz = 1.0e-30;
76  flux.fppdxdz = fGSimpleNuMI->pppx / apppz;
77  flux.fppdydz = fGSimpleNuMI->pppy / apppz;
78  flux.fpppz = fGSimpleNuMI->pppz;
79 
80  flux.fptype = fGSimpleNuMI->ptype;
81  }
82 
83  // anything useful stuffed into vdbl or vint?
84  // need to check the metadata auxintname, auxdblname
85  if ( fGSimpleAux && fGSimpleMeta ) {
86  // references just for reducing complexity
87  const std::vector<std::string>& auxdblname = fGSimpleMeta->auxdblname;
88  const std::vector<std::string>& auxintname = fGSimpleMeta->auxintname;
89  const std::vector<int>& auxint = fGSimpleAux->auxint;
90  const std::vector<double>& auxdbl = fGSimpleAux->auxdbl;
91 
92  for (size_t id=0; id<auxdblname.size(); ++id) {
93  if ("muparpx" == auxdblname[id]) flux.fmuparpx = auxdbl[id];
94  if ("muparpy" == auxdblname[id]) flux.fmuparpy = auxdbl[id];
95  if ("muparpz" == auxdblname[id]) flux.fmuparpz = auxdbl[id];
96  if ("mupare" == auxdblname[id]) flux.fmupare = auxdbl[id];
97  if ("necm" == auxdblname[id]) flux.fnecm = auxdbl[id];
98  if ("nimpwt" == auxdblname[id]) flux.fnimpwt = auxdbl[id];
99  if ("fgXYWgt" == auxdblname[id]) {
100  flux.fnwtnear = flux.fnwtfar = auxdbl[id];
101  }
102  }
103  for (size_t ii=0; ii<auxintname.size(); ++ii) {
104  if ("tgen" == auxintname[ii]) flux.ftgen = auxint[ii];
105  if ("tgptype" == auxintname[ii]) flux.ftgptype = auxint[ii];
106  }
107  }
108  return true;
109  }
genie::flux::GSimpleNtpEntry * fGSimpleEntry
genie::flux::GSimpleNtpNuMI * fGSimpleNuMI
genie::flux::GSimpleNtpMeta * fGSimpleMeta
genie::flux::GSimpleNtpAux * fGSimpleAux
const Long64_t fluxr::GSimpleInterface::GetEntries ( )
inlinevirtual

Implements fluxr::FluxInterface.

Definition at line 19 of file GSimpleInterface.h.

19 {return fNEntries;};
const TLorentzVector fluxr::GSimpleInterface::GetNuMomentum ( )
inlinevirtual

Implements fluxr::FluxInterface.

Definition at line 24 of file GSimpleInterface.h.

24 {return fNuMom;};
const TLorentzVector fluxr::GSimpleInterface::GetNuPosition ( )
inlinevirtual

Implements fluxr::FluxInterface.

Definition at line 23 of file GSimpleInterface.h.

23 {return fNuPos;};
const float fluxr::GSimpleInterface::GetPOT ( )
inlinevirtual

Implements fluxr::FluxInterface.

Definition at line 22 of file GSimpleInterface.h.

22 {return fPOT;};
const int fluxr::GSimpleInterface::GetRun ( )
inlinevirtual

Implements fluxr::FluxInterface.

Definition at line 20 of file GSimpleInterface.h.

20 {return fRun;};
void fluxr::GSimpleInterface::SetRootFile ( TFile *  rootFileName)

Definition at line 14 of file GSimpleInterface.cxx.

15  {
16  fFluxTree=dynamic_cast<TTree*>(fluxInputFile->Get("flux"));
17  fMetaTree=dynamic_cast<TTree*>(fluxInputFile->Get("meta"));
18  fGSimpleEntry = new genie::flux::GSimpleNtpEntry;
19  fGSimpleNuMI = new genie::flux::GSimpleNtpNuMI;
20  fGSimpleAux = new genie::flux::GSimpleNtpAux;
21  fGSimpleMeta = new genie::flux::GSimpleNtpMeta;
22  fFluxTree->SetBranchAddress("entry",&fGSimpleEntry);
23  fFluxTree->SetBranchAddress("numi" ,&fGSimpleNuMI);
24  fFluxTree->SetBranchAddress("aux" ,&fGSimpleAux);
25  fMetaTree->SetBranchAddress("meta" ,&fGSimpleMeta);
26 
27  fNEntries=fFluxTree->GetEntries();
28  fFluxTree->GetEntry(0);
29  fRun=fGSimpleNuMI->run;
30  fMetaTree->GetEntry(0);
31  fPOT=fGSimpleMeta->protons;
32 
33  Double_t* window_base = fGSimpleMeta->windowBase;
34  Double_t* window_dir_1 = fGSimpleMeta->windowDir1;
35  Double_t* window_dir_2 = fGSimpleMeta->windowDir2;
36  std::cout << "GSimple Window:" << std::endl;
37  std::cout << "\tBase: " << window_base[0] << ", " << window_base[1] << ", " << window_base[2] << std::endl;
38  std::cout << "\tDir 1: " << window_dir_1[0] << ", " << window_dir_1[1] << ", " << window_dir_1[2] << std::endl;
39  std::cout << "\tDir 2: " << window_dir_2[0] << ", " << window_dir_2[1] << ", " << window_dir_2[2] << std::endl;
40  }
genie::flux::GSimpleNtpEntry * fGSimpleEntry
genie::flux::GSimpleNtpNuMI * fGSimpleNuMI
genie::flux::GSimpleNtpMeta * fGSimpleMeta
genie::flux::GSimpleNtpAux * fGSimpleAux
BEGIN_PROLOG could also be cout
const void fluxr::GSimpleInterface::SetRun ( int  run)
inlinevirtual

Implements fluxr::FluxInterface.

Definition at line 21 of file GSimpleInterface.h.

21 {fRun = run;};

Member Data Documentation

TTree* fluxr::GSimpleInterface::fFluxTree
private

Definition at line 30 of file GSimpleInterface.h.

genie::flux::GSimpleNtpAux* fluxr::GSimpleInterface::fGSimpleAux
private

Definition at line 34 of file GSimpleInterface.h.

genie::flux::GSimpleNtpEntry* fluxr::GSimpleInterface::fGSimpleEntry
private

Definition at line 32 of file GSimpleInterface.h.

genie::flux::GSimpleNtpMeta* fluxr::GSimpleInterface::fGSimpleMeta
private

Definition at line 35 of file GSimpleInterface.h.

genie::flux::GSimpleNtpNuMI* fluxr::GSimpleInterface::fGSimpleNuMI
private

Definition at line 33 of file GSimpleInterface.h.

TTree* fluxr::GSimpleInterface::fMetaTree
private

Definition at line 31 of file GSimpleInterface.h.

Long64_t fluxr::GSimpleInterface::fNEntries
private

Definition at line 36 of file GSimpleInterface.h.

TLorentzVector fluxr::GSimpleInterface::fNuMom
private

Definition at line 40 of file GSimpleInterface.h.

TLorentzVector fluxr::GSimpleInterface::fNuPos
private

Definition at line 39 of file GSimpleInterface.h.

float fluxr::GSimpleInterface::fPOT
private

Definition at line 38 of file GSimpleInterface.h.

int fluxr::GSimpleInterface::fRun
private

Definition at line 37 of file GSimpleInterface.h.


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