NuETargetRemnantGenerator.cxx
Go to the documentation of this file.
1 //____________________________________________________________________________
2 /*
3  Copyright (c) 2003-2020, The GENIE Collaboration
4  For the full text of the license visit http://copyright.genie-mc.org
5 
6  Costas Andreopoulos <constantinos.andreopoulos \at cern.ch>
7  University of Liverpool & STFC Rutherford Appleton Laboratory
8 */
9 //____________________________________________________________________________
10 
19 
20 using namespace genie;
21 
22 //___________________________________________________________________________
24 EventRecordVisitorI("genie::NuETargetRemnantGenerator")
25 {
26 
27 }
28 //___________________________________________________________________________
30 EventRecordVisitorI("genie::NuETargetRemnantGenerator", config)
31 {
32 
33 }
34 //___________________________________________________________________________
36 {
37 
38 }
39 //___________________________________________________________________________
41 {
42  this -> AddElectronNeutrino (evrec);
43  this -> AddTargetNucleusRemnant (evrec);
44 }
45 //___________________________________________________________________________
47 {
48  //-- Get all initial & final state particles 4-momenta (in the LAB frame)
49 
50  //incoming v:
51  GHepParticle * nu = evrec->Probe();
52 
53  //struck particle
54  GHepParticle * el = evrec->HitElectron();
55 
56  //final state primary lepton:
58 
59  assert(nu);
60  assert(el);
61  assert(l);
62 
63  //-- Force energy conservation
64  // Pv(Ev,pxv,pyv,pzv) + Pe(En,pxn,pyn,pzn) = Pfsl(El,pxl,pyl,pzl) + Px
65 
66  const TLorentzVector & p4v = *(nu->P4());
67  const TLorentzVector & p4e = *(el->P4());
68  const TLorentzVector & p4l = *(l->P4());
69  const TLorentzVector & p4 = p4v + p4e - p4l;
70 
71  //-- Vtx position
72  const TLorentzVector & vtx = *(nu->X4());
73 
74  LOG("NuETargetRemnant", pINFO) << "Adding final state lepton from e- vtx";
75 
76  const ProcessInfo & proc_info = evrec->Summary()->ProcInfo();
77  int mom = evrec->HitElectronPosition();
78  int pdgc = 0;
79  if (proc_info.IsNuElectronElastic()) pdgc = evrec->Summary()->InitState().ProbePdg();
80  else if (proc_info.IsInverseMuDecay()) pdgc = kPdgNuE;
81  else if (proc_info.IsIMDAnnihilation()) pdgc = kPdgAntiNuMu;
82  assert(pdgc!=0);
83  evrec->AddParticle(
84  pdgc,kIStStableFinalState, mom,-1,-1,-1, p4, vtx);
85 }
86 //___________________________________________________________________________
88  GHepRecord * evrec) const
89 {
90 // add the remnant nuclear target at the GHEP record
91 
92  LOG("NuETargetRemnant", pDEBUG) << "Adding final state nucleus";
93 
94  //-- get A,Z for initial state nucleus
95  Interaction * interaction = evrec->Summary();
96  const InitialState & init_state = interaction->InitState();
97 
98  bool is_nucleus = init_state.Tgt().IsNucleus();
99  if (!is_nucleus) {
100  LOG("NuETargetRemnant", pDEBUG)
101  << "Initial state not a nucleus - no remnant nucleus to add";
102  return;
103  }
104  int A = init_state.Tgt().A();
105  int Z = init_state.Tgt().Z();
106 
107  int ipdgc = pdg::IonPdgCode(A, Z);
108  double mass = PDGLibrary::Instance()->Find(ipdgc)->Mass();
109 
110  //-- Add the nucleus to the event record
111  LOG("NuETargetRemnant", pINFO)
112  << "Adding nucleus [A = " << A << ", Z = " << Z
113  << ", pdgc = " << ipdgc << "]";
114 
115  int mom = evrec->TargetNucleusPosition();
116  evrec->AddParticle(
117  ipdgc,kIStStableFinalState, mom,-1,-1,-1, 0,0,0,mass, 0,0,0,0);
118 }
119 //___________________________________________________________________________
const int kPdgNuE
Definition: PDGCodes.h:28
THE MAIN GENIE PROJECT NAMESPACE
Definition: AlgCmp.h:25
virtual GHepParticle * HitElectron(void) const
Definition: GHepRecord.cxx:316
virtual Interaction * Summary(void) const
Definition: GHepRecord.cxx:91
const TLorentzVector * P4(void) const
Definition: GHepParticle.h:78
Defines the EventRecordVisitorI interface. Concrete implementations of this interface use the &#39;Visito...
int A(void) const
Definition: Target.h:70
bool IsInverseMuDecay(void) const
bool IsNucleus(void) const
Definition: Target.cxx:272
bool IsIMDAnnihilation(void) const
static QStrList * l
Definition: config.cpp:1044
virtual GHepParticle * Probe(void) const
Definition: GHepRecord.cxx:277
Summary information for an interaction.
Definition: Interaction.h:56
#define LOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a string (using the FILE...
Definition: Messenger.h:96
bool IsNuElectronElastic(void) const
static Config * config
Definition: config.cpp:1054
A class encapsulating an enumeration of interaction types (EM, Weak-CC, Weak-NC) and scattering types...
Definition: ProcessInfo.h:46
void AddTargetNucleusRemnant(GHepRecord *evrec) const
virtual GHepParticle * FinalStatePrimaryLepton(void) const
Definition: GHepRecord.cxx:326
int ProbePdg(void) const
Definition: InitialState.h:64
int Z(void) const
Definition: Target.h:68
#define pINFO
Definition: Messenger.h:62
virtual int HitElectronPosition(void) const
Definition: GHepRecord.cxx:433
const int kPdgAntiNuMu
Definition: PDGCodes.h:31
static PDGLibrary * Instance(void)
Definition: PDGLibrary.cxx:57
const TLorentzVector * X4(void) const
Definition: GHepParticle.h:79
int IonPdgCode(int A, int Z)
Definition: PDGUtils.cxx:68
void ProcessEventRecord(GHepRecord *evrec) const
#define A
Definition: memgrp.cpp:38
void AddElectronNeutrino(GHepRecord *evrec) const
virtual void AddParticle(const GHepParticle &p)
Definition: GHepRecord.cxx:491
const InitialState & InitState(void) const
Definition: Interaction.h:69
const ProcessInfo & ProcInfo(void) const
Definition: Interaction.h:70
TParticlePDG * Find(int pdgc, bool must_exist=true)
Definition: PDGLibrary.cxx:75
const Target & Tgt(void) const
Definition: InitialState.h:66
GENIE&#39;s GHEP MC event record.
Definition: GHepRecord.h:45
Most commonly used PDG codes. A set of utility functions to handle PDG codes is provided in PDGUtils...
STDHEP-like event record entry that can fit a particle or a nucleus.
Definition: GHepParticle.h:39
virtual int TargetNucleusPosition(void) const
Definition: GHepRecord.cxx:362
Initial State information.
Definition: InitialState.h:48
#define pDEBUG
Definition: Messenger.h:63