142 bool tweaked = (PT2tweaked || XFtweaked);
143 if(!tweaked)
return 1.;
151 TIter event_iter(&event);
152 int i=-1, ihadsyst = -1;
153 while ( (p = dynamic_cast<GHepParticle *>(event_iter.Next())) ) {
159 if(ihadsyst<0)
return 1.;
162 <<
"Found HadronicSystem pseudo-particle at position = " << ihadsyst;
164 int fd =
event.Particle(ihadsyst)->FirstDaughter();
165 int ld =
event.Particle(ihadsyst)->LastDaughter();
169 <<
"HadronicSystem pseudo-particle's num. of daughters = " << nd
170 <<
" at positions (" << fd <<
", " << ld <<
")";
175 int fdpdg =
event.Particle(fd)->Pdg();
176 int ldpdg =
event.Particle(ld)->Pdg();
187 if(!is_Npi)
return 1.;
190 <<
"A DIS event with a 'nucleon+pion' primary hadronic state";
194 TLorentzVector p4N(N->
Px(), N->
Py(), N->
Pz(), N->
E());
195 TVector3 p3N = p4N.Vect();
197 <<
"4-p @ LAB: px = " << p4N.Px() <<
", py = " << p4N.Py()
198 <<
", pz = " << p4N.Pz() <<
", E = " << p4N.Energy();
202 TVector3 p3had = p4had.Vect();
206 double pTlabp = p3N.Pt(p3had);
207 double pLlabp = TMath::Sqrt(p3N.Mag2()-pTlabp*pTlabp);
208 double Elabp = p4N.Energy();
209 TLorentzVector p4Nr(0,pTlabp,pLlabp,Elabp);
212 TVector3 bv(0,0,-1.*p4had.P()/p4had.Energy());
218 bool selected =
true;
219 double W =
event.Summary()->Kine().W(selected);
221 double XF = p4Nr.Pz() / PZmax;
222 double PT2 = p4Nr.Perp2();
225 <<
"@ HCM: pT2 = " << PT2 <<
", xF = " << XF;
229 bool inrange = XFinrange && PT2inrange;
230 if(!inrange)
return 1.;
262 TLorentzVector ph(0,0,0,W);
263 TGenPhaseSpace phspgen;
264 phspgen.SetDecay(ph, 2, masses);
267 for (Int_t
n=0;
n<ndec;
n++) {
268 double dec_weight = phspgen.Generate();
269 TLorentzVector * nucp4 = phspgen.GetDecay(0);
270 double dec_px=nucp4->Px();
271 double dec_py=nucp4->Py();
272 double dec_pz=nucp4->Pz();
273 double dec_pT2 = dec_px*dec_px+dec_py*dec_py;
274 double dec_xF = dec_pz/(W/2.);
278 double fpT2rnd = fpT2max * rnd->
RndHadro().Rndm();
279 double fxFrnd = fxFmax * rnd->
RndHadro().Rndm();
282 if(fxFrnd < fxFpdf && fpT2rnd < fpT2pdf) {
283 hdef.Fill(dec_xF, dec_pT2, dec_weight);
288 fpT2rnd = fpT2max * rnd->
RndHadro().Rndm();
289 fxFrnd = fxFmax * rnd->
RndHadro().Rndm();
292 if(fxFrnd < fxFpdf && fpT2rnd < fpT2pdf) {
293 htwk.Fill(dec_xF, dec_pT2, dec_weight);
297 double Idef = hdef.Integral(
"width");
298 double Itwk = htwk.Integral(
"width");
299 if(Idef > 0 && Itwk > 0) {
300 hdef.Scale(1./hdef.Integral(
"width"));
301 htwk.Scale(1./htwk.Integral(
"width"));
306 int xfbin = hdef.GetXaxis()->FindBin(XF);
307 int pt2bin = hdef.GetYaxis()->FindBin(PT2);
309 double prob_def = hdef.GetBinContent(xfbin,pt2bin);
310 double prob_twk = htwk.GetBinContent(xfbin,pt2bin);
311 if(prob_def <= 0 || prob_twk < 0) {
315 double wght = prob_twk/prob_def;
317 #ifdef _G_REWEIGHT_AGKY_DEBUG_
double E(void) const
Get energy.
static const double kNucleonMass
static RandomGen * Instance()
Access instance.
tweak xF distribution for low multiplicity (N + pi) DIS f/s produced by AGKY
TLorentzVector Hadronic4pLAB(const EventRecord &event)
A singleton holding random number generator classes. All random number generation in GENIE should tak...
double Pz(void) const
Get Pz.
tweak pT distribution for low multiplicity (N + pi) DIS f/s produced by AGKY
double Px(void) const
Get Px.
double OneSigmaErr(GSyst_t syst, int sign=0) const
double fPeakBaryonXFTwkDial
#define LOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a string (using the FILE...
static const double kASmallNum
auto norm(Vector const &v)
Return norm of the specified vector.
TRandom3 & RndHadro(void) const
rnd number generator used by hadronization models
static const double kPionMass
static GSystUncertainty * Instance(void)
const int kPdgHadronicSyst
STDHEP-like event record entry that can fit a particle or a nucleus.
double Py(void) const
Get Py.