GENIEGenerator
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
NormGenerator.cxx
Go to the documentation of this file.
1 //____________________________________________________________________________
2 /*
3  Copyright (c) 2003-2024, The GENIE Collaboration
4  For the full text of the license visit http://copyright.genie-mc.org
5 
6  Igor Kakorin <kakorin@jinr.ru>
7  Joint Institute for Nuclear Research
8 */
9 //____________________________________________________________________________
10 
11 #include <cstdlib>
12 
13 #include <TLorentzVector.h>
14 
15 
17 #include "Framework/Conventions/GBuild.h"
23 
24 using namespace genie;
25 
26 //___________________________________________________________________________
28 EventRecordVisitorI("genie::NormGenerator")
29 {
30 
31 }
32 //___________________________________________________________________________
34 EventRecordVisitorI("genie::NormGenerator")
35 {
36 
37 }
38 //___________________________________________________________________________
40 {
41 
42 }
43 //___________________________________________________________________________
45 {
46  Interaction * interaction = evrec->Summary();
47  const InitialState & init_state = interaction -> InitState();
48 
49  // Access cross section algorithm for running thread
51  const EventGeneratorI * evg = rtinfo->RunningThread();
52  fXSecModel = evg->CrossSectionAlg();
53 
54  //bool isHeavyNucleus = tgt->A()>=3;
55  GHepParticle * probe = evrec->Probe();
56  int pdg_probe = probe->Pdg();
57  int iprobe = evrec->ProbePosition();
58  TLorentzVector * p4v = probe->GetP4();
59  TLorentzVector * vtx = probe->X4();
60 
61  GHepParticle * nucltgt = evrec->TargetNucleus();
62  int pdg_tgt = nucltgt->Pdg();
63  int inucltgt = evrec->TargetNucleusPosition();
64  TLorentzVector * p4_tgt = nucltgt->GetP4();
65  TLorentzVector * vtx_tgt = nucltgt->X4();
66 
67 
68  evrec->AddParticle(pdg_probe, kIStStableFinalState, iprobe,-1,-1,-1, *p4v, *vtx);
69  evrec->AddParticle(pdg_tgt, kIStStableFinalState, inucltgt,-1,-1,-1, *p4_tgt, *vtx_tgt);
70 
71  //-- Determine the status code
72  //const Target & tgt = interaction->InitState().Tgt();
73 
74 
75  // update the interaction summary
76  evrec->Summary()->KinePtr()->SetFSLeptonP4(*p4v);
77 
78  double xsec = fXSecModel->XSec(interaction, kPSfE);
79 
80  evrec->SetDiffXSec(xsec, kPSfE);
81 
82  return;
83 }
84 //___________________________________________________________________________
85 void NormGenerator::Configure(const Registry & config)
86 {
87  Algorithm::Configure(config);
88  this->LoadConfig();
89 }
90 //____________________________________________________________________________
91 void NormGenerator::Configure(string config)
92 {
93  Algorithm::Configure(config);
94  this->LoadConfig();
95 }
96 //____________________________________________________________________________
98 {
99 }
100 //____________________________________________________________________________
virtual Interaction * Summary(void) const
Definition: GHepRecord.cxx:91
Kinematics * KinePtr(void) const
Definition: Interaction.h:76
Defines the EventRecordVisitorI interface. Concrete implementations of this interface use the &#39;Visito...
Defines the EventGeneratorI interface.
void ProcessEventRecord(GHepRecord *event_rec) const
virtual GHepParticle * Probe(void) const
Definition: GHepRecord.cxx:284
int Pdg(void) const
Definition: GHepParticle.h:63
Summary information for an interaction.
Definition: Interaction.h:56
void SetFSLeptonP4(const TLorentzVector &p4)
Definition: Kinematics.cxx:297
TLorentzVector * GetP4(void) const
virtual void Configure(const Registry &config)
Definition: Algorithm.cxx:62
virtual GHepParticle * TargetNucleus(void) const
Definition: GHepRecord.cxx:293
virtual double XSec(const Interaction *i, KinePhaseSpace_t k=kPSfE) const =0
Compute the cross section for the input interaction.
static RunningThreadInfo * Instance(void)
const TLorentzVector * X4(void) const
Definition: GHepParticle.h:79
A registry. Provides the container for algorithm configuration parameters.
Definition: Registry.h:65
virtual const XSecAlgorithmI * CrossSectionAlg(void) const =0
const XSecAlgorithmI * fXSecModel
Definition: NormGenerator.h:54
virtual void AddParticle(const GHepParticle &p)
Definition: GHepRecord.cxx:499
virtual int ProbePosition(void) const
Definition: GHepRecord.cxx:352
void Configure(const Registry &config)
const EventGeneratorI * RunningThread(void)
GENIE&#39;s GHEP MC event record.
Definition: GHepRecord.h:45
STDHEP-like event record entry that can fit a particle or a nucleus.
Definition: GHepParticle.h:39
Keep info on the event generation thread currently on charge. This is used so that event generation m...
virtual int TargetNucleusPosition(void) const
Definition: GHepRecord.cxx:370
virtual void SetDiffXSec(double xsec, KinePhaseSpace_t ps)
Definition: GHepRecord.h:133
Initial State information.
Definition: InitialState.h:48