DMETargetRemnantGenerator.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 
7  Costas Andreopoulos <constantinos.andreopoulos \at cern.ch>
8  University of Liverpool & STFC Rutherford Appleton Laboratory
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 DME 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::DMETargetRemnantGenerator")
35 {
36 
37 }
38 //___________________________________________________________________________
40 EventRecordVisitorI("genie::DMETargetRemnantGenerator", 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("DMETargetRemnant", 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.IsDarkMatterElectronElastic()) pdgc = kPdgElectron;
90  assert(pdgc!=0);
91  evrec->AddParticle(
92  pdgc,kIStStableFinalState, mom,-1,-1,-1, p4, vtx);
93 }
94 //___________________________________________________________________________
96  GHepRecord * evrec) const
97 {
98 // add the remnant nuclear target at the GHEP record
99 
100  LOG("DMETargetRemnant", pDEBUG) << "Adding final state nucleus";
101 
102  //-- get A,Z for initial state nucleus
103  Interaction * interaction = evrec->Summary();
104  const InitialState & init_state = interaction->InitState();
105 
106  bool is_nucleus = init_state.Tgt().IsNucleus();
107  if (!is_nucleus) {
108  LOG("DMETargetRemnant", pDEBUG)
109  << "Initial state not a nucleus - no remnant nucleus to add";
110  return;
111  }
112  int A = init_state.Tgt().A();
113  int Z = init_state.Tgt().Z();
114 
115  int ipdgc = pdg::IonPdgCode(A, Z);
116  double mass = PDGLibrary::Instance()->Find(ipdgc)->Mass();
117 
118  //-- Add the nucleus to the event record
119  LOG("DMETargetRemnant", pINFO)
120  << "Adding nucleus [A = " << A << ", Z = " << Z
121  << ", pdgc = " << ipdgc << "]";
122 
123  int mom = evrec->TargetNucleusPosition();
124  evrec->AddParticle(
125  ipdgc,kIStStableFinalState, mom,-1,-1,-1, 0,0,0,mass, 0,0,0,0);
126 }
127 //___________________________________________________________________________
THE MAIN GENIE PROJECT NAMESPACE
Definition: AlgCmp.h:25
bool IsDarkMatterElectronElastic(void) const
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 IsNucleus(void) const
Definition: Target.cxx:272
const int kPdgElectron
Definition: PDGCodes.h:35
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
void AddTargetNucleusRemnant(GHepRecord *evrec) 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
virtual GHepParticle * FinalStatePrimaryLepton(void) const
Definition: GHepRecord.cxx:326
int Z(void) const
Definition: Target.h:68
#define pINFO
Definition: Messenger.h:62
void AddElectronNeutrino(GHepRecord *evrec) const
virtual int HitElectronPosition(void) const
Definition: GHepRecord.cxx:433
void ProcessEventRecord(GHepRecord *evrec) const
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
#define A
Definition: memgrp.cpp:38
const InitialState & InitState(void) const
Definition: Interaction.h:69
virtual void AddParticle(const GHepParticle &p)
Definition: GHepRecord.cxx:491
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