NuETargetRemnantGenerator.cxx
Go to the documentation of this file.
1 //____________________________________________________________________________
2 /*
3  Copyright (c) 2003-2019, The GENIE Collaboration
4  For the full text of the license visit http://copyright.genie-mc.org
5  or see $GENIE/LICENSE
6 
7  Author: Costas Andreopoulos <costas.andreopoulos \at stfc.ac.uk>
8  University of Liverpool & STFC Rutherford Appleton Lab
9 
10  For the class documentation see the corresponding header file.
11 
12  Important revisions after version 2.0.0 :
13  @ Feb 09, 2009 - CA
14  Moved into the NuE package from its previous location (EVGModules package)
15  @ Feb 12, 2013 - CA (code from Rosen Matev)
16  Handle the IMD annihilation channel.
17 
18 */
19 //____________________________________________________________________________
20 
29 
30 using namespace genie;
31 
32 //___________________________________________________________________________
34 EventRecordVisitorI("genie::NuETargetRemnantGenerator")
35 {
36 
37 }
38 //___________________________________________________________________________
40 EventRecordVisitorI("genie::NuETargetRemnantGenerator", config)
41 {
42 
43 }
44 //___________________________________________________________________________
46 {
47 
48 }
49 //___________________________________________________________________________
51 {
52  this -> AddElectronNeutrino (evrec);
53  this -> AddTargetNucleusRemnant (evrec);
54 }
55 //___________________________________________________________________________
57 {
58  //-- Get all initial & final state particles 4-momenta (in the LAB frame)
59 
60  //incoming v:
61  GHepParticle * nu = evrec->Probe();
62 
63  //struck particle
64  GHepParticle * el = evrec->HitElectron();
65 
66  //final state primary lepton:
68 
69  assert(nu);
70  assert(el);
71  assert(l);
72 
73  //-- Force energy conservation
74  // Pv(Ev,pxv,pyv,pzv) + Pe(En,pxn,pyn,pzn) = Pfsl(El,pxl,pyl,pzl) + Px
75 
76  const TLorentzVector & p4v = *(nu->P4());
77  const TLorentzVector & p4e = *(el->P4());
78  const TLorentzVector & p4l = *(l->P4());
79  const TLorentzVector & p4 = p4v + p4e - p4l;
80 
81  //-- Vtx position
82  const TLorentzVector & vtx = *(nu->X4());
83 
84  LOG("NuETargetRemnant", pINFO) << "Adding final state lepton from e- vtx";
85 
86  const ProcessInfo & proc_info = evrec->Summary()->ProcInfo();
87  int mom = evrec->HitElectronPosition();
88  int pdgc = 0;
89  if (proc_info.IsNuElectronElastic()) pdgc = evrec->Summary()->InitState().ProbePdg();
90  else if (proc_info.IsInverseMuDecay()) pdgc = kPdgNuE;
91  else if (proc_info.IsIMDAnnihilation()) pdgc = kPdgAntiNuMu;
92  assert(pdgc!=0);
93  evrec->AddParticle(
94  pdgc,kIStStableFinalState, mom,-1,-1,-1, p4, vtx);
95 }
96 //___________________________________________________________________________
98  GHepRecord * evrec) const
99 {
100 // add the remnant nuclear target at the GHEP record
101 
102  LOG("NuETargetRemnant", pDEBUG) << "Adding final state nucleus";
103 
104  //-- get A,Z for initial state nucleus
105  Interaction * interaction = evrec->Summary();
106  const InitialState & init_state = interaction->InitState();
107 
108  bool is_nucleus = init_state.Tgt().IsNucleus();
109  if (!is_nucleus) {
110  LOG("NuETargetRemnant", pDEBUG)
111  << "Initial state not a nucleus - no remnant nucleus to add";
112  return;
113  }
114  int A = init_state.Tgt().A();
115  int Z = init_state.Tgt().Z();
116 
117  int ipdgc = pdg::IonPdgCode(A, Z);
118  double mass = PDGLibrary::Instance()->Find(ipdgc)->Mass();
119 
120  //-- Add the nucleus to the event record
121  LOG("NuETargetRemnant", pINFO)
122  << "Adding nucleus [A = " << A << ", Z = " << Z
123  << ", pdgc = " << ipdgc << "]";
124 
125  int mom = evrec->TargetNucleusPosition();
126  evrec->AddParticle(
127  ipdgc,kIStStableFinalState, mom,-1,-1,-1, 0,0,0,mass, 0,0,0,0);
128 }
129 //___________________________________________________________________________
const int kPdgNuE
Definition: PDGCodes.h:28
THE MAIN GENIE PROJECT NAMESPACE
Definition: GeneratorBase.h:8
virtual GHepParticle * HitElectron(void) const
Definition: GHepRecord.cxx:360
virtual Interaction * Summary(void) const
Definition: GHepRecord.cxx:135
const TLorentzVector * P4(void) const
Definition: GHepParticle.h:79
Defines the EventRecordVisitorI interface. Concrete implementations of this interface use the &#39;Visito...
int A(void) const
Definition: Target.h:71
bool IsInverseMuDecay(void) const
bool IsNucleus(void) const
Definition: Target.cxx:289
Definition: config.py:1
bool IsIMDAnnihilation(void) const
virtual GHepParticle * Probe(void) const
Definition: GHepRecord.cxx:321
Float_t Z
Definition: plot.C:38
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:97
bool IsNuElectronElastic(void) const
A class encapsulating an enumeration of interaction types (EM, Weak-CC, Weak-NC) and scattering types...
Definition: ProcessInfo.h:44
void AddTargetNucleusRemnant(GHepRecord *evrec) const
virtual GHepParticle * FinalStatePrimaryLepton(void) const
Definition: GHepRecord.cxx:370
int ProbePdg(void) const
Definition: InitialState.h:65
int Z(void) const
Definition: Target.h:69
#define pINFO
Definition: Messenger.h:63
virtual int HitElectronPosition(void) const
Definition: GHepRecord.cxx:477
const int kPdgAntiNuMu
Definition: PDGCodes.h:31
static const double A
Definition: Units.h:82
static PDGLibrary * Instance(void)
Definition: PDGLibrary.cxx:43
const TLorentzVector * X4(void) const
Definition: GHepParticle.h:80
TParticlePDG * Find(int pdgc)
Definition: PDGLibrary.cxx:61
int IonPdgCode(int A, int Z)
Definition: PDGUtils.cxx:69
void ProcessEventRecord(GHepRecord *evrec) const
assert(nhit_max >=nhit_nbins)
void AddElectronNeutrino(GHepRecord *evrec) const
virtual void AddParticle(const GHepParticle &p)
Definition: GHepRecord.cxx:535
const InitialState & InitState(void) const
Definition: Interaction.h:69
const ProcessInfo & ProcInfo(void) const
Definition: Interaction.h:70
const Target & Tgt(void) const
Definition: InitialState.h:67
GENIE&#39;s GHEP MC event record.
Definition: GHepRecord.h:46
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:40
virtual int TargetNucleusPosition(void) const
Definition: GHepRecord.cxx:406
Initial State information.
Definition: InitialState.h:49
#define pDEBUG
Definition: Messenger.h:64