22 #include <TParticlePDG.h> 23 #include <TDecayChannel.h> 35 using namespace genie;
47 #ifdef _G_REWEIGHT_RESDEC_DEBUG_ 105 if(!is_res)
return 1.;
109 if(is_cc && !
fRewCC)
return 1.;
110 if(is_nc && !
fRewNC)
return 1.;
130 bool tweaked = (tweaked_br1gamma || tweaked_br1eta);
131 if(!tweaked)
return 1.;
137 LOG(
"ReW",
pDEBUG) <<
"Checking resonance decay mode.";
147 for(
int i=fd;
i<=ld;
i++) {
148 int dpdg =
event.Particle(
i)->Pdg();
152 bool is_1gamma = (ngamma==1);
153 bool is_1eta = (neta ==1);
156 LOG(
"ReW",
pDEBUG) <<
"A resonance -> X + 1gamma event";
159 LOG(
"ReW",
pDEBUG) <<
"A resonance -> X + 1eta event";
168 if(tweaked_br1gamma) {
171 double w = (1. + dial*frerr);
172 w = TMath::Max(0.,w);
174 double mass = p->
P4()->M();
175 mass = TMath::Min(mass, brfw->GetXaxis()->GetXmax());
176 int ibin = brfw->FindBin(mass);
177 double brdef = brfw->GetBinContent(ibin);
178 double brtwk = brdef*
w;
186 wght *= ((1-brtwk)/(1-brdef));
194 double w = (1. + dial*frerr);
195 w = TMath::Max(0.,w);
197 double mass = p->
P4()->M();
198 mass = TMath::Min(mass, brfw->GetXaxis()->GetXmax());
199 int ibin = brfw->FindBin(mass);
200 double brdef = brfw->GetBinContent(ibin);
201 double brtwk = brdef*
w;
209 wght *= ((1-brtwk)/(1-brdef));
226 if(!tweaked)
return 1.;
228 bool is_Delta_1pi =
false;
240 int nd = 1 + ld - fd;
242 int fpdg =
event.Particle(fd)->Pdg();
243 int lpdg =
event.Particle(ld)->Pdg();
254 int nd = 1 + ld - fd;
256 int fpdg =
event.Particle(fd)->Pdg();
257 int lpdg =
event.Particle(ld)->Pdg();
270 int nd = 1 + ld - fd;
272 int fpdg =
event.Particle(fd)->Pdg();
273 int lpdg =
event.Particle(ld)->Pdg();
286 int nd = 1 + ld - fd;
288 int fpdg =
event.Particle(fd)->Pdg();
289 int lpdg =
event.Particle(ld)->Pdg();
295 if(is_Delta_1pi)
break;
299 if(!is_Delta_1pi)
return 1.;
301 LOG(
"ReW",
pDEBUG) <<
"A Delta++ -> p pi+ event:";
302 LOG(
"ReW",
pDEBUG) <<
"Resonance is at position: " << ir;
303 LOG(
"ReW",
pDEBUG) <<
"Pion is at position: " << ip;
307 TLorentzVector p4res(*event.
Particle(ir)->
P4());
308 TLorentzVector p4pip(*event.
Particle(ip)->
P4());
311 TVector3 bv = -1*p4res.BoostVector();
328 double p32iso = 0.50;
329 double p12iso = 0.50;
332 double costheta = p4pip.Vect().CosTheta();
333 double P2 = 0.5 * (3.*costheta*costheta - 1.);
334 double Wiso = 1 - p32iso * P2 + p12iso * P2;
335 double Wrs = 1 - p32rs * P2 + p12rs * P2;
338 double Wtwk = dial*Wrs + (1-dial)*Wiso;
341 if(Wdef>0. && Wtwk>0.) {
346 <<
"Pion Cos(ThetaCM) = " << costheta <<
", weight = " << wght;
348 #ifdef _G_REWEIGHT_RESDEC_DEBUG_ 349 fTestNtp->Fill(costheta,wght);
368 const int respdgarray[] = {
390 const double kWmin = 0.9;
391 const double kWmax = 5.0;
394 while((respdg = respdgarray[ires++])) {
396 fMpBR1etaDef [respdg] =
new TH1D(
"",
"",kNW,kWmin,kWmax);
404 while((respdg = respdgarray[ires++])) {
405 TParticlePDG * res = pdglib->
Find(respdg);
407 for(
int j=0; j<res->NDecayChannels(); j++) {
408 TDecayChannel * dch = res->DecayChannel(j);
411 double br = dch->BranchingRatio();
413 for(
int k=0;
k<dch->NDaughters();
k++) {
414 int dpdg = dch->DaughterPdgCode(
k);
419 bool is_1gamma = (ngamma==1);
420 bool is_1eta = (neta ==1);
421 for(
int ibin = 1; ibin <=
fMpBR1gammaDef[respdg]->GetNbinsX(); ibin++) {
424 bool is_allowed = (W>mt);
425 if(is_allowed && is_1gamma) {
fMpBR1gammaDef[respdg]->Fill(W, br); }
426 if(is_allowed && is_1eta ) {
fMpBR1etaDef [respdg]->Fill(W, br); }
431 #ifdef _G_REWEIGHT_RESDEC_DEBUG_ 432 fTestFile =
new TFile(
"./resdec_reweight_test.root",
"recreate");
433 fTestNtp =
new TNtupleD(
"testntp",
"",
"costheta:wght");
const int kPdgP31m1910_DeltaP
~GReWeightResonanceDecay()
bool IsResonant(void) const
const int kPdgS31m1620_DeltaM
const int kPdgP33m1232_DeltaPP
double RewThetaDelta2Npi(const EventRecord &event)
GReWeightResonanceDecay()
virtual GHepParticle * Particle(int position) const
map< int, TH1D * > fMpBR1etaDef
bool IsWeakCC(void) const
const int kPdgF35m1905_DeltaM
#include "Numerical/GSFunc.h"
const int kPdgD15m1675_N0
const int kPdgF35m1905_Delta0
void Reset(void)
set all nuisance parameters to default values
int FirstDaughter(void) const
const int kPdgF15m1680_NP
const int kPdgD33m1700_Delta0
const int kPdgD13m1700_NP
const int kPdgS11m1650_N0
tweak Resonance -> X + eta branching ratio, eg N+(1440) -> p eta
const int kPdgF37m1950_DeltaM
const int kPdgF37m1950_DeltaP
const int kPdgS11m1535_N0
void Reconfigure(void)
propagate updated nuisance parameter values to actual MC, etc
const int kPdgP33m1232_DeltaP
const int kPdgP33m1232_DeltaM
const int kPdgP31m1910_DeltaM
double OneSigmaErr(GSyst_t syst, int sign=0) const
double fThetaDelta2NpiTwkDial
Summary information for an interaction.
const int kPdgF37m1950_Delta0
const int kPdgD33m1700_DeltaPP
int LastDaughter(void) const
const int kPdgF35m1905_DeltaP
bool IsWeakNC(void) const
#define LOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a string (using the FILE...
const int kPdgD15m1675_NP
const int kPdgF35m1905_DeltaPP
const int kPdgS31m1620_DeltaPP
const int kPdgP31m1910_DeltaPP
const int kPdgP33m1920_DeltaPP
const int kPdgP31m1910_Delta0
const int kPdgP33m1920_DeltaP
const int kPdgD33m1700_DeltaM
const int kPdgP33m1920_DeltaM
const int kPdgF37m1950_DeltaPP
bool fRewNuebar
reweight nu_e_bar?
static const double kASmallNum
const int kPdgD13m1520_NP
An enumeration of systematic parameters.
const int kPdgF15m1680_N0
const int kPdgP11m1710_N0
const int kPdgS11m1650_NP
const int kPdgP33m1232_Delta0
const int kPdgP13m1720_N0
const int kPdgP11m1440_N0
Generated Event Record. It is a GHepRecord object that can accept / be visited by EventRecordVisitorI...
const int kPdgP33m1920_Delta0
const int kPdgD13m1520_N0
const int kPdgP11m1440_NP
const int kPdgS31m1620_Delta0
static PDGLibrary * Instance(void)
double CalcWeight(const EventRecord &event)
calculate a weight for the input event using the current nuisance param values
Singleton class to load & serve a TDatabasePDG.
bool fRewNumu
reweight nu_mu?
tweak Resonance -> X + gamma branching ratio, eg Delta+(1232) -> p gamma
bool fRewNumubar
reweight nu_mu_bar?
TParticlePDG * Find(int pdgc)
const InitialState & InitState(void) const
const ProcessInfo & ProcInfo(void) const
bool IsBaryonResonance(int pdgc)
is input a baryon resonance?
void SetSystematic(GSyst_t syst, double val)
update the value for the specified nuisance param
static GSystUncertainty * Instance(void)
const int kPdgP11m1710_NP
const int kPdgS11m1535_NP
TLorentzVector * P4(void) const
map< int, TH1D * > fMpBR1gammaDef
bool IsHandled(GSyst_t syst)
does the current weight calculator handle the input nuisance param?
const int kPdgS31m1620_DeltaP
double RewBR(const EventRecord &event)
distort pi angular distribution in Delta -> N + pi
Most commonly used PDG codes. A set of utility functions to handle PDG codes is provided in PDGUtils...
STDHEP-like event record entry that can fit a particle or a nucleus.
bool fRewNue
reweight nu_e?
const int kPdgP13m1720_NP
Event finding and building.
const int kPdgD13m1700_N0
GENIE event reweighting engine ABC.
const int kPdgD33m1700_DeltaP