GENIEGenerator
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
COHPrimaryLeptonGenerator.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  Costas Andreopoulos <c.andreopoulos \at cern.ch>
7  University of Liverpool
8 */
9 //____________________________________________________________________________
10 
11 #include <TMath.h>
12 #include <TVector3.h>
13 
25 
26 using namespace genie;
27 using namespace genie::constants;
28 
29 //___________________________________________________________________________
31  PrimaryLeptonGenerator("genie::COHPrimaryLeptonGenerator")
32 {
33 
34 }
35 //___________________________________________________________________________
37  PrimaryLeptonGenerator("genie::COHPrimaryLeptonGenerator", config)
38 {
39 
40 }
41 //___________________________________________________________________________
43 {
44 
45 }
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 //___________________________________________________________________________
void CalculatePrimaryLepton_AlvarezRuso(GHepRecord *event_rec) const
Cross Section Calculation Interface.
void ProcessEventRecord(GHepRecord *event_rec) const
virtual Interaction * Summary(void) const
Definition: GHepRecord.cxx:91
#define pFATAL
Definition: Messenger.h:56
Defines the EventGeneratorI interface.
Generated/set kinematical variables for an event.
Definition: Kinematics.h:39
Summary information for an interaction.
Definition: Interaction.h:56
const TLorentzVector & FSLeptonP4(void) const
Definition: Kinematics.h:65
#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 void ProcessEventRecord(GHepRecord *evrec) const
const Kinematics & Kine(void) const
Definition: Interaction.h:71
Abstract class. Is used to pass common implementation to concrete implementations of the EventRecordV...
TParticlePDG * FSPrimLepton(void) const
final state primary lepton
static RunningThreadInfo * Instance(void)
virtual const AlgId & Id(void) const
Get algorithm ID.
Definition: Algorithm.h:98
virtual void SetPolarization(GHepRecord *ev) const
virtual const XSecAlgorithmI * CrossSectionAlg(void) const =0
const EventGeneratorI * RunningThread(void)
virtual void AddToEventRecord(GHepRecord *ev, int pdgc, const TLorentzVector &p4) const
GENIE&#39;s GHEP MC event record.
Definition: GHepRecord.h:45
Keep info on the event generation thread currently on charge. This is used so that event generation m...