GENIEGenerator
Loading...
Searching...
No Matches
AGKY2019.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 <cstdlib>
12
13#include <TLorentzVector.h>
14#include <TClonesArray.h>
15#include <TH1D.h>
16
25
26using namespace genie;
27using namespace genie::constants;
28
29//____________________________________________________________________________
31EventRecordVisitorI("genie::AGKY2019")
32{
33
34}
35//____________________________________________________________________________
36AGKY2019::AGKY2019(string config) :
37EventRecordVisitorI("genie::AGKY2019", config)
38{
39
40}
41//____________________________________________________________________________
46//____________________________________________________________________________
47// void AGKY2019::Initialize(void) const
48// {
49//
50// }
51//____________________________________________________________________________
53{
54// Generate the hadronic system using either the KNO-based or PYTHIA/JETSET
55// hadronization models according to the specified transition scheme
56 Interaction * interaction = event->Summary();
57
58
59 //-- Select hadronizer
60 const EventRecordVisitorI * hadronizer =
61 this->SelectHadronizer(interaction);
62
63 //-- Run the selected hadronizer
64 hadronizer->ProcessEventRecord(event);
65
66 // //-- Update the weight
67 // fWeight = hadronizer->Weight();
68}
69//____________________________________________________________________________
70/*
71PDGCodeList * AGKY2019::SelectParticles(
72 const Interaction * interaction) const
73{
74 //-- Select hadronizer
75 const EventRecordVisitorI * hadronizer = this->SelectHadronizer(interaction);
76
77 //-- Run the selected hadronizer
78 PDGCodeList * pdgv = hadronizer->SelectParticles(interaction);
79
80 return pdgv;
81}
82//____________________________________________________________________________
83TH1D * AGKY2019::MultiplicityProb(
84 const Interaction * interaction, Option_t * opt) const
85{
86 //-- Select hadronizer
87 const EventRecordVisitorI * hadronizer = this->SelectHadronizer(interaction);
88
89 //-- Run the selected hadronizer
90 TH1D * mprob = hadronizer->MultiplicityProb(interaction,opt);
91
92 return mprob;
93}
94//____________________________________________________________________________
95double AGKY2019::Weight(void) const
96{
97 return fWeight;
98}
99*/
100//____________________________________________________________________________
102 const Interaction * interaction) const
103{
104 const EventRecordVisitorI * hadronizer = 0;
106 double W = 0;
107
108 switch(fMethod) {
109
110 // ** KNO-only
111 case(0) :
112 hadronizer = fKNOHadronizer;
113 break;
114
115 // ** PYTHIA/JETSET-only
116 case(1) :
117 hadronizer = fPythiaHadronizer;
118 break;
119
120 // ** KNO-only @ W < Wmin
121 // ** PYTHIA/JETSET-only @ W > Wmax
122 // ** Smooth linear transition in [Wmin,Wmax]
123 case(2) :
124 W = interaction->Kine().W();
125 if (W <= fWminTrWindow) hadronizer = fKNOHadronizer;
126 else if (W > fWmaxTrWindow) hadronizer = fPythiaHadronizer;
127 else {
128 // Transition window
129 double R = rnd->RndHadro().Rndm();
131 if(R>f) hadronizer = fKNOHadronizer;
132 else hadronizer = fPythiaHadronizer;
133 }
134 break;
135
136 default :
137 LOG("HybridHad", pFATAL)
138 << "Unspecified transition method: " << fMethod;
139 exit(1);
140 }
141
142 if(!hadronizer) {
143 LOG("HybridHad", pFATAL) << "Null hadronizer!!";
144 exit(1);
145 }
146
147 LOG("HybridHad", pINFO) << "Selected hadronizer: " << hadronizer->Id();
148 return hadronizer;
149}
150//____________________________________________________________________________
151void AGKY2019::Configure(const Registry & config)
152{
153 Algorithm::Configure(config);
154 this->LoadConfig();
155}
156//____________________________________________________________________________
157void AGKY2019::Configure(string config)
158{
159 Algorithm::Configure(config);
160 this->LoadConfig();
161}
162//____________________________________________________________________________
164{
165// Read configuration options or set defaults
166
167 // Load the requested hadronizers
169 dynamic_cast<const EventRecordVisitorI *> (
170 this->SubAlg("KNO-Hadronizer"));
172 dynamic_cast<const EventRecordVisitorI *> (
173 this->SubAlg("PYTHIA-Hadronizer"));
174
176
177 // Get transition method
178 fMethod = 2 ;
179 GetParam( "TransMethod", fMethod, false ) ;
180
181
182 // Get transition scheme specific config
183 if(fMethod==2) {
184
185 GetParam( "KNO2PYTHIA-Wmin", fWminTrWindow ) ;
186
187 GetParam( "KNO2PYTHIA-Wmax", fWmaxTrWindow ) ;
188
189 }
190}
191//____________________________________________________________________________
#define pINFO
Definition Messenger.h:62
#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
const EventRecordVisitorI * fPythiaHadronizer
PYTHIA Hadronizer.
Definition AGKY2019.h:54
double fWminTrWindow
min W in transition region (pure KNO < Wmin)
Definition AGKY2019.h:57
virtual void Configure(const Registry &config)
Definition AGKY2019.cxx:151
int fMethod
KNO -> PYTHIA transition method.
Definition AGKY2019.h:56
void LoadConfig(void)
Definition AGKY2019.cxx:163
void ProcessEventRecord(GHepRecord *event) const
Definition AGKY2019.cxx:52
const EventRecordVisitorI * fKNOHadronizer
KNO Hadronizer.
Definition AGKY2019.h:53
const EventRecordVisitorI * SelectHadronizer(const Interaction *) const
Definition AGKY2019.cxx:101
double fWmaxTrWindow
max W in transition region (pure PYTHIA > Wmax)
Definition AGKY2019.h:58
virtual ~AGKY2019()
Definition AGKY2019.cxx:42
bool GetParam(const RgKey &name, T &p, bool is_top_call=true) const
virtual void Configure(const Registry &config)
Definition Algorithm.cxx:62
const Algorithm * SubAlg(const RgKey &registry_key) const
virtual const AlgId & Id(void) const
Get algorithm ID.
Definition Algorithm.h:98
virtual void ProcessEventRecord(GHepRecord *event_rec) const =0
GENIE's GHEP MC event record.
Definition GHepRecord.h:45
Summary information for an interaction.
Definition Interaction.h:56
const Kinematics & Kine(void) const
Definition Interaction.h:71
double W(bool selected=false) const
A singleton holding random number generator classes. All random number generation in GENIE should tak...
Definition RandomGen.h:29
TRandom3 & RndHadro(void) const
rnd number generator used by hadronization models
Definition RandomGen.h:53
static RandomGen * Instance()
Access instance.
Definition RandomGen.cxx:74
A registry. Provides the container for algorithm configuration parameters.
Definition Registry.h:65
Basic constants.
THE MAIN GENIE PROJECT NAMESPACE
Definition AlgCmp.h:25