GENIE2ART.cxx
Go to the documentation of this file.
1 ////////////////////////////////////////////////////////////////////////
2 /// \file GENIE2ART.cxx
3 /// \brief Functions for transforming GENIE objects into ART objects (and back)
4 ///
5 /// \version $Id: GENIE2ART.cxx,v 1.0 2016-04-20 18:42:01 rhatcher Exp $
6 /// \author rhatcher@fnal.gov
7 /// Parts taken from GENIEHelper & NuReweight classes
8 ///
9 ////////////////////////////////////////////////////////////////////////
10 
11 #include "GENIE2ART.h"
12 //#include <math.h>
13 //#include <map>
14 //#include <fstream>
15 #include <memory> // for unique_ptr
16 #include <typeinfo>
17 
18 // ROOT includes
19 #include "TVector3.h"
20 #include "TLorentzVector.h"
21 #include "TSystem.h"
22 
23 //GENIE includes
24 #ifdef GENIE_PRE_R3
25  #include "Conventions/GVersion.h"
26  #include "Conventions/Units.h"
27  #include "EVGCore/EventRecord.h"
28  #include "GHEP/GHepUtils.h"
29  #include "PDG/PDGCodes.h"
30  #include "PDG/PDGLibrary.h"
31  #include "GENIE/Utils/RunOpt.h"
32 
34  #include "Interaction/Interaction.h"
35  #include "Interaction/Kinematics.h"
36  #include "Interaction/KPhaseSpace.h"
37  #include "Interaction/ProcessInfo.h"
38  #include "Interaction/XclsTag.h"
39  #include "GHEP/GHepParticle.h"
40  #include "PDG/PDGCodeList.h"
41  #include "Conventions/Constants.h" //for calculating event kinematics
42 
43  #include "EVGDrivers/GFluxI.h"
44  #include "FluxDrivers/GFluxBlender.h"
45  #include "FluxDrivers/GNuMIFlux.h"
46  #include "FluxDrivers/GSimpleNtpFlux.h"
47 #else
48  // GENIE R-3 reorganized headers
49  #include "GENIE/Framework/Conventions/GVersion.h"
50  #include "GENIE/Framework/Conventions/Units.h"
51  #include "GENIE/Framework/Conventions/Constants.h" //for calculating event kinematics
52  #include "GENIE/Framework/ParticleData/PDGCodes.h"
53  #include "GENIE/Framework/ParticleData/PDGCodeList.h"
54  #include "GENIE/Framework/ParticleData/PDGLibrary.h"
55  #include "GENIE/Framework/GHEP/GHepUtils.h"
56  #include "GENIE/Framework/GHEP/GHepParticle.h"
57  #include "GENIE/Framework/Utils/RunOpt.h"
58  #include "GENIE/Framework/Utils/XSecSplineList.h"
59 
60  #include "GENIE/Framework/Interaction/InitialState.h"
61  #include "GENIE/Framework/Interaction/Interaction.h"
62  #include "GENIE/Framework/Interaction/Kinematics.h"
63  #include "GENIE/Framework/Interaction/KPhaseSpace.h"
64  #include "GENIE/Framework/Interaction/ProcessInfo.h"
65  #include "GENIE/Framework/Interaction/XclsTag.h"
66 
67  #include "GENIE/Framework/EventGen/EventRecord.h"
68  #include "GENIE/Framework/EventGen/GFluxI.h"
69  #include "GENIE/Tools/Flux/GFluxBlender.h"
70  #include "GENIE/Tools/Flux/GNuMIFlux.h"
71  #include "GENIE/Tools/Flux/GSimpleNtpFlux.h"
72 #endif
73 
74 #ifndef ART_V1
80 #else
81  #include "SimulationBase/MCTruth.h"
84  #include "SimulationBase/GTruth.h"
85  #include "SimulationBase/MCFlux.h"
86 #endif
87 
88 // dk2nu
89 #include "dk2nu/tree/dk2nu.h"
90 #include "dk2nu/tree/NuChoice.h"
91 #include "dk2nu/tree/dkmeta.h"
92 #include "dk2nu/genie/GDk2NuFlux.h"
93 
95 #include "cetlib_except/exception.h"
96 
98 {
99  // utility function:
100  // if input "s" starts w/ $, return corresponding env var value,
101  // otherwise return as is
102 
103  if ( s.find('$') != 0 ) return s;
104 
105  // need to remove ${}'s
106  std::string sEnvVar = s;
107  char rmchars[] = "$(){} ";
108  for (unsigned int i = 0; i < strlen(rmchars); ++i) {
109  // remove moves matching characters in [first,last) to end and
110  // returns a past-the-end iterator for the new end of the range [funky!]
111  // erase actually trims the string
112  sEnvVar.erase( std::remove(sEnvVar.begin(), sEnvVar.end(),
113  rmchars[i]), sEnvVar.end() );
114  }
115  const char* charEnvValue = std::getenv(sEnvVar.c_str());
116  if ( ! charEnvValue ) {
117  // resolved into an empty string ... not what one would expect
118 
119  throw cet::exception("UnresolvedEnvVariable")
120  << " can't resolve " << s << " via getenv(\"" << sEnvVar << "\")";
121  return s; // return original (though we won't get here due to throw)
122  }
123  return std::string(charEnvValue);
124 
125 }
126 
128  const std::string& tunename)
129 {
130  // set EventGeneratorList name (if non-blank)
131  // set Tune name (if >= R-3_XX_YY)
132 
133 #ifdef GENIE_PRE_R3
134  mf::LogInfo("GENIE2ART") << "GENIE_PRE_R3 ignore setting tune name: \""
135  << tunename << "\"";
136 #else
137  // Constructor automatically calls grunopt->Init();
139 
140  // SetEventGeneratorList wasn't introduced until R-3
141  std::string expEvtGenListName = evgb::ExpandEnvVar(evtgenlistname);
142  if ( expEvtGenListName != "" ) {
143  grunopt->SetEventGeneratorList(expEvtGenListName);
144  }
145 
146  std::string expTuneName = evgb::ExpandEnvVar(tunename);
147  if ( expTuneName != tunename ) {
148  mf::LogInfo("GENIE2ART") << "TuneName started as '" << tunename << "' "
149  << " converted to " << expTuneName;
150  }
151 
152  // If the XSecSplineList returns a non-empty string as the current tune name,
153  // then genie::RunOpt::BuildTune() has already been called.
155  if ( current_tune.empty() ) {
156  // We need to build the GENIE tune config
157  mf::LogInfo("GENIE2ART") << "Configuring GENIE tune \""
158  << expTuneName << '\"';
159  grunopt->SetTuneName( expTuneName );
160  grunopt->BuildTune();
161  mf::LogInfo("GENIEHelper") << *(grunopt->Tune());
162  }
163  else {
164  // It has already been built, so just check consistency
165  if ( expTuneName != current_tune) {
166  throw cet::exception("TuneNameMismatch") << "Requested GENIE tune \""
167  << expTuneName << "\" does not match previously built tune \""
168  << current_tune << '\"';
169  }
170  }
171 #endif
172 
173 }
174 
175 
176 //---------------------------------------------------------------------------
177 //choose a spill time (ns) to shift the vertex times by:
178 // double spillTime = fGlobalTimeOffset +
179 // fHelperRandom->Uniform()*fRandomTimeOffset;
180 
181 void evgb::FillMCTruth(const genie::EventRecord *record, double spillTime,
182  simb::MCTruth &truth)
183 {
184  TLorentzVector vtxOffset(0,0,0,spillTime);
185  FillMCTruth(record,vtxOffset,truth);
186 }
187 
189  TLorentzVector &vtxOffset,
190  simb::MCTruth &truth)
191 {
192  TLorentzVector *vertex = record->Vertex();
193 
194  // get the Interaction object from the record - this is the object
195  // that talks to the event information objects and is in m
196  const genie::Interaction *inter = record->Summary();
197 
198  // get the different components making up the interaction
199  const genie::InitialState &initState = inter->InitState();
200  const genie::ProcessInfo &procInfo = inter->ProcInfo();
201 
202  //const genie::Kinematics &kine = inter->Kine();
203  //const genie::XclsTag &exclTag = inter->ExclTag();
204  //const genie::KPhaseSpace &phaseSpace = inter->PhaseSpace();
205 
206  // add the particles from the interaction
207  TIter partitr(record);
208  genie::GHepParticle *part = 0;
209  // GHepParticles return units of GeV/c for p. the V_i are all in fermis
210  // and are relative to the center of the struck nucleus.
211  // add the vertex X/Y/Z to the V_i for status codes 0 and 1
212  int trackid = 0;
213  std::string primary("primary");
214 
215  while( (part = dynamic_cast<genie::GHepParticle *>(partitr.Next())) ){
216 
217  simb::MCParticle tpart(trackid,
218  part->Pdg(),
219  primary,
220  part->FirstMother(),
221  part->Mass(),
222  part->Status());
223  double vtx[4] = {part->Vx(), part->Vy(), part->Vz(), part->Vt()};
224  /*
225  if ( vtx[0] == 0 &&
226  vtx[1] == 0 &&
227  vtx[2] == 0 &&
228  vtx[3] == 0 ) {
229  //mf::LogInfo("GENIEHelper") << "tweak vtx[3] for MCParticle";
230  vtx[3] = 1.0e-30;
231  }
232  */
233  tpart.SetGvtx(vtx);
234  tpart.SetRescatter(part->RescatterCode());
235 
236  // set the vertex location for the neutrino, nucleus and everything
237  // that is to be tracked. vertex returns values in meters.
238  if (part->Status() == 0 || part->Status() == 1){
239  vtx[0] = 100.*(part->Vx()*1.e-15 + vertex->X() + vtxOffset.X());
240  vtx[1] = 100.*(part->Vy()*1.e-15 + vertex->Y() + vtxOffset.Y());
241  vtx[2] = 100.*(part->Vz()*1.e-15 + vertex->Z() + vtxOffset.Z());
242  vtx[3] = part->Vt() + vtxOffset.T();
243  }
244  TLorentzVector pos(vtx[0], vtx[1], vtx[2], vtx[3]);
245  TLorentzVector mom(part->Px(), part->Py(), part->Pz(), part->E());
246  tpart.AddTrajectoryPoint(pos,mom);
247  if (part->PolzIsSet()) {
248  TVector3 polz;
249  part->GetPolarization(polz);
250  tpart.SetPolarization(polz);
251  }
252  truth.Add(tpart);
253 
254  ++trackid;
255  }// end loop to convert GHepParticles to MCParticles
256 
257  // is the interaction NC or CC
258  int CCNC = simb::kCC;
259  if (procInfo.IsWeakNC()) CCNC = simb::kNC;
260 
261  // what is the interaction type
262  int mode = simb::kUnknownInteraction;
263 
264  if (procInfo.IsQuasiElastic() ) mode = simb::kQE;
265  else if (procInfo.IsDeepInelastic() ) mode = simb::kDIS;
266  else if (procInfo.IsResonant() ) mode = simb::kRes;
267  else if (procInfo.IsCoherent() ) mode = simb::kCoh;
268  else if (procInfo.IsCoherentElas() ) mode = simb::kCohElastic;
269  else if (procInfo.IsElectronScattering() ) mode = simb::kElectronScattering;
270  else if (procInfo.IsNuElectronElastic() ) mode = simb::kNuElectronElastic;
271  else if (procInfo.IsInverseMuDecay() ) mode = simb::kInverseMuDecay;
272  else if (procInfo.IsIMDAnnihilation() ) mode = simb::kIMDAnnihilation;
273  else if (procInfo.IsInverseBetaDecay() ) mode = simb::kInverseBetaDecay;
274  else if (procInfo.IsGlashowResonance() ) mode = simb::kGlashowResonance;
275  else if (procInfo.IsAMNuGamma() ) mode = simb::kAMNuGamma;
276  else if (procInfo.IsMEC() ) mode = simb::kMEC;
277  else if (procInfo.IsDiffractive() ) mode = simb::kDiffractive;
278  else if (procInfo.IsEM() ) mode = simb::kEM;
279  else if (procInfo.IsWeakMix() ) mode = simb::kWeakMix;
280 
282 
283  // set the neutrino information in MCTruth
285 
286  // The genie event kinematics are subtle different from the event
287  // kinematics that a experimentalist would calculate
288  // Instead of retriving the genie values for these kinematic variables
289  // calcuate them from the the final state particles
290  // while ingnoring the fermi momentum and the off-shellness of the bound nucleon.
291  genie::GHepParticle * hitnucl = record->HitNucleon();
292  TLorentzVector pdummy(0, 0, 0, 0);
293  // these don't exist if it came from nucleon decay .. RWH
294  const TLorentzVector v4_null;
295  genie::GHepParticle* probe = record->Probe();
296  genie::GHepParticle* finallepton = record->FinalStatePrimaryLepton();
297  const TLorentzVector & k1 = ( probe ? *(probe->P4()) : v4_null );
298  const TLorentzVector & k2 = ( finallepton ? *(finallepton->P4()) : v4_null );
299 
300 #ifdef OLD_KINE_CALC
301  //const TLorentzVector & p1 = (hitnucl) ? *(hitnucl->P4()) : pdummy;
302 
304  TLorentzVector q = k1-k2; // q=k1-k2, 4-p transfer
305  double Q2 = -1 * q.M2(); // momemtum transfer
306  double v = (hitnucl) ? q.Energy() : -1; // v (E transfer to the nucleus)
307  double x = (hitnucl) ? 0.5*Q2/(M*v) : -1; // Bjorken x
308  double y = (hitnucl) ? v/k1.Energy() : -1; // Inelasticity, y = q*P1/k1*P1
309  double W2 = (hitnucl) ? M*M + 2*M*v - Q2 : -1; // Hadronic Invariant mass ^ 2
310  double W = (hitnucl) ? std::sqrt(W2) : -1;
311 #else
312  // (same strategy as in gNtpConv.cxx::ConvertToGST().)
313 
314  // also note that since most of these variables are calculated purely
315  // from the leptonic system, they have meaning in reactions that didn't
316  // strike a nucleon (or even a hadron) as well.
317  TLorentzVector q = k1-k2; // q=k1-k2, 4-p transfer
318 
319  double Q2 = -1 * q.M2(); // momemtum transfer
320  double v = q.Energy(); // v (E transfer to the had system)
321  double y = v/k1.Energy(); // Inelasticity, y = q*P1/k1*P1
322  double x, W2, W;
323  x = W2 = W = -1;
324 
325  if ( hitnucl || procInfo.IsCoherent() ) {
326  const double M = genie::constants::kNucleonMass;
327  // Bjorken x.
328  // Rein & Sehgal use this same formulation of x even for Coherent
329  x = 0.5*Q2/(M*v);
330  // Hadronic Invariant mass ^ 2.
331  // ("wrong" for Coherent, but it's "experimental", so ok?)
332  W2 = M*M + 2*M*v - Q2;
333  W = std::sqrt(W2);
334  }
335 #endif
336 
337  truth.SetNeutrino(CCNC,
338  mode,
339  itype,
340  initState.Tgt().Pdg(),
341  initState.Tgt().HitNucPdg(),
342  initState.Tgt().HitQrkPdg(),
343  W,
344  x,
345  y,
346  Q2);
347  return;
348 }
349 
350 //---------------------------------------------------------------------------
352  simb::GTruth& truth) {
353 
354  //interactions info
355  genie::Interaction *inter = record->Summary();
356  const genie::ProcessInfo &procInfo = inter->ProcInfo();
357  truth.fGint = (int)procInfo.InteractionTypeId();
358  truth.fGscatter = (int)procInfo.ScatteringTypeId();
359 
360  //Event info
361  truth.fweight = record->Weight();
362  truth.fprobability = record->Probability();
363  truth.fXsec = record->XSec();
364  truth.fDiffXsec = record->DiffXSec();
365  truth.fGPhaseSpace = (int)record->DiffXSecVars();
366 
367  TLorentzVector vtx;
368  TLorentzVector *erVtx = record->Vertex();
369  vtx.SetXYZT(erVtx->X(), erVtx->Y(), erVtx->Z(), erVtx->T() );
370  truth.fVertex = vtx;
371 
372  //true reaction information and byproducts
373  //(PRE FSI)
374  const genie::XclsTag &exclTag = inter->ExclTag();
375  truth.fIsCharm = exclTag.IsCharmEvent();
376  truth.fCharmHadronPdg = exclTag.CharmHadronPdg();
377  truth.fIsStrange = exclTag.IsStrangeEvent();
378  truth.fStrangeHadronPdg = exclTag.StrangeHadronPdg();
379  truth.fResNum = (int)exclTag.Resonance();
380  truth.fDecayMode = exclTag.DecayMode();
381 
382  //note that in principle this information could come from the XclsTag,
383  //but that object isn't completely filled for most reactions,
384  //at least for GENIE <= 2.12
385 // truth.fNumPiPlus = exclTag.NPiPlus();
386 // truth.fNumPiMinus = exclTag.NPiMinus();
387 // truth.fNumPi0 = exclTag.NPi0();
388 // truth.fNumProton = exclTag.NProtons();
389 // truth.fNumNeutron = exclTag.NNucleons();
390  truth.fNumPiPlus = truth.fNumPiMinus = truth.fNumPi0 = truth.fNumProton = truth.fNumNeutron = 0;
391  for (int idx = 0; idx < record->GetEntries(); idx++)
392  {
393  // want hadrons that are about to be sent to the FSI model
394  const genie::GHepParticle * particle = record->Particle(idx);
395  if (particle->Status() != genie::kIStHadronInTheNucleus)
396  continue;
397 
398  int pdg = particle->Pdg();
399  if (pdg == genie::kPdgPi0)
400  truth.fNumPi0++;
401  else if (pdg == genie::kPdgPiP)
402  truth.fNumPiPlus++;
403  else if (pdg == genie::kPdgPiM)
404  truth.fNumPiMinus++;
405  else if (pdg == genie::kPdgNeutron)
406  truth.fNumNeutron++;
407  else if (pdg == genie::kPdgProton)
408  truth.fNumProton++;
409  } // for (idx)
410 
411  // Get the GENIE kinematics info
412  const genie::Kinematics &kine = inter->Kine();
413  // RWH: really should be looping of GENIE Conventions/KineVar_t enum
414  // and only recording/resetting those that were originally there ...
415  truth.fgQ2 = kine.Q2(true);
416  truth.fgq2 = kine.q2(true);
417  truth.fgW = kine.W(true);
418  if ( kine.KVSet(genie::kKVSelt) ) {
419  // only get this if it is set in the Kinematics class
420  // to avoid a warning message
421  truth.fgT = kine.t(true);
422  }
423  truth.fgX = kine.x(true);
424  truth.fgY = kine.y(true);
425 
426  /*
427  truth.fgQ2 = kine.Q2(false);
428  truth.fgW = kine.W(false);
429  truth.fgT = kine.t(false);
430  truth.fgX = kine.x(false);
431  truth.fgY = kine.y(false);
432  */
433  truth.fFShadSystP4 = kine.HadSystP4();
434 
435  //Initial State info
436  const genie::InitialState &initState = inter->InitState();
437  truth.fProbePDG = initState.ProbePdg();
438  truth.fProbeP4 = *initState.GetProbeP4();
439  truth.fTgtP4 = *initState.GetTgtP4();
440 
441  //Target info
442  const genie::Target &tgt = initState.Tgt();
443  truth.fIsSeaQuark = tgt.HitSeaQrk();
444  truth.fHitNucP4 = tgt.HitNucP4();
445  truth.fHitNucPos = tgt.HitNucPosition();
446  truth.ftgtZ = tgt.Z();
447  truth.ftgtA = tgt.A();
448  truth.ftgtPDG = tgt.Pdg();
449 
450  return;
451 
452 }
453 
454 //---------------------------------------------------------------------------
456  const simb::GTruth& gtruth,
457  bool useFirstTrajPosition)
458 {
459  genie::EventRecord* newEvent = new genie::EventRecord;
460 
461  newEvent->SetWeight(gtruth.fweight);
462  newEvent->SetProbability(gtruth.fprobability);
463  newEvent->SetXSec(gtruth.fXsec);
464 
466 
467  newEvent->SetDiffXSec(gtruth.fDiffXsec,space);
468 
469  TLorentzVector vtx = gtruth.fVertex;
470  newEvent->SetVertex(vtx);
471 
472  //mf::LogWarning("GENIE2ART")
473  // << "####### mctruth.NParticles() " << mctruth.NParticles();
474 
475  for (int i = 0; i < mctruth.NParticles(); i++) {
476  simb::MCParticle mcpart = mctruth.GetParticle(i);
477 
478  int gmid = mcpart.PdgCode();
480  int gmmo = mcpart.Mother();
481  int gmfd = -1;
482  int gmld = -1;
483 
484  /*
485  // GENIE will update daughter references as particles are added
486  // without a need to jump through these hoops ... which gets
487  // it wrong anyway (always sets 0th particles daughter to
488  // mctruth.NParticles()-1, and leave the others at -1 (which then
489  // GENIE handles correctly ...
490 
491  int ndaughters = mcpart.NumberDaughters();
492  //find the track ID of the first and last daughter particles
493  int fdtrkid = 0;
494  int ldtrkid = 0;
495  if (ndaughters !=0) {
496  fdtrkid = mcpart.Daughter(0);
497  if (ndaughters == 1) {
498  ldtrkid = 1;
499  }
500  else if (ndaughters >1) {
501  fdtrkid = mcpart.Daughter(ndaughters-1);
502  }
503  }
504 
505  // Genie uses the index in the particle array to reference
506  // the daughter particles.
507  // MCTruth keeps the particles in the same order so use the
508  // track ID to find the proper index.
509  for (int j = 0; j < mctruth.NParticles(); j++) {
510  simb::MCParticle temp = mctruth.GetParticle(i);
511  if (temp.TrackId() == fdtrkid) {
512  gmfd = j;
513  }
514  if (temp.TrackId() == ldtrkid) {
515  gmld = j;
516  }
517  }
518  */
519 
520  double gmpx = mcpart.Px(0);
521  double gmpy = mcpart.Py(0);
522  double gmpz = mcpart.Pz(0);
523  double gme = mcpart.E(0);
524 
525  double gmvx = mcpart.Gvx();
526  double gmvy = mcpart.Gvy();
527  double gmvz = mcpart.Gvz();
528  double gmvt = mcpart.Gvt();
529  bool GvtxFunky = false;
530  if ( gmvx == 0 && gmvy == 0 &&
531  gmvz == 0 && gmvt == 0 ) GvtxFunky = true;
532  if ( gmvx == simb::GTruth::kUndefinedValue &&
535  gmvt == simb::GTruth::kUndefinedValue ) GvtxFunky = true;
536  if (GvtxFunky) {
537  static int nmsg = 0; // don't warn about this for now
538  if (nmsg > 0) {
539  --nmsg;
540  std::string andOut = "";
541  if (nmsg == 0 ) andOut = "... last of such messages";
542  mf::LogWarning("GENIE2ART")
543  << "RetrieveGHEP(simb::MCTruth,simb::Gtruth) ... Gv[xyzt] all "
544  << gmvx << " for index " << i
545  << "; probably not filled ..."
546  << andOut << std::endl;
547  }
548  // MCParticle Vx(), Vy(), Vz() implicitly are index=0
549  // put it's likely we want the _last_ position ...
550  const TLorentzVector mcpartTrjPos =
551  ( useFirstTrajPosition ) ? mcpart.Position() : // default indx=0
552  mcpart.EndPosition();
553  unsigned int nTrj = mcpart.NumberTrajectoryPoints();
554  if ( nTrj < 1 ) // || nTrj > 1 )
555  mf::LogWarning("GENIE2ART") << "############### nTrj = " << nTrj;
556 
557  // set the vertex location for the neutrino, nucleus and everything
558  // that is to be tracked. vertex returns values in meters.
559  if ( mcpart.StatusCode() == 0 || mcpart.StatusCode() == 1 ){
560  // inverse of this....
561  // mcpartvtx[0] = 100.*(gpart->Vx()*1.e-15 + vertex->X());
562  // mcpartvtx[1] = 100.*(gpart->Vy()*1.e-15 + vertex->Y());
563  // mcpartvtx[2] = 100.*(gpart->Vz()*1.e-15 + vertex->Z());
564  // mcpartvtx[3] = gpart->Vt() + spillTime;
565  // local "vtx" is equiv to "vertex" ; solve for (genie)part->V
566  gmvx = 1.e15*((mcpartTrjPos.X()*1.e-2) - vtx.X());
567  gmvy = 1.e15*((mcpartTrjPos.Y()*1.e-2) - vtx.Y());
568  gmvz = 1.e15*((mcpartTrjPos.Z()*1.e-2) - vtx.Z());
569  gmvt = mcpartTrjPos.T() - vtx.T();
570  } else {
571  gmvx = mcpartTrjPos.X();
572  gmvy = mcpartTrjPos.Y();
573  gmvz = mcpartTrjPos.Z();
574  gmvt = mcpartTrjPos.T();
575  }
576 
577  } // if Gv[xyzt] seem unset
578 
579  int gmri = mcpart.Rescatter();
580 
581  genie::GHepParticle gpart(gmid, gmst, gmmo, -1, gmfd, gmld,
582  gmpx, gmpy, gmpz, gme, gmvx, gmvy, gmvz, gmvt);
583  gpart.SetRescatterCode(gmri);
584  TVector3 polz = mcpart.Polarization();
585  if (polz.x() !=0 || polz.y() !=0 || polz.z() !=0) {
586  gpart.SetPolarization(polz);
587  }
588  newEvent->AddParticle(gpart);
589  }
590 
591  genie::ProcessInfo proc_info;
594 
595  proc_info.Set(gscty,ginty);
596 
597  genie::XclsTag gxt;
598 
599  //Set Exclusive Final State particle numbers
601  gxt.SetResonance(gres);
602  gxt.SetDecayMode(gtruth.fDecayMode);
603  gxt.SetNPions(gtruth.fNumPiPlus, gtruth.fNumPi0, gtruth.fNumPiMinus);
604  gxt.SetNNucleons(gtruth.fNumProton, gtruth.fNumNeutron);
605 
606  if (gtruth.fIsCharm) {
607  gxt.SetCharm(gtruth.fCharmHadronPdg);
608  } else {
609  gxt.UnsetCharm();
610  }
611 
612  if (gtruth.fIsStrange) {
613  gxt.SetStrange(gtruth.fStrangeHadronPdg);
614  } else {
615  gxt.UnsetStrange();
616  }
617 
618  // Set the GENIE kinematics info
619  genie::Kinematics gkin;
620  // RWH: really should be looping of GENIE Conventions/KineVar_t enum
621  // and only recording/resetting those that were originally there ...
622  const double flagVal = -99999;
623  if ( gtruth.fgX != flagVal) gkin.Setx(gtruth.fgX, true);
624  if ( gtruth.fgY != flagVal) gkin.Sety(gtruth.fgY, true);
625  if ( gtruth.fgT != flagVal) gkin.Sett(gtruth.fgT, true);
626  if ( gtruth.fgW != flagVal) gkin.SetW(gtruth.fgW, true);
627  if ( gtruth.fgQ2 != flagVal) gkin.SetQ2(gtruth.fgQ2, true);
628  if ( gtruth.fgq2 != flagVal) gkin.Setq2(gtruth.fgq2, true);
629  simb::MCNeutrino nu = mctruth.GetNeutrino();
630  simb::MCParticle lep = nu.Lepton();
631  // is this even real?
632  if ( lep.NumberTrajectoryPoints() > 0 ) {
633  gkin.SetFSLeptonP4(lep.Px(), lep.Py(), lep.Pz(), lep.E());
634  }
635  gkin.SetHadSystP4(gtruth.fFShadSystP4.Px(),
636  gtruth.fFShadSystP4.Py(),
637  gtruth.fFShadSystP4.Pz(),
638  gtruth.fFShadSystP4.E());
639 
640  // reordering this to avoid warning (A=0,Z=0)
641  int probe_pdgc = gtruth.fProbePDG;
642  int tgtZ = gtruth.ftgtZ;
643  int tgtA = gtruth.ftgtA;
644 
645  //std::cerr << " tgtZ " << tgtZ << " tgtA " << tgtA << " probe " << probe_pdgc << std::endl;
646 
647  // genie::InitialState::Init() will fail if target_pdgc or probe_pdgc
648  // come back with nothign from PDGLibrary::Instance()->Find()
649  // fake it ... (what does nucleon decay do here??)
650  if ( tgtZ == 0 || tgtA == 0 ) { tgtZ = tgtA = 1; } // H1
651  if ( probe_pdgc == 0 || probe_pdgc == -1 ) { probe_pdgc = 22; } // gamma
652 
653  //std::cerr << " tgtZ " << tgtZ << " tgtA " << tgtA << " probe " << probe_pdgc << std::endl;
654 
655  int target_pdgc = genie::pdg::IonPdgCode(tgtA,tgtZ);
656 
657  /*
658  TParticlePDG * t = genie::PDGLibrary::Instance()->Find(target_pdgc);
659  TParticlePDG * p = genie::PDGLibrary::Instance()->Find(probe_pdgc );
660 
661  std::cerr << " target " << target_pdgc << " t " << t << " p " << p << std::endl;
662  */
663 
664  int targetNucleon = nu.HitNuc();
665  int struckQuark = nu.HitQuark();
666 
667  //genie::Target tmptgt(gtruth.ftgtZ, gtruth.ftgtA, targetNucleon);
668  // this ctor doesn't copy the state of the Target beyond the PDG value!
669  // so don't bother creating a tmptgt ...
670  //genie::InitialState ginitstate(tmptgt,probe_pdgc);
671 
672  genie::InitialState ginitstate(target_pdgc,probe_pdgc);
673 
674  // do this here _after_ creating InitialState
675  genie::Target* tgtptr = ginitstate.TgtPtr();
676  tgtptr->SetHitNucPdg(targetNucleon);
677  tgtptr->SetHitNucPosition(gtruth.fHitNucPos);
678  tgtptr->SetHitQrkPdg(struckQuark);
679  tgtptr->SetHitSeaQrk(gtruth.fIsSeaQuark);
680 
681  if (newEvent->HitNucleonPosition() >= 0) {
682  genie::GHepParticle * hitnucleon = newEvent->HitNucleon();
683  std::unique_ptr<TLorentzVector> p4hitnucleon(hitnucleon->GetP4());
684  tgtptr->SetHitNucP4(*p4hitnucleon);
685  } else {
686  if ( targetNucleon != 0 ) {
687  mf::LogWarning("GENIE2ART")
688  << "evgb::RetrieveGHEP() no hit nucleon position "
689  << " but targetNucleon is " << targetNucleon
690  << " at " << __FILE__ << ":" << __LINE__
691  << std::endl << std::flush;
692  }
693  TLorentzVector dummy(0.,0.,0.,0.);
694  tgtptr->SetHitNucP4(dummy);
695  }
696 
697  if (newEvent->TargetNucleusPosition() >= 0) {
698  genie::GHepParticle * target = newEvent->TargetNucleus();
699  std::unique_ptr<TLorentzVector> p4target(target->GetP4());
700  ginitstate.SetTgtP4(*p4target);
701  } else {
702  double Erest = 0.;
703  if ( gtruth.ftgtPDG != 0 ) {
704  TParticlePDG* ptmp = genie::PDGLibrary::Instance()->Find(gtruth.ftgtPDG);
705  if ( ptmp ) Erest = ptmp->Mass();
706  } else {
707  mf::LogWarning("GENIE2ART")
708  << "evgb::RetrieveGHEP() no target nucleus position "
709  << " but gtruth.ftgtPDG is " << gtruth.ftgtPDG
710  << " at " << __FILE__ << ":" << __LINE__
711  << std::endl << std::flush;
712  }
713  TLorentzVector dummy(0.,0.,0.,Erest);
714  ginitstate.SetTgtP4(dummy);
715  }
716 
717  genie::GHepParticle * probe = newEvent->Probe();
718  if ( probe ) {
719  std::unique_ptr<TLorentzVector> p4probe(probe->GetP4());
720  ginitstate.SetProbeP4(*p4probe);
721  } else {
722  // this can happen ...
723  mf::LogDebug("GENIE2ART")
724  << "evgb::RetrieveGHEP() no probe "
725  << " at " << __FILE__ << ":" << __LINE__
726  << std::endl << std::flush;
727  TLorentzVector dummy(0.,0.,0.,0.);
728  ginitstate.SetProbeP4(dummy);
729  }
730 
731  genie::Interaction * p_gint = new genie::Interaction(ginitstate,proc_info);
732 
733  p_gint->SetProcInfo(proc_info);
734  p_gint->SetKine(gkin);
735  p_gint->SetExclTag(gxt);
736  newEvent->AttachSummary(p_gint);
737 
738  /*
739  //For temporary debugging purposes
740  genie::Interaction *inter = newEvent->Summary();
741  const genie::InitialState &initState = inter->InitState();
742  const genie::Target &tgt = initState.Tgt();
743  std::cout << "TargetPDG as Recorded: " << gtruth.ftgtPDG << std::endl;
744  std::cout << "TargetZ as Recorded: " << gtruth.ftgtZ << std::endl;
745  std::cout << "TargetA as Recorded: " << gtruth.ftgtA << std::endl;
746  std::cout << "TargetPDG as Recreated: " << tgt.Pdg() << std::endl;
747  std::cout << "TargetZ as Recreated: " << tgt.Z() << std::endl;
748  std::cout << "TargetA as Recreated: " << tgt.A() << std::endl;
749  */
750 
751  return newEvent;
752 
753 }
754 
755 //---------------------------------------------------------------------------
757 {
758  // is the real driver hidden behind a blender?
759  genie::flux::GFluxBlender* gblender =
760  dynamic_cast<genie::flux::GFluxBlender *>(fdriver);
761  if ( gblender ) {
762  // it is, it is ... proceed with that ...
763  fdriver = gblender->GetFluxGenerator();
764  }
765 
766  genie::flux::GNuMIFlux* gnumi =
767  dynamic_cast<genie::flux::GNuMIFlux *>(fdriver);
768  if ( gnumi ) {
769  FillMCFlux(gnumi,mcflux);
770  return;
771  } else {
772  genie::flux::GSimpleNtpFlux* gsimple =
773  dynamic_cast<genie::flux::GSimpleNtpFlux *>(fdriver);
774  if ( gsimple ) {
775  FillMCFlux(gsimple,mcflux);
776  return;
777  } else {
778  genie::flux::GDk2NuFlux* gdk2nu =
779  dynamic_cast<genie::flux::GDk2NuFlux *>(fdriver);
780  if ( gdk2nu ) {
781  FillMCFlux(gdk2nu,mcflux);
782  return;
783  } else {
784  static bool first = true;
785  if ( first ) {
786  first = false;
787  std::string dname = typeid(*fdriver).name();
788  // can't use fdriver->GetClass()->GetName(); not derived from TObject
789  mf::LogInfo("GENIE2ART")
790  << " " << __FILE__ << ":" << __LINE__ << "\n"
791  << " no FillMCFlux() for this flux driver: "
792  << dname
793  << " (typeid.name, use \"c++filt -t\" to demangle)"
794  << std::endl;
795  // atmospheric fluxes don't have a method for FillMCFLux
796  // don't abort ... just note the problem, once // abort();
797  }
798  }
799  }
800  }
801 }
802 
803 //---------------------------------------------------------------------------
804 
806  simb::MCFlux& flux)
807 {
808  const genie::flux::GNuMIFluxPassThroughInfo& numiflux =
809  gnumi->PassThroughInfo();
810  const genie::flux::GNuMIFluxPassThroughInfo* nflux = &numiflux;
811  double dk2gen = gnumi->GetDecayDist();
812  evgb::FillMCFlux(nflux,dk2gen,flux);
813 }
815  double dk2gen,
816  simb::MCFlux& flux)
817 {
818  flux.Reset();
819  flux.fFluxType = simb::kNtuple;
820 
821  // check the particle codes and the units passed through
822  // nflux->pcodes: 0=original GEANT particle codes, 1=converted to PDG
823  // nflux->units: 0=original GEANT cm, 1=meters
824  if (nflux->pcodes != 1 && nflux->units != 0) {
825  mf::LogError("FillMCFlux")
826  << "either wrong particle codes or units "
827  << "from flux object - beware!!";
828  }
829 
830  // maintained variable names from gnumi ntuples
831  // see http://www.hep.utexas.edu/~zarko/wwwgnumi/v19/[/v19/output_gnumi.html]
832 
833  flux.frun = nflux->run;
834  flux.fevtno = nflux->evtno;
835  flux.fndxdz = nflux->ndxdz;
836  flux.fndydz = nflux->ndydz;
837  flux.fnpz = nflux->npz;
838  flux.fnenergy = nflux->nenergy;
839  flux.fndxdznea = nflux->ndxdznea;
840  flux.fndydznea = nflux->ndydznea;
841  flux.fnenergyn = nflux->nenergyn;
842  flux.fnwtnear = nflux->nwtnear;
843  flux.fndxdzfar = nflux->ndxdzfar;
844  flux.fndydzfar = nflux->ndydzfar;
845  flux.fnenergyf = nflux->nenergyf;
846  flux.fnwtfar = nflux->nwtfar;
847  flux.fnorig = nflux->norig;
848  flux.fndecay = nflux->ndecay;
849  flux.fntype = nflux->ntype;
850  flux.fvx = nflux->vx;
851  flux.fvy = nflux->vy;
852  flux.fvz = nflux->vz;
853  flux.fpdpx = nflux->pdpx;
854  flux.fpdpy = nflux->pdpy;
855  flux.fpdpz = nflux->pdpz;
856  flux.fppdxdz = nflux->ppdxdz;
857  flux.fppdydz = nflux->ppdydz;
858  flux.fpppz = nflux->pppz;
859  flux.fppenergy = nflux->ppenergy;
860  flux.fppmedium = nflux->ppmedium;
861  flux.fptype = nflux->ptype; // converted to PDG
862  flux.fppvx = nflux->ppvx;
863  flux.fppvy = nflux->ppvy;
864  flux.fppvz = nflux->ppvz;
865  flux.fmuparpx = nflux->muparpx;
866  flux.fmuparpy = nflux->muparpy;
867  flux.fmuparpz = nflux->muparpz;
868  flux.fmupare = nflux->mupare;
869  flux.fnecm = nflux->necm;
870  flux.fnimpwt = nflux->nimpwt;
871  flux.fxpoint = nflux->xpoint;
872  flux.fypoint = nflux->ypoint;
873  flux.fzpoint = nflux->zpoint;
874  flux.ftvx = nflux->tvx;
875  flux.ftvy = nflux->tvy;
876  flux.ftvz = nflux->tvz;
877  flux.ftpx = nflux->tpx;
878  flux.ftpy = nflux->tpy;
879  flux.ftpz = nflux->tpz;
880  flux.ftptype = nflux->tptype; // converted to PDG
881  flux.ftgen = nflux->tgen;
882  flux.ftgptype = nflux->tgptype; // converted to PDG
883  flux.ftgppx = nflux->tgppx;
884  flux.ftgppy = nflux->tgppy;
885  flux.ftgppz = nflux->tgppz;
886  flux.ftprivx = nflux->tprivx;
887  flux.ftprivy = nflux->tprivy;
888  flux.ftprivz = nflux->tprivz;
889  flux.fbeamx = nflux->beamx;
890  flux.fbeamy = nflux->beamy;
891  flux.fbeamz = nflux->beamz;
892  flux.fbeampx = nflux->beampx;
893  flux.fbeampy = nflux->beampy;
894  flux.fbeampz = nflux->beampz;
895 
896  flux.fdk2gen = dk2gen;
897 
898  return;
899 }
900 
901 //---------------------------------------------------------------------------
903  simb::MCFlux& flux)
904 {
905  const genie::flux::GSimpleNtpEntry* nflux_entry =
906  gsimple->GetCurrentEntry();
907  const genie::flux::GSimpleNtpNuMI* nflux_numi =
908  gsimple->GetCurrentNuMI();
909  const genie::flux::GSimpleNtpAux* nflux_aux =
910  gsimple->GetCurrentAux();
911  const genie::flux::GSimpleNtpMeta* nflux_meta =
912  gsimple->GetCurrentMeta();
913  evgb::FillMCFlux(nflux_entry, nflux_numi, nflux_aux, nflux_meta, flux);
914 }
916  const genie::flux::GSimpleNtpNuMI* nflux_numi,
917  const genie::flux::GSimpleNtpAux* nflux_aux,
918  const genie::flux::GSimpleNtpMeta* nflux_meta,
919  simb::MCFlux& flux)
920 {
921  flux.Reset();
923 
924  // maintained variable names from gnumi ntuples
925  // see http://www.hep.utexas.edu/~zarko/wwwgnumi/v19/[/v19/output_gnumi.html]
926 
927 
928  flux.fntype = nflux_entry->pdg;
929  flux.fnimpwt = nflux_entry->wgt;
930  flux.fdk2gen = nflux_entry->dist;
931  flux.fnenergyn = flux.fnenergyf = nflux_entry->E;
932 
933  if ( nflux_numi ) {
934  flux.frun = nflux_numi->run;
935  flux.fevtno = nflux_numi->evtno;
936  flux.ftpx = nflux_numi->tpx;
937  flux.ftpy = nflux_numi->tpy;
938  flux.ftpz = nflux_numi->tpz;
939  flux.ftptype = nflux_numi->tptype; // converted to PDG
940  flux.fvx = nflux_numi->vx;
941  flux.fvy = nflux_numi->vy;
942  flux.fvz = nflux_numi->vz;
943 
944  flux.fndecay = nflux_numi->ndecay;
945  flux.fppmedium = nflux_numi->ppmedium;
946 
947  flux.fpdpx = nflux_numi->pdpx;
948  flux.fpdpy = nflux_numi->pdpy;
949  flux.fpdpz = nflux_numi->pdpz;
950 
951  double apppz = nflux_numi->pppz;
952  if ( TMath::Abs(nflux_numi->pppz) < 1.0e-30 ) apppz = 1.0e-30;
953  flux.fppdxdz = nflux_numi->pppx / apppz;
954  flux.fppdydz = nflux_numi->pppy / apppz;
955  flux.fpppz = nflux_numi->pppz;
956 
957  flux.fptype = nflux_numi->ptype;
958 
959  }
960 
961  // anything useful stuffed into vdbl or vint?
962  // need to check the metadata auxintname, auxdblname
963 
964  if ( nflux_aux && nflux_meta ) {
965 
966  // references just for reducing complexity
967  const std::vector<std::string>& auxdblname = nflux_meta->auxdblname;
968  const std::vector<std::string>& auxintname = nflux_meta->auxintname;
969  const std::vector<int>& auxint = nflux_aux->auxint;
970  const std::vector<double>& auxdbl = nflux_aux->auxdbl;
971 
972  for (size_t id=0; id<auxdblname.size(); ++id) {
973  if ("muparpx" == auxdblname[id]) flux.fmuparpx = auxdbl[id];
974  if ("muparpy" == auxdblname[id]) flux.fmuparpy = auxdbl[id];
975  if ("muparpz" == auxdblname[id]) flux.fmuparpz = auxdbl[id];
976  if ("mupare" == auxdblname[id]) flux.fmupare = auxdbl[id];
977  if ("necm" == auxdblname[id]) flux.fnecm = auxdbl[id];
978  if ("nimpwt" == auxdblname[id]) flux.fnimpwt = auxdbl[id];
979  if ("fgXYWgt" == auxdblname[id]) {
980  flux.fnwtnear = flux.fnwtfar = auxdbl[id];
981  }
982  }
983  for (size_t ii=0; ii<auxintname.size(); ++ii) {
984  if ("tgen" == auxintname[ii]) flux.ftgen = auxint[ii];
985  if ("tgptype" == auxintname[ii]) flux.ftgptype = auxint[ii];
986  }
987 
988  }
989 
990 //#define RWH_TEST
991 #ifdef RWH_TEST
992  static bool first = true;
993  if (first) {
994  first = false;
995  mf::LogDebug("GENIE2ART")
996  << __FILE__ << ":" << __LINE__
997  << " one time dump of GSimple objects\n";
998  if ( nflux_meta ) {
999  mf::LogDebug("GENIE2ART")
1000  << "evgb::FillMCFlux() GSimpleNtpMeta:\n"
1001  << *nflux_meta << "\n";
1002  } else {
1003  mf::LogDebug("GENIE2ART")
1004  << "evgb::FillMCFlux() no GSimpleNtpMeta:\n";
1005  }
1006  }
1007  //mf::LogDebug("GENIEHelper")
1008  mf::LogDebug("GENIE2ART")
1009  << "simb::MCFlux:\n"
1010  << flux << "\n"
1011  << "GSimpleNtpFlux:\n";
1012  if ( nflux_entry) mf::LogDebug("GENIE2ART") << *nflux_entry << "\n";
1013  else mf::LogDebug("GENIE2ART") << "no GSimpleNtpEntry\n";
1014  if ( nflux_numi ) mf::LogDebug("GENIE2ART") << *nflux_numi << "\n";
1015  else mf::LogDebug("GENIE2ART") << "no GSimpleNtpNuMI\n";
1016  if ( nflux_aux ) mf::LogDebug("GENIE2ART") << *nflux_aux << "\n";
1017  else mf::LogDebug("GENIE2ART") << "no GSimpleNtpAux\n";
1018 #endif
1019 
1020  // flux.fndxdz = nflux.ndxdz;
1021  // flux.fndydz = nflux.ndydz;
1022  // flux.fnpz = nflux.npz;
1023  // flux.fnenergy = nflux.nenergy;
1024  // flux.fndxdznea = nflux.ndxdznea;
1025  // flux.fndydznea = nflux.ndydznea;
1026  // flux.fnenergyn = nflux.nenergyn;
1027  // flux.fnwtnear = nflux.nwtnear;
1028  // flux.fndxdzfar = nflux.ndxdzfar;
1029  // flux.fndydzfar = nflux.ndydzfar;
1030  // flux.fnenergyf = nflux.nenergyf;
1031  // flux.fnwtfar = nflux.nwtfar;
1032  // flux.fnorig = nflux.norig;
1033  // in numi // flux.fndecay = nflux.ndecay;
1034  // flux.fntype = nflux.ntype;
1035  // in numi // flux.fvx = nflux.vx;
1036  // in numi // flux.fvy = nflux.vy;
1037  // in numi // flux.fvz = nflux.vz;
1038  // flux.fppenergy = nflux.ppenergy;
1039  // in numi // flux.fppmedium = nflux.ppmedium;
1040  // flux.fppvx = nflux.ppvx;
1041  // flux.fppvy = nflux.ppvy;
1042  // flux.fppvz = nflux.ppvz;
1043  // see above // flux.fmuparpx = nflux.muparpx;
1044  // see above // flux.fmuparpy = nflux.muparpy;
1045  // see above // flux.fmuparpz = nflux.muparpz;
1046  // see above // flux.fmupare = nflux.mupare;
1047  // see above // flux.fnecm = nflux.necm;
1048  // see above // flux.fnimpwt = nflux.nimpwt;
1049  // flux.fxpoint = nflux.xpoint;
1050  // flux.fypoint = nflux.ypoint;
1051  // flux.fzpoint = nflux.zpoint;
1052  // flux.ftvx = nflux.tvx;
1053  // flux.ftvy = nflux.tvy;
1054  // flux.ftvz = nflux.tvz;
1055  // see above // flux.ftgen = nflux.tgen;
1056  // see above // flux.ftgptype = nflux.tgptype; // converted to PDG
1057  // flux.ftgppx = nflux.tgppx;
1058  // flux.ftgppy = nflux.tgppy;
1059  // flux.ftgppz = nflux.tgppz;
1060  // flux.ftprivx = nflux.tprivx;
1061  // flux.ftprivy = nflux.tprivy;
1062  // flux.ftprivz = nflux.tprivz;
1063  // flux.fbeamx = nflux.beamx;
1064  // flux.fbeamy = nflux.beamy;
1065  // flux.fbeamz = nflux.beamz;
1066  // flux.fbeampx = nflux.beampx;
1067  // flux.fbeampy = nflux.beampy;
1068  // flux.fbeampz = nflux.beampz;
1069 
1070  return;
1071 }
1072 
1073 //---------------------------------------------------------------------------
1074 void evgb::FillMCFlux(genie::flux::GDk2NuFlux* gdk2nu,
1075  simb::MCFlux& flux)
1076 {
1077  const bsim::Dk2Nu& dk2nu = gdk2nu->GetDk2Nu();
1078  const bsim::NuChoice& nuchoice = gdk2nu->GetNuChoice();
1079  evgb::FillMCFlux(&dk2nu,&nuchoice,flux);
1080  // do this after Fill as that does a Reset()
1081  flux.fdk2gen = gdk2nu->GetDecayDist();
1082 }
1083 void evgb::FillMCFlux(const bsim::Dk2Nu* dk2nu,
1084  const bsim::NuChoice* nuchoice,
1085  simb::MCFlux& flux)
1086 {
1087  flux.Reset();
1088  flux.fFluxType = simb::kDk2Nu;
1089 
1090  if ( dk2nu ) {
1091  flux.frun = dk2nu->job;
1092  flux.fevtno = dk2nu->potnum;
1093 
1094  // ignore vector<bsim::NuRay> (see nuchoice above)
1095 
1096  // bsim::Decay object
1097  flux.fnorig = dk2nu->decay.norig;
1098  flux.fndecay = dk2nu->decay.ndecay;
1099  flux.fntype = dk2nu->decay.ntype;
1100  flux.fppmedium = dk2nu->decay.ppmedium;
1101  flux.fptype = dk2nu->decay.ptype;
1102 
1103  flux.fvx = dk2nu->decay.vx;
1104  flux.fvy = dk2nu->decay.vy;
1105  flux.fvz = dk2nu->decay.vz;
1106  flux.fpdpx = dk2nu->decay.pdpx;
1107  flux.fpdpy = dk2nu->decay.pdpy;
1108  flux.fpdpz = dk2nu->decay.pdpz;
1109 
1110  flux.fppdxdz = dk2nu->decay.ppdxdz;
1111  flux.fppdydz = dk2nu->decay.ppdydz;
1112  flux.fpppz = dk2nu->decay.pppz;
1113  flux.fppenergy = dk2nu->decay.ppenergy;
1114 
1115  flux.fmuparpx = dk2nu->decay.muparpx;
1116  flux.fmuparpy = dk2nu->decay.muparpy;
1117  flux.fmuparpz = dk2nu->decay.muparpz;
1118  flux.fmupare = dk2nu->decay.mupare;
1119 
1120  flux.fnecm = dk2nu->decay.necm;
1121  flux.fnimpwt = dk2nu->decay.nimpwt;
1122 
1123  // no place for: vector<bsim::Ancestor>
1124 
1125  // production vertex of nu parent
1126  flux.fppvx = dk2nu->ppvx;
1127  flux.fppvy = dk2nu->ppvy;
1128  flux.fppvz = dk2nu->ppvz;
1129 
1130  // bsim::TgtExit object
1131  flux.ftvx = dk2nu->tgtexit.tvx;
1132  flux.ftvy = dk2nu->tgtexit.tvy;
1133  flux.ftvz = dk2nu->tgtexit.tvz;
1134  flux.ftpx = dk2nu->tgtexit.tpx;
1135  flux.ftpy = dk2nu->tgtexit.tpy;
1136  flux.ftpz = dk2nu->tgtexit.tpz;
1137  flux.ftptype = dk2nu->tgtexit.tptype; // converted to PDG
1138  flux.ftgen = dk2nu->tgtexit.tgen;
1139 
1140  // ignore vector<bsim::Traj>
1141 
1142  }
1143 
1144  if ( nuchoice ) {
1145  flux.fntype = nuchoice->pdgNu;
1146  flux.fnimpwt = nuchoice->impWgt;
1147 
1148  flux.fnenergyn = flux.fnenergyf = nuchoice->p4NuUser.E();
1149  flux.fnwtnear = flux.fnwtfar = nuchoice->xyWgt;
1150  }
1151 
1152  /*
1153  // anything useful stuffed into vdbl or vint?
1154  // need to check the metadata auxintname, auxdblname
1155 
1156  if ( nflux_aux && nflux_meta ) {
1157 
1158  // references just for reducing complexity
1159  const std::vector<std::string>& auxdblname = nflux_meta->auxdblname;
1160  const std::vector<std::string>& auxintname = nflux_meta->auxintname;
1161  const std::vector<int>& auxint = nflux_aux->auxint;
1162  const std::vector<double>& auxdbl = nflux_aux->auxdbl;
1163 
1164  for (size_t id=0; id<auxdblname.size(); ++id) {
1165  if ("muparpx" == auxdblname[id]) flux.fmuparpx = auxdbl[id];
1166  if ("muparpy" == auxdblname[id]) flux.fmuparpy = auxdbl[id];
1167  if ("muparpz" == auxdblname[id]) flux.fmuparpz = auxdbl[id];
1168  if ("mupare" == auxdblname[id]) flux.fmupare = auxdbl[id];
1169  if ("necm" == auxdblname[id]) flux.fnecm = auxdbl[id];
1170  if ("nimpwt" == auxdblname[id]) flux.fnimpwt = auxdbl[id];
1171  if ("fgXYWgt" == auxdblname[id]) {
1172  flux.fnwtnear = flux.fnwtfar = auxdbl[id];
1173  }
1174  }
1175  for (size_t ii=0; ii<auxintname.size(); ++ii) {
1176  if ("tgen" == auxintname[ii]) flux.ftgen = auxint[ii];
1177  if ("tgptype" == auxintname[ii]) flux.ftgptype = auxint[ii];
1178  }
1179 
1180  }
1181 
1182  // probably can get this from vx,vy,vz + NuChoice
1183  flux.fdk2gen = gdk2nu->GetDecayDist();
1184 
1185  */
1186 
1187  // flux.fndxdz = nflux.ndxdz;
1188  // flux.fndydz = nflux.ndydz;
1189  // flux.fnpz = nflux.npz;
1190  // flux.fnenergy = nflux.nenergy;
1191  // flux.fndxdznea = nflux.ndxdznea;
1192  // flux.fndydznea = nflux.ndydznea;
1193  // flux.fnenergyn = nflux.nenergyn;
1194  // flux.fnwtnear = nflux.nwtnear;
1195  // flux.fndxdzfar = nflux.ndxdzfar;
1196  // flux.fndydzfar = nflux.ndydzfar;
1197  // flux.fnenergyf = nflux.nenergyf;
1198  // flux.fnwtfar = nflux.nwtfar;
1199  // flux.fnorig = nflux.norig;
1200  // in numi // flux.fndecay = nflux.ndecay;
1201  // flux.fntype = nflux.ntype;
1202  // in numi // flux.fvx = nflux.vx;
1203  // in numi // flux.fvy = nflux.vy;
1204  // in numi // flux.fvz = nflux.vz;
1205  // flux.fppenergy = nflux.ppenergy;
1206  // in numi // flux.fppmedium = nflux.ppmedium;
1207  // flux.fppvx = nflux.ppvx;
1208  // flux.fppvy = nflux.ppvy;
1209  // flux.fppvz = nflux.ppvz;
1210  // see above // flux.fmuparpx = nflux.muparpx;
1211  // see above // flux.fmuparpy = nflux.muparpy;
1212  // see above // flux.fmuparpz = nflux.muparpz;
1213  // see above // flux.fmupare = nflux.mupare;
1214  // see above // flux.fnecm = nflux.necm;
1215  // see above // flux.fnimpwt = nflux.nimpwt;
1216  // flux.fxpoint = nflux.xpoint;
1217  // flux.fypoint = nflux.ypoint;
1218  // flux.fzpoint = nflux.zpoint;
1219  // flux.ftvx = nflux.tvx;
1220  // flux.ftvy = nflux.tvy;
1221  // flux.ftvz = nflux.tvz;
1222  // see above // flux.ftgen = nflux.tgen;
1223  // see above // flux.ftgptype = nflux.tgptype; // converted to PDG
1224  // flux.ftgppx = nflux.tgppx;
1225  // flux.ftgppy = nflux.tgppy;
1226  // flux.ftgppz = nflux.tgppz;
1227  // flux.ftprivx = nflux.tprivx;
1228  // flux.ftprivy = nflux.tprivy;
1229  // flux.ftprivz = nflux.tprivz;
1230  // flux.fbeamx = nflux.beamx;
1231  // flux.fbeamy = nflux.beamy;
1232  // flux.fbeamz = nflux.beamz;
1233  // flux.fbeampx = nflux.beampx;
1234  // flux.fbeampy = nflux.beampy;
1235  // flux.fbeampz = nflux.beampz;
1236 
1237  return;
1238 }
1239 
1240 //---------------------------------------------------------------------------
1241 
1242 
double fgW
Definition: GTruth.h:63
double E(const int i=0) const
Definition: MCParticle.h:232
int fGint
interaction code
Definition: GTruth.h:56
bool IsResonant(void) const
Definition: ProcessInfo.cxx:92
Double_t E
energy in lab frame
Unified ntuple flux format (replaces 2)
Definition: MCFlux.h:23
int frun
Definition: MCFlux.h:35
unsigned int NumberTrajectoryPoints() const
Definition: MCParticle.h:217
double W(bool selected=false) const
Definition: Kinematics.cxx:167
const TVector3 & Polarization() const
Definition: MCParticle.h:213
void SetTgtP4(const TLorentzVector &P4)
virtual void SetXSec(double xsec)
Definition: GHepRecord.h:133
const TLorentzVector & Position(const int i=0) const
Definition: MCParticle.h:218
void SetNPions(int npi_plus, int npi_0, int npi_minus)
Definition: XclsTag.cxx:97
int RescatterCode(void) const
Definition: GHepParticle.h:66
virtual GHepParticle * Particle(int position) const
Definition: GHepRecord.cxx:148
int PdgCode() const
Definition: MCParticle.h:211
TuneId * Tune(void) const
Definition: RunOpt.h:45
virtual void SetWeight(double wght)
Definition: GHepRecord.h:131
bool IsWeakMix(void) const
double fgq2
Definition: GTruth.h:62
double fnenergy
Definition: MCFlux.h:40
bool HitSeaQrk(void) const
Definition: Target.cxx:316
const simb::MCNeutrino & GetNeutrino() const
Definition: MCTruth.h:77
double ftgppy
Definition: MCFlux.h:86
double fgX
Definition: GTruth.h:65
int ftgtA
Definition: GTruth.h:46
double fpdpx
Definition: MCFlux.h:55
double Py(const int i=0) const
Definition: MCParticle.h:230
double Gvz() const
Definition: MCParticle.h:247
InteractionType_t InteractionTypeId(void) const
void SetProbeP4(const TLorentzVector &P4)
double ftpx
Definition: MCFlux.h:79
const TLorentzVector & EndPosition() const
Definition: MCParticle.h:224
Double_t pdpx
nu parent momentum at time of decay
double E(void) const
Get energy.
Definition: GHepParticle.h:92
static const double kNucleonMass
Definition: Constants.h:78
int HitQuark() const
Definition: MCNeutrino.h:153
double Q2(const Interaction *const i)
Definition: KineUtils.cxx:1007
double ftprivy
Definition: MCFlux.h:89
Full flux simulation ntuple.
Definition: MCFlux.h:21
void SetOrigin(simb::Origin_t origin)
Definition: MCTruth.h:82
neutrino electron elastic scatter
Definition: MCNeutrino.h:140
virtual Interaction * Summary(void) const
Definition: GHepRecord.cxx:135
int fppmedium
Definition: MCFlux.h:62
int HitNucPdg(void) const
Definition: Target.cxx:321
virtual KinePhaseSpace_t DiffXSecVars(void) const
Definition: GHepRecord.h:129
void SetQ2(double Q2, bool selected=false)
Definition: Kinematics.cxx:265
const TLorentzVector * P4(void) const
Definition: GHepParticle.h:79
A GENIE flux driver using a simple ntuple format.
std::string string
Definition: nybbler.cc:12
MaybeLogger_< ELseverityLevel::ELsev_info, false > LogInfo
genie::EventRecord * RetrieveGHEP(const simb::MCTruth &truth, const simb::GTruth &gtruth, bool useFirstTrajPosition=true)
return genie::EventRecord pointer; callee takes possession
Definition: GENIE2ART.cxx:455
double fbeamx
Definition: MCFlux.h:91
void FillMCFlux(genie::GFluxI *fdriver, simb::MCFlux &mcflux)
Definition: GENIE2ART.cxx:756
int A(void) const
Definition: Target.h:71
void Setq2(double q2, bool selected=false)
Definition: Kinematics.cxx:277
int HitQrkPdg(void) const
Definition: Target.cxx:259
bool IsInverseMuDecay(void) const
int Mother() const
Definition: MCParticle.h:212
double fbeampy
Definition: MCFlux.h:95
Double_t vx
vertex position of hadron/muon decay
bool IsQuasiElastic(void) const
Definition: ProcessInfo.cxx:67
enum genie::EGHepStatus GHepStatus_t
int ftptype
Definition: MCFlux.h:82
virtual void SetProbability(double prob)
Definition: GHepRecord.h:132
void UnsetStrange(void)
Definition: XclsTag.cxx:91
int fGPhaseSpace
phase space system of DiffXSec
Definition: GTruth.h:32
int NuanceReactionCode(const GHepRecord *evrec)
Definition: GHepUtils.cxx:281
int CharmHadronPdg(void) const
Definition: XclsTag.h:52
bool IsStrangeEvent(void) const
Definition: XclsTag.h:53
bool IsElectronScattering(void) const
simb::flux_code_ fFluxType
Definition: MCFlux.h:98
int Pdg(void) const
Definition: Target.h:72
double Px(const int i=0) const
Definition: MCParticle.h:229
int fNumNeutron
number of neutrons after reaction, before FSI
Definition: GTruth.h:76
double fvx
Definition: MCFlux.h:52
void SetHitNucP4(const TLorentzVector &p4)
Definition: Target.cxx:206
Generated/set kinematical variables for an event.
Definition: Kinematics.h:40
int HitNuc() const
Definition: MCNeutrino.h:152
double fnwtfar
Definition: MCFlux.h:48
void SetHitQrkPdg(int pdgc)
Definition: Target.cxx:201
std::vector< std::string > auxintname
tagname of aux ints associated w/ entry
virtual int HitNucleonPosition(void) const
Definition: GHepRecord.cxx:454
bool IsInverseBetaDecay(void) const
int ftgtZ
Definition: GTruth.h:45
double fXsec
cross section of interaction
Definition: GTruth.h:30
virtual double Weight(void) const
Definition: GHepRecord.h:125
double x(bool selected=false) const
Definition: Kinematics.cxx:109
const TLorentzVector & HadSystP4(void) const
Definition: Kinematics.h:67
Functions for transforming GENIE objects into ART objects (and back)
void SetHitNucPosition(double r)
Definition: Target.cxx:227
int fNumPiPlus
number of pi pluses after reaction, before FSI
Definition: GTruth.h:78
offset to account for adding in Nuance codes to this enum
Definition: MCNeutrino.h:95
int StatusCode() const
Definition: MCParticle.h:210
int fNumPiMinus
number of pi minuses after reaction, before FSI
Definition: GTruth.h:79
double fppdxdz
Definition: MCFlux.h:58
bool IsDiffractive(void) const
double Gvx() const
Definition: MCParticle.h:245
Int_t tptype
parent particle type at target exit
std::vector< Double_t > auxdbl
additional doubles associated w/ entry
double Mass(void) const
Mass that corresponds to the PDG code.
bool IsIMDAnnihilation(void) const
int NParticles() const
Definition: MCTruth.h:75
void SetNeutrino(int CCNC, int mode, int interactionType, int target, int nucleon, int quark, double w, double x, double y, double qsqr)
Definition: MCTruth.cxx:30
int ftgen
Definition: MCFlux.h:83
void SetKine(const Kinematics &kine)
MaybeLogger_< ELseverityLevel::ELsev_error, false > LogError
void SetPolarization(double theta, double phi)
static XSecSplineList * Instance()
double fdk2gen
distance from decay to ray origin
Definition: MCFlux.h:103
double Gvy() const
Definition: MCParticle.h:246
enum genie::EKinePhaseSpace KinePhaseSpace_t
Particle class.
enum genie::EResonance Resonance_t
double ftprivx
Definition: MCFlux.h:88
std::vector< Int_t > auxint
additional ints associated w/ entry
double Pz(void) const
Get Pz.
Definition: GHepParticle.h:91
void SetResonance(Resonance_t res)
Definition: XclsTag.cxx:137
void Set(ScatteringType_t sc_type, InteractionType_t int_type)
GHepStatus_t Status(void) const
Definition: GHepParticle.h:65
bool fIsStrange
strange production // added version 13
Definition: GTruth.h:73
virtual void AttachSummary(Interaction *interaction)
Definition: GHepRecord.cxx:143
object containing MC flux information
Contains minimal information for tagging exclusive processes.
Definition: XclsTag.h:39
virtual TLorentzVector * Vertex(void) const
Definition: GHepRecord.h:141
double Px(void) const
Get Px.
Definition: GHepParticle.h:89
void SetCharm(int charm_pdgc=0)
Definition: XclsTag.cxx:68
TLorentzVector fProbeP4
Definition: GTruth.h:41
void SetEventGeneratorList(string evgenlist)
Definition: RunOpt.h:60
virtual GHepParticle * Probe(void) const
Definition: GHepRecord.cxx:321
double y(bool selected=false) const
Definition: Kinematics.cxx:122
bool IsCharmEvent(void) const
Definition: XclsTag.h:50
double Vt(void) const
Get production time.
Definition: GHepParticle.h:98
int Pdg(void) const
Definition: GHepParticle.h:64
int FirstMother(void) const
Definition: GHepParticle.h:67
double fndydzfar
Definition: MCFlux.h:46
A GENIE flux driver encapsulating the NuMI neutrino flux. It reads-in the official GNUMI neutrino flu...
Definition: GNuMIFlux.h:217
int ftgptype
Definition: MCFlux.h:84
const genie::flux::GSimpleNtpEntry * GetCurrentEntry(void)
GSimpleNtpEntry.
int fResNum
resonance number
Definition: GTruth.h:80
Some common run-time GENIE options.
Definition: RunOpt.h:36
Summary information for an interaction.
Definition: Interaction.h:55
Double_t pppx
nu parent momentum at production point
double y
int fNumProton
number of protons after reaction, before FSI
Definition: GTruth.h:75
const genie::flux::GSimpleNtpMeta * GetCurrentMeta(void)
GSimpleNtpMeta.
const TLorentzVector & HitNucP4(void) const
Definition: Target.h:92
int fDecayMode
Definition: GTruth.h:81
double q2(bool selected=false) const
Definition: Kinematics.cxx:151
double fprobability
interaction probability
Definition: GTruth.h:29
double fnenergyf
Definition: MCFlux.h:47
void Reset()
Definition: MCFlux.cxx:94
double ftprivz
Definition: MCFlux.h:90
double fbeamz
Definition: MCFlux.h:93
double fnwtnear
Definition: MCFlux.h:44
bool IsWeakNC(void) const
int StrangeHadronPdg(void) const
Definition: XclsTag.h:55
const simb::MCParticle & Lepton() const
Definition: MCNeutrino.h:147
int fptype
Definition: MCFlux.h:63
int fProbePDG
Definition: GTruth.h:39
double ftvx
Definition: MCFlux.h:76
bool KVSet(KineVar_t kv) const
Definition: Kinematics.cxx:327
void SetFSLeptonP4(const TLorentzVector &p4)
Definition: Kinematics.cxx:307
bool IsNuElectronElastic(void) const
const GNuMIFluxPassThroughInfo & PassThroughInfo(void)
GNuMIFluxPassThroughInfo.
Definition: GNuMIFlux.h:252
int fGscatter
neutrino scattering code
Definition: GTruth.h:55
int fndecay
Definition: MCFlux.h:50
double fndydz
Definition: MCFlux.h:38
std::string ExpandEnvVar(const std::string &s)
Definition: GENIE2ART.cxx:97
void SetStrange(int strange_pdgc=0)
Definition: XclsTag.cxx:85
int fnorig
Definition: MCFlux.h:49
A class encapsulating an enumeration of interaction types (EM, Weak-CC, Weak-NC) and scattering types...
Definition: ProcessInfo.h:43
double fbeamy
Definition: MCFlux.h:92
bool IsAMNuGamma(void) const
double ftgppz
Definition: MCFlux.h:87
void SetRescatterCode(int code)
Definition: GHepParticle.h:130
double fpdpz
Definition: MCFlux.h:57
std::string getenv(std::string const &name)
Definition: getenv.cc:15
int fNumPi0
number of pi0 after reaction, before FSI
Definition: GTruth.h:77
int fCharmHadronPdg
Definition: GTruth.h:72
TLorentzVector * GetP4(void) const
virtual GHepParticle * FinalStatePrimaryLepton(void) const
Definition: GHepRecord.cxx:370
QTextStream & flush(QTextStream &s)
const Kinematics & Kine(void) const
Definition: Interaction.h:70
A Neutrino Interaction Target. Is a transparent encapsulation of quite different physical systems suc...
Definition: Target.h:41
int ProbePdg(void) const
Definition: InitialState.h:65
void Sett(double t, bool selected=false)
Definition: Kinematics.cxx:301
bool fIsCharm
did the interaction produce a charmed hadron?
Definition: GTruth.h:71
double fmuparpz
Definition: MCFlux.h:69
int DecayMode(void) const
Definition: XclsTag.h:70
const int kPdgPiP
Definition: PDGCodes.h:139
Int_t ppmedium
tracking medium where parent was produced
const int kPdgPi0
Definition: PDGCodes.h:141
double fweight
event interaction weight (genie internal)
Definition: GTruth.h:28
virtual GHepParticle * TargetNucleus(void) const
Definition: GHepRecord.cxx:330
virtual double DiffXSec(void) const
Definition: GHepRecord.h:128
int Z(void) const
Definition: Target.h:69
double ftgppx
Definition: MCFlux.h:85
int fevtno
Definition: MCFlux.h:36
double fppdydz
Definition: MCFlux.h:59
double ftpz
Definition: MCFlux.h:81
double ftvy
Definition: MCFlux.h:77
Double_t tpx
parent particle px at target exit
ScatteringType_t ScatteringTypeId(void) const
Resonance_t Resonance(void) const
Definition: XclsTag.h:69
TLorentzVector fHitNucP4
Definition: GTruth.h:51
void BuildTune()
build tune and inform XSecSplineList
Definition: RunOpt.cxx:100
double fbeampz
Definition: MCFlux.h:96
GFluxI * GetFluxGenerator()
access, not ownership
Definition: GFluxBlender.h:89
bool PolzIsSet(void) const
void SetDecayMode(int decay_mode)
Definition: XclsTag.cxx:142
virtual double Probability(void) const
Definition: GHepRecord.h:126
double fndxdzfar
Definition: MCFlux.h:45
double fpdpy
Definition: MCFlux.h:56
double fnpz
Definition: MCFlux.h:39
bool IsMEC(void) const
bool IsEM(void) const
const simb::MCParticle & GetParticle(int i) const
Definition: MCTruth.h:76
double fzpoint
Definition: MCFlux.h:75
void GetPolarization(TVector3 &polz)
Generated Event Record. It is a GHepRecord object that can accept / be visited by EventRecordVisitorI...
Definition: EventRecord.h:38
double GetDecayDist() const
dist (user units) from dk to current pos
Definition: GNuMIFlux.cxx:551
bool IsDeepInelastic(void) const
Definition: ProcessInfo.cxx:82
void Setx(double x, bool selected=false)
Definition: Kinematics.cxx:241
double fvy
Definition: MCFlux.h:53
double fmupare
Definition: MCFlux.h:70
const genie::flux::GSimpleNtpAux * GetCurrentAux(void)
GSimpleNtpAux.
double fxpoint
Definition: MCFlux.h:73
void SetExclTag(const XclsTag &xcls)
double fndxdznea
Definition: MCFlux.h:41
void SetW(double W, bool selected=false)
Definition: Kinematics.cxx:289
void FillMCTruth(const genie::EventRecord *grec, double spillTime, simb::MCTruth &mctruth)
Definition: GENIE2ART.cxx:181
void Add(simb::MCParticle const &part)
Definition: MCTruth.h:80
n.b.: this group is similar but not quite, entirely unlike GENIE ScatteringType convention ...
Definition: MCNeutrino.h:80
static PDGLibrary * Instance(void)
Definition: PDGLibrary.cxx:43
void SetNNucleons(int np, int nn)
Definition: XclsTag.cxx:104
void SetEventGeneratorListAndTune(const std::string &evtlistname="", const std::string &tunename="${GENIE_XSEC_TUNE}")
Definition: GENIE2ART.cxx:127
static RunOpt * Instance(void)
Definition: RunOpt.cxx:62
double fppenergy
Definition: MCFlux.h:61
int fntype
Definition: MCFlux.h:51
double fHitNucPos
Definition: GTruth.h:52
double Vz(void) const
Get production z.
Definition: GHepParticle.h:97
enum genie::EScatteringType ScatteringType_t
int ftgtPDG
PDG of Target Nucleus, nucleon only if free.
Definition: GTruth.h:47
double fgQ2
Definition: GTruth.h:61
void SetHitNucPdg(int pdgc)
Definition: Target.cxx:188
void Sety(double y, bool selected=false)
Definition: Kinematics.cxx:253
MaybeLogger_< ELseverityLevel::ELsev_success, false > LogDebug
double fnecm
Definition: MCFlux.h:71
inverse muon decay
Definition: MCNeutrino.h:141
const XclsTag & ExclTag(void) const
Definition: Interaction.h:71
double HitNucPosition(void) const
Definition: Target.h:90
TLorentzVector * GetTgtP4(RefFrame_t rf=kRfLab) const
virtual GHepParticle * HitNucleon(void) const
Definition: GHepRecord.cxx:350
Target * TgtPtr(void) const
Definition: InitialState.h:68
virtual void SetVertex(double x, double y, double z, double t)
Definition: GHepRecord.cxx:863
double Gvt() const
Definition: MCParticle.h:248
MaybeLogger_< ELseverityLevel::ELsev_warning, false > LogWarning
TParticlePDG * Find(int pdgc)
Definition: PDGLibrary.cxx:61
TLorentzVector fFShadSystP4
generated final state hadronic system (LAB frame)
Definition: GTruth.h:68
int IonPdgCode(int A, int Z)
Definition: PDGUtils.cxx:69
double Pz(const int i=0) const
Definition: MCParticle.h:231
int Rescatter() const
Definition: MCParticle.h:251
TLorentzVector fTgtP4
Definition: GTruth.h:42
double fndydznea
Definition: MCFlux.h:42
void UnsetCharm(void)
Definition: XclsTag.cxx:74
double fypoint
Definition: MCFlux.h:74
double fmuparpy
Definition: MCFlux.h:68
void SetHadSystP4(const TLorentzVector &p4)
Definition: Kinematics.cxx:317
double fppvx
Definition: MCFlux.h:64
virtual double XSec(void) const
Definition: GHepRecord.h:127
const int kPdgPiM
Definition: PDGCodes.h:140
cet::LibraryManager dummy("noplugin")
double fpppz
Definition: MCFlux.h:60
double fppvy
Definition: MCFlux.h:65
string CurrentTune(void) const
virtual void AddParticle(const GHepParticle &p)
Definition: GHepRecord.cxx:535
const InitialState & InitState(void) const
Definition: Interaction.h:68
const ProcessInfo & ProcInfo(void) const
Definition: Interaction.h:69
double fbeampx
Definition: MCFlux.h:94
list x
Definition: train.py:276
double t(bool selected=false) const
Definition: Kinematics.cxx:180
double fppvz
Definition: MCFlux.h:66
Double_t dist
distance from hadron decay
double fgT
Definition: GTruth.h:64
const int kPdgProton
Definition: PDGCodes.h:65
double ftpy
Definition: MCFlux.h:80
void FillGTruth(const genie::EventRecord *grec, simb::GTruth &gtruth)
Definition: GENIE2ART.cxx:351
double Vy(void) const
Get production y.
Definition: GHepParticle.h:96
double Q2(bool selected=false) const
Definition: Kinematics.cxx:135
const Target & Tgt(void) const
Definition: InitialState.h:67
const genie::flux::GSimpleNtpNuMI * GetCurrentNuMI(void)
GSimpleNtpNuMI.
double fndxdz
Definition: MCFlux.h:37
Event generator information.
Definition: MCTruth.h:32
double fvz
Definition: MCFlux.h:54
void SetHitSeaQrk(bool tf)
Definition: Target.cxx:212
bool IsGlashowResonance(void) const
Event generator information.
Definition: MCNeutrino.h:18
bool fIsSeaQuark
Definition: GTruth.h:50
const int kPdgNeutron
Definition: PDGCodes.h:67
TLorentzVector fVertex
Definition: GTruth.h:26
enum genie::EInteractionType InteractionType_t
STDHEP-like event record entry that can fit a particle or a nucleus.
Definition: GHepParticle.h:40
double fgY
Definition: GTruth.h:66
double fDiffXsec
differential cross section of interaction
Definition: GTruth.h:31
static QCString * s
Definition: config.cpp:1042
void SetProcInfo(const ProcessInfo &proc)
double fmuparpx
Definition: MCFlux.h:67
virtual int TargetNucleusPosition(void) const
Definition: GHepRecord.cxx:406
A simplified flux ntuple for quick running.
Definition: MCFlux.h:22
void SetTuneName(string tuneName="Default")
Definition: RunOpt.cxx:89
cet::coded_exception< error, detail::translate > exception
Definition: exception.h:33
QTextStream & endl(QTextStream &s)
TLorentzVector * GetProbeP4(RefFrame_t rf=kRfHitNucRest) const
std::vector< std::string > auxdblname
tagname of aux doubles associated w/ entry
virtual void SetDiffXSec(double xsec, KinePhaseSpace_t ps)
Definition: GHepRecord.h:134
double Vx(void) const
Get production x.
Definition: GHepParticle.h:95
Beam neutrinos.
Definition: MCTruth.h:23
double fnenergyn
Definition: MCFlux.h:43
static constexpr double kUndefinedValue
Definition: GTruth.h:87
Initial State information.
Definition: InitialState.h:49
GENIE Interface for user-defined flux classes.
Definition: GFluxI.h:37
double ftvz
Definition: MCFlux.h:78
double fnimpwt
Definition: MCFlux.h:72
double Py(void) const
Get Py.
Definition: GHepParticle.h:90
int fStrangeHadronPdg
Definition: GTruth.h:74
Int_t ptype
parent type (PDG)
vertex reconstruction