COHPrimaryLeptonGenerator.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 new Coherent package from its previous location (EVGModules
15  package)
16 
17 */
18 //____________________________________________________________________________
19 
20 #include <TMath.h>
21 #include <TVector3.h>
22 
34 
35 using namespace genie;
36 using namespace genie::constants;
37 
38 //___________________________________________________________________________
40  PrimaryLeptonGenerator("genie::COHPrimaryLeptonGenerator")
41 {
42 
43 }
44 //___________________________________________________________________________
46  PrimaryLeptonGenerator("genie::COHPrimaryLeptonGenerator", config)
47 {
48 
49 }
50 //___________________________________________________________________________
52 {
53 
54 }
55 //___________________________________________________________________________
57 {
58  //-- Access cross section algorithm for running thread
60  const EventGeneratorI * evg = rtinfo->RunningThread();
61  const XSecAlgorithmI *fXSecModel = evg->CrossSectionAlg();
62 
63  // In Rein and Berger-Sehgal, no modification is required to the standard impl.
64  if (fXSecModel->Id().Name() == "genie::ReinSehgalCOHPiPXSec") {
66  }
67  else if ((fXSecModel->Id().Name() == "genie::BergerSehgalCOHPiPXSec2015")) {
69  }
70  else if ((fXSecModel->Id().Name() == "genie::BergerSehgalFMCOHPiPXSec2015")) {
72  }
73  else if ((fXSecModel->Id().Name() == "genie::AlvarezRusoCOHPiPXSec")) {
75  }
76  else {
77  LOG("COHPrimaryLeptonGenerator",pFATAL) <<
78  "ProcessEventRecord >> Cannot calculate primary lepton for " <<
79  fXSecModel->Id().Name();
80  }
81 }
82 //___________________________________________________________________________
84 {
85  Interaction * interaction = evrec->Summary();
86  const Kinematics & kinematics = interaction->Kine();
87  TLorentzVector p4l = kinematics.FSLeptonP4();
88  int pdgc = interaction->FSPrimLepton()->PdgCode();
89  this->AddToEventRecord(evrec, pdgc, p4l);
90 }
91 //___________________________________________________________________________
void CalculatePrimaryLepton_AlvarezRuso(GHepRecord *event_rec) const
Cross Section Calculation Interface.
Basic constants.
void ProcessEventRecord(GHepRecord *event_rec) const
THE MAIN GENIE PROJECT NAMESPACE
Definition: GeneratorBase.h:8
virtual Interaction * Summary(void) const
Definition: GHepRecord.cxx:135
#define pFATAL
Definition: Messenger.h:57
Defines the EventGeneratorI interface.
Generated/set kinematical variables for an event.
Definition: Kinematics.h:40
Definition: config.py:1
Summary information for an interaction.
Definition: Interaction.h:56
const TLorentzVector & FSLeptonP4(void) const
Definition: Kinematics.h:66
#define LOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a string (using the FILE...
Definition: Messenger.h:97
string Name(void) const
Definition: AlgId.h:45
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...
virtual const XSecAlgorithmI * CrossSectionAlg(void) const =0
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
const EventGeneratorI * RunningThread(void)
void kinematics()
Definition: kinematics.C:10
virtual void AddToEventRecord(GHepRecord *ev, int pdgc, const TLorentzVector &p4) const
GENIE&#39;s GHEP MC event record.
Definition: GHepRecord.h:46
Keep info on the event generation thread currently on charge. This is used so that event generation m...