Main Page
Related Pages
Modules
Namespaces
Classes
Files
Examples
File List
File Members
Generator
src
Physics
Strange
EventGen
SKPrimaryLeptonGenerator.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
Chris Marshall <marshall \at pas.rochester.edu>
7
University of Rochester
8
9
Martti Nirkko
10
University of Berne
11
*/
12
//____________________________________________________________________________
13
14
#include "
Framework/GHEP/GHepParticle.h
"
15
#include "
Framework/GHEP/GHepRecord.h
"
16
#include "
Framework/GHEP/GHepFlags.h
"
17
#include "
Framework/Messenger/Messenger.h
"
18
#include "
Framework/EventGen/EVGThreadException.h
"
19
#include "
Physics/Strange/EventGen/SKPrimaryLeptonGenerator.h
"
20
21
using namespace
genie
;
22
23
//___________________________________________________________________________
24
SKPrimaryLeptonGenerator::SKPrimaryLeptonGenerator
() :
25
PrimaryLeptonGenerator
(
"genie::SKPrimaryLeptonGenerator"
)
26
{
27
28
}
29
//___________________________________________________________________________
30
SKPrimaryLeptonGenerator::SKPrimaryLeptonGenerator
(
string
config
) :
31
PrimaryLeptonGenerator
(
"genie::SKPrimaryLeptonGenerator"
, config)
32
{
33
34
}
35
//___________________________________________________________________________
36
SKPrimaryLeptonGenerator::~SKPrimaryLeptonGenerator
()
37
{
38
39
}
40
//___________________________________________________________________________
41
void
SKPrimaryLeptonGenerator::ProcessEventRecord
(
GHepRecord
* evrec)
const
42
{
43
44
// no modification is required to the std implementation
45
PrimaryLeptonGenerator::ProcessEventRecord
(evrec);
46
47
if
(evrec->
FinalStatePrimaryLepton
()->
IsOffMassShell
()) {
48
LOG
(
"LeptonicVertex"
,
pERROR
)
49
<<
"*** Selected kinematics lead to off mass shell lepton!"
;
50
evrec->
EventFlags
()->SetBitNumber(
kLeptoGenErr
,
true
);
51
genie::exceptions::EVGThreadException
exception
;
52
exception.
SetReason
(
"E<m for final state lepton"
);
53
exception.
SwitchOnFastForward
();
54
throw
exception
;
55
}
56
//CalculatePrimaryLepton(evrec);
57
}
58
/*
59
//___________________________________________________________________________
60
void SKPrimaryLeptonGenerator::CalculatePrimaryLepton(GHepRecord * evrec) const
61
{
62
// This method generates the final state primary lepton in single-K events
63
64
Interaction * interaction = evrec->Summary();
65
const InitialState & init_state = interaction->InitState();
66
67
// Look-up selected kinematics
68
double lep_t = interaction->Kine().GetKV(kKVSelTl);
69
double lep_costheta = interaction->Kine().GetKV(kKVSelctl);
70
71
// Auxiliary params
72
double ml = interaction->FSPrimLepton()->Mass();
73
double ml2 = TMath::Power(ml,2);
74
double El = lep_t + ml;
75
double plep = TMath::Sqrt( El*El - ml2 );
76
77
// Randomize transverse components
78
RandomGen * rnd = RandomGen::Instance();
79
double phi = 2*kPi * rnd->RndLep().Rndm();
80
81
LOG( "SKLepton", pDEBUG )
82
<< "lepton T = " << lep_t << " cos theta = " << lep_costheta << " random phi = " << phi;
83
84
// Lepton 3vector w.r.t. neutrino direction
85
TVector3 p3l(0,0,0);
86
p3l.SetMagThetaPhi(plep, TMath::ACos(lep_costheta), phi);
87
88
// Take a unit vector along the neutrino direction
89
TVector3 unit_nudir = evrec->Probe()->P4()->Vect().Unit();
90
91
// Rotate lepton momentum vector from the reference frame (x'y'z') where
92
// {z':(neutrino direction), z'x':(theta plane)} to the LAB
93
p3l.RotateUz(unit_nudir);
94
95
LOG( "SKLepton", pDEBUG )
96
<< "lab frame lepton px = " << p3l.x() << " py = " << p3l.y() << " pz = " << p3l.z();
97
98
// Lepton 4-momentum in LAB
99
TLorentzVector p4l(p3l,El);
100
101
// Figure out the Final State Lepton PDG Code
102
int pdgc = interaction->FSPrimLepton()->PdgCode();
103
104
// Create a GHepParticle and add it to the event record
105
this->AddToEventRecord(evrec, pdgc, p4l);
106
107
// Set final state lepton polarization
108
this->SetPolarization(evrec);
109
}
110
*/
EVGThreadException.h
genie::SKPrimaryLeptonGenerator::SKPrimaryLeptonGenerator
SKPrimaryLeptonGenerator()
Definition:
SKPrimaryLeptonGenerator.cxx:24
genie
THE MAIN GENIE PROJECT NAMESPACE
Definition:
AlgCmp.h:25
pERROR
#define pERROR
Definition:
Messenger.h:59
GHepRecord.h
SKPrimaryLeptonGenerator.h
genie::exceptions::EVGThreadException
An exception thrown by EventRecordVisitorI when the normal processing sequence has to be disrupted (f...
Definition:
EVGThreadException.h:35
LOG
#define LOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a string (using the FILE...
Definition:
Messenger.h:96
genie::PrimaryLeptonGenerator::ProcessEventRecord
virtual void ProcessEventRecord(GHepRecord *evrec) const
Definition:
PrimaryLeptonGenerator.cxx:57
config
static Config * config
Definition:
config.cpp:1054
genie::SKPrimaryLeptonGenerator::ProcessEventRecord
void ProcessEventRecord(GHepRecord *event_rec) const
Definition:
SKPrimaryLeptonGenerator.cxx:41
GHepParticle.h
genie::GHepRecord::FinalStatePrimaryLepton
virtual GHepParticle * FinalStatePrimaryLepton(void) const
Definition:
GHepRecord.cxx:326
GHepFlags.h
genie::PrimaryLeptonGenerator
Abstract class. Is used to pass common implementation to concrete implementations of the EventRecordV...
Definition:
PrimaryLeptonGenerator.h:30
genie::kLeptoGenErr
Definition:
GHepFlags.h:33
Messenger.h
genie::GHepParticle::IsOffMassShell
bool IsOffMassShell(void) const
Definition:
GHepParticle.cxx:303
genie::SKPrimaryLeptonGenerator::~SKPrimaryLeptonGenerator
~SKPrimaryLeptonGenerator()
Definition:
SKPrimaryLeptonGenerator.cxx:36
genie::exceptions::EVGThreadException::SwitchOnFastForward
void SwitchOnFastForward(void)
Definition:
EVGThreadException.h:44
genie::exceptions::EVGThreadException::SetReason
void SetReason(string reason)
Definition:
EVGThreadException.h:43
genie::GHepRecord::EventFlags
virtual TBits * EventFlags(void) const
Definition:
GHepRecord.h:117
genie::GHepRecord
GENIE's GHEP MC event record.
Definition:
GHepRecord.h:45
fhicl::exception
cet::coded_exception< error, detail::translate > exception
Definition:
exception.h:33
Generated by
1.8.11