GENIEGenerator
Loading...
Searching...
No Matches
COHPrimaryLeptonGenerator.cxx
Go to the documentation of this file.
1//____________________________________________________________________________
2/*
3 Copyright (c) 2003-2025, The GENIE Collaboration
4 For the full text of the license visit http://copyright.genie-mc.org
5
6 Costas Andreopoulos <c.andreopoulos \at cern.ch>
7 University of Liverpool
8*/
9//____________________________________________________________________________
10
11#include <TMath.h>
12#include <TVector3.h>
13
25
26using namespace genie;
27using namespace genie::constants;
28
29//___________________________________________________________________________
31 PrimaryLeptonGenerator("genie::COHPrimaryLeptonGenerator")
32{
33
34}
35//___________________________________________________________________________
37 PrimaryLeptonGenerator("genie::COHPrimaryLeptonGenerator", config)
38{
39
40}
41//___________________________________________________________________________
46//___________________________________________________________________________
48{
49 //-- Access cross section algorithm for running thread
51 const EventGeneratorI * evg = rtinfo->RunningThread();
52 const XSecAlgorithmI *fXSecModel = evg->CrossSectionAlg();
53
54 // In Rein and Berger-Sehgal, no modification is required to the standard impl.
55 if (fXSecModel->Id().Name() == "genie::ReinSehgalCOHPiPXSec") {
57 }
58 else if ((fXSecModel->Id().Name() == "genie::BergerSehgalCOHPiPXSec2015")) {
60 }
61 else if ((fXSecModel->Id().Name() == "genie::BergerSehgalFMCOHPiPXSec2015")) {
63 }
64 else if ((fXSecModel->Id().Name() == "genie::AlvarezRusoCOHPiPXSec")) {
66 }
67 else {
68 LOG("COHPrimaryLeptonGenerator",pFATAL) <<
69 "ProcessEventRecord >> Cannot calculate primary lepton for " <<
70 fXSecModel->Id().Name();
71 }
72}
73//___________________________________________________________________________
75{
76 Interaction * interaction = evrec->Summary();
77 const Kinematics & kinematics = interaction->Kine();
78 TLorentzVector p4l = kinematics.FSLeptonP4();
79 int pdgc = interaction->FSPrimLepton()->PdgCode();
80 this->AddToEventRecord(evrec, pdgc, p4l);
81 this->SetPolarization( evrec );
82}
83//___________________________________________________________________________
#define pFATAL
Definition Messenger.h:56
#define LOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a string (using the FILE,...
Definition Messenger.h:96
string Name(void) const
Definition AlgId.h:44
virtual const AlgId & Id(void) const
Get algorithm ID.
Definition Algorithm.h:98
void ProcessEventRecord(GHepRecord *event_rec) const
void CalculatePrimaryLepton_AlvarezRuso(GHepRecord *event_rec) const
Defines the EventGeneratorI interface.
virtual const XSecAlgorithmI * CrossSectionAlg(void) const =0
GENIE's GHEP MC event record.
Definition GHepRecord.h:45
virtual Interaction * Summary(void) const
Summary information for an interaction.
Definition Interaction.h:56
const Kinematics & Kine(void) const
Definition Interaction.h:71
TParticlePDG * FSPrimLepton(void) const
final state primary lepton
Generated/set kinematical variables for an event.
Definition Kinematics.h:39
const TLorentzVector & FSLeptonP4(void) const
Definition Kinematics.h:65
virtual void ProcessEventRecord(GHepRecord *evrec) const
virtual void SetPolarization(GHepRecord *ev) const
virtual void AddToEventRecord(GHepRecord *ev, int pdgc, const TLorentzVector &p4) const
Keep info on the event generation thread currently on charge. This is used so that event generation m...
static RunningThreadInfo * Instance(void)
const EventGeneratorI * RunningThread(void)
Cross Section Calculation Interface.
Basic constants.
THE MAIN GENIE PROJECT NAMESPACE
Definition AlgCmp.h:25