diff --git a/.gitignore b/.gitignore index 855e019c8..8de7e0a0a 100644 --- a/.gitignore +++ b/.gitignore @@ -13,4 +13,4 @@ src/Framework/Conventions/GVersion.h *~ *.rootmap *_ROOT_DICT_* -*.swp +*.swp \ No newline at end of file diff --git a/config/AR23_20i/ModelConfiguration.xml b/config/AR23_20i/ModelConfiguration.xml index 69e2930a1..63e847358 100644 --- a/config/AR23_20i/ModelConfiguration.xml +++ b/config/AR23_20i/ModelConfiguration.xml @@ -44,6 +44,19 @@ STFC, Rutherford Appleton Laboratory genie::SpectralFunc1d/Default --> + + genie::BohrElectronVelocity/Default + - genie::IMDXSec/Default + genie::XSecOnElectron/Default + genie::ElectronVelocityMap/Default + 10000 + 0.0001 diff --git a/config/BohrElectronVelocity.xml b/config/BohrElectronVelocity.xml new file mode 100644 index 000000000..f88208339 --- /dev/null +++ b/config/BohrElectronVelocity.xml @@ -0,0 +1,17 @@ + + + + + + + + + diff --git a/config/EventGenerator.xml b/config/EventGenerator.xml index 69cd17af2..b31cf5502 100644 --- a/config/EventGenerator.xml +++ b/config/EventGenerator.xml @@ -425,34 +425,37 @@ XSecModel alg Yes Cross section model used at the thread - 5 + 6 genie::InitialStateAppender/Default genie::VertexGenerator/Default - genie::NuEKinematicsGenerator/Default - genie::NuEPrimaryLeptonGenerator/Default - genie::NuETargetRemnantGenerator/Default + genie::ElectronVelocityMap/Default + genie::NuEKinematicsGenerator/Default + genie::NuEPrimaryLeptonGenerator/Default + genie::NuETargetRemnantGenerator/Default genie::NuEInteractionListGenerator/IMD - 5 + 6 genie::InitialStateAppender/Default genie::VertexGenerator/Default - genie::NuEKinematicsGenerator/Default - genie::NuEPrimaryLeptonGenerator/Default - genie::NuETargetRemnantGenerator/Default + genie::ElectronVelocityMap/Default + genie::NuEKinematicsGenerator/Default + genie::NuEPrimaryLeptonGenerator/Default + genie::NuETargetRemnantGenerator/Default genie::NuEInteractionListGenerator/IMD-ANH - 5 + 6 genie::InitialStateAppender/Default genie::VertexGenerator/Default - genie::NuEKinematicsGenerator/Default - genie::NuEPrimaryLeptonGenerator/Default - genie::NuETargetRemnantGenerator/Default + genie::ElectronVelocityMap/Default + genie::NuEKinematicsGenerator/Default + genie::NuEPrimaryLeptonGenerator/Default + genie::NuETargetRemnantGenerator/Default genie::NuEInteractionListGenerator/NUE-EL diff --git a/config/G00_00a/EventGenerator.xml b/config/G00_00a/EventGenerator.xml index 2d873f1ad..d728bcd00 100644 --- a/config/G00_00a/EventGenerator.xml +++ b/config/G00_00a/EventGenerator.xml @@ -300,36 +300,39 @@ XSecModel alg Yes Cross section model used at the thread genie::DISInteractionListGenerator/CC-Charm-Default - + - 5 + 6 genie::InitialStateAppender/Default genie::VertexGenerator/Default - genie::NuEKinematicsGenerator/Default - genie::NuEPrimaryLeptonGenerator/Default - genie::NuETargetRemnantGenerator/Default + genie::ElectronVelocityMap/Default + genie::NuEKinematicsGenerator/Default + genie::NuEPrimaryLeptonGenerator/Default + genie::NuETargetRemnantGenerator/Default genie::NuEInteractionListGenerator/IMD - + - 5 + 6 genie::InitialStateAppender/Default genie::VertexGenerator/Default - genie::NuEKinematicsGenerator/Default - genie::NuEPrimaryLeptonGenerator/Default - genie::NuETargetRemnantGenerator/Default + genie::ElectronVelocityMap/Default + genie::NuEKinematicsGenerator/Default + genie::NuEPrimaryLeptonGenerator/Default + genie::NuETargetRemnantGenerator/Default genie::NuEInteractionListGenerator/IMD-ANH - + - 5 + 6 genie::InitialStateAppender/Default genie::VertexGenerator/Default - genie::NuEKinematicsGenerator/Default - genie::NuEPrimaryLeptonGenerator/Default - genie::NuETargetRemnantGenerator/Default + genie::ElectronVelocityMap/Default + genie::NuEKinematicsGenerator/Default + genie::NuEPrimaryLeptonGenerator/Default + genie::NuETargetRemnantGenerator/Default genie::NuEInteractionListGenerator/NUE-EL diff --git a/config/G00_00a/ModelConfiguration.xml b/config/G00_00a/ModelConfiguration.xml index 106bca2db..b227139fc 100644 --- a/config/G00_00a/ModelConfiguration.xml +++ b/config/G00_00a/ModelConfiguration.xml @@ -43,6 +43,17 @@ STFC, Rutherford Appleton Laboratory genie::SpectralFunc1d/Default --> + + genie::StaticElectronVelocity/Default - + + + genie::StaticElectronVelocity/Default + + genie::StaticElectronVelocity/Default + - - + + + genie::BohrElectronVelocity/Default + + genie::BohrElectronVelocity/Default + + genie::BohrElectronVelocity/Default + + + + genie::BohrElectronVelocity/Default + - + + + genie::BohrElectronVelocity/Default + + genie::BohrElectronVelocity/Default + + genie::BohrElectronVelocity/Default + + genie::BohrElectronVelocity/Default + + + genie::BohrElectronVelocity/Default + + genie::BohrElectronVelocity/Default + + genie::BohrElectronVelocity/Default + + genie::BohrElectronVelocity/Default + + genie::BohrElectronVelocity/Default + + genie::BohrElectronVelocity/Default + + genie::BohrElectronVelocity/Default + + genie::BohrElectronVelocity/Default - + + + genie::BohrElectronVelocity/Default - + + + genie::BohrElectronVelocity/Default + + + genie::BohrElectronVelocity/Default + genie::BohrElectronVelocity/Default + + - genie::IMDXSec/Default + genie::XSecOnElectron/Default + genie::ElectronVelocityMap/Default + 10000 + 0.0001 diff --git a/config/IMDXSec.xml b/config/IMDXSec.xml deleted file mode 100644 index 38eee9e52..000000000 --- a/config/IMDXSec.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - - - adaptive - 40000 - 0.001 - - - - diff --git a/config/Messenger.xml b/config/Messenger.xml index 20607f9dd..338504d1c 100644 --- a/config/Messenger.xml +++ b/config/Messenger.xml @@ -109,7 +109,6 @@ WARN WARN NOTICE - NOTICE WARN WARN NOTICE diff --git a/config/Messenger_whisper.xml b/config/Messenger_whisper.xml index a8450bb2c..efd740454 100644 --- a/config/Messenger_whisper.xml +++ b/config/Messenger_whisper.xml @@ -104,7 +104,6 @@ FATAL FATAL FATAL - FATAL FATAL FATAL FATAL diff --git a/config/NuElectronPXSec.xml b/config/NuElectronPXSec.xml index 8fe2b2992..55a270038 100644 --- a/config/NuElectronPXSec.xml +++ b/config/NuElectronPXSec.xml @@ -7,15 +7,21 @@ Configuration for the NuElectronPXSec xsec algorithm. Configurable Parameters: .................................................................................... -Name Type Optional Comment Default -WeinbergAngle double No CommonParam[WeakInt] +Name Type Optional Comment Default +WeinbergAngle double No CommonParam[WeakInt] +XSec-Integrator alg No genie::XSecOnElectron/Default +Electron-Velocity alg No genie::ElectronVelocityMap/Default +N-Integration-Samples int No max iteration in case error doesn't converge 10000 +NuE-XSecRelError double No error to accept xsec in integrator 0.001 .................................................................................... --> WeakInt - - genie::NuElectronXSec/Default + genie::XSecOnElectron/Default + genie::ElectronVelocityMap/Default + 10000 + 0.001 diff --git a/config/NuElectronXSec.xml b/config/NuElectronXSec.xml deleted file mode 100644 index 9c30e669a..000000000 --- a/config/NuElectronXSec.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - adaptive - 40000 - 0.001 - - - - diff --git a/config/StaticElectronVelocity.xml b/config/StaticElectronVelocity.xml new file mode 100644 index 000000000..a48332360 --- /dev/null +++ b/config/StaticElectronVelocity.xml @@ -0,0 +1,17 @@ + + + + + + + + + diff --git a/config/master_config.xml b/config/master_config.xml index 048508c3f..35194edca 100644 --- a/config/master_config.xml +++ b/config/master_config.xml @@ -5,6 +5,9 @@ EventGenerator.xml FermiMover.xml + Default.xml + BohrElectronVelocity.xml + Default.xml HadronTransporter.xml HAIntranuke.xml HAIntranuke2018.xml @@ -160,10 +163,8 @@ CEvNSXSec.xml DFRXSec.xml AlamSimoAtharVacasSKXSec.xml - IMDXSec.xml RESXSec.xml MECXSec.xml - NuElectronXSec.xml DMElectronXSec.xml DMELXSec.xml DMDISXSec.xml diff --git a/src/Apps/gSplineXml2Root.cxx b/src/Apps/gSplineXml2Root.cxx index 29249200c..af68f10b8 100644 --- a/src/Apps/gSplineXml2Root.cxx +++ b/src/Apps/gSplineXml2Root.cxx @@ -630,8 +630,8 @@ void SaveGraphsToRootFile(void) << " interaction type has not recongnised: spline not added " ; continue; } - if(tgt.HitNucIsSet()) { - int hitnuc = tgt.HitNucPdg(); + if(tgt.HitPartIsSet() && tgt.HitPartPdg() != kPdgElectron) { + int hitnuc = tgt.HitPartPdg(); if ( pdg::IsProton (hitnuc) ) { title << "_p"; } else if ( pdg::IsNeutron(hitnuc) ) { title << "_n"; } else if ( pdg::Is2NucleonCluster(hitnuc) ) @@ -752,22 +752,22 @@ void SaveGraphsToRootFile(void) const Spline * spl = evg_driver.XSecSpline(interaction); - if (proc.IsResonant() && proc.IsWeakCC() && pdg::IsProton(tgt.HitNucPdg())) { + if (proc.IsResonant() && proc.IsWeakCC() && pdg::IsProton(tgt.HitPartPdg())) { for(int i=0; iEvaluate(e[i]) * (1E+38/units::cm2)); } } - if (proc.IsResonant() && proc.IsWeakCC() && pdg::IsNeutron(tgt.HitNucPdg())) { + if (proc.IsResonant() && proc.IsWeakCC() && pdg::IsNeutron(tgt.HitPartPdg())) { for(int i=0; iEvaluate(e[i]) * (1E+38/units::cm2)); } } - if (proc.IsResonant() && proc.IsWeakNC() && pdg::IsProton(tgt.HitNucPdg())) { + if (proc.IsResonant() && proc.IsWeakNC() && pdg::IsProton(tgt.HitPartPdg())) { for(int i=0; iEvaluate(e[i]) * (1E+38/units::cm2)); } } - if (proc.IsResonant() && proc.IsWeakNC() && pdg::IsNeutron(tgt.HitNucPdg())) { + if (proc.IsResonant() && proc.IsWeakNC() && pdg::IsNeutron(tgt.HitPartPdg())) { for(int i=0; iEvaluate(e[i]) * (1E+38/units::cm2)); } @@ -820,25 +820,25 @@ void SaveGraphsToRootFile(void) if(xcls.IsCharmEvent()) continue; - if (proc.IsDeepInelastic() && proc.IsWeakCC() && pdg::IsProton(tgt.HitNucPdg())) { + if (proc.IsDeepInelastic() && proc.IsWeakCC() && pdg::IsProton(tgt.HitPartPdg())) { for(int i=0; iEvaluate(e[i]) * (1E+38/units::cm2)); xsdisccp[i] += (spl->Evaluate(e[i]) * (1E+38/units::cm2)); } } - if (proc.IsDeepInelastic() && proc.IsWeakCC() && pdg::IsNeutron(tgt.HitNucPdg())) { + if (proc.IsDeepInelastic() && proc.IsWeakCC() && pdg::IsNeutron(tgt.HitPartPdg())) { for(int i=0; iEvaluate(e[i]) * (1E+38/units::cm2)); xsdisccn[i] += (spl->Evaluate(e[i]) * (1E+38/units::cm2)); } } - if (proc.IsDeepInelastic() && proc.IsWeakNC() && pdg::IsProton(tgt.HitNucPdg())) { + if (proc.IsDeepInelastic() && proc.IsWeakNC() && pdg::IsProton(tgt.HitPartPdg())) { for(int i=0; iEvaluate(e[i]) * (1E+38/units::cm2)); xsdisncp[i] += (spl->Evaluate(e[i]) * (1E+38/units::cm2)); } } - if (proc.IsDeepInelastic() && proc.IsWeakNC() && pdg::IsNeutron(tgt.HitNucPdg())) { + if (proc.IsDeepInelastic() && proc.IsWeakNC() && pdg::IsNeutron(tgt.HitPartPdg())) { for(int i=0; iEvaluate(e[i]) * (1E+38/units::cm2)); xsdisncn[i] += (spl->Evaluate(e[i]) * (1E+38/units::cm2)); @@ -893,25 +893,25 @@ void SaveGraphsToRootFile(void) if(!xcls.IsCharmEvent()) continue; - if (proc.IsDeepInelastic() && proc.IsWeakCC() && pdg::IsProton(tgt.HitNucPdg())) { + if (proc.IsDeepInelastic() && proc.IsWeakCC() && pdg::IsProton(tgt.HitPartPdg())) { for(int i=0; iEvaluate(e[i]) * (1E+38/units::cm2)); xsdisccp[i] += (spl->Evaluate(e[i]) * (1E+38/units::cm2)); } } - if (proc.IsDeepInelastic() && proc.IsWeakCC() && pdg::IsNeutron(tgt.HitNucPdg())) { + if (proc.IsDeepInelastic() && proc.IsWeakCC() && pdg::IsNeutron(tgt.HitPartPdg())) { for(int i=0; iEvaluate(e[i]) * (1E+38/units::cm2)); xsdisccn[i] += (spl->Evaluate(e[i]) * (1E+38/units::cm2)); } } - if (proc.IsDeepInelastic() && proc.IsWeakNC() && pdg::IsProton(tgt.HitNucPdg())) { + if (proc.IsDeepInelastic() && proc.IsWeakNC() && pdg::IsProton(tgt.HitPartPdg())) { for(int i=0; iEvaluate(e[i]) * (1E+38/units::cm2)); xsdisncp[i] += (spl->Evaluate(e[i]) * (1E+38/units::cm2)); } } - if (proc.IsDeepInelastic() && proc.IsWeakNC() && pdg::IsNeutron(tgt.HitNucPdg())) { + if (proc.IsDeepInelastic() && proc.IsWeakNC() && pdg::IsNeutron(tgt.HitPartPdg())) { for(int i=0; iEvaluate(e[i]) * (1E+38/units::cm2)); xsdisncn[i] += (spl->Evaluate(e[i]) * (1E+38/units::cm2)); @@ -1110,8 +1110,8 @@ void SaveGraphsToRootFile(void) bool iscc = proc.IsWeakCC(); bool isnc = proc.IsWeakNC(); - bool offp = pdg::IsProton (tgt.HitNucPdg()); - bool offn = pdg::IsNeutron(tgt.HitNucPdg()); + bool offp = pdg::IsProton (tgt.HitPartPdg()); + bool offn = pdg::IsNeutron(tgt.HitPartPdg()); if (iscc && offp) { for(int i=0; iEvaluate(e[i]) * (1E+38/units::cm2)); } } - if (proc.IsResonant() && proc.IsEM() && pdg::IsNeutron(tgt.HitNucPdg())) { + if (proc.IsResonant() && proc.IsEM() && pdg::IsNeutron(tgt.HitPartPdg())) { for(int i=0; iEvaluate(e[i]) * (1E+38/units::cm2)); } @@ -1268,12 +1268,12 @@ void SaveGraphsToRootFile(void) if(xcls.IsCharmEvent()) continue; - if (proc.IsDeepInelastic() && proc.IsEM() && pdg::IsProton(tgt.HitNucPdg())) { + if (proc.IsDeepInelastic() && proc.IsEM() && pdg::IsProton(tgt.HitPartPdg())) { for(int i=0; iEvaluate(e[i]) * (1E+38/units::cm2)); } } - if (proc.IsDeepInelastic() && proc.IsEM() && pdg::IsNeutron(tgt.HitNucPdg())) { + if (proc.IsDeepInelastic() && proc.IsEM() && pdg::IsNeutron(tgt.HitPartPdg())) { for(int i=0; iEvaluate(e[i]) * (1E+38/units::cm2)); } @@ -1307,12 +1307,12 @@ void SaveGraphsToRootFile(void) if(!xcls.IsCharmEvent()) continue; - if (proc.IsDeepInelastic() && proc.IsEM() && pdg::IsProton(tgt.HitNucPdg())) { + if (proc.IsDeepInelastic() && proc.IsEM() && pdg::IsProton(tgt.HitPartPdg())) { for(int i=0; iEvaluate(e[i]) * (1E+38/units::cm2)); } } - if (proc.IsDeepInelastic() && proc.IsEM() && pdg::IsNeutron(tgt.HitNucPdg())) { + if (proc.IsDeepInelastic() && proc.IsEM() && pdg::IsNeutron(tgt.HitPartPdg())) { for(int i=0; iEvaluate(e[i]) * (1E+38/units::cm2)); } @@ -1347,8 +1347,8 @@ void SaveGraphsToRootFile(void) const Spline * spl = evg_driver.XSecSpline(interaction); bool isem = proc.IsEM(); - bool offp = pdg::IsProton (tgt.HitNucPdg()); - bool offn = pdg::IsNeutron(tgt.HitNucPdg()); + bool offp = pdg::IsProton (tgt.HitPartPdg()); + bool offn = pdg::IsNeutron(tgt.HitPartPdg()); if (isem && offp) { for(int i=0; i 2.0) : false; diff --git a/src/Framework/Interaction/InitialState.cxx b/src/Framework/Interaction/InitialState.cxx index b74b5ef75..2d3c89311 100644 --- a/src/Framework/Interaction/InitialState.cxx +++ b/src/Framework/Interaction/InitialState.cxx @@ -199,7 +199,7 @@ void InitialState::SetTgtP4(const TLorentzVector & P4) bool InitialState::IsNuP(void) const { int prob = fProbePdg; - int nucl = fTgt->HitNucPdg(); + int nucl = fTgt->HitPartPdg(); bool isvp = pdg::IsNeutrino(prob) && pdg::IsProton(nucl); return isvp; @@ -208,7 +208,7 @@ bool InitialState::IsNuP(void) const bool InitialState::IsNuN(void) const { int prob = fProbePdg; - int nucl = fTgt->HitNucPdg(); + int nucl = fTgt->HitPartPdg(); bool isvn = pdg::IsNeutrino(prob) && pdg::IsNeutron(nucl); return isvn; @@ -217,7 +217,7 @@ bool InitialState::IsNuN(void) const bool InitialState::IsNuBarP(void) const { int prob = fProbePdg; - int nucl = fTgt->HitNucPdg(); + int nucl = fTgt->HitPartPdg(); bool isvbp = pdg::IsAntiNeutrino(prob) && pdg::IsProton(nucl); return isvbp; @@ -226,7 +226,7 @@ bool InitialState::IsNuBarP(void) const bool InitialState::IsNuBarN(void) const { int prob = fProbePdg; - int nucl = fTgt->HitNucPdg(); + int nucl = fTgt->HitPartPdg(); bool isvbn = pdg::IsAntiNeutrino(prob) && pdg::IsNeutron(nucl); return isvbn; @@ -236,7 +236,7 @@ bool InitialState::IsDMP(void) const { // Check if DM - proton interaction int prob = fProbePdg; - int nucl = fTgt->HitNucPdg(); + int nucl = fTgt->HitPartPdg(); bool isdp = pdg::IsDarkMatter(prob) && pdg::IsProton(nucl); return isdp; @@ -246,7 +246,7 @@ bool InitialState::IsDMN(void) const { // Check if DM - neutron interaction int prob = fProbePdg; - int nucl = fTgt->HitNucPdg(); + int nucl = fTgt->HitPartPdg(); bool isdn = pdg::IsDarkMatter(prob) && pdg::IsNeutron(nucl); return isdn; @@ -256,7 +256,7 @@ bool InitialState::IsDMBP(void) const { // Check if DM - proton interaction int prob = fProbePdg; - int nucl = fTgt->HitNucPdg(); + int nucl = fTgt->HitPartPdg(); bool isdp = pdg::IsAntiDarkMatter(prob) && pdg::IsProton(nucl); return isdp; @@ -266,7 +266,7 @@ bool InitialState::IsDMBN(void) const { // Check if DM - neutron interaction int prob = fProbePdg; - int nucl = fTgt->HitNucPdg(); + int nucl = fTgt->HitPartPdg(); bool isdn = pdg::IsAntiDarkMatter(prob) && pdg::IsNeutron(nucl); return isdn; @@ -294,8 +294,8 @@ TLorentzVector * InitialState::GetTgtP4(RefFrame_t ref_frame) const { // make sure that 'struck nucleon' properties were set in // the nuclear target object - assert(fTgt->HitNucIsSet()); - TLorentzVector * pnuc4 = fTgt->HitNucP4Ptr(); + assert(pdg::IsNucleon(fTgt->HitPartPdg())); + TLorentzVector * pnuc4 = fTgt->HitPartP4Ptr(); // compute velocity vector (px/E, py/E, pz/E) double bx = pnuc4->Px() / pnuc4->Energy(); @@ -346,9 +346,9 @@ TLorentzVector * InitialState::GetProbeP4(RefFrame_t ref_frame) const // make sure that 'struck nucleon' properties were set in // the nuclear target object - assert( fTgt->HitNucP4Ptr() != 0 ); + assert( pdg::IsNucleon(fTgt->HitPartPdg()) ); - TLorentzVector * pnuc4 = fTgt->HitNucP4Ptr(); + TLorentzVector * pnuc4 = fTgt->HitPartP4Ptr(); // compute velocity vector (px/E, py/E, pz/E) @@ -374,6 +374,23 @@ TLorentzVector * InitialState::GetProbeP4(RefFrame_t ref_frame) const break; } + //----------------- STRUCK ELECTRON REST FRAME + case (kRfHitElRest) : + { + //Ensure target is electron + if (!pdg::IsElectron(fTgt->HitPartPdg())){ + return nullptr; + } + TLorentzVector * pele4 = fTgt->HitPartP4Ptr(); + + // compute velocity vector + + auto boost = pele4->BoostVector(); + TLorentzVector * p4 = new TLorentzVector(*fProbeP4); + p4->Boost(-boost); + return p4; + break; + } default: LOG("Interaction", pERROR) << "Uknown reference frame"; @@ -394,7 +411,7 @@ double InitialState::ProbeE(RefFrame_t ref_frame) const double InitialState::CMEnergy() const { TLorentzVector * k4 = this->GetProbeP4(kRfLab); - TLorentzVector * p4 = fTgt->HitNucP4Ptr(); + TLorentzVector * p4 = fTgt->HitPartP4Ptr(); *k4 += *p4; // now k4 represents centre-of-mass 4-momentum double s = k4->Dot(*k4); // dot-product with itself @@ -443,8 +460,8 @@ void InitialState::Print(ostream & stream) const } stream << endl; - stream << " |--> hit nucleon : "; - int nuc_pdgc = fTgt->HitNucPdg(); + stream << " |--> hit particle : "; + int nuc_pdgc = fTgt->HitPartPdg(); if ( pdg::IsNeutronOrProton(nuc_pdgc) ) { TParticlePDG * p = PDGLibrary::Instance()->Find(nuc_pdgc); @@ -481,11 +498,11 @@ void InitialState::Print(ostream & stream) const << ")" << endl; - if ( pdg::IsNeutronOrProton(nuc_pdgc) ) { + if ( pdg::IsParticle(nuc_pdgc) ) { - TLorentzVector * nuc_p4 = fTgt->HitNucP4Ptr(); + TLorentzVector * nuc_p4 = fTgt->HitPartP4Ptr(); - stream << " |--> nucleon 4P : " + stream << " |--> hit particle : " << "(E = " << setw(12) << setprecision(6) << nuc_p4->E() << ", Px = " << setw(12) << setprecision(6) << nuc_p4->Px() << ", Py = " << setw(12) << setprecision(6) << nuc_p4->Py() diff --git a/src/Framework/Interaction/Interaction.cxx b/src/Framework/Interaction/Interaction.cxx index 7282c1241..2314898c8 100644 --- a/src/Framework/Interaction/Interaction.cxx +++ b/src/Framework/Interaction/Interaction.cxx @@ -183,7 +183,7 @@ int Interaction::RecoilNucleonPdg(void) const const Target & target = fInitialState->Tgt(); int recoil_nuc = 0; - int struck_nuc = target.HitNucPdg(); + int struck_nuc = target.HitPartPdg(); if (fProcInfo->IsQuasiElastic() || fProcInfo->IsInverseBetaDecay() || fProcInfo->IsDarkMatterElastic()) { bool struck_is_nuc = pdg::IsNucleon(struck_nuc); @@ -266,8 +266,8 @@ string Interaction::AsString(void) const } interaction << "tgt:" << tgt.Pdg() << ";"; - if(tgt.HitNucIsSet()) { - interaction << "N:" << tgt.HitNucPdg() << ";"; + if(tgt.HitPartIsSet()) { + interaction << "Part:" << tgt.HitPartPdg() << ";"; } if(tgt.HitQrkIsSet()) { interaction << "q:" << tgt.HitQrkPdg() @@ -329,7 +329,7 @@ Interaction * Interaction::DISCC(int target, int hitnuc, int probe, double E) InitialState * init_state = interaction->InitStatePtr(); init_state->SetProbeE(E); - init_state->TgtPtr()->SetHitNucPdg(hitnuc); + init_state->TgtPtr()->SetHitPartPdg(hitnuc); return interaction; } @@ -369,7 +369,7 @@ Interaction * Interaction::DISCC( InitialState * init_state = interaction->InitStatePtr(); init_state->SetProbeP4(p4probe); - init_state->TgtPtr()->SetHitNucPdg(hitnuc); + init_state->TgtPtr()->SetHitPartPdg(hitnuc); return interaction; } @@ -394,7 +394,7 @@ Interaction * Interaction::DISNC(int target, int hitnuc, int probe, double E) InitialState * init_state = interaction->InitStatePtr(); init_state->SetProbeE(E); - init_state->TgtPtr()->SetHitNucPdg(hitnuc); + init_state->TgtPtr()->SetHitPartPdg(hitnuc); return interaction; } @@ -434,7 +434,7 @@ Interaction * Interaction::DISNC( InitialState * init_state = interaction->InitStatePtr(); init_state->SetProbeP4(p4probe); - init_state->TgtPtr()->SetHitNucPdg(hitnuc); + init_state->TgtPtr()->SetHitPartPdg(hitnuc); return interaction; } @@ -459,7 +459,7 @@ Interaction * Interaction::DISEM(int target, int hitnuc, int probe, double E) InitialState * init_state = interaction->InitStatePtr(); init_state->SetProbeE(E); - init_state->TgtPtr()->SetHitNucPdg(hitnuc); + init_state->TgtPtr()->SetHitPartPdg(hitnuc); return interaction; } @@ -484,7 +484,7 @@ Interaction * Interaction::DISEM( InitialState * init_state = interaction->InitStatePtr(); init_state->SetProbeP4(p4probe); - init_state->TgtPtr()->SetHitNucPdg(hitnuc); + init_state->TgtPtr()->SetHitPartPdg(hitnuc); return interaction; } @@ -509,7 +509,7 @@ Interaction * Interaction::QELCC(int target, int hitnuc, int probe, double E) InitialState * init_state = interaction->InitStatePtr(); init_state->SetProbeE(E); - init_state->TgtPtr()->SetHitNucPdg(hitnuc); + init_state->TgtPtr()->SetHitPartPdg(hitnuc); return interaction; } @@ -522,7 +522,7 @@ Interaction * Interaction::QELCC( InitialState * init_state = interaction->InitStatePtr(); init_state->SetProbeP4(p4probe); - init_state->TgtPtr()->SetHitNucPdg(hitnuc); + init_state->TgtPtr()->SetHitPartPdg(hitnuc); return interaction; } @@ -534,7 +534,7 @@ Interaction * Interaction::QELNC(int target, int hitnuc, int probe, double E) InitialState * init_state = interaction->InitStatePtr(); init_state->SetProbeE(E); - init_state->TgtPtr()->SetHitNucPdg(hitnuc); + init_state->TgtPtr()->SetHitPartPdg(hitnuc); return interaction; } @@ -547,7 +547,7 @@ Interaction * Interaction::QELNC( InitialState * init_state = interaction->InitStatePtr(); init_state->SetProbeP4(p4probe); - init_state->TgtPtr()->SetHitNucPdg(hitnuc); + init_state->TgtPtr()->SetHitPartPdg(hitnuc); return interaction; } @@ -559,7 +559,7 @@ Interaction * Interaction::QELEM(int target, int hitnuc, int probe, double E) InitialState * init_state = interaction->InitStatePtr(); init_state->SetProbeE(E); - init_state->TgtPtr()->SetHitNucPdg(hitnuc); + init_state->TgtPtr()->SetHitPartPdg(hitnuc); return interaction; } @@ -572,7 +572,7 @@ Interaction * Interaction::QELEM( InitialState * init_state = interaction->InitStatePtr(); init_state->SetProbeP4(p4probe); - init_state->TgtPtr()->SetHitNucPdg(hitnuc); + init_state->TgtPtr()->SetHitPartPdg(hitnuc); return interaction; } @@ -584,7 +584,7 @@ Interaction * Interaction::IBD(int target, int hitnuc, int probe, double E) InitialState * init_state = interaction->InitStatePtr(); init_state->SetProbeE(E); - init_state->TgtPtr()->SetHitNucPdg(hitnuc); + init_state->TgtPtr()->SetHitPartPdg(hitnuc); return interaction; } @@ -597,7 +597,7 @@ Interaction * Interaction::IBD( InitialState * init_state = interaction->InitStatePtr(); init_state->SetProbeP4(p4probe); - init_state->TgtPtr()->SetHitNucPdg(hitnuc); + init_state->TgtPtr()->SetHitPartPdg(hitnuc); return interaction; } @@ -609,7 +609,7 @@ Interaction * Interaction::RESCC(int target, int hitnuc, int probe, double E) InitialState * init_state = interaction->InitStatePtr(); init_state->SetProbeE(E); - init_state->TgtPtr()->SetHitNucPdg(hitnuc); + init_state->TgtPtr()->SetHitPartPdg(hitnuc); return interaction; } @@ -622,7 +622,7 @@ Interaction * Interaction::RESCC( InitialState * init_state = interaction->InitStatePtr(); init_state->SetProbeP4(p4probe); - init_state->TgtPtr()->SetHitNucPdg(hitnuc); + init_state->TgtPtr()->SetHitPartPdg(hitnuc); return interaction; } @@ -634,7 +634,7 @@ Interaction * Interaction::RESNC(int target, int hitnuc, int probe, double E) InitialState * init_state = interaction->InitStatePtr(); init_state->SetProbeE(E); - init_state->TgtPtr()->SetHitNucPdg(hitnuc); + init_state->TgtPtr()->SetHitPartPdg(hitnuc); return interaction; } @@ -647,7 +647,7 @@ Interaction * Interaction::RESNC( InitialState * init_state = interaction->InitStatePtr(); init_state->SetProbeP4(p4probe); - init_state->TgtPtr()->SetHitNucPdg(hitnuc); + init_state->TgtPtr()->SetHitPartPdg(hitnuc); return interaction; } @@ -659,7 +659,7 @@ Interaction * Interaction::RESEM(int target, int hitnuc, int probe, double E) InitialState * init_state = interaction->InitStatePtr(); init_state->SetProbeE(E); - init_state->TgtPtr()->SetHitNucPdg(hitnuc); + init_state->TgtPtr()->SetHitPartPdg(hitnuc); return interaction; } @@ -672,7 +672,7 @@ Interaction * Interaction::RESEM( InitialState * init_state = interaction->InitStatePtr(); init_state->SetProbeP4(p4probe); - init_state->TgtPtr()->SetHitNucPdg(hitnuc); + init_state->TgtPtr()->SetHitPartPdg(hitnuc); return interaction; } @@ -684,7 +684,7 @@ Interaction * Interaction::DFRCC(int tgt,int hitnuc, int probe, double E) InitialState * init_state = interaction->InitStatePtr(); init_state->SetProbeE(E); - init_state->TgtPtr()->SetHitNucPdg(hitnuc); + init_state->TgtPtr()->SetHitPartPdg(hitnuc); return interaction; } @@ -697,7 +697,7 @@ Interaction * Interaction::DFRCC( InitialState * init_state = interaction->InitStatePtr(); init_state->SetProbeP4(p4probe); - init_state->TgtPtr()->SetHitNucPdg(hitnuc); + init_state->TgtPtr()->SetHitPartPdg(hitnuc); return interaction; } @@ -820,7 +820,7 @@ Interaction * Interaction::AMNuGamma(int tgt, int nuc, int probe, double E) InitialState * init_state = interaction->InitStatePtr(); init_state->SetProbeE(E); - init_state->TgtPtr()->SetHitNucPdg(nuc); + init_state->TgtPtr()->SetHitPartPdg(nuc); return interaction; } @@ -833,7 +833,7 @@ Interaction * Interaction::AMNuGamma( InitialState * init_state = interaction->InitStatePtr(); init_state->SetProbeP4(p4probe); - init_state->TgtPtr()->SetHitNucPdg(nuc); + init_state->TgtPtr()->SetHitPartPdg(nuc); return interaction; } @@ -845,7 +845,7 @@ Interaction * Interaction::MECCC(int tgt, int ncluster, int probe, double E) InitialState * init_state = interaction->InitStatePtr(); init_state->SetProbeE(E); - init_state->TgtPtr()->SetHitNucPdg(ncluster); + init_state->TgtPtr()->SetHitPartPdg(ncluster); return interaction; } @@ -858,7 +858,7 @@ Interaction * Interaction::MECCC( InitialState * init_state = interaction->InitStatePtr(); init_state->SetProbeP4(p4probe); - init_state->TgtPtr()->SetHitNucPdg(ncluster); + init_state->TgtPtr()->SetHitPartPdg(ncluster); return interaction; } @@ -894,7 +894,7 @@ Interaction * Interaction::MECNC(int tgt, int ncluster, int probe, double E) InitialState * init_state = interaction->InitStatePtr(); init_state->SetProbeE(E); - init_state->TgtPtr()->SetHitNucPdg(ncluster); + init_state->TgtPtr()->SetHitPartPdg(ncluster); return interaction; } @@ -907,7 +907,7 @@ Interaction * Interaction::MECNC( InitialState * init_state = interaction->InitStatePtr(); init_state->SetProbeP4(p4probe); - init_state->TgtPtr()->SetHitNucPdg(ncluster); + init_state->TgtPtr()->SetHitPartPdg(ncluster); return interaction; } @@ -931,7 +931,7 @@ Interaction * Interaction::MECEM(int tgt, int ncluster, int probe, double E) InitialState * init_state = interaction->InitStatePtr(); init_state->SetProbeE(E); - init_state->TgtPtr()->SetHitNucPdg(ncluster); + init_state->TgtPtr()->SetHitPartPdg(ncluster); return interaction; } @@ -944,7 +944,7 @@ Interaction * Interaction::MECEM( InitialState * init_state = interaction->InitStatePtr(); init_state->SetProbeP4(p4probe); - init_state->TgtPtr()->SetHitNucPdg(ncluster); + init_state->TgtPtr()->SetHitPartPdg(ncluster); return interaction; } @@ -956,7 +956,7 @@ Interaction * Interaction::GLR(int tgt, double E) InitialState * init_state = interaction->InitStatePtr(); init_state->SetProbeE(E); - init_state->TgtPtr()->SetHitNucPdg(0); + init_state->TgtPtr()->SetHitPartPdg(0); return interaction; } @@ -968,7 +968,7 @@ Interaction * Interaction::GLR(int tgt, const TLorentzVector & p4probe) InitialState * init_state = interaction->InitStatePtr(); init_state->SetProbeP4(p4probe); - init_state->TgtPtr()->SetHitNucPdg(0); + init_state->TgtPtr()->SetHitPartPdg(0); return interaction; } @@ -980,7 +980,7 @@ Interaction * Interaction::NDecay(int tgt, int decay_mode, int decayed_nucleon) interaction->ExclTagPtr()->SetDecayMode(decay_mode); InitialState * init_state = interaction->InitStatePtr(); - init_state->TgtPtr()->SetHitNucPdg(decayed_nucleon); + init_state->TgtPtr()->SetHitPartPdg(decayed_nucleon); return interaction; } @@ -1024,7 +1024,7 @@ Interaction * Interaction::DME(int target, int hitnuc, int probe, double E) InitialState * init_state = interaction->InitStatePtr(); init_state->SetProbeE(E); - init_state->TgtPtr()->SetHitNucPdg(hitnuc); + init_state->TgtPtr()->SetHitPartPdg(hitnuc); return interaction; } @@ -1038,7 +1038,7 @@ Interaction * Interaction::DME( InitialState * init_state = interaction->InitStatePtr(); init_state->SetProbeP4(p4probe); - init_state->TgtPtr()->SetHitNucPdg(hitnuc); + init_state->TgtPtr()->SetHitPartPdg(hitnuc); return interaction; } @@ -1050,7 +1050,7 @@ Interaction * Interaction::DMDI(int target, int hitnuc, int probe, double E) InitialState * init_state = interaction->InitStatePtr(); init_state->SetProbeE(E); - init_state->TgtPtr()->SetHitNucPdg(hitnuc); + init_state->TgtPtr()->SetHitPartPdg(hitnuc); return interaction; } @@ -1075,7 +1075,7 @@ Interaction * Interaction::DMDI( InitialState * init_state = interaction->InitStatePtr(); init_state->SetProbeP4(p4probe); - init_state->TgtPtr()->SetHitNucPdg(hitnuc); + init_state->TgtPtr()->SetHitPartPdg(hitnuc); return interaction; } diff --git a/src/Framework/Interaction/KPhaseSpace.cxx b/src/Framework/Interaction/KPhaseSpace.cxx index f5945f193..804fadb6d 100644 --- a/src/Framework/Interaction/KPhaseSpace.cxx +++ b/src/Framework/Interaction/KPhaseSpace.cxx @@ -92,7 +92,7 @@ double KPhaseSpace::Threshold(void) const if (pi.IsSingleKaon()) { int kaon_pdgc = xcls.StrangeHadronPdg(); - double Mi = tgt.HitNucP4Ptr()->M(); // initial nucleon mass + double Mi = tgt.HitPartP4Ptr()->M(); // initial nucleon mass // Final nucleon can be different for K0 interaction double Mf = (xcls.NProtons()==1) ? kProtonMass : kNeutronMass; double mk = PDGLibrary::Instance()->Find(kaon_pdgc)->Mass(); @@ -134,12 +134,12 @@ double KPhaseSpace::Threshold(void) const pi.IsDarkMatterDeepInelastic() || pi.IsDiffractive()) { - assert(tgt.HitNucIsSet()); - double Mn = tgt.HitNucP4Ptr()->M(); + assert(tgt.HitPartIsSet()); + double Mn = tgt.HitPartP4Ptr()->M(); double Mn2 = TMath::Power(Mn,2); double Wmin = kNucleonMass + kPionMass; if ( pi.IsQuasiElastic() || pi.IsDarkMatterElastic() || pi.IsInverseBetaDecay() ) { - int finalNucPDG = tgt.HitNucPdg(); + int finalNucPDG = tgt.HitPartPdg(); if ( pi.IsWeakCC() ) finalNucPDG = pdg::SwitchProtonNeutron( finalNucPDG ); Wmin = PDGLibrary::Instance()->Find( finalNucPDG )->Mass(); } @@ -187,8 +187,8 @@ double KPhaseSpace::Threshold(void) const return 0; } if (pi.IsMEC()) { - if (tgt.HitNucIsSet()) { - double Mn = tgt.HitNucP4Ptr()->M(); + if (tgt.HitPartIsSet()) { + double Mn = tgt.HitPartP4Ptr()->M(); double Mn2 = TMath::Power(Mn,2); double Wmin = fInteraction->RecoilNucleon()->Mass(); // mass of the recoil nucleon cluster double smin = TMath::Power(Wmin+ml,2.); @@ -205,7 +205,7 @@ double KPhaseSpace::Threshold(void) const return TMath::Max(0.,Ethr); } if(pi.IsPhotonResonance()) { - double Mn = tgt.HitNucP4Ptr()->M(); + double Mn = tgt.HitPartP4Ptr()->M(); double Ethr = 0.5 * (ml*ml-TMath::Power(Mn,2))/Mn; return TMath::Max(0.,Ethr); } @@ -272,9 +272,7 @@ bool KPhaseSpace::IsAboveThreshold(void) const if (pi.IsCoherentElastic() || pi.IsCoherentProduction() || - pi.IsInverseMuDecay() || - pi.IsIMDAnnihilation() || - pi.IsNuElectronElastic() || + pi.IsNuElectronElastic() || //Leave here since there are no thresholds pi.IsDarkMatterElectronElastic() || pi.IsMEC() || pi.IsPhotonCoherent() || @@ -297,6 +295,12 @@ bool KPhaseSpace::IsAboveThreshold(void) const E = init_state.ProbeE(kRfHitNucRest); } + if(pi.IsInverseMuDecay() || + pi.IsIMDAnnihilation()) + { + E = init_state.ProbeE(kRfHitElRest); + } + LOG("KPhaseSpace", pDEBUG) << "E = " << E << ", Ethr = " << Ethr; return (E>Ethr); } @@ -445,7 +449,7 @@ Range1D_t KPhaseSpace::WLim(void) const if(is_inel) { const InitialState & init_state = fInteraction->InitState(); double Ev = init_state.ProbeE(kRfHitNucRest); - double M = init_state.Tgt().HitNucP4Ptr()->M(); //can be off m/shell + double M = init_state.Tgt().HitPartP4Ptr()->M(); //can be off m/shell double ml = fInteraction->FSPrimLepton()->Mass(); Wl = is_em ? kinematics::electromagnetic::InelWLim(Ev,ml,M) : kinematics::InelWLim(Ev,M,ml); @@ -468,7 +472,7 @@ Range1D_t KPhaseSpace::WLim(void) const if(is_dmdis) { const InitialState & init_state = fInteraction->InitState(); double Ev = init_state.ProbeE(kRfHitNucRest); - double M = init_state.Tgt().HitNucP4Ptr()->M(); //can be off m/shell + double M = init_state.Tgt().HitPartP4Ptr()->M(); //can be off m/shell double ml = fInteraction->FSPrimLepton()->Mass(); Wl = kinematics::DarkWLim(Ev,M,ml); if(fInteraction->ExclTag().IsCharmEvent()) { @@ -520,7 +524,7 @@ Range1D_t KPhaseSpace::Q2Lim_W(void) const const InitialState & init_state = fInteraction->InitState(); double Ev = init_state.ProbeE(kRfHitNucRest); - double M = init_state.Tgt().HitNucP4Ptr()->M(); // can be off m/shell + double M = init_state.Tgt().HitPartP4Ptr()->M(); // can be off m/shell double ml = fInteraction->FSPrimLepton()->Mass(); double W = 0; @@ -573,7 +577,7 @@ Range1D_t KPhaseSpace::Q2Lim(void) const const InitialState & init_state = fInteraction->InitState(); double Ev = init_state.ProbeE(kRfHitNucRest); - double M = init_state.Tgt().HitNucP4Ptr()->M(); // can be off m/shell + double M = init_state.Tgt().HitPartP4Ptr()->M(); // can be off m/shell double ml = fInteraction->FSPrimLepton()->Mass(); if(is_cevns) { @@ -685,7 +689,7 @@ Range1D_t KPhaseSpace::XLim(void) const if(is_inel) { const InitialState & init_state = fInteraction->InitState(); double Ev = init_state.ProbeE(kRfHitNucRest); - double M = init_state.Tgt().HitNucP4Ptr()->M(); // can be off m/shell + double M = init_state.Tgt().HitPartP4Ptr()->M(); // can be off m/shell double ml = fInteraction->FSPrimLepton()->Mass(); xl = is_em ? kinematics::electromagnetic::InelXLim(Ev,ml,M) : kinematics::InelXLim(Ev,M,ml); return xl; @@ -695,7 +699,7 @@ Range1D_t KPhaseSpace::XLim(void) const if(is_dmdis) { const InitialState & init_state = fInteraction->InitState(); double Ev = init_state.ProbeE(kRfHitNucRest); - double M = init_state.Tgt().HitNucP4Ptr()->M(); // can be off m/shell + double M = init_state.Tgt().HitPartP4Ptr()->M(); // can be off m/shell double ml = fInteraction->FSPrimLepton()->Mass(); xl = kinematics::DarkXLim(Ev,M,ml); return xl; @@ -737,7 +741,7 @@ Range1D_t KPhaseSpace::YLim(void) const if(is_inel) { const InitialState & init_state = fInteraction->InitState(); double Ev = init_state.ProbeE(kRfHitNucRest); - double M = init_state.Tgt().HitNucP4Ptr()->M(); // can be off m/shell + double M = init_state.Tgt().HitPartP4Ptr()->M(); // can be off m/shell double ml = fInteraction->FSPrimLepton()->Mass(); yl = is_em ? kinematics::electromagnetic::InelYLim(Ev,ml,M) : kinematics::InelYLim(Ev,M,ml); return yl; @@ -747,7 +751,7 @@ Range1D_t KPhaseSpace::YLim(void) const if(is_dmdis) { const InitialState & init_state = fInteraction->InitState(); double Ev = init_state.ProbeE(kRfHitNucRest); - double M = init_state.Tgt().HitNucP4Ptr()->M(); // can be off m/shell + double M = init_state.Tgt().HitPartP4Ptr()->M(); // can be off m/shell double ml = fInteraction->FSPrimLepton()->Mass(); yl = kinematics::DarkYLim(Ev,M,ml); return yl; @@ -809,7 +813,7 @@ Range1D_t KPhaseSpace::YLim_X(void) const if(is_inel) { const InitialState & init_state = fInteraction->InitState(); double Ev = init_state.ProbeE(kRfHitNucRest); - double M = init_state.Tgt().HitNucP4Ptr()->M(); // can be off m/shell + double M = init_state.Tgt().HitPartP4Ptr()->M(); // can be off m/shell double ml = fInteraction->FSPrimLepton()->Mass(); double x = fInteraction->Kine().x(); yl = is_em ? kinematics::electromagnetic::InelYLim_X(Ev,ml,M,x) : kinematics::InelYLim_X(Ev,M,ml,x); @@ -820,7 +824,7 @@ Range1D_t KPhaseSpace::YLim_X(void) const if(is_dmdis) { const InitialState & init_state = fInteraction->InitState(); double Ev = init_state.ProbeE(kRfHitNucRest); - double M = init_state.Tgt().HitNucP4Ptr()->M(); // can be off m/shell + double M = init_state.Tgt().HitPartP4Ptr()->M(); // can be off m/shell double ml = fInteraction->FSPrimLepton()->Mass(); double x = fInteraction->Kine().x(); yl = kinematics::DarkYLim_X(Ev,M,ml,x); @@ -940,7 +944,7 @@ Range1D_t KPhaseSpace::TLim(void) const double mpi = pionIsCharged ? kPionMass : kPi0Mass; double mpi2 = mpi*mpi; - double M = init_state.Tgt().HitNucMass(); + double M = init_state.Tgt().HitPartMass(); double M2 = M*M; double nuSqPlusQ2 = nu*nu + Q2; double nuOverM = nu / M; diff --git a/src/Framework/Interaction/SppChannel.h b/src/Framework/Interaction/SppChannel.h index f811bb99e..c16a19ae6 100644 --- a/src/Framework/Interaction/SppChannel.h +++ b/src/Framework/Interaction/SppChannel.h @@ -283,7 +283,7 @@ class SppChannel if( xcls_tag.NNucleons() != 1 ) return kSppNull; // get struck nucleon - int hit_nucl_pdgc = init_state.Tgt().HitNucPdg(); + int hit_nucl_pdgc = init_state.Tgt().HitPartPdg(); if( ! pdg::IsNeutronOrProton(hit_nucl_pdgc) ) return kSppNull; bool hit_p = pdg::IsProton(hit_nucl_pdgc); bool hit_n = !hit_p; diff --git a/src/Framework/Interaction/Target.cxx b/src/Framework/Interaction/Target.cxx index e999998eb..61f9b27f5 100644 --- a/src/Framework/Interaction/Target.cxx +++ b/src/Framework/Interaction/Target.cxx @@ -58,12 +58,12 @@ TObject() this->SetId(ZZ,AA); } //___________________________________________________________________________ -Target::Target(int ZZ, int AA, int hit_nucleon_pdgc) : +Target::Target(int ZZ, int AA, int hit_part_pdgc) : TObject() { this->Init(); this->SetId(ZZ,AA); - this->SetHitNucPdg(hit_nucleon_pdgc); + this->SetHitPartPdg(hit_part_pdgc); } //___________________________________________________________________________ Target::Target(const Target & tgt) : @@ -78,9 +78,9 @@ TObject(), fZ(0), fA(0), fTgtPDG(0), -fHitNucPDG(0), +fHitPartPDG(0), fHitSeaQrk(false), -fHitNucP4(0) +fHitPartP4(nullptr) { } @@ -98,51 +98,51 @@ void Target::Reset(void) //___________________________________________________________________________ void Target::Init(void) { - fZ = 0; - fA = 0; - fTgtPDG = 0; - fHitNucPDG = 0; - fHitQrkPDG = 0; - fHitSeaQrk = false; - fHitNucP4 = new TLorentzVector(0,0,0,kNucleonMass); - fHitNucRad = 0.; + fZ = 0; + fA = 0; + fTgtPDG = 0; + fHitPartPDG = 0; + fHitQrkPDG = 0; + fHitSeaQrk = false; + fHitPartP4 = new TLorentzVector(0,0,0,kNucleonMass); + fHitPartRad = 0.; } //___________________________________________________________________________ void Target::CleanUp(void) { - delete fHitNucP4; + delete fHitPartP4; } //___________________________________________________________________________ void Target::Copy(const Target & tgt) { fTgtPDG = tgt.fTgtPDG; + fHitPartPDG = tgt.fHitPartPDG; // struck nucleon PDG if( pdg::IsIon(fTgtPDG) ) { - fZ = tgt.fZ; // copy A,Z - fA = tgt.fA; - fHitNucPDG = tgt.fHitNucPDG; // struck nucleon PDG - fHitQrkPDG = tgt.fHitQrkPDG; // struck quark PDG - fHitSeaQrk = tgt.fHitSeaQrk; // struck quark is from sea? + fZ = tgt.fZ; // copy A,Z + fA = tgt.fA; + fHitQrkPDG = tgt.fHitQrkPDG; // struck quark PDG + fHitSeaQrk = tgt.fHitSeaQrk; // struck quark is from sea? //// valgrind warns about this ... try something else - // (*fHitNucP4) = (*tgt.fHitNucP4); - const TLorentzVector& p4 = *(tgt.fHitNucP4); - // *fHitNucP4 = p4; // nope + // (*fHitPartP4) = (*tgt.fHitPartP4); + const TLorentzVector& p4 = *(tgt.fHitPartP4); + // *fHitPartP4 = p4; // nope //// this works for valgrind - fHitNucP4->SetX(p4.X()); - fHitNucP4->SetY(p4.Y()); - fHitNucP4->SetZ(p4.Z()); - fHitNucP4->SetT(p4.T()); + fHitPartP4->SetX(p4.X()); + fHitPartP4->SetY(p4.Y()); + fHitPartP4->SetZ(p4.Z()); + fHitPartP4->SetT(p4.T()); - fHitNucRad = tgt.fHitNucRad; + fHitPartRad = tgt.fHitPartRad; // look-up the nucleus in the isotopes chart this->ForceNucleusValidity(); - // make sure the hit nucleus constituent object is either - // a nucleon (p or n) or a di-nucleon cluster (p+p, p+n, n+n) - this->ForceHitNucValidity(); + // make sure the hit nucleus constituent object is a valid + // particle usable in the simulation + this->ForceHitPartValidity(); } } //___________________________________________________________________________ @@ -155,7 +155,7 @@ void Target::SetId(int pdgc) } this->ForceNucleusValidity(); // search at the isotopes chart - //this->AutoSetHitNuc(); // struck nuc := tgt for free nucleon tgt + //this->AutoSetHitPart(); // struck nuc := tgt for free nucleon tgt } //___________________________________________________________________________ void Target::SetId(int ZZ, int AA) @@ -165,19 +165,19 @@ void Target::SetId(int ZZ, int AA) fA = AA; this->ForceNucleusValidity(); // search at the isotopes chart - //this->AutoSetHitNuc(); // struck nuc := tgt for free nucleon tgt + //this->AutoSetHitPart(); // struck nuc := tgt for free nucleon tgt } //___________________________________________________________________________ -void Target::SetHitNucPdg(int nucl_pdgc) +void Target::SetHitPartPdg(int pdgc) { - fHitNucPDG = nucl_pdgc; - bool is_valid = this->ForceHitNucValidity(); // p, n or a di-nucleon + fHitPartPDG = pdgc; + bool is_valid = this->ForceHitPartValidity(); // valid particle // If it is a valid struck nucleon pdg code, initialize its 4P: // at-rest + on-mass-shell if(is_valid) { - double M = PDGLibrary::Instance()->Find(nucl_pdgc)->Mass(); - fHitNucP4->SetPxPyPzE(0,0,0,M); + double M = PDGLibrary::Instance()->Find(pdgc)->Mass(); + fHitPartP4->SetPxPyPzE(0,0,0,M); } } //___________________________________________________________________________ @@ -186,10 +186,10 @@ void Target::SetHitQrkPdg(int pdgc) if(pdg::IsQuark(pdgc) || pdg::IsAntiQuark(pdgc)) fHitQrkPDG = pdgc; } //___________________________________________________________________________ -void Target::SetHitNucP4(const TLorentzVector & p4) +void Target::SetHitPartP4(const TLorentzVector & p4) { - if(fHitNucP4) delete fHitNucP4; - fHitNucP4 = new TLorentzVector(p4); + if(fHitPartP4) delete fHitPartP4; + fHitPartP4 = new TLorentzVector(p4); } //___________________________________________________________________________ void Target::SetHitSeaQrk(bool tf) @@ -197,19 +197,19 @@ void Target::SetHitSeaQrk(bool tf) fHitSeaQrk = tf; } //___________________________________________________________________________ -void Target::ForceHitNucOnMassShell(void) +void Target::ForceHitPartOnMassShell(void) { - if(this->HitNucIsSet()) { - double m = this->HitNucMass(); - double p = this->HitNucP4Ptr()->P(); + if(this->HitPartIsSet()) { + double m = this->HitPartMass(); + double p = this->HitPartP4Ptr()->P(); double e = TMath::Sqrt(p*p+m*m); - this->HitNucP4Ptr()->SetE(e); + this->HitPartP4Ptr()->SetE(e); } } //___________________________________________________________________________ -void Target::SetHitNucPosition(double r) +void Target::SetHitPartPosition(double r) { - fHitNucRad = r; + fHitPartRad = r; } //___________________________________________________________________________ double Target::Charge(void) const @@ -230,13 +230,13 @@ double Target::Mass(void) const return 0.; } //___________________________________________________________________________ -double Target::HitNucMass(void) const +double Target::HitPartMass(void) const { - if(!fHitNucPDG) { - LOG("Target", pWARN) << "Returning struck nucleon mass = 0"; + if(!fHitPartPDG) { + LOG("Target", pWARN) << "Returning struck particle mass = 0"; return 0; } - return PDGLibrary::Instance()->Find(fHitNucPDG)->Mass(); + return PDGLibrary::Instance()->Find(fHitPartPDG)->Mass(); } //___________________________________________________________________________ int Target::HitQrkPdg(void) const @@ -244,14 +244,14 @@ int Target::HitQrkPdg(void) const return fHitQrkPDG; } //___________________________________________________________________________ -TLorentzVector * Target::HitNucP4Ptr(void) const +TLorentzVector * Target::HitPartP4Ptr(void) const { - if(!fHitNucP4) { - LOG("Target", pWARN) << "Returning NULL struck nucleon 4-momentum"; + if(!fHitPartP4) { + LOG("Target", pWARN) << "Returning NULL struck particle 4-momentum"; return 0; } - return fHitNucP4; + return fHitPartP4; } //___________________________________________________________________________ bool Target::IsFreeNucleon(void) const @@ -280,11 +280,12 @@ bool Target::IsParticle(void) const return (p && fA==0 && fZ==0); } //___________________________________________________________________________ -bool Target::HitNucIsSet(void) const +bool Target::HitPartIsSet(void) const { bool ok = - pdg::IsNucleon(fHitNucPDG) || - pdg::Is2NucleonCluster (fHitNucPDG); + pdg::IsNucleon(fHitPartPDG) || + pdg::Is2NucleonCluster(fHitPartPDG) || + pdg::IsElectron(fHitPartPDG); return ok; } @@ -301,9 +302,9 @@ bool Target::HitSeaQrk(void) const return fHitSeaQrk; } //___________________________________________________________________________ -int Target::HitNucPdg(void) const +int Target::HitPartPdg(void) const { - return fHitNucPDG; + return fHitPartPDG; } //___________________________________________________________________________ bool Target::IsValidNucleus(void) const @@ -347,14 +348,15 @@ bool Target::IsOddOdd(void) const return false; } //___________________________________________________________________________ -bool Target::ForceHitNucValidity(void) +bool Target::ForceHitPartValidity(void) { -// resets the struck nucleon pdg-code if it is found not to be a valid one +// resets the struck part pdg-code if it is found not to be a valid one bool valid = - pdg::IsNucleon(fHitNucPDG) || - pdg::Is2NucleonCluster (fHitNucPDG) || - (fHitNucPDG==0); /* not set */ + pdg::IsNucleon(fHitPartPDG) || + pdg::Is2NucleonCluster (fHitPartPDG) || + pdg::IsElectron(fHitPartPDG) || + (fHitPartPDG==0); /* not set */ return valid; } @@ -370,13 +372,13 @@ void Target::ForceNucleusValidity(void) } } //___________________________________________________________________________ -void Target::AutoSetHitNuc(void) +void Target::AutoSetHitPart(void) { // for free nucleon targets -> (auto)set struck nucleon = target if( this->IsFreeNucleon() ) { - if( this->IsProton() ) this->SetHitNucPdg(kPdgProton); - else this->SetHitNucPdg(kPdgNeutron); + if( this->IsProton() ) this->SetHitPartPdg(kPdgProton); + else this->SetHitPartPdg(kPdgNeutron); } } //___________________________________________________________________________ @@ -385,8 +387,8 @@ string Target::AsString(void) const ostringstream s; s << this->Pdg(); - if(this->HitNucIsSet()) - s << "[N=" << this->HitNucPdg() << "]"; + if(this->HitPartIsSet()) + s << "[Part=" << this->HitPartPdg() << "]"; if(this->HitQrkIsSet()) { s << "[q=" << this->HitQrkPdg(); s << (this->HitSeaQrk() ? "(s)" : "(v)"); @@ -404,10 +406,10 @@ void Target::Print(ostream & stream) const stream << " Z = " << fZ << ", A = " << fA << endl; } - if( this->HitNucIsSet() ) { - TParticlePDG * p = PDGLibrary::Instance()->Find(fHitNucPDG); - stream << " struck nucleon = " << p->GetName() - << ", P4 = " << utils::print::P4AsString(fHitNucP4) << endl; + if( this->HitPartIsSet() ) { + TParticlePDG * p = PDGLibrary::Instance()->Find(fHitPartPDG); + stream << " struck Part = " << p->GetName() + << ", P4 = " << utils::print::P4AsString(fHitPartP4) << endl; } if( this->HitQrkIsSet() ) { @@ -421,15 +423,15 @@ void Target::Print(ostream & stream) const //___________________________________________________________________________ bool Target::Compare(const Target & target) const { - int tgt_pdg = target.Pdg(); - int struck_nuc_pdg = target.HitNucPdg(); - int struck_qrk_pdg = target.HitQrkPdg(); - bool struck_sea_qrk = target.HitSeaQrk(); + int tgt_pdg = target.Pdg(); + int struck_part_pdg = target.HitPartPdg(); + int struck_qrk_pdg = target.HitQrkPdg(); + bool struck_sea_qrk = target.HitSeaQrk(); - bool equal = ( fTgtPDG == tgt_pdg ) && - ( fHitNucPDG == struck_nuc_pdg ) && - ( fHitQrkPDG == struck_qrk_pdg ) && - ( fHitSeaQrk == struck_sea_qrk ); + bool equal = ( fTgtPDG == tgt_pdg ) && + ( fHitPartPDG == struck_part_pdg ) && + ( fHitQrkPDG == struck_qrk_pdg ) && + ( fHitSeaQrk == struck_sea_qrk ); return equal; } //___________________________________________________________________________ diff --git a/src/Framework/Interaction/Target.h b/src/Framework/Interaction/Target.h index 1552ca145..85b9b9369 100644 --- a/src/Framework/Interaction/Target.h +++ b/src/Framework/Interaction/Target.h @@ -47,21 +47,21 @@ using TObject::Copy; Target(); Target(int pdgc); Target(int Z, int A); - Target(int Z, int A, int hit_nucleon_pdgc); + Target(int Z, int A, int hit_particle_pdgc); Target(const Target & tgt); Target(TRootIOCtor*); ~Target(); //-- Set target properties - void SetId (int pdgc); - void SetId (int Z, int A); - void SetHitNucPdg (int pdgc); - void SetHitNucP4 (const TLorentzVector & p4); - void SetHitNucPosition (double r); - void SetHitQrkPdg (int pdgc); - void SetHitSeaQrk (bool tf); - void ForceHitNucOnMassShell (void); + void SetId (int pdgc); + void SetId (int Z, int A); + void SetHitPartPdg (int pdgc); + void SetHitPartP4 (const TLorentzVector & p4); + void SetHitPartPosition (double r); + void SetHitQrkPdg (int pdgc); + void SetHitSeaQrk (bool tf); + void ForceHitPartOnMassShell (void); //-- Query target information @@ -77,19 +77,19 @@ using TObject::Copy; bool IsNucleus (void) const; bool IsParticle (void) const; bool IsValidNucleus (void) const; - bool HitNucIsSet (void) const; + bool HitPartIsSet (void) const; bool HitQrkIsSet (void) const; bool HitSeaQrk (void) const; bool IsEvenEven (void) const; bool IsEvenOdd (void) const; bool IsOddOdd (void) const; - int HitNucPdg (void) const; + int HitPartPdg (void) const; int HitQrkPdg (void) const; - double HitNucMass (void) const; - double HitNucPosition (void) const { return fHitNucRad; } + double HitPartMass (void) const; + double HitPartPosition(void) const { return fHitPartRad; } - const TLorentzVector & HitNucP4 (void) const { return *this->HitNucP4Ptr(); } - TLorentzVector * HitNucP4Ptr (void) const; + const TLorentzVector & HitPartP4 (void) const { return *this->HitPartP4Ptr(); } + TLorentzVector * HitPartP4Ptr (void) const; //-- Copy, reset, compare, print itself and build string code void Reset (void); @@ -109,21 +109,21 @@ using TObject::Copy; void CleanUp (void); //-- Methods assuring nucleus & hit nucleon validity - void ForceNucleusValidity (void); - bool ForceHitNucValidity (void); - void AutoSetHitNuc (void); + void ForceNucleusValidity (void); + bool ForceHitPartValidity (void); + void AutoSetHitPart (void); //-- Private data members int fZ; ///< nuclear target Z int fA; ///< nuclear target A int fTgtPDG; ///< nuclear target PDG code - int fHitNucPDG; ///< hit nucleon PDG code + int fHitPartPDG; ///< hit particle PDG code int fHitQrkPDG; ///< hit quark PDG code bool fHitSeaQrk; ///< hit quark from sea? - TLorentzVector * fHitNucP4; ///< hit nucleon 4p - double fHitNucRad; ///< hit nucleon position + TLorentzVector *fHitPartP4; ///< hit particle 4p + double fHitPartRad; ///< hit particle position -ClassDef(Target,2) +ClassDef(Target,3) }; } // genie namespace diff --git a/src/Framework/Numerical/MathUtils.cxx b/src/Framework/Numerical/MathUtils.cxx index 7e3174d6e..1cb4b121f 100644 --- a/src/Framework/Numerical/MathUtils.cxx +++ b/src/Framework/Numerical/MathUtils.cxx @@ -15,6 +15,8 @@ #include "Framework/Messenger/Messenger.h" #include "Framework/Numerical/RandomGen.h" #include "Framework/Numerical/MathUtils.h" +#include "TLorentzVector.h" +#include "TVector3.h" //____________________________________________________________________________ TMatrixD genie::utils::math::CholeskyDecomposition(const TMatrixD& cov_matrix) @@ -284,3 +286,20 @@ double genie::utils::math::NonNegative(float x) return TMath::Max( (float)0., x); } //____________________________________________________________________________ +TLorentzVector genie::utils::math::GetOrthogonal(const TLorentzVector &lv, const TVector3 &unitVec) { + // Returns TLorentz vector that is orthogonal to a given unit vector in 3d + auto lv3d = lv.Vect(); + auto par_mom_module = lv3d.Dot(unitVec); + TVector3 par_mom(0., 0., par_mom_module); + par_mom.RotateUz(unitVec); + auto orthogonal_mom_3d = lv3d - par_mom; + return TLorentzVector(orthogonal_mom_3d, lv.E()); +} +//____________________________________________________________________________ +TLorentzVector genie::utils::math::GetParallel(const TLorentzVector &lv, const TVector3 &unitVec) { + // Returns TLorentz vector that is parallel to a given unit vector in 3d + auto lv3d = lv.Vect(); + auto par_mom_module = lv3d.Dot(unitVec); + TVector3 par_mom = par_mom_module * unitVec; + return TLorentzVector(par_mom, lv.E()); +} \ No newline at end of file diff --git a/src/Framework/Numerical/MathUtils.h b/src/Framework/Numerical/MathUtils.h index 805a90b75..73c9ecf3f 100644 --- a/src/Framework/Numerical/MathUtils.h +++ b/src/Framework/Numerical/MathUtils.h @@ -22,6 +22,7 @@ #include #include #include +#include #include "Framework/Utils/Range1.h" #include "cmath" @@ -128,6 +129,9 @@ namespace math double NonNegative (double x); double NonNegative (float x); + TLorentzVector GetParallel(const TLorentzVector &lv, const TVector3 &unitVec); + TLorentzVector GetOrthogonal(const TLorentzVector &lv, const TVector3 &unitVec); + } // math namespace } // utils namespace } // genie namespace diff --git a/src/Framework/Utils/KineUtils.cxx b/src/Framework/Utils/KineUtils.cxx index 5b5917134..b340518c3 100644 --- a/src/Framework/Utils/KineUtils.cxx +++ b/src/Framework/Utils/KineUtils.cxx @@ -86,7 +86,7 @@ double genie::utils::kinematics::PhaseSpaceVolume( const InitialState & init_state = in->InitState(); double Ev = init_state.ProbeE(kRfHitNucRest); - double M = init_state.Tgt().HitNucP4Ptr()->M(); + double M = init_state.Tgt().HitPartP4Ptr()->M(); const int kNx = 100; const int kNy = 100; @@ -217,7 +217,7 @@ double genie::utils::kinematics::Jacobian( { const InitialState & init_state = i->InitState(); double Ev = init_state.ProbeE(kRfHitNucRest); - double M = init_state.Tgt().HitNucP4Ptr()->M(); + double M = init_state.Tgt().HitPartP4Ptr()->M(); double x = kine.x(); J = 2*x*Ev*M; } @@ -230,7 +230,7 @@ double genie::utils::kinematics::Jacobian( { const InitialState & init_state = i->InitState(); double Ev = init_state.ProbeE(kRfHitNucRest); - double M = init_state.Tgt().HitNucP4Ptr()->M(); + double M = init_state.Tgt().HitPartP4Ptr()->M(); double y = kine.y(); J = 2*y*Ev*M; } @@ -260,7 +260,7 @@ double genie::utils::kinematics::Jacobian( { const InitialState & init_state = i->InitState(); double Ev = init_state.ProbeE(kRfHitNucRest); - double M = init_state.Tgt().HitNucP4Ptr()->M(); + double M = init_state.Tgt().HitPartP4Ptr()->M(); double y = kine.y(); J = TMath::Power(2*M*Ev,2) * y; } @@ -273,7 +273,7 @@ double genie::utils::kinematics::Jacobian( { const InitialState & init_state = i->InitState(); double Ev = init_state.ProbeE(kRfHitNucRest); - double M = init_state.Tgt().HitNucP4Ptr()->M(); + double M = init_state.Tgt().HitPartP4Ptr()->M(); double y = kine.y(); double W = kine.W(); J = 2*TMath::Power(M*Ev,2) * y/W; @@ -306,7 +306,7 @@ double genie::utils::kinematics::Jacobian( double pv = std::sqrt( std::max(0., Ev*Ev - mv*mv) ); // Invariant mass of the initial hit nucleon - const TLorentzVector& hit_nuc_P4 = init_state.Tgt().HitNucP4(); + const TLorentzVector& hit_nuc_P4 = init_state.Tgt().HitPartP4(); double M = hit_nuc_P4.M(); // Outgoing lepton mass @@ -1087,7 +1087,7 @@ double genie::utils::kinematics::Q2(const Interaction * const interaction) } if (kinematics.KVSet(kKVy)) { const InitialState & init_state = interaction->InitState(); - double Mn = init_state.Tgt().HitNucP4Ptr()->M(); // can be off m/shell + double Mn = init_state.Tgt().HitPartP4Ptr()->M(); // can be off m/shell double x = kinematics.x(); double y = kinematics.y(); double Ev = init_state.ProbeE(kRfHitNucRest); @@ -1117,7 +1117,7 @@ double genie::utils::kinematics::W(const Interaction * const interaction) if(kinematics.KVSet(kKVx) && kinematics.KVSet(kKVy)) { const InitialState & init_state = interaction->InitState(); double Ev = init_state.ProbeE(kRfHitNucRest); - double M = init_state.Tgt().HitNucP4Ptr()->M(); + double M = init_state.Tgt().HitPartP4Ptr()->M(); double M2 = M*M; double x = kinematics.x(); double y = kinematics.y(); @@ -1294,7 +1294,7 @@ void genie::utils::kinematics::UpdateWQ2FromXY(const Interaction * in) if(kine->KVSet(kKVx) && kine->KVSet(kKVy)) { const InitialState & init_state = in->InitState(); double Ev = init_state.ProbeE(kRfHitNucRest); - double M = init_state.Tgt().HitNucP4Ptr()->M(); // can be off mass shell + double M = init_state.Tgt().HitPartP4Ptr()->M(); // can be off mass shell double x = kine->x(); double y = kine->y(); @@ -1312,7 +1312,7 @@ void genie::utils::kinematics::UpdateXYFromWQ2(const Interaction * in) if(kine->KVSet(kKVW) && kine->KVSet(kKVQ2)) { const InitialState & init_state = in->InitState(); double Ev = init_state.ProbeE(kRfHitNucRest); - double M = init_state.Tgt().HitNucP4Ptr()->M(); // can be off mass shell + double M = init_state.Tgt().HitPartP4Ptr()->M(); // can be off mass shell double W = kine->W(); double Q2 = kine->Q2(); @@ -1330,7 +1330,7 @@ void genie::utils::kinematics::UpdateWYFromXQ2(const Interaction * in) if(kine->KVSet(kKVx) && kine->KVSet(kKVQ2)) { const InitialState & init_state = in->InitState(); double Ev = init_state.ProbeE(kRfHitNucRest); - double M = init_state.Tgt().HitNucP4Ptr()->M(); // can be off mass shell + double M = init_state.Tgt().HitPartP4Ptr()->M(); // can be off mass shell double x = kine->x(); double Q2 = kine->Q2(); @@ -1357,7 +1357,7 @@ void genie::utils::kinematics::UpdateXFromQ2Y(const Interaction * in) Ev = init_state.ProbeE(kRfLab); } else { - M = in->InitState().Tgt().HitNucP4Ptr()->M(); //can be off m/shell + M = in->InitState().Tgt().HitPartP4Ptr()->M(); //can be off m/shell Ev = init_state.ProbeE(kRfHitNucRest); } diff --git a/src/Physics/AnomalyMediatedNuGamma/XSection/H3AMNuGammaPXSec.cxx b/src/Physics/AnomalyMediatedNuGamma/XSection/H3AMNuGammaPXSec.cxx index ada4219dd..8fcf1d933 100644 --- a/src/Physics/AnomalyMediatedNuGamma/XSection/H3AMNuGammaPXSec.cxx +++ b/src/Physics/AnomalyMediatedNuGamma/XSection/H3AMNuGammaPXSec.cxx @@ -76,7 +76,7 @@ double H3AMNuGammaPXSec::Integral(const Interaction * interaction) const if( interaction->TestBit(kIAssumeFreeNucleon) ) return xsec; // Scale for the number of scattering centers at the target - int nucpdgc = target.HitNucPdg(); + int nucpdgc = target.HitPartPdg(); int NNucl = (pdg::IsProton(nucpdgc)) ? target.Z() : target.N(); xsec*=NNucl; diff --git a/src/Physics/BoostedDarkMatter/EventGen/DMDISInteractionListGenerator.cxx b/src/Physics/BoostedDarkMatter/EventGen/DMDISInteractionListGenerator.cxx index 53387fd51..461adf474 100644 --- a/src/Physics/BoostedDarkMatter/EventGen/DMDISInteractionListGenerator.cxx +++ b/src/Physics/BoostedDarkMatter/EventGen/DMDISInteractionListGenerator.cxx @@ -82,7 +82,7 @@ InteractionList * DMDISInteractionListGenerator::CreateInteractionList( Interaction * interaction = new Interaction(init_state, proc_info); Target * target = interaction->InitStatePtr()->TgtPtr(); - target->SetHitNucPdg(struck_nucleon); + target->SetHitPartPdg(struck_nucleon); if(fIsCharm) { XclsTag exclusive_tag; diff --git a/src/Physics/BoostedDarkMatter/EventGen/DMDISKinematicsGenerator.cxx b/src/Physics/BoostedDarkMatter/EventGen/DMDISKinematicsGenerator.cxx index 581123976..56728b6de 100644 --- a/src/Physics/BoostedDarkMatter/EventGen/DMDISKinematicsGenerator.cxx +++ b/src/Physics/BoostedDarkMatter/EventGen/DMDISKinematicsGenerator.cxx @@ -77,7 +77,7 @@ void DMDISKinematicsGenerator::ProcessEventRecord(GHepRecord * evrec) const //-- Get dark matter energy and hit 'nucleon mass' const InitialState & init_state = interaction->InitState(); double Ev = init_state.ProbeE(kRfHitNucRest); - double M = init_state.Tgt().HitNucP4().M(); // can be off m-shell + double M = init_state.Tgt().HitPartP4().M(); // can be off m-shell //-- Get the physical W range const KPhaseSpace & kps = interaction->PhaseSpace(); diff --git a/src/Physics/BoostedDarkMatter/EventGen/DMEInteractionListGenerator.cxx b/src/Physics/BoostedDarkMatter/EventGen/DMEInteractionListGenerator.cxx index 0f1a9232e..1d6885f17 100644 --- a/src/Physics/BoostedDarkMatter/EventGen/DMEInteractionListGenerator.cxx +++ b/src/Physics/BoostedDarkMatter/EventGen/DMEInteractionListGenerator.cxx @@ -65,7 +65,7 @@ InteractionList * DMEInteractionListGenerator::DMEELInteractionList( // clone init state and de-activate the struck nucleon info InitialState init(init_state); - init_state.TgtPtr()->SetHitNucPdg(0); + init_state.TgtPtr()->SetHitPartPdg(0); if(nupdg == kPdgDarkMatter || nupdg == kPdgAntiDarkMatter) { ProcessInfo proc_info(kScDarkMatterElectron, kIntDarkMatter); diff --git a/src/Physics/BoostedDarkMatter/EventGen/DMELEventGenerator.cxx b/src/Physics/BoostedDarkMatter/EventGen/DMELEventGenerator.cxx index ad08646dc..da0a53577 100644 --- a/src/Physics/BoostedDarkMatter/EventGen/DMELEventGenerator.cxx +++ b/src/Physics/BoostedDarkMatter/EventGen/DMELEventGenerator.cxx @@ -101,7 +101,7 @@ void DMELEventGenerator::ProcessEventRecord(GHepRecord * evrec) const // cross section (important when using the local Fermi gas model) Target* tgt = interaction->InitState().TgtPtr(); double hitNucPos = nucleon->X4()->Vect().Mag(); - tgt->SetHitNucPosition( hitNucPos ); + tgt->SetHitPartPosition( hitNucPos ); //-- For the subsequent kinematic selection with the rejection method: // Calculate the max differential cross section or retrieve it from the @@ -216,7 +216,7 @@ void DMELEventGenerator::ProcessEventRecord(GHepRecord * evrec) const // struck nucleon mass (can be off the mass shell) const InitialState & init_state = interaction->InitState(); double E = init_state.ProbeE(kRfHitNucRest); - double M = init_state.Tgt().HitNucP4().M(); + double M = init_state.Tgt().HitPartP4().M(); LOG("DMELKinematics", pNOTICE) << "E = " << E << ", M = "<< M; // The hadronic inv. mass is equal to the recoil nucleon on-shell mass. @@ -263,7 +263,7 @@ void DMELEventGenerator::ProcessEventRecord(GHepRecord * evrec) const -1, -1, -1, interaction->KinePtr()->HadSystP4(), x4l); // Store struck nucleon momentum and binding energy - TLorentzVector p4ptr = interaction->InitStatePtr()->TgtPtr()->HitNucP4(); + TLorentzVector p4ptr = interaction->InitStatePtr()->TgtPtr()->HitPartP4(); LOG("DMELEvent",pNOTICE) << "pn: " << p4ptr.X() << ", " << p4ptr.Y() << ", " << p4ptr.Z() << ", " << p4ptr.E(); nucleon->SetMomentum(p4ptr); @@ -443,7 +443,7 @@ double DMELEventGenerator::ComputeMaxXSec(const Interaction * in) const // TODO: document this, won't work for spectral functions double dummy_w = -1.; double prob = fNuclModel->Prob(pNi_next, dummy_w, tgt, - tgt.HitNucPosition()); + tgt.HitPartPosition()); double costh0_max = genie::utils::CosTheta0Max( *interaction ); diff --git a/src/Physics/BoostedDarkMatter/EventGen/DMELInteractionListGenerator.cxx b/src/Physics/BoostedDarkMatter/EventGen/DMELInteractionListGenerator.cxx index 6fc3cc6fd..d8728979b 100644 --- a/src/Physics/BoostedDarkMatter/EventGen/DMELInteractionListGenerator.cxx +++ b/src/Physics/BoostedDarkMatter/EventGen/DMELInteractionListGenerator.cxx @@ -91,7 +91,7 @@ InteractionList * DMELInteractionListGenerator::CreateInteractionListDM( delete interaction; continue; } - target->SetHitNucPdg(nuclpdg[i]); + target->SetHitPartPdg(nuclpdg[i]); intlist->push_back(interaction); } diff --git a/src/Physics/BoostedDarkMatter/EventGen/DMELKinematicsGenerator.cxx b/src/Physics/BoostedDarkMatter/EventGen/DMELKinematicsGenerator.cxx index 27bac5ecb..96da43432 100644 --- a/src/Physics/BoostedDarkMatter/EventGen/DMELKinematicsGenerator.cxx +++ b/src/Physics/BoostedDarkMatter/EventGen/DMELKinematicsGenerator.cxx @@ -77,7 +77,7 @@ void DMELKinematicsGenerator::ProcessEventRecord(GHepRecord * evrec) const // store the struck nucleon position for use by the xsec method double hitNucPos = evrec->HitNucleon()->X4()->Vect().Mag(); - interaction->InitStatePtr()->TgtPtr()->SetHitNucPosition(hitNucPos); + interaction->InitStatePtr()->TgtPtr()->SetHitPartPosition(hitNucPos); //-- Note: The kinematic generator would be using the free nucleon cross // section (even for nuclear targets) so as not to double-count nuclear @@ -185,7 +185,7 @@ void DMELKinematicsGenerator::ProcessEventRecord(GHepRecord * evrec) const // struck nucleon mass (can be off the mass shell) const InitialState & init_state = interaction->InitState(); double E = init_state.ProbeE(kRfHitNucRest); - double M = init_state.Tgt().HitNucP4().M(); + double M = init_state.Tgt().HitPartP4().M(); LOG("DMELKinematics", pNOTICE) << "E = " << E << ", M = "<< M; @@ -255,7 +255,7 @@ void DMELKinematicsGenerator::SpectralFuncExperimentalCode( // store the struck nucleon position for use by the xsec method double hitNucPos = evrec->HitNucleon()->X4()->Vect().Mag(); - interaction->InitStatePtr()->TgtPtr()->SetHitNucPosition(hitNucPos); + interaction->InitStatePtr()->TgtPtr()->SetHitPartPosition(hitNucPos); //-- Note: The kinematic generator would be using the free nucleon cross // section (even for nuclear targets) so as not to double-count nuclear @@ -267,14 +267,14 @@ void DMELKinematicsGenerator::SpectralFuncExperimentalCode( interaction->SetBit(kIAssumeFreeNucleon); //-- Assume scattering off a nucleon on the mass shell (PWIA prescription) - double Mn = interaction->InitState().Tgt().HitNucMass(); // PDG mass, take it to be on-shell - double pxn = interaction->InitState().Tgt().HitNucP4().Px(); - double pyn = interaction->InitState().Tgt().HitNucP4().Py(); - double pzn = interaction->InitState().Tgt().HitNucP4().Pz(); - double En = interaction->InitState().Tgt().HitNucP4().Energy(); + double Mn = interaction->InitState().Tgt().HitPartMass(); // PDG mass, take it to be on-shell + double pxn = interaction->InitState().Tgt().HitPartP4().Px(); + double pyn = interaction->InitState().Tgt().HitPartP4().Py(); + double pzn = interaction->InitState().Tgt().HitPartP4().Pz(); + double En = interaction->InitState().Tgt().HitPartP4().Energy(); double En0 = TMath::Sqrt(pxn*pxn + pyn*pyn + pzn*pzn + Mn*Mn); double Eb = En0 - En; - interaction->InitStatePtr()->TgtPtr()->HitNucP4Ptr()->SetE(En0); + interaction->InitStatePtr()->TgtPtr()->HitPartP4Ptr()->SetE(En0); double ml = interaction->FSPrimLepton()->Mass(); //-- Get the limits for the generated Q2 diff --git a/src/Physics/BoostedDarkMatter/XSection/AhrensDMELPXSec.cxx b/src/Physics/BoostedDarkMatter/XSection/AhrensDMELPXSec.cxx index f0dd132e3..084d8d118 100644 --- a/src/Physics/BoostedDarkMatter/XSection/AhrensDMELPXSec.cxx +++ b/src/Physics/BoostedDarkMatter/XSection/AhrensDMELPXSec.cxx @@ -66,7 +66,7 @@ double AhrensDMELPXSec::XSec( double E = init_state.ProbeE(kRfHitNucRest); double ml = init_state.GetProbeP4(kRfHitNucRest)->M(); double Q2 = kinematics.Q2(); - double M = target.HitNucMass(); + double M = target.HitPartMass(); double M2 = TMath::Power(M, 2.); double E2 = TMath::Power(E, 2.); double ml2 = TMath::Power(ml,2.); @@ -78,7 +78,7 @@ double AhrensDMELPXSec::XSec( int nusign = 1; int nucsign = 1; int nupdgc = init_state.ProbePdg(); - int nucpdgc = target.HitNucPdg(); + int nucpdgc = target.HitPartPdg(); if( pdg::IsAntiDarkMatter(nupdgc) ) nusign = -1; if( pdg::IsNeutron(nucpdgc) ) nucsign = -1; diff --git a/src/Physics/BoostedDarkMatter/XSection/DMDISXSec.cxx b/src/Physics/BoostedDarkMatter/XSection/DMDISXSec.cxx index 29be83475..b44169435 100644 --- a/src/Physics/BoostedDarkMatter/XSection/DMDISXSec.cxx +++ b/src/Physics/BoostedDarkMatter/XSection/DMDISXSec.cxx @@ -71,9 +71,8 @@ double DMDISXSec::Integrate( const InitialState & init_state = in->InitState(); double Ed = init_state.ProbeE(kRfHitNucRest); - int nucpdgc = init_state.Tgt().HitNucPdg(); - int NNucl = (pdg::IsProton(nucpdgc)) ? - init_state.Tgt().Z() : init_state.Tgt().N(); + int nucpdgc = init_state.Tgt().HitPartPdg(); + int NNucl = (pdg::IsProton(nucpdgc)) ? init_state.Tgt().Z() : init_state.Tgt().N(); // If the input interaction is off a nuclear target, then chek whether // the corresponding free nucleon cross section already exists at the @@ -230,7 +229,7 @@ void DMDISXSec::CacheFreeNucleonXSec( // Tweak interaction to be on a free nucleon target Target * target = interaction->InitStatePtr()->TgtPtr(); - int nucpdgc = target->HitNucPdg(); + int nucpdgc = target->HitPartPdg(); if(pdg::IsProton(nucpdgc)) { target->SetId(kPdgTgtFreeP); } else { target->SetId(kPdgTgtFreeN); } diff --git a/src/Physics/BoostedDarkMatter/XSection/DMELUtils.cxx b/src/Physics/BoostedDarkMatter/XSection/DMELUtils.cxx index d2d5b83b7..56f986586 100644 --- a/src/Physics/BoostedDarkMatter/XSection/DMELUtils.cxx +++ b/src/Physics/BoostedDarkMatter/XSection/DMELUtils.cxx @@ -36,7 +36,7 @@ namespace { TVector3 COMframe2Lab(const genie::InitialState& initialState) { TLorentzVector* k4 = initialState.GetProbeP4( genie::kRfLab ); - TLorentzVector* p4 = initialState.TgtPtr()->HitNucP4Ptr(); + TLorentzVector* p4 = initialState.TgtPtr()->HitPartP4Ptr(); TLorentzVector totMom = *k4 + *p4; TVector3 beta = totMom.BoostVector(); @@ -59,7 +59,7 @@ double genie::utils::EnergyDeltaFunctionSolutionDMEL( // vice-versa TLorentzVector* probe = inter.InitStatePtr()->GetProbeP4( kRfLab ); const TLorentzVector& hit_nucleon = inter.InitStatePtr()->TgtPtr() - ->HitNucP4(); + ->HitPartP4(); TLorentzVector total_p4 = (*probe) + hit_nucleon; TVector3 beta_COM_to_lab = total_p4.BoostVector(); TVector3 beta_lab_to_COM = -beta_COM_to_lab; @@ -242,10 +242,10 @@ double genie::utils::CosTheta0Max(const genie::Interaction& interaction) { // Possibly off-shell initial struck nucleon total energy // (BindHitNucleon() should have been called previously if needed) - const TLorentzVector& p4Ni = interaction.InitState().Tgt().HitNucP4(); + const TLorentzVector& p4Ni = interaction.InitState().Tgt().HitPartP4(); double ENi = p4Ni.E(); // On-shell mass of initial struck nucleon - double mNi = interaction.InitState().Tgt().HitNucMass(); + double mNi = interaction.InitState().Tgt().HitPartMass(); // On-shell initial struck nucleon energy double ENi_on_shell = std::sqrt( mNi*mNi + p4Ni.Vect().Mag2() ); // Energy needed to put initial nucleon on the mass shell @@ -261,14 +261,14 @@ void genie::utils::BindHitNucleon(genie::Interaction& interaction, genie::DMELEvGen_BindingMode_t hitNucleonBindingMode) { genie::Target* tgt = interaction.InitState().TgtPtr(); - TLorentzVector* p4Ni = tgt->HitNucP4Ptr(); + TLorentzVector* p4Ni = tgt->HitPartP4Ptr(); // Initial nucleon 3-momentum (lab frame) TVector3 p3Ni = nucl_model.Momentum3(); // Look up the (on-shell) mass of the initial nucleon TDatabasePDG* tb = TDatabasePDG::Instance(); - double mNi = tb->GetParticle( tgt->HitNucPdg() )->Mass(); + double mNi = tb->GetParticle( tgt->HitPartPdg() )->Mass(); // Set the (possibly off-shell) initial nucleon energy based on // the selected binding energy mode. Always put the initial nucleon @@ -306,7 +306,7 @@ void genie::utils::BindHitNucleon(genie::Interaction& interaction, // Determine the mass and proton numbers for the remnant nucleus int Af = tgt->A() - 1; int Zf = tgt->Z(); - if ( genie::pdg::IsProton( tgt->HitNucPdg()) ) --Zf; + if ( genie::pdg::IsProton( tgt->HitPartPdg()) ) --Zf; Mf = genie::PDGLibrary::Instance()->Find( genie::pdg::IonPdgCode(Af, Zf) )->Mass(); // Deduce the binding energy from the final nucleus mass diff --git a/src/Physics/BoostedDarkMatter/XSection/QPMDMDISPXSec.cxx b/src/Physics/BoostedDarkMatter/XSection/QPMDMDISPXSec.cxx index fe3a6550c..11f81e3c8 100644 --- a/src/Physics/BoostedDarkMatter/XSection/QPMDMDISPXSec.cxx +++ b/src/Physics/BoostedDarkMatter/XSection/QPMDMDISPXSec.cxx @@ -78,7 +78,7 @@ double QPMDMDISPXSec::XSec( double E = init_state.ProbeE(kRfHitNucRest); double ml = interaction->FSPrimLepton()->Mass(); - double Mnuc = init_state.Tgt().HitNucMass(); + double Mnuc = init_state.Tgt().HitPartMass(); double x = kinematics.x(); double y = kinematics.y(); @@ -202,7 +202,7 @@ double QPMDMDISPXSec::XSec( // Compute nuclear cross section (simple scaling here, corrections must // have been included in the structure functions) const Target & target = init_state.Tgt(); - int nucpdgc = target.HitNucPdg(); + int nucpdgc = target.HitPartPdg(); int NNucl = (pdg::IsProton(nucpdgc)) ? target.Z() : target.N(); xsec *= NNucl; @@ -240,9 +240,7 @@ bool QPMDMDISPXSec::ValidProcess(const Interaction * interaction) const int probe_pdg = init_state.ProbePdg(); if(!pdg::IsDarkMatter(probe_pdg) && !pdg::IsAntiDarkMatter(probe_pdg)) return false; - if(! init_state.Tgt().HitNucIsSet()) return false; - - int hitnuc_pdg = init_state.Tgt().HitNucPdg(); + int hitnuc_pdg = init_state.Tgt().HitPartPdg(); if(!pdg::IsNeutronOrProton(hitnuc_pdg)) return false; return true; diff --git a/src/Physics/BoostedDarkMatter/XSection/QPMDMDISStrucFuncBase.cxx b/src/Physics/BoostedDarkMatter/XSection/QPMDMDISStrucFuncBase.cxx index abe11427c..07e761767 100644 --- a/src/Physics/BoostedDarkMatter/XSection/QPMDMDISStrucFuncBase.cxx +++ b/src/Physics/BoostedDarkMatter/XSection/QPMDMDISStrucFuncBase.cxx @@ -145,7 +145,7 @@ void QPMDMDISStrucFuncBase::Calculate(const Interaction * interaction) const const InitialState & init_state = interaction->InitState(); const Target & tgt = init_state.Tgt(); - int nuc_pdgc = tgt.HitNucPdg(); + int nuc_pdgc = tgt.HitPartPdg(); int probe_pdgc = init_state.ProbePdg(); bool is_p = pdg::IsProton ( nuc_pdgc ); bool is_n = pdg::IsNeutron ( nuc_pdgc ); @@ -328,7 +328,7 @@ double QPMDMDISStrucFuncBase::Q2(const Interaction * interaction) const // if Q2 was not set, then compute it from x,y,Ev,Mnucleon if (kinematics.KVSet(kKVy)) { const InitialState & init_state = interaction->InitState(); - double Mn = init_state.Tgt().HitNucP4Ptr()->M(); // could be off-shell + double Mn = init_state.Tgt().HitPartP4Ptr()->M(); // could be off-shell //double x = this->ScalingVar(interaction); // could be redefined double x = kinematics.x(); double y = kinematics.y(); @@ -421,7 +421,7 @@ void QPMDMDISStrucFuncBase::CalcPDFs(const Interaction * interaction) const // Get the hit nucleon mass (could be off-shell) const Target & tgt = interaction->InitState().Tgt(); - double M = tgt.HitNucP4().M(); + double M = tgt.HitPartP4().M(); // Get the Q2 for which PDFs will be evaluated double Q2pdf = TMath::Max(Q2val, fQ2min); @@ -526,7 +526,7 @@ void QPMDMDISStrucFuncBase::CalcPDFs(const Interaction * interaction) const // The above are the proton parton density function. Get the PDFs for the // hit nucleon (p or n) by swapping u<->d if necessary - int nuc_pdgc = tgt.HitNucPdg(); + int nuc_pdgc = tgt.HitPartPdg(); bool isP = pdg::IsProton (nuc_pdgc); bool isN = pdg::IsNeutron (nuc_pdgc); assert(isP || isN); diff --git a/src/Physics/Charm/XSection/AivazisCharmPXSecLO.cxx b/src/Physics/Charm/XSection/AivazisCharmPXSecLO.cxx index 3b483cb7e..4a83e8bdc 100644 --- a/src/Physics/Charm/XSection/AivazisCharmPXSecLO.cxx +++ b/src/Physics/Charm/XSection/AivazisCharmPXSecLO.cxx @@ -64,7 +64,7 @@ double AivazisCharmPXSecLO::XSec( //----- get target information (hit nucleon and quark) int nu = init_state.ProbePdg(); - int nuc = target.HitNucPdg(); + int nuc = target.HitPartPdg(); bool isP = pdg::IsProton (nuc); bool isN = pdg::IsNeutron(nuc); bool qset = target.HitQrkIsSet(); @@ -82,7 +82,7 @@ double AivazisCharmPXSecLO::XSec( double x = kinematics.x(); double y = kinematics.y(); double x2 = TMath::Power(x, 2); - double Mnuc = target.HitNucMass(); + double Mnuc = target.HitPartMass(); double Mnuc2 = TMath::Power(Mnuc, 2); double Q2 = 2*Mnuc*E*x*y; double inverse_eta = 0.5/x + TMath::Sqrt( 0.25/x2 + Mnuc2/Q2 ); @@ -180,7 +180,7 @@ bool AivazisCharmPXSecLO::ValidProcess(const Interaction * interaction) const if(!is_inclusive_charm) return false; int nu = init_state.ProbePdg(); - int nuc = init_state.Tgt().HitNucPdg(); + int nuc = init_state.Tgt().HitPartPdg(); if (!pdg::IsProton(nuc) && !pdg::IsNeutron(nuc)) return false; if (!pdg::IsNeutrino(nu) && !pdg::IsAntiNeutrino(nu)) return false; diff --git a/src/Physics/Charm/XSection/KovalenkoQELCharmPXSec.cxx b/src/Physics/Charm/XSection/KovalenkoQELCharmPXSec.cxx index 2f7434c5a..0b59d4c6c 100644 --- a/src/Physics/Charm/XSection/KovalenkoQELCharmPXSec.cxx +++ b/src/Physics/Charm/XSection/KovalenkoQELCharmPXSec.cxx @@ -50,8 +50,8 @@ KovalenkoQELCharmPXSec::~KovalenkoQELCharmPXSec() } //____________________________________________________________________________ -double KovalenkoQELCharmPXSec::XSec( - const Interaction * interaction, KinePhaseSpace_t kps) const +double KovalenkoQELCharmPXSec::XSec( const Interaction * interaction, + KinePhaseSpace_t kps) const { if(! this -> ValidProcess (interaction) ) return 0.; if(! this -> ValidKinematics (interaction) ) return 0.; @@ -73,7 +73,7 @@ double KovalenkoQELCharmPXSec::XSec( //resonance mass & nucleon mass double MR = this->MRes (interaction); double MR2 = TMath::Power(MR,2); - double Mnuc = target.HitNucMass(); + double Mnuc = target.HitPartMass(); double Mnuc2 = TMath::Power(Mnuc,2); #ifdef __GENIE_LOW_LEVEL_MESG_ENABLED__ @@ -110,7 +110,7 @@ double KovalenkoQELCharmPXSec::XSec( if( interaction->TestBit(kIAssumeFreeNucleon) ) return xsec; //----- Nuclear cross section (simple scaling here) - int nuc = target.HitNucPdg(); + int nuc = target.HitPartPdg(); int NNucl = (pdg::IsProton(nuc)) ? target.Z() : target.N(); xsec *= NNucl; @@ -129,8 +129,8 @@ double KovalenkoQELCharmPXSec::ZR(const Interaction * interaction) const const InitialState & init_state = interaction->InitState(); int pdgc = xcls.CharmHadronPdg(); - bool isP = pdg::IsProton ( init_state.Tgt().HitNucPdg() ); - bool isN = pdg::IsNeutron( init_state.Tgt().HitNucPdg() ); + bool isP = pdg::IsProton ( init_state.Tgt().HitPartPdg() ); + bool isN = pdg::IsNeutron( init_state.Tgt().HitPartPdg() ); if ( pdgc == kPdgLambdaPc && isN ) return fScLambdaP; else if ( pdgc == kPdgSigmaPc && isN ) return fScSigmaP; @@ -150,7 +150,7 @@ double KovalenkoQELCharmPXSec::DR(const Interaction * interaction) const const Kinematics & kinematics = interaction->Kine(); double Q2 = kinematics.Q2(); - double Mnuc = init_state.Tgt().HitNucMass(); + double Mnuc = init_state.Tgt().HitPartMass(); double Mnuc2 = TMath::Power(Mnuc,2); double MR = this->MRes(interaction); double DeltaR = this->ResDM(interaction); @@ -167,7 +167,7 @@ double KovalenkoQELCharmPXSec::DR(const Interaction * interaction) const LOG("QELCharmXSec", pDEBUG) << "Integration limits = [" << xi_bar_plus << ", " << xi_bar_minus << "]"; - int pdgc = init_state.Tgt().HitNucPdg(); + int pdgc = init_state.Tgt().HitPartPdg(); ROOT::Math::IBaseFunctionOneDim * integrand = new utils::gsl::wrap::KovQELCharmIntegrand(&pdfs,Q2,pdgc); @@ -251,8 +251,8 @@ bool KovalenkoQELCharmPXSec::ValidProcess( if(!proc_info.IsQuasiElastic()) return false; if(!proc_info.IsWeak()) return false; - bool isP = pdg::IsProton ( init_state.Tgt().HitNucPdg() ); - bool isN = pdg::IsNeutron( init_state.Tgt().HitNucPdg() ); + bool isP = pdg::IsProton ( init_state.Tgt().HitPartPdg() ); + bool isN = pdg::IsNeutron( init_state.Tgt().HitPartPdg() ); int pdgc = xcls.CharmHadronPdg(); @@ -275,7 +275,7 @@ bool KovalenkoQELCharmPXSec::ValidKinematics( //resonance, final state primary lepton & nucleon mass double MR = this -> MRes (interaction); double ml = interaction->FSPrimLepton()->Mass(); - double Mnuc = init_state.Tgt().HitNucP4Ptr()->M(); + double Mnuc = init_state.Tgt().HitPartP4Ptr()->M(); double Mnuc2 = TMath::Power(Mnuc,2); //resonance threshold diff --git a/src/Physics/Charm/XSection/SlowRsclCharmDISPXSecLO.cxx b/src/Physics/Charm/XSection/SlowRsclCharmDISPXSecLO.cxx index 7a749150f..e4f07723b 100644 --- a/src/Physics/Charm/XSection/SlowRsclCharmDISPXSecLO.cxx +++ b/src/Physics/Charm/XSection/SlowRsclCharmDISPXSecLO.cxx @@ -62,7 +62,7 @@ double SlowRsclCharmDISPXSecLO::XSec( const InitialState & init_state = interaction->InitState(); const Target & target = init_state.Tgt(); - double Mnuc = target.HitNucMass(); + double Mnuc = target.HitPartMass(); double E = init_state.ProbeE(kRfHitNucRest); double x = kinematics.x(); double y = kinematics.y(); @@ -70,7 +70,7 @@ double SlowRsclCharmDISPXSecLO::XSec( //----- get target information (hit nucleon and quark) int nu = init_state.ProbePdg(); - int nuc = target.HitNucPdg(); + int nuc = target.HitPartPdg(); bool isP = pdg::IsProton (nuc); bool isN = pdg::IsNeutron(nuc); bool qset = target.HitQrkIsSet(); @@ -173,7 +173,7 @@ bool SlowRsclCharmDISPXSecLO::ValidProcess( if(!is_inclusive_charm) return false; int nu = init_state.ProbePdg(); - int nuc = init_state.Tgt().HitNucPdg(); + int nuc = init_state.Tgt().HitPartPdg(); if (!pdg::IsProton(nuc) && !pdg::IsNeutron(nuc)) return false; if (!pdg::IsNeutrino(nu) && !pdg::IsAntiNeutrino(nu)) return false; diff --git a/src/Physics/Coherent/XSection/AlvarezRusoCOHPiPXSec.cxx b/src/Physics/Coherent/XSection/AlvarezRusoCOHPiPXSec.cxx index 0d277f832..a19b5f256 100644 --- a/src/Physics/Coherent/XSection/AlvarezRusoCOHPiPXSec.cxx +++ b/src/Physics/Coherent/XSection/AlvarezRusoCOHPiPXSec.cxx @@ -146,7 +146,7 @@ bool AlvarezRusoCOHPiPXSec::ValidProcess(const Interaction * interaction) const if (!proc_info.IsCoherentProduction()) return false; if (!proc_info.IsWeak()) return false; - if (target.HitNucIsSet()) return false; + if (target.HitPartIsSet()) return false; if (!(target.A()>1)) return false; if (!pdg::IsNeutrino(nu) && !pdg::IsAntiNeutrino(nu)) return false; diff --git a/src/Physics/Coherent/XSection/BergerSehgalCOHPiPXSec2015.cxx b/src/Physics/Coherent/XSection/BergerSehgalCOHPiPXSec2015.cxx index 276e0e1b2..585995a76 100644 --- a/src/Physics/Coherent/XSection/BergerSehgalCOHPiPXSec2015.cxx +++ b/src/Physics/Coherent/XSection/BergerSehgalCOHPiPXSec2015.cxx @@ -275,7 +275,7 @@ bool BergerSehgalCOHPiPXSec2015::ValidProcess(const Interaction * interaction) c if (!proc_info.IsCoherentProduction()) return false; if (!proc_info.IsWeak()) return false; - if (target.HitNucIsSet()) return false; + if (target.HitPartIsSet()) return false; if (!(target.A()>1)) return false; if (!pdg::IsNeutrino(nu) && !pdg::IsAntiNeutrino(nu)) return false; diff --git a/src/Physics/Coherent/XSection/BergerSehgalFMCOHPiPXSec2015.cxx b/src/Physics/Coherent/XSection/BergerSehgalFMCOHPiPXSec2015.cxx index 29753b259..9b7159512 100644 --- a/src/Physics/Coherent/XSection/BergerSehgalFMCOHPiPXSec2015.cxx +++ b/src/Physics/Coherent/XSection/BergerSehgalFMCOHPiPXSec2015.cxx @@ -274,7 +274,7 @@ bool BergerSehgalFMCOHPiPXSec2015::ValidProcess(const Interaction * interaction) if (!proc_info.IsCoherentProduction()) return false; if (!proc_info.IsWeak()) return false; - if (target.HitNucIsSet()) return false; + if (target.HitPartIsSet()) return false; if (!(target.A()>1)) return false; if (!pdg::IsNeutrino(nu) && !pdg::IsAntiNeutrino(nu)) return false; diff --git a/src/Physics/Coherent/XSection/ReinSehgalCOHPiPXSec.cxx b/src/Physics/Coherent/XSection/ReinSehgalCOHPiPXSec.cxx index 7c8932ff8..77e96ad0f 100644 --- a/src/Physics/Coherent/XSection/ReinSehgalCOHPiPXSec.cxx +++ b/src/Physics/Coherent/XSection/ReinSehgalCOHPiPXSec.cxx @@ -166,7 +166,7 @@ bool ReinSehgalCOHPiPXSec::ValidProcess(const Interaction * interaction) const if (!proc_info.IsCoherentProduction()) return false; if (!proc_info.IsWeak()) return false; - if (target.HitNucIsSet()) return false; + if (target.HitPartIsSet()) return false; if (!(target.A()>1)) return false; if (!pdg::IsNeutrino(nu) && !pdg::IsAntiNeutrino(nu)) return false; diff --git a/src/Physics/Common/ElectronVelocityMap.cxx b/src/Physics/Common/ElectronVelocityMap.cxx new file mode 100644 index 000000000..c3fc0a317 --- /dev/null +++ b/src/Physics/Common/ElectronVelocityMap.cxx @@ -0,0 +1,107 @@ +///____________________________________________________________________________ +/* + Copyright (c) 2003-2023, The GENIE Collaboration + For the full text of the license visit http://copyright.genie-mc.org + + \brief It provides the correct ElectronVelociy model to be used + for a given atom. + + \author Marco Roda + University of Liverpool + + \created March 28, 2023 + + For the class documentation see the corresponding header file. +*/ +//____________________________________________________________________________ + +#include "Physics/Common/ElectronVelocityMap.h" + +#include "Framework/Algorithm/AlgConfigPool.h" +#include "Framework/ParticleData/PDGUtils.h" + +using namespace genie; + +ElectronVelocityMap::ElectronVelocityMap() : + ElectronVelocity("genie::ElectronVelocityMap", "Default") { ; } +//___________________________________________________________________________ +ElectronVelocityMap::ElectronVelocityMap(string config) : +ElectronVelocity("genie::ElectronVelocityMap", config) { ; } +//___________________________________________________________________________ +void ElectronVelocityMap::Configure(string config) +{ + Algorithm::Configure(config); + + Registry * algos = AlgConfigPool::Instance() -> GlobalParameterList() ; + Registry r( "ElectronVelocitylMap", false ) ; + + // copy in local pool relevant configurations + RgIMap entries = algos -> GetItemMap(); + const std::string keyStart = "ElectronVelocity"; + for( RgIMap::const_iterator it = entries.begin(); it != entries.end(); ++it ) { + + if( it -> first.compare(0, keyStart.size(), keyStart.c_str()) == 0 ) { + r.Set( it -> first, algos -> GetAlg(it->first ) ) ; + } + + } + + ElectronVelocity::Configure(r) ; + +} +//___________________________________________________________________________ +void ElectronVelocityMap::LoadConfig() { + fDefGlobalVelocity = nullptr; + fSpecificModels.clear(); + + // load default global model (should work for all nuclei) + RgAlg dgmodel ; + GetParam( "ElectronVelocity", dgmodel ) ; + + LOG("ElcetronVelocity", pINFO) + << "Default global electron velocity model: " << dgmodel; + fDefGlobalVelocity = dynamic_cast ( this -> SubAlg( "ElectronVelocity" ) ) ; + assert(fDefGlobalVelocity); + + // We're looking for keys that match this string + const std::string keyStart = "ElectronVelocity@Pdg="; + // Looking in both of these registries + RgIMap entries = GetConfig().GetItemMap(); + + for(RgIMap::const_iterator it = entries.begin(); it != entries.end(); ++it){ + const std::string& key = it->first; + // Does it start with the right string? + if(key.compare(0, keyStart.size(), keyStart.c_str()) == 0){ + // The rest is the PDG code + const int pdg = atoi(key.c_str()+keyStart.size()); + const int Z = pdg::IonPdgCodeToZ(pdg); + //const int A = pdg::IonPdgCodeToA(pdg); + + RgAlg rgmodel = GetConfig().GetAlg(key) ; + LOG("ElectronVelocity", pNOTICE) + << "Atom =" << pdg + << " -> refined velocity model: " << rgmodel; + const ElectronVelocity * model = + dynamic_cast ( + this -> SubAlg(key) ) ; + assert(model); + fSpecificModels.insert(map::value_type(Z,model)); + } + } +} +//___________________________________________________________________________ +void ElectronVelocityMap::InitializeVelocity(Interaction & interaction) const { + + const auto & model = SelectModel(interaction.InitState().Tgt()); + + model.InitializeVelocity(interaction); + +} +//___________________________________________________________________________ +const ElectronVelocity & ElectronVelocityMap::SelectModel(const Target & t) const { + auto it = fSpecificModels.find(t.Z()); + + if ( it != fSpecificModels.end()) return *(it->second) ; + else return * fDefGlobalVelocity; +} + diff --git a/src/Physics/Common/ElectronVelocityMap.h b/src/Physics/Common/ElectronVelocityMap.h new file mode 100644 index 000000000..85064e666 --- /dev/null +++ b/src/Physics/Common/ElectronVelocityMap.h @@ -0,0 +1,59 @@ +//____________________________________________________________________________ +/*! + +\class genie::ElectronVelocityMap + +\brief This class is a hook for Electron velocity distributions and allows associating each + one of them with specific nuclei. + Is a concrete implementation of the ElectronVelocity interface. + + \author Marco Roda + University of Liverpool + + \created March 28, 2023 + +\cpright Copyright (c) 2003-2023, The GENIE Collaboration + For the full text of the license visit http://copyright.genie-mc.org + +*/ +//____________________________________________________________________________ + +#ifndef _ELECTRON_VELOCITY_MAP_H_ +#define _ELECTRON_VELOCITY_MAP_H_ + +#include "Physics/NuclearState/ElectronVelocity.h" + +namespace genie { + +class ElectronVelocityMap : public ElectronVelocity { + +public : + + ElectronVelocityMap(); + ElectronVelocityMap(string config); + + ElectronVelocityMap(const ElectronVelocityMap & ) = delete; + ElectronVelocityMap(ElectronVelocityMap && ) = delete; + + + virtual ~ElectronVelocityMap() {;} + + //-- overload the ElectronVelocity::Configure() methods + // to load data from ModelConfig.xml + void Configure(string config) override final ; + + void InitializeVelocity(Interaction & interaction) const override; //Give initial velocity + +protected: + void LoadConfig () override; + const ElectronVelocity & SelectModel(const Target &) const; + +private: + const ElectronVelocity * fDefGlobalVelocity = nullptr; + map fSpecificModels ; + // the key is the Z of the atom + +}; + +} // genie namespace +#endif // _ELECTRON_VELOCITY_MAP_H_ diff --git a/src/Physics/Common/HadronicSystemGenerator.cxx b/src/Physics/Common/HadronicSystemGenerator.cxx index 66611cb0e..eec12b754 100644 --- a/src/Physics/Common/HadronicSystemGenerator.cxx +++ b/src/Physics/Common/HadronicSystemGenerator.cxx @@ -200,7 +200,7 @@ int HadronicSystemGenerator::HadronShowerCharge(GHepRecord * evrec) const Interaction * interaction = evrec->Summary(); const InitialState & init_state = interaction->InitState(); - int hit_nucleon = init_state.Tgt().HitNucPdg(); + int hit_nucleon = init_state.Tgt().HitPartPdg(); assert( pdg::IsProton(hit_nucleon) || pdg::IsNeutron(hit_nucleon) ); diff --git a/src/Physics/Common/InitialStateAppender.cxx b/src/Physics/Common/InitialStateAppender.cxx index 57863c5b5..1367bc608 100644 --- a/src/Physics/Common/InitialStateAppender.cxx +++ b/src/Physics/Common/InitialStateAppender.cxx @@ -128,7 +128,7 @@ void InitialStateAppender::AddStruckParticle(GHepRecord * evrec) const return; } - int pdgc = init_state.Tgt().HitNucPdg(); + int pdgc = init_state.Tgt().HitPartPdg(); if(pdgc != 0) { @@ -138,7 +138,7 @@ void InitialStateAppender::AddStruckParticle(GHepRecord * evrec) const int imom1 = (is_nucleus) ? 1 : -1; int imom2 = -1; - const TLorentzVector p4(init_state.Tgt().HitNucP4()); + const TLorentzVector p4(init_state.Tgt().HitPartP4()); const TLorentzVector v4(0.,0.,0.,0.); LOG("ISApp", pINFO)<< "Adding struck nucleon [pdgc = " << pdgc << "]"; diff --git a/src/Physics/Common/LinkDef.h b/src/Physics/Common/LinkDef.h index 7f12724a5..9d533fc88 100644 --- a/src/Physics/Common/LinkDef.h +++ b/src/Physics/Common/LinkDef.h @@ -28,4 +28,5 @@ #pragma link C++ class genie::NormInteractionListGenerator; +#pragma link C++ class genie::ElectronVelocityMap; #endif diff --git a/src/Physics/Common/OutgoingDarkGenerator.cxx b/src/Physics/Common/OutgoingDarkGenerator.cxx index 8d8564086..f0e04042c 100644 --- a/src/Physics/Common/OutgoingDarkGenerator.cxx +++ b/src/Physics/Common/OutgoingDarkGenerator.cxx @@ -135,7 +135,7 @@ TVector3 OutgoingDarkGenerator::NucRestFrame2Lab(GHepRecord * evrec) const Interaction * interaction = evrec->Summary(); const InitialState & init_state = interaction->InitState(); - const TLorentzVector & pnuc4 = init_state.Tgt().HitNucP4(); //[@LAB] + const TLorentzVector & pnuc4 = init_state.Tgt().HitPartP4(); //[@LAB] TVector3 beta = pnuc4.BoostVector(); return beta; diff --git a/src/Physics/Common/PrimaryLeptonGenerator.cxx b/src/Physics/Common/PrimaryLeptonGenerator.cxx index eadf9155d..3a56ae85e 100644 --- a/src/Physics/Common/PrimaryLeptonGenerator.cxx +++ b/src/Physics/Common/PrimaryLeptonGenerator.cxx @@ -132,7 +132,7 @@ TVector3 PrimaryLeptonGenerator::NucRestFrame2Lab(GHepRecord * evrec) const Interaction * interaction = evrec->Summary(); const InitialState & init_state = interaction->InitState(); - const TLorentzVector & pnuc4 = init_state.Tgt().HitNucP4(); //[@LAB] + const TLorentzVector & pnuc4 = init_state.Tgt().HitPartP4(); //[@LAB] TVector3 beta = pnuc4.BoostVector(); return beta; diff --git a/src/Physics/DeepInelastic/EventGen/DISInteractionListGenerator.cxx b/src/Physics/DeepInelastic/EventGen/DISInteractionListGenerator.cxx index 61edbf17b..4f044955e 100644 --- a/src/Physics/DeepInelastic/EventGen/DISInteractionListGenerator.cxx +++ b/src/Physics/DeepInelastic/EventGen/DISInteractionListGenerator.cxx @@ -78,7 +78,7 @@ InteractionList * DISInteractionListGenerator::CreateInteractionList( Interaction * interaction = new Interaction(init_state, proc_info); Target * target = interaction->InitStatePtr()->TgtPtr(); - target->SetHitNucPdg(struck_nucleon); + target->SetHitPartPdg(struck_nucleon); if(fIsCharm) { XclsTag exclusive_tag; diff --git a/src/Physics/DeepInelastic/EventGen/DISKinematicsGenerator.cxx b/src/Physics/DeepInelastic/EventGen/DISKinematicsGenerator.cxx index cf726820d..615a71c8e 100644 --- a/src/Physics/DeepInelastic/EventGen/DISKinematicsGenerator.cxx +++ b/src/Physics/DeepInelastic/EventGen/DISKinematicsGenerator.cxx @@ -73,7 +73,7 @@ void DISKinematicsGenerator::ProcessEventRecord(GHepRecord * evrec) const //-- Get neutrino energy and hit 'nucleon mass' const InitialState & init_state = interaction->InitState(); double Ev = init_state.ProbeE(kRfHitNucRest); - double M = init_state.Tgt().HitNucP4().M(); // can be off m-shell + double M = init_state.Tgt().HitPartP4().M(); // can be off m-shell //-- Get the physical W range const KPhaseSpace & kps = interaction->PhaseSpace(); diff --git a/src/Physics/DeepInelastic/XSection/DISXSec.cxx b/src/Physics/DeepInelastic/XSection/DISXSec.cxx index a38614075..2903444fd 100644 --- a/src/Physics/DeepInelastic/XSection/DISXSec.cxx +++ b/src/Physics/DeepInelastic/XSection/DISXSec.cxx @@ -67,7 +67,7 @@ double DISXSec::Integrate( const InitialState & init_state = in->InitState(); double Ev = init_state.ProbeE(kRfHitNucRest); - int nucpdgc = init_state.Tgt().HitNucPdg(); + int nucpdgc = init_state.Tgt().HitPartPdg(); int NNucl = (pdg::IsProton(nucpdgc)) ? init_state.Tgt().Z() : init_state.Tgt().N(); @@ -226,7 +226,7 @@ void DISXSec::CacheFreeNucleonXSec( // Tweak interaction to be on a free nucleon target Target * target = interaction->InitStatePtr()->TgtPtr(); - int nucpdgc = target->HitNucPdg(); + int nucpdgc = target->HitPartPdg(); if(pdg::IsProton(nucpdgc)) { target->SetId(kPdgTgtFreeP); } else { target->SetId(kPdgTgtFreeN); } diff --git a/src/Physics/DeepInelastic/XSection/KNOTunedQPMDISPXSec.cxx b/src/Physics/DeepInelastic/XSection/KNOTunedQPMDISPXSec.cxx index f2f45a220..5119362b4 100644 --- a/src/Physics/DeepInelastic/XSection/KNOTunedQPMDISPXSec.cxx +++ b/src/Physics/DeepInelastic/XSection/KNOTunedQPMDISPXSec.cxx @@ -110,7 +110,7 @@ double KNOTunedQPMDISPXSec::DISRESJoinSuppressionFactor( const bool is_EM = pi.IsEM(); double E = ist.ProbeE(kRfHitNucRest); - double Mnuc = ist.Tgt().HitNucMass(); + double Mnuc = ist.Tgt().HitPartMass(); double x = in->Kine().x(); double y = in->Kine().y(); double Wo = utils::kinematics::XYtoW(E,Mnuc,x,y); @@ -139,7 +139,7 @@ double KNOTunedQPMDISPXSec::DISRESJoinSuppressionFactor( ostringstream ikey; ikey << "nu-pdgc:" << ist.ProbePdg() - << ";hit-nuc-pdg:"<< ist.Tgt().HitNucPdg() << "/" + << ";hit-nuc-pdg:"<< ist.Tgt().HitPartPdg() << "/" << pi.InteractionTypeAsString(); string key = cache->CacheBranchKey(algkey, ikey.str()); diff --git a/src/Physics/DeepInelastic/XSection/QPMDISPXSec.cxx b/src/Physics/DeepInelastic/XSection/QPMDISPXSec.cxx index 41c1ffea9..a0af9c194 100644 --- a/src/Physics/DeepInelastic/XSection/QPMDISPXSec.cxx +++ b/src/Physics/DeepInelastic/XSection/QPMDISPXSec.cxx @@ -71,7 +71,7 @@ double QPMDISPXSec::XSec( double E = init_state.ProbeE(kRfHitNucRest); double ml = interaction->FSPrimLepton()->Mass(); - double Mnuc = init_state.Tgt().HitNucMass(); + double Mnuc = init_state.Tgt().HitPartMass(); double x = kinematics.x(); double y = kinematics.y(); @@ -166,7 +166,7 @@ double QPMDISPXSec::XSec( // Compute nuclear cross section (simple scaling here, corrections must // have been included in the structure functions) const Target & target = init_state.Tgt(); - int nucpdgc = target.HitNucPdg(); + int nucpdgc = target.HitPartPdg(); int NNucl = (pdg::IsProton(nucpdgc)) ? target.Z() : target.N(); xsec *= NNucl; @@ -204,9 +204,9 @@ bool QPMDISPXSec::ValidProcess(const Interaction * interaction) const int probe_pdg = init_state.ProbePdg(); if(!pdg::IsLepton(probe_pdg)) return false; - if(! init_state.Tgt().HitNucIsSet()) return false; + if(! init_state.Tgt().HitPartIsSet()) return false; - int hitnuc_pdg = init_state.Tgt().HitNucPdg(); + int hitnuc_pdg = init_state.Tgt().HitPartPdg(); if(!pdg::IsNeutronOrProton(hitnuc_pdg)) return false; return true; diff --git a/src/Physics/DeepInelastic/XSection/QPMDISStrucFuncBase.cxx b/src/Physics/DeepInelastic/XSection/QPMDISStrucFuncBase.cxx index 4f5cef8dc..29a4f8c33 100644 --- a/src/Physics/DeepInelastic/XSection/QPMDISStrucFuncBase.cxx +++ b/src/Physics/DeepInelastic/XSection/QPMDISStrucFuncBase.cxx @@ -149,7 +149,7 @@ void QPMDISStrucFuncBase::Calculate(const Interaction * interaction) const const InitialState & init_state = interaction->InitState(); const Target & tgt = init_state.Tgt(); - int nuc_pdgc = tgt.HitNucPdg(); + int nuc_pdgc = tgt.HitPartPdg(); int probe_pdgc = init_state.ProbePdg(); bool is_p = pdg::IsProton ( nuc_pdgc ); bool is_n = pdg::IsNeutron ( nuc_pdgc ); @@ -411,7 +411,7 @@ double QPMDISStrucFuncBase::Q2(const Interaction * interaction) const // if Q2 was not set, then compute it from x,y,Ev,Mnucleon if (kinematics.KVSet(kKVy)) { const InitialState & init_state = interaction->InitState(); - double Mn = init_state.Tgt().HitNucP4Ptr()->M(); // could be off-shell + double Mn = init_state.Tgt().HitPartP4Ptr()->M(); // could be off-shell //double x = this->ScalingVar(interaction); // could be redefined double x = kinematics.x(); double y = kinematics.y(); @@ -504,7 +504,7 @@ void QPMDISStrucFuncBase::CalcPDFs(const Interaction * interaction) const // Get the hit nucleon mass (could be off-shell) const Target & tgt = interaction->InitState().Tgt(); - double M = tgt.HitNucP4().M(); + double M = tgt.HitPartP4().M(); // Get the Q2 for which PDFs will be evaluated double Q2pdf = TMath::Max(Q2val, fQ2min); @@ -609,7 +609,7 @@ void QPMDISStrucFuncBase::CalcPDFs(const Interaction * interaction) const // The above are the proton parton density function. Get the PDFs for the // hit nucleon (p or n) by swapping u<->d if necessary - int nuc_pdgc = tgt.HitNucPdg(); + int nuc_pdgc = tgt.HitPartPdg(); bool isP = pdg::IsProton (nuc_pdgc); bool isN = pdg::IsNeutron (nuc_pdgc); assert(isP || isN); diff --git a/src/Physics/Diffractive/EventGen/DFRHadronicSystemGenerator.cxx b/src/Physics/Diffractive/EventGen/DFRHadronicSystemGenerator.cxx index fd1254baf..720207edd 100644 --- a/src/Physics/Diffractive/EventGen/DFRHadronicSystemGenerator.cxx +++ b/src/Physics/Diffractive/EventGen/DFRHadronicSystemGenerator.cxx @@ -96,7 +96,7 @@ void DFRHadronicSystemGenerator::ProcessEventRecord(GHepRecord * evrec) const const Target & target = init_state.Tgt(); double E = init_state.ProbeE(kRfHitNucRest); // neutrino energy - double M = target.HitNucMass(); + double M = target.HitPartMass(); double mpi = PDGLibrary::Instance()->Find(pion_pdgc)->Mass(); double mpi2 = TMath::Power(mpi,2); double xo = interaction->Kine().x(true); diff --git a/src/Physics/Diffractive/EventGen/DFRInteractionListGenerator.cxx b/src/Physics/Diffractive/EventGen/DFRInteractionListGenerator.cxx index 4083e1663..812e06cdb 100644 --- a/src/Physics/Diffractive/EventGen/DFRInteractionListGenerator.cxx +++ b/src/Physics/Diffractive/EventGen/DFRInteractionListGenerator.cxx @@ -117,7 +117,7 @@ InteractionList * DFRInteractionListGenerator::CreateInteractionList( else if (nuc == kPdgNeutron) interaction->ExclTagPtr()->SetNNeutrons(1); - interaction->InitStatePtr()->TgtPtr()->SetHitNucPdg(nuc); + interaction->InitStatePtr()->TgtPtr()->SetHitPartPdg(nuc); intlist->push_back(interaction); } diff --git a/src/Physics/Diffractive/EventGen/DFRKinematicsGenerator.cxx b/src/Physics/Diffractive/EventGen/DFRKinematicsGenerator.cxx index 906a7d719..e7bc6c48d 100644 --- a/src/Physics/Diffractive/EventGen/DFRKinematicsGenerator.cxx +++ b/src/Physics/Diffractive/EventGen/DFRKinematicsGenerator.cxx @@ -75,7 +75,7 @@ void DFRKinematicsGenerator::ProcessEventRecord(GHepRecord * evrec) const //-- Get neutrino energy and hit 'nucleon mass' const InitialState & init_state = interaction->InitState(); double Ev = init_state.ProbeE(kRfHitNucRest); - double M = init_state.Tgt().HitNucP4().M(); // can be off m-shell + double M = init_state.Tgt().HitPartP4().M(); // can be off m-shell //-- Get the physical W range const KPhaseSpace & kps = interaction->PhaseSpace(); diff --git a/src/Physics/Diffractive/XSection/ReinDFRPXSec.cxx b/src/Physics/Diffractive/XSection/ReinDFRPXSec.cxx index c27c7f034..b1540cd15 100644 --- a/src/Physics/Diffractive/XSection/ReinDFRPXSec.cxx +++ b/src/Physics/Diffractive/XSection/ReinDFRPXSec.cxx @@ -61,7 +61,7 @@ double ReinDFRPXSec::XSec( double x = kinematics.x(); // bjorken x double y = kinematics.y(); // inelasticity y double t = kinematics.t(); // (magnitude of) square of four-momentum xferred to proton - double M = target.HitNucMass(); // + double M = target.HitPartMass(); // double Q2 = 2.*x*y*M*E; // momentum transfer Q2>0 double Gf = kGF2 * M/(16*kPi3); // GF/pi/etc factor double fp = 0.93 * kPionMass; // pion decay constant (cc) @@ -111,7 +111,7 @@ double ReinDFRPXSec::XSec( if( interaction->TestBit(kIAssumeFreeNucleon) ) return xsec; //----- number of scattering centers in the target - int nucpdgc = target.HitNucPdg(); + int nucpdgc = target.HitPartPdg(); int NNucl = (pdg::IsProton(nucpdgc)) ? target.Z() : target.N(); xsec *= NNucl; diff --git a/src/Physics/HEDIS/EventGen/HEDISInteractionListGenerator.cxx b/src/Physics/HEDIS/EventGen/HEDISInteractionListGenerator.cxx index cfb3283a9..d694b51a1 100644 --- a/src/Physics/HEDIS/EventGen/HEDISInteractionListGenerator.cxx +++ b/src/Physics/HEDIS/EventGen/HEDISInteractionListGenerator.cxx @@ -98,7 +98,7 @@ InteractionList * HEDISInteractionListGenerator::CreateHEDISlist( ProcessInfo proc(kScDeepInelastic,*inttype); Interaction * interaction = new Interaction(*init, proc); - interaction->InitStatePtr()->TgtPtr()->SetHitNucPdg(*inucl); + interaction->InitStatePtr()->TgtPtr()->SetHitPartPdg(*inucl); multimap hq = this->GetHitQuarks(interaction); multimap::const_iterator hqi = hq.begin(); for( ; hqi != hq.end(); ++hqi) { diff --git a/src/Physics/HEDIS/EventGen/HEDISKinematicsGenerator.cxx b/src/Physics/HEDIS/EventGen/HEDISKinematicsGenerator.cxx index 9c2814397..a6d29731b 100644 --- a/src/Physics/HEDIS/EventGen/HEDISKinematicsGenerator.cxx +++ b/src/Physics/HEDIS/EventGen/HEDISKinematicsGenerator.cxx @@ -74,7 +74,7 @@ void HEDISKinematicsGenerator::ProcessEventRecord(GHepRecord * evrec) const //-- Get neutrino energy and hit 'nucleon mass' const InitialState & init_state = interaction->InitState(); double Ev = init_state.ProbeE(kRfLab); - double M = init_state.Tgt().HitNucP4().M(); // can be off m-shell + double M = init_state.Tgt().HitPartP4().M(); // can be off m-shell //-- Get the physical W range const KPhaseSpace & kps = interaction->PhaseSpace(); diff --git a/src/Physics/HEDIS/XSection/HEDISPXSec.cxx b/src/Physics/HEDIS/XSection/HEDISPXSec.cxx index 075574b5d..0f471a7ee 100644 --- a/src/Physics/HEDIS/XSection/HEDISPXSec.cxx +++ b/src/Physics/HEDIS/XSection/HEDISPXSec.cxx @@ -69,7 +69,7 @@ double HEDISPXSec::XSec( double Q2 = kinematics.Q2(); double x = kinematics.x(); double E = init_state.ProbeE(kRfLab); - double Mnuc = init_state.Tgt().HitNucMass(); + double Mnuc = init_state.Tgt().HitPartMass(); double Mlep2 = TMath::Power(interaction->FSPrimLepton()->Mass(),2); // Get F1,F2,F3 for particular quark channel and compute differential xsec @@ -107,7 +107,7 @@ double HEDISPXSec::XSec( if( interaction->TestBit(kIAssumeFreeNucleon) ) return xsec; // Compute nuclear cross section (simple scaling here, corrections must have been included in the structure functions) - int NNucl = (pdg::IsProton(init_state.Tgt().HitNucPdg())) ? init_state.Tgt().Z() : init_state.Tgt().N(); + int NNucl = (pdg::IsProton(init_state.Tgt().HitPartPdg())) ? init_state.Tgt().Z() : init_state.Tgt().N(); xsec *= NNucl; return xsec; @@ -167,9 +167,9 @@ bool HEDISPXSec::ValidProcess(const Interaction * interaction) const int probe_pdg = init_state.ProbePdg(); if(!pdg::IsLepton(probe_pdg)) return false; - if(! init_state.Tgt().HitNucIsSet()) return false; + if(! init_state.Tgt().HitPartIsSet()) return false; - int hitnuc_pdg = init_state.Tgt().HitNucPdg(); + int hitnuc_pdg = init_state.Tgt().HitPartPdg(); if(!pdg::IsNeutronOrProton(hitnuc_pdg)) return false; return true; @@ -223,4 +223,4 @@ void HEDISPXSec::LoadConfig(void) GetParam("Mts", fSFinfo.Vts ); GetParam("Mtb", fSFinfo.Vtb ); -} \ No newline at end of file +} diff --git a/src/Physics/HEDIS/XSection/HEDISStrucFunc.cxx b/src/Physics/HEDIS/XSection/HEDISStrucFunc.cxx index c565f68c4..84f795c95 100644 --- a/src/Physics/HEDIS/XSection/HEDISStrucFunc.cxx +++ b/src/Physics/HEDIS/XSection/HEDISStrucFunc.cxx @@ -361,11 +361,11 @@ void HEDISStrucFunc::CreateQrkSF( const Interaction * in, string sfFile ) // variables used to tag the SF for particular channel bool iscc = in->ProcInfo().IsWeakCC(); bool isnu = pdg::IsNeutrino(in->InitState().ProbePdg()); - bool ispr = pdg::IsProton(in->InitState().Tgt().HitNucPdg()); + bool ispr = pdg::IsProton(in->InitState().Tgt().HitPartPdg()); bool sea_iq = in->InitState().Tgt().HitSeaQrk(); int pdg_iq = in->InitState().Tgt().HitQrkPdg(); int pdg_fq = in->ExclTag().FinalQuarkPdg(); - double mass_nucl = in->InitState().Tgt().HitNucMass(); + double mass_nucl = in->InitState().Tgt().HitPartMass(); // up and down quark swicth depending on proton or neutron interaction int qrkd = 0; @@ -507,7 +507,7 @@ void HEDISStrucFunc::CreateNucSF( const Interaction * in, string sfFile ) // variables used to tag the SF for particular channel bool iscc = in->ProcInfo().IsWeakCC(); bool isnu = pdg::IsNeutrino(in->InitState().ProbePdg()); - bool ispr = pdg::IsProton(in->InitState().Tgt().HitNucPdg()); + bool ispr = pdg::IsProton(in->InitState().Tgt().HitPartPdg()); // Define the channel that is used in APFEL if ( isnu ) APFEL::SetProjectileDIS("neutrino"); @@ -574,7 +574,7 @@ string HEDISStrucFunc::QrkSFName( const Interaction * in) { string sin = pdg::IsNeutrino(in->InitState().ProbePdg()) ? "nu_" : "nubar_"; sin += in->ProcInfo().IsWeakCC() ? "cc_" : "nc_"; - sin += pdg::IsProton(in->InitState().Tgt().HitNucPdg()) ? "p_" : "n_"; + sin += pdg::IsProton(in->InitState().Tgt().HitPartPdg()) ? "p_" : "n_"; sin += "iq"+to_string(in->InitState().Tgt().HitQrkPdg()); sin += in->InitState().Tgt().HitSeaQrk() ? "sea_" : "val_"; sin += "fq"+to_string(in->ExclTag().FinalQuarkPdg()); @@ -585,7 +585,7 @@ string HEDISStrucFunc::NucSFName( const Interaction * in) { string sin = pdg::IsNeutrino(in->InitState().ProbePdg()) ? "nu_" : "nubar_"; sin += in->ProcInfo().IsWeakCC() ? "cc_" : "nc_"; - sin += pdg::IsProton(in->InitState().Tgt().HitNucPdg()) ? "p" : "n"; + sin += pdg::IsProton(in->InitState().Tgt().HitPartPdg()) ? "p" : "n"; return sin; } //____________________________________________________________________________ @@ -593,7 +593,7 @@ int HEDISStrucFunc::QrkSFCode( const Interaction * in) { int code = 10000000*pdg::IsNeutrino(in->InitState().ProbePdg()); code += 1000000*in->ProcInfo().IsWeakCC(); - code += 100000*pdg::IsProton(in->InitState().Tgt().HitNucPdg()); + code += 100000*pdg::IsProton(in->InitState().Tgt().HitPartPdg()); code += 10000*in->InitState().Tgt().HitSeaQrk(); code += 100*(6+in->InitState().Tgt().HitQrkPdg()); code += 1*(6+in->ExclTag().FinalQuarkPdg()); @@ -604,7 +604,7 @@ int HEDISStrucFunc::NucSFCode( const Interaction * in) { int code = 100*pdg::IsNeutrino(in->InitState().ProbePdg()); code += 10*in->ProcInfo().IsWeakCC(); - code += 1*pdg::IsProton(in->InitState().Tgt().HitNucPdg()); + code += 1*pdg::IsProton(in->InitState().Tgt().HitPartPdg()); return code; } //____________________________________________________________________________ diff --git a/src/Physics/HEDIS/XSection/HEDISXSec.cxx b/src/Physics/HEDIS/XSection/HEDISXSec.cxx index a71936d28..3677b4603 100644 --- a/src/Physics/HEDIS/XSection/HEDISXSec.cxx +++ b/src/Physics/HEDIS/XSection/HEDISXSec.cxx @@ -74,7 +74,7 @@ double HEDISXSec::Integrate( XSecSplineList * xsl = XSecSplineList::Instance(); if(init_state.Tgt().IsNucleus() && !xsl->IsEmpty() ) { - int nucpdgc = init_state.Tgt().HitNucPdg(); + int nucpdgc = init_state.Tgt().HitPartPdg(); int NNucl = (pdg::IsProton(nucpdgc)) ? init_state.Tgt().Z() : init_state.Tgt().N(); Interaction * interaction = new Interaction(*in); diff --git a/src/Physics/HELepton/EventGen/HELeptonInteractionListGenerator.cxx b/src/Physics/HELepton/EventGen/HELeptonInteractionListGenerator.cxx index bce1cb0be..59c728078 100644 --- a/src/Physics/HELepton/EventGen/HELeptonInteractionListGenerator.cxx +++ b/src/Physics/HELepton/EventGen/HELeptonInteractionListGenerator.cxx @@ -49,7 +49,7 @@ InteractionList * if(probepdg == kPdgAntiNuE) { InitialState init(init_state); - init_state.TgtPtr()->SetHitNucPdg(0); + init_state.TgtPtr()->SetHitPartPdg(0); Interaction * interaction = new Interaction(init_state, proc_info); XclsTag exclusive_tag; if (fIsGLRESMu) exclusive_tag.SetFinalLepton(kPdgMuon); @@ -77,7 +77,7 @@ InteractionList * if (fIsHENuElCC) { ProcessInfo proc_info(kScGlashowResonance, kIntWeakCC); InitialState init(init_state); - init_state.TgtPtr()->SetHitNucPdg(0); + init_state.TgtPtr()->SetHitPartPdg(0); Interaction * interaction = new Interaction(init_state, proc_info); XclsTag exclusive_tag; //charged lepton if ( pdg::IsNuMu(probepdg) ) exclusive_tag.SetFinalLepton(kPdgMuon); @@ -90,7 +90,7 @@ InteractionList * else if (fIsHENuElNC) { ProcessInfo proc_info(kScGlashowResonance, kIntWeakNC); InitialState init(init_state); - init_state.TgtPtr()->SetHitNucPdg(0); + init_state.TgtPtr()->SetHitPartPdg(0); Interaction * interaction = new Interaction(init_state, proc_info); XclsTag exclusive_tag; //charged lepton if ( pdg::IsNuMu(probepdg) ) exclusive_tag.SetFinalLepton(kPdgElectron); @@ -125,7 +125,7 @@ InteractionList * if( (struck_nucleon == kPdgProton && hasP) || (struck_nucleon == kPdgNeutron && hasN) ) { Interaction * interaction = new Interaction(init_state, proc_info); Target * target = interaction->InitStatePtr()->TgtPtr(); - target->SetHitNucPdg(struck_nucleon); + target->SetHitPartPdg(struck_nucleon); XclsTag exclusive_tag; if (fIsPhotonRESMu) exclusive_tag.SetFinalLepton( (probepdg>0) ? kPdgAntiMuon : kPdgMuon ); else if (fIsPhotonRESTau) exclusive_tag.SetFinalLepton( (probepdg>0) ? kPdgAntiTau : kPdgTau ); @@ -226,4 +226,4 @@ void HELeptonInteractionListGenerator::LoadConfigData(void) GetParamDef("is-PhotonRES-Had", fIsPhotonRESHad, false ) ; GetParamDef("is-PhotonCOH", fIsPhotonCOH, false ) ; -} \ No newline at end of file +} diff --git a/src/Physics/HELepton/EventGen/PhotonRESGenerator.cxx b/src/Physics/HELepton/EventGen/PhotonRESGenerator.cxx index 97870ae0a..360de60ce 100644 --- a/src/Physics/HELepton/EventGen/PhotonRESGenerator.cxx +++ b/src/Physics/HELepton/EventGen/PhotonRESGenerator.cxx @@ -82,7 +82,7 @@ void PhotonRESGenerator::ProcessEventRecord(GHepRecord * evrec) const int probepdg = init_state.ProbePdg(); - long double Mtarget = init_state.Tgt().HitNucMass(); + long double Mtarget = init_state.Tgt().HitPartMass(); long double mlout = interaction->FSPrimLepton()->Mass(); //mass of charged lepton long double Enuin = init_state.ProbeE(kRfLab); diff --git a/src/Physics/HELepton/XSection/GLRESPXSec.cxx b/src/Physics/HELepton/XSection/GLRESPXSec.cxx index a37178434..cf44cff62 100644 --- a/src/Physics/HELepton/XSection/GLRESPXSec.cxx +++ b/src/Physics/HELepton/XSection/GLRESPXSec.cxx @@ -129,7 +129,7 @@ bool GLRESPXSec::ValidProcess(const Interaction* interaction) const const InitialState & init_state = interaction -> InitState(); if(!pdg::IsAntiNuE(init_state.ProbePdg())) return false; - if(init_state.Tgt().HitNucIsSet()) return false; + if(init_state.Tgt().HitPartIsSet()) return false; return true; } @@ -157,4 +157,4 @@ void GLRESPXSec::LoadConfig(void) GetParam( "Xsec-Wmin", fWmin ) ; -} \ No newline at end of file +} diff --git a/src/Physics/HELepton/XSection/HELeptonXSec.cxx b/src/Physics/HELepton/XSection/HELeptonXSec.cxx index a45f2f375..a3f67860c 100644 --- a/src/Physics/HELepton/XSection/HELeptonXSec.cxx +++ b/src/Physics/HELepton/XSection/HELeptonXSec.cxx @@ -85,7 +85,7 @@ double HELeptonXSec::Integrate( target->SetId(kPdgTgtFreeP); } else if ( proc_info.IsPhotonResonance() ) { - int nucpdgc = init_state.Tgt().HitNucPdg(); + int nucpdgc = init_state.Tgt().HitPartPdg(); if (pdg::IsProton(nucpdgc)) { NNucl = init_state.Tgt().Z(); target->SetId(kPdgTgtFreeP); diff --git a/src/Physics/HELepton/XSection/HENuElPXSec.cxx b/src/Physics/HELepton/XSection/HENuElPXSec.cxx index 711ac89fd..572560b98 100644 --- a/src/Physics/HELepton/XSection/HENuElPXSec.cxx +++ b/src/Physics/HELepton/XSection/HENuElPXSec.cxx @@ -134,7 +134,7 @@ bool HENuElPXSec::ValidProcess(const Interaction* interaction) const if(pdg::IsAntiNuMu(init_state.ProbePdg()) && proc_info.IsWeakCC()) return false; if(pdg::IsAntiNuTau(init_state.ProbePdg()) && proc_info.IsWeakCC()) return false; - if(init_state.Tgt().HitNucIsSet()) return false; + if(init_state.Tgt().HitPartIsSet()) return false; return true; } @@ -159,4 +159,4 @@ void HENuElPXSec::LoadConfig(void) fXSecIntegrator = dynamic_cast (this->SubAlg("XSec-Integrator")); assert(fXSecIntegrator); -} \ No newline at end of file +} diff --git a/src/Physics/HELepton/XSection/PhotonCOHPXSec.cxx b/src/Physics/HELepton/XSection/PhotonCOHPXSec.cxx index 9af8a06d3..71854f76c 100644 --- a/src/Physics/HELepton/XSection/PhotonCOHPXSec.cxx +++ b/src/Physics/HELepton/XSection/PhotonCOHPXSec.cxx @@ -135,7 +135,7 @@ bool PhotonCOHPXSec::ValidProcess(const Interaction* interaction) const const InitialState & init_state = interaction -> InitState(); if(!pdg::IsLepton(init_state.ProbePdg())) return false; - if(init_state.Tgt().HitNucIsSet()) return false; + if(init_state.Tgt().HitPartIsSet()) return false; return true; } diff --git a/src/Physics/HELepton/XSection/PhotonRESPXSec.cxx b/src/Physics/HELepton/XSection/PhotonRESPXSec.cxx index 9fca8747f..5a3984006 100644 --- a/src/Physics/HELepton/XSection/PhotonRESPXSec.cxx +++ b/src/Physics/HELepton/XSection/PhotonRESPXSec.cxx @@ -55,11 +55,11 @@ double PhotonRESPXSec::XSec( int probepdg = init_state.ProbePdg(); int loutpdg = xclstag.FinalLeptonPdg(); - int tgtpdg = init_state.Tgt().HitNucPdg(); + int tgtpdg = init_state.Tgt().HitPartPdg(); double mlout = interaction->FSPrimLepton()->Mass(); //mass of charged lepton - double Mnuc = init_state.Tgt().HitNucMass(); + double Mnuc = init_state.Tgt().HitPartMass(); double Enuin = init_state.ProbeE(kRfLab); double s = born->GetS(Mnuc,Enuin); @@ -124,9 +124,9 @@ bool PhotonRESPXSec::ValidProcess(const Interaction* interaction) const const InitialState & init_state = interaction -> InitState(); if(!pdg::IsLepton(init_state.ProbePdg())) return false; - if(! init_state.Tgt().HitNucIsSet()) return false; + if(! init_state.Tgt().HitPartIsSet()) return false; - int hitnuc_pdg = init_state.Tgt().HitNucPdg(); + int hitnuc_pdg = init_state.Tgt().HitPartPdg(); if(!pdg::IsNeutronOrProton(hitnuc_pdg)) return false; return true; @@ -159,4 +159,4 @@ void PhotonRESPXSec::LoadConfig(void) GetParam("Q2Grid-Min", fQ2PDFmin ); GetParam("XGrid-Min", fxPDFmin ); -} \ No newline at end of file +} diff --git a/src/Physics/HadronTransport/HAIntranuke.cxx b/src/Physics/HadronTransport/HAIntranuke.cxx index b2cd22fc8..e74ccee45 100644 --- a/src/Physics/HadronTransport/HAIntranuke.cxx +++ b/src/Physics/HadronTransport/HAIntranuke.cxx @@ -633,7 +633,7 @@ void HAIntranuke::InelasticHA( // handle fermi momentum if(fDoFermi) { - target.SetHitNucPdg(tcode); + target.SetHitPartPdg(tcode); fNuclmodel->GenerateNucleon(target); TVector3 tP3 = fFermiFac * fNuclmodel->Momentum3(); double tE = TMath::Sqrt(tP3.Mag2()+ tM*tM); @@ -867,12 +867,12 @@ void HAIntranuke::Inelastic( Target target(ev->TargetNucleus()->Pdg()); if(fDoFermi) { - target.SetHitNucPdg(t1code); + target.SetHitPartPdg(t1code); fNuclmodel->GenerateNucleon(target); tP2_1L=fFermiFac * fNuclmodel->Momentum3(); E2_1L = TMath::Sqrt(tP2_1L.Mag2() + M2_1*M2_1); - target.SetHitNucPdg(t2code); + target.SetHitPartPdg(t2code); fNuclmodel->GenerateNucleon(target); tP2_2L=fFermiFac * fNuclmodel->Momentum3(); E2_2L = TMath::Sqrt(tP2_2L.Mag2() + M2_2*M2_2); @@ -1236,7 +1236,7 @@ void HAIntranuke::Inelastic( vector::const_iterator pdg_iter; for(pdg_iter=++(listar[i]->begin());pdg_iter!=listar[i]->end();++pdg_iter) { - target.SetHitNucPdg(*pdg_iter); + target.SetHitPartPdg(*pdg_iter); fNuclmodel->GenerateNucleon(target); mBuf = pLib->Find(*pdg_iter)->Mass(); mSum += mBuf; @@ -1316,7 +1316,7 @@ void HAIntranuke::Inelastic( vector::const_iterator pdg_iter; for(pdg_iter=++(list.begin());pdg_iter!=list.end();++pdg_iter) { - target.SetHitNucPdg(*pdg_iter); + target.SetHitPartPdg(*pdg_iter); fNuclmodel->GenerateNucleon(target); mBuf = pLib->Find(*pdg_iter)->Mass(); mSum += mBuf; diff --git a/src/Physics/HadronTransport/HAIntranuke2018.cxx b/src/Physics/HadronTransport/HAIntranuke2018.cxx index f5023442e..6a6fa49ff 100644 --- a/src/Physics/HadronTransport/HAIntranuke2018.cxx +++ b/src/Physics/HadronTransport/HAIntranuke2018.cxx @@ -644,7 +644,7 @@ void HAIntranuke2018::InelasticHA( // handle fermi momentum if(fDoFermi) { - target.SetHitNucPdg(tcode); + target.SetHitPartPdg(tcode); fNuclmodel->GenerateNucleon(target); TVector3 tP3 = fFermiFac * fNuclmodel->Momentum3(); double tE = TMath::Sqrt(tP3.Mag2()+ tM*tM); @@ -903,13 +903,13 @@ void HAIntranuke2018::Inelastic( Target target(ev->TargetNucleus()->Pdg()); if(fDoFermi) { - target.SetHitNucPdg(t1code); + target.SetHitPartPdg(t1code); fNuclmodel->GenerateNucleon(target); //LOG("HAIntranuke2018", pNOTICE) << "Nuclmodel= " << fNuclmodel->ModelType(target) ; tP2_1L=fFermiFac * fNuclmodel->Momentum3(); E2_1L = TMath::Sqrt(tP2_1L.Mag2() + M2_1*M2_1); - target.SetHitNucPdg(t2code); + target.SetHitPartPdg(t2code); fNuclmodel->GenerateNucleon(target); tP2_2L=fFermiFac * fNuclmodel->Momentum3(); E2_2L = TMath::Sqrt(tP2_2L.Mag2() + M2_2*M2_2); @@ -1299,7 +1299,7 @@ void HAIntranuke2018::Inelastic( vector::const_iterator pdg_iter; for(pdg_iter=++(listar[i]->begin());pdg_iter!=listar[i]->end();++pdg_iter) { - target.SetHitNucPdg(*pdg_iter); + target.SetHitPartPdg(*pdg_iter); fNuclmodel->GenerateNucleon(target); mBuf = pLib->Find(*pdg_iter)->Mass(); mSum += mBuf; @@ -1432,7 +1432,7 @@ void HAIntranuke2018::Inelastic( vector::const_iterator pdg_iter; for(pdg_iter=++(list.begin());pdg_iter!=list.end();++pdg_iter) { - target.SetHitNucPdg(*pdg_iter); + target.SetHitPartPdg(*pdg_iter); fNuclmodel->GenerateNucleon(target); mBuf = pLib->Find(*pdg_iter)->Mass(); mSum += mBuf; diff --git a/src/Physics/HadronTransport/HNIntranuke2018.cxx b/src/Physics/HadronTransport/HNIntranuke2018.cxx index 269f8fc48..3fc3ed302 100644 --- a/src/Physics/HadronTransport/HNIntranuke2018.cxx +++ b/src/Physics/HadronTransport/HNIntranuke2018.cxx @@ -484,12 +484,12 @@ void HNIntranuke2018::AbsorbHN( // handle fermi momentum if(fDoFermi) { - target.SetHitNucPdg(t1code); + target.SetHitPartPdg(t1code); fNuclmodel->GenerateNucleon(target); tP2_1L=fFermiFac * fNuclmodel->Momentum3(); E2_1L = TMath::Sqrt(tP2_1L.Mag2() + M2_1*M2_1); - target.SetHitNucPdg(t2code); + target.SetHitPartPdg(t2code); fNuclmodel->GenerateNucleon(target); tP2_2L=fFermiFac * fNuclmodel->Momentum3(); E2_2L = TMath::Sqrt(tP2_2L.Mag2() + M2_2*M2_2); @@ -727,7 +727,7 @@ void HNIntranuke2018::ElasHN( // Handle fermi target Target target(ev->TargetNucleus()->Pdg()); //LOG("HAIntranuke2018", pNOTICE) << "Nuclmodel= " << fNuclmodel->ModelType(target) ; - target.SetHitNucPdg(tcode); + target.SetHitPartPdg(tcode); fNuclmodel->GenerateNucleon(target); TVector3 tP3L = fFermiFac * fNuclmodel->Momentum3(); double tE = TMath::Sqrt(tP3L.Mag2() + Mt*Mt); @@ -866,7 +866,7 @@ void HNIntranuke2018::GammaInelasticHN(GHepRecord* ev, GHepParticle* p, INukeFat // Handle fermi target Target target(ev->TargetNucleus()->Pdg()); - target.SetHitNucPdg(tcode); + target.SetHitPartPdg(tcode); fNuclmodel->GenerateNucleon(target); TVector3 tP3L = fFermiFac * fNuclmodel->Momentum3(); double tE = TMath::Sqrt(tP3L.Mag2() + Mt*Mt); diff --git a/src/Physics/HadronTransport/INukeUtils.cxx b/src/Physics/HadronTransport/INukeUtils.cxx index b68eef5af..ebd5ccbcd 100644 --- a/src/Physics/HadronTransport/INukeUtils.cxx +++ b/src/Physics/HadronTransport/INukeUtils.cxx @@ -443,7 +443,7 @@ void genie::utils::intranuke::PreEquilibrium( vector::const_iterator pdg_iter; for(pdg_iter=++(list.begin());pdg_iter!=list.end();++pdg_iter) { - target.SetHitNucPdg(*pdg_iter); + target.SetHitPartPdg(*pdg_iter); Nuclmodel->GenerateNucleon(target); mBuf = pLib->Find(*pdg_iter)->Mass(); mSum += mBuf; @@ -597,7 +597,7 @@ void genie::utils::intranuke::Equilibrium( vector::const_iterator pdg_iter; for(pdg_iter=++(list.begin());pdg_iter!=list.end();++pdg_iter) { - target.SetHitNucPdg(*pdg_iter); + target.SetHitPartPdg(*pdg_iter); Nuclmodel->GenerateNucleon(target); mBuf = pLib->Find(*pdg_iter)->Mass(); mSum += mBuf; @@ -992,7 +992,7 @@ bool genie::utils::intranuke::ThreeBodyKinematics( // handle fermi momentum if(DoFermi) { - target.SetHitNucPdg(tcode); + target.SetHitPartPdg(tcode); Nuclmodel->GenerateNucleon(target); tP2L = FermiFac * Nuclmodel->Momentum3(); P2L = tP2L.Mag(); diff --git a/src/Physics/HadronTransport/INukeUtils2018.cxx b/src/Physics/HadronTransport/INukeUtils2018.cxx index 12b9df456..a5b2de887 100644 --- a/src/Physics/HadronTransport/INukeUtils2018.cxx +++ b/src/Physics/HadronTransport/INukeUtils2018.cxx @@ -542,7 +542,7 @@ void genie::utils::intranuke2018::PreEquilibrium( vector::const_iterator pdg_iter; for(pdg_iter=++(list.begin());pdg_iter!=list.end();++pdg_iter) { - target.SetHitNucPdg(*pdg_iter); + target.SetHitPartPdg(*pdg_iter); Nuclmodel->GenerateNucleon(target); mBuf = pLib->Find(*pdg_iter)->Mass(); mSum += mBuf; @@ -699,7 +699,7 @@ void genie::utils::intranuke2018::Equilibrium( vector::const_iterator pdg_iter; for(pdg_iter=++(list.begin());pdg_iter!=list.end();++pdg_iter) { - target.SetHitNucPdg(*pdg_iter); + target.SetHitPartPdg(*pdg_iter); Nuclmodel->GenerateNucleon(target); mBuf = pLib->Find(*pdg_iter)->Mass(); mSum += mBuf; @@ -1115,7 +1115,7 @@ bool genie::utils::intranuke2018::ThreeBodyKinematics( // handle fermi momentum if(DoFermi) { - target.SetHitNucPdg(tcode); + target.SetHitPartPdg(tcode); Nuclmodel->GenerateNucleon(target); tP2L = FermiFac * Nuclmodel->Momentum3(); P2L = tP2L.Mag(); diff --git a/src/Physics/Hadronization/AGCharm2019.cxx b/src/Physics/Hadronization/AGCharm2019.cxx index 4f78055b2..5e7f96117 100644 --- a/src/Physics/Hadronization/AGCharm2019.cxx +++ b/src/Physics/Hadronization/AGCharm2019.cxx @@ -197,7 +197,7 @@ TClonesArray * AGCharm2019::Hadronize( LOG("CharmHad", pNOTICE) << "Ehad (LAB) = " << Eh << ", W = " << W; int nu_pdg = init_state.ProbePdg(); - int nuc_pdg = target.HitNucPdg(); + int nuc_pdg = target.HitPartPdg(); //int qpdg = target.HitQrkPdg(); //bool sea = target.HitSeaQrk(); bool isp = pdg::IsProton (nuc_pdg); diff --git a/src/Physics/Hadronization/AGKYLowW2019.cxx b/src/Physics/Hadronization/AGKYLowW2019.cxx index cc7d2a0bc..1e4b2670b 100644 --- a/src/Physics/Hadronization/AGKYLowW2019.cxx +++ b/src/Physics/Hadronization/AGKYLowW2019.cxx @@ -390,7 +390,7 @@ TH1D * AGKYLowW2019::MultiplicityProb( const InitialState & init_state = interaction->InitState(); int nu_pdg = init_state.ProbePdg(); - int nuc_pdg = init_state.Tgt().HitNucPdg(); + int nuc_pdg = init_state.Tgt().HitPartPdg(); // Compute the average charged hadron multiplicity as: = a + b*ln(W^2) // Calculate avergage hadron multiplicity (= 1.5 x charged hadron mult.) @@ -724,7 +724,7 @@ int AGKYLowW2019::HadronShowerCharge(const Interaction* interaction) const // get the initial state, ask for the hit-nucleon and get // its charge ( = initial state charge for vN interactions) const InitialState & init_state = interaction->InitState(); - int hit_nucleon = init_state.Tgt().HitNucPdg(); + int hit_nucleon = init_state.Tgt().HitPartPdg(); assert( pdg::IsProton(hit_nucleon) || pdg::IsNeutron(hit_nucleon) ); @@ -1584,7 +1584,7 @@ void AGKYLowW2019::ApplyRijk( const Interaction * interaction, const InitialState & init_state = interaction->InitState(); int probe_pdg = init_state.ProbePdg(); - int nuc_pdg = init_state.Tgt().HitNucPdg(); + int nuc_pdg = init_state.Tgt().HitPartPdg(); const ProcessInfo & proc_info = interaction->ProcInfo(); bool is_CC = proc_info.IsWeakCC(); diff --git a/src/Physics/Hadronization/LeptoHadronization.cxx b/src/Physics/Hadronization/LeptoHadronization.cxx index 3063d9555..1aff0fdc5 100644 --- a/src/Physics/Hadronization/LeptoHadronization.cxx +++ b/src/Physics/Hadronization/LeptoHadronization.cxx @@ -143,11 +143,11 @@ bool LeptoHadronization::Hadronize(GHepRecord * assert(target.HitQrkIsSet()); - bool isp = pdg::IsProton(target.HitNucPdg()); + bool isp = pdg::IsProton(target.HitPartPdg()); int hit_quark = target.HitQrkPdg(); int frag_quark = xclstag.FinalQuarkPdg(); - LOG("LeptoHad", pDEBUG) << "Hit nucleon pdgc = " << target.HitNucPdg() << ", W = " << W; + LOG("LeptoHad", pDEBUG) << "Hit nucleon pdgc = " << target.HitPartPdg() << ", W = " << W; LOG("LeptoHad", pDEBUG) << "Selected hit quark pdgc = " << hit_quark << " // Fragmentation quark = " << frag_quark; RandomGen * rnd = RandomGen::Instance(); diff --git a/src/Physics/Hadronization/PythiaBaseHadro2019.cxx b/src/Physics/Hadronization/PythiaBaseHadro2019.cxx index 224692166..065e3e11a 100644 --- a/src/Physics/Hadronization/PythiaBaseHadro2019.cxx +++ b/src/Physics/Hadronization/PythiaBaseHadro2019.cxx @@ -109,7 +109,7 @@ void PythiaBaseHadro2019::MakeQuarkDiquarkAssignments( double W = kinematics.W(); int probe = init_state.ProbePdg(); - int hit_nucleon = target.HitNucPdg(); + int hit_nucleon = target.HitPartPdg(); int hit_quark = target.HitQrkPdg(); bool from_sea = target.HitSeaQrk(); @@ -300,7 +300,7 @@ bool PythiaBaseHadro2019::AssertValidity(const Interaction * interaction) const } int probe = init_state.ProbePdg(); - int hit_nucleon = target.HitNucPdg(); + int hit_nucleon = target.HitPartPdg(); int hit_quark = target.HitQrkPdg(); //bool from_sea = target.HitSeaQrk(); diff --git a/src/Physics/InverseBetaDecay/EventGen/IBDKinematicsGenerator.cxx b/src/Physics/InverseBetaDecay/EventGen/IBDKinematicsGenerator.cxx index 2f6b80d6e..300d6b4d6 100644 --- a/src/Physics/InverseBetaDecay/EventGen/IBDKinematicsGenerator.cxx +++ b/src/Physics/InverseBetaDecay/EventGen/IBDKinematicsGenerator.cxx @@ -163,7 +163,7 @@ void IBDKinematicsGenerator::ProcessEventRecord(GHepRecord * evrec) const // struck nucleon mass (can be off the mass shell) const InitialState & init_state = interaction->InitState(); const double E = init_state.ProbeE(kRfHitNucRest); - const double M = init_state.Tgt().HitNucP4().M(); + const double M = init_state.Tgt().HitPartP4().M(); LOG("IBD", pNOTICE) << "E = " << E << ", M = "<< M; diff --git a/src/Physics/Multinucleon/EventGen/MECGenerator.cxx b/src/Physics/Multinucleon/EventGen/MECGenerator.cxx index d6d9ca9b9..20427d2ba 100644 --- a/src/Physics/Multinucleon/EventGen/MECGenerator.cxx +++ b/src/Physics/Multinucleon/EventGen/MECGenerator.cxx @@ -181,10 +181,10 @@ void MECGenerator::GenerateFermiMomentum(GHepRecord * event) const Target tgt(target_nucleus->Pdg()); PDGCodeList pdgv = this->NucleonClusterConstituents(nucleon_cluster->Pdg()); assert(pdgv.size()==2); - tgt.SetHitNucPdg(pdgv[0]); + tgt.SetHitPartPdg(pdgv[0]); fNuclModel->GenerateNucleon(tgt); TVector3 p3a = fNuclModel->Momentum3(); - tgt.SetHitNucPdg(pdgv[1]); + tgt.SetHitPartPdg(pdgv[1]); fNuclModel->GenerateNucleon(tgt); TVector3 p3b = fNuclModel->Momentum3(); @@ -225,7 +225,7 @@ void MECGenerator::GenerateFermiMomentum(GHepRecord * event) const // set the nucleon cluster 4-momentum at the interaction summary - event->Summary()->InitStatePtr()->TgtPtr()->SetHitNucP4(p4nclust); + event->Summary()->InitStatePtr()->TgtPtr()->SetHitPartP4(p4nclust); } //___________________________________________________________________________ void MECGenerator::SelectEmpiricalKinematics(GHepRecord * event) const @@ -305,7 +305,7 @@ void MECGenerator::SelectEmpiricalKinematics(GHepRecord * event) const double gx = 0; double gy = 0; // More accurate calculation of the mass of the cluster than 2*Mnucl - int nucleon_cluster_pdg = interaction->InitState().Tgt().HitNucPdg(); + int nucleon_cluster_pdg = interaction->InitState().Tgt().HitPartPdg(); double M2n = PDGLibrary::Instance()->Find(nucleon_cluster_pdg)->Mass(); //bool is_em = interaction->ProcInfo().IsEM(); kinematics::WQ2toXY(Ev,M2n,gW,gQ2,gx,gy); @@ -332,7 +332,7 @@ void MECGenerator::AddFinalStateLepton(GHepRecord * event) const // The boost back to the lab frame was missing, that is included now with the introduction of the beta factor const InitialState & init_state = interaction->InitState(); - const TLorentzVector & pnuc4 = init_state.Tgt().HitNucP4(); //[@LAB] + const TLorentzVector & pnuc4 = init_state.Tgt().HitPartP4(); //[@LAB] TVector3 beta = pnuc4.BoostVector(); // Boosting the incoming neutrino to the NN-cluster rest frame @@ -703,17 +703,17 @@ void MECGenerator::SelectNSVLeptonKinematics (GHepRecord * event) const // first, get delta-less all if (NuPDG > 0) { - interaction->InitStatePtr()->TgtPtr()->SetHitNucPdg(kPdgClusterNN); + interaction->InitStatePtr()->TgtPtr()->SetHitPartPdg(kPdgClusterNN); } else { - interaction->InitStatePtr()->TgtPtr()->SetHitNucPdg(kPdgClusterPP); + interaction->InitStatePtr()->TgtPtr()->SetHitPartPdg(kPdgClusterPP); } double XSec = fXSecModel->XSec(interaction, kPSTlctl); // now get all with delta interaction->ExclTagPtr()->SetResonance(genie::kP33_1232); double XSecDelta = fXSecModel->XSec(interaction, kPSTlctl); // get PN with delta - interaction->InitStatePtr()->TgtPtr()->SetHitNucPdg(kPdgClusterNP); + interaction->InitStatePtr()->TgtPtr()->SetHitPartPdg(kPdgClusterNP); double XSecDeltaPN = fXSecModel->XSec(interaction, kPSTlctl); // now get delta-less PN interaction->ExclTagPtr()->SetResonance(genie::kNoResonance); @@ -751,7 +751,7 @@ void MECGenerator::SelectNSVLeptonKinematics (GHepRecord * event) const // yes it is, add a PN initial state to event record event->AddParticle(kPdgClusterNP, kIStNucleonTarget, 1, -1, -1, -1, tempp4, v4); - interaction->InitStatePtr()->TgtPtr()->SetHitNucPdg(kPdgClusterNP); + interaction->InitStatePtr()->TgtPtr()->SetHitPartPdg(kPdgClusterNP); // Its a pn, so test for Delta by comparing DeltaPN/PN if (rnd->RndKine().Rndm() <= XSecDeltaPN / XSecPN) { @@ -763,12 +763,12 @@ void MECGenerator::SelectNSVLeptonKinematics (GHepRecord * event) const if (NuPDG > 0) { event->AddParticle(kPdgClusterNN, kIStNucleonTarget, 1, -1, -1, -1, tempp4, v4); - interaction->InitStatePtr()->TgtPtr()->SetHitNucPdg(kPdgClusterNN); + interaction->InitStatePtr()->TgtPtr()->SetHitPartPdg(kPdgClusterNN); } else { event->AddParticle(kPdgClusterPP, kIStNucleonTarget, 1, -1, -1, -1, tempp4, v4); - interaction->InitStatePtr()->TgtPtr()->SetHitNucPdg(kPdgClusterPP); + interaction->InitStatePtr()->TgtPtr()->SetHitPartPdg(kPdgClusterPP); } // its not pn, so test for Delta (XSecDelta-XSecDeltaPN)/(XSec-XSecPN) // right, both numerator and denominator are total not pn. @@ -1037,7 +1037,7 @@ void MECGenerator::SelectSuSALeptonKinematics(GHepRecord* event) const // yes it is, add a PN initial state to event record event->AddParticle(kPdgClusterNP, kIStNucleonTarget, 1, -1, -1, -1, tempp4, v4); - interaction->InitStatePtr()->TgtPtr()->SetHitNucPdg( kPdgClusterNP ); + interaction->InitStatePtr()->TgtPtr()->SetHitPartPdg( kPdgClusterNP ); } else { // no it is not a PN, add either NN or PP initial state to event record (EM case). @@ -1046,24 +1046,24 @@ void MECGenerator::SelectSuSALeptonKinematics(GHepRecord* event) const // record a PP pair: event->AddParticle(kPdgClusterPP, kIStNucleonTarget, 1, -1, -1, -1, tempp4, v4); - interaction->InitStatePtr()->TgtPtr()->SetHitNucPdg( kPdgClusterPP ); + interaction->InitStatePtr()->TgtPtr()->SetHitPartPdg( kPdgClusterPP ); } else { // record a NN pair: event->AddParticle(kPdgClusterNN, kIStNucleonTarget, 1, -1, -1, -1, tempp4, v4); - interaction->InitStatePtr()->TgtPtr()->SetHitNucPdg( kPdgClusterNN ); + interaction->InitStatePtr()->TgtPtr()->SetHitPartPdg( kPdgClusterNN ); } } else { // no it is not a PN, add either NN or PP initial state to event record (CC cases). if ( NuPDG > 0 ) { event->AddParticle(kPdgClusterNN, kIStNucleonTarget, 1, -1, -1, -1, tempp4, v4); - interaction->InitStatePtr()->TgtPtr()->SetHitNucPdg( kPdgClusterNN ); + interaction->InitStatePtr()->TgtPtr()->SetHitPartPdg( kPdgClusterNN ); } else { event->AddParticle(kPdgClusterPP, kIStNucleonTarget, 1, -1, -1, -1, tempp4, v4); - interaction->InitStatePtr()->TgtPtr()->SetHitNucPdg( kPdgClusterPP ); + interaction->InitStatePtr()->TgtPtr()->SetHitPartPdg( kPdgClusterPP ); } } } @@ -1235,11 +1235,11 @@ void MECGenerator::GenerateNSVInitialHadrons(GHepRecord * event) const // Nieves et al. would use a local Fermi gas here, not this, but ok. // so momentum from global Fermi gas, local Fermi gas, or spectral function // and removal energy ~0.025 GeV, correlated with density, or from SF distribution - tgt.SetHitNucPdg(pdgv[0]); + tgt.SetHitPartPdg(pdgv[0]); fNuclModel->GenerateNucleon(tgt); p31i = fNuclModel->Momentum3(); removalenergy1 = fNuclModel->RemovalEnergy(); - tgt.SetHitNucPdg(pdgv[1]); + tgt.SetHitPartPdg(pdgv[1]); fNuclModel->GenerateNucleon(tgt); p32i = fNuclModel->Momentum3(); removalenergy2 = fNuclModel->RemovalEnergy(); diff --git a/src/Physics/Multinucleon/XSection/EmpiricalMECPXSec2015.cxx b/src/Physics/Multinucleon/XSection/EmpiricalMECPXSec2015.cxx index e336645f4..0530be497 100644 --- a/src/Physics/Multinucleon/XSection/EmpiricalMECPXSec2015.cxx +++ b/src/Physics/Multinucleon/XSection/EmpiricalMECPXSec2015.cxx @@ -69,7 +69,7 @@ double EmpiricalMECPXSec2015::XSec( double pv = std::sqrt( std::max(0., Ev*Ev - mv*mv) ); // Invariant mass of the initial hit nucleon - const TLorentzVector& hit_nuc_P4 = init_state.Tgt().HitNucP4(); + const TLorentzVector& hit_nuc_P4 = init_state.Tgt().HitPartP4(); double M = hit_nuc_P4.M(); // Outgoing lepton mass @@ -112,7 +112,7 @@ double EmpiricalMECPXSec2015::XSec( // Do a check whether W,Q2 is allowed. Return 0 otherwise. // double Ev = interaction->InitState().ProbeE(kRfHitNucRest); // kRfLab - int nucleon_cluster_pdg = interaction->InitState().Tgt().HitNucPdg(); + int nucleon_cluster_pdg = interaction->InitState().Tgt().HitPartPdg(); double M2n = PDGLibrary::Instance()->Find(nucleon_cluster_pdg)-> Mass(); // nucleon cluster mass double M2n2 = M2n*M2n; double ml = interaction->FSPrimLepton()->Mass(); @@ -225,7 +225,7 @@ double EmpiricalMECPXSec2015::Integral(const Interaction * interaction) const int nupdg = interaction->InitState().ProbePdg(); int tgtpdg = interaction->InitState().Tgt().Pdg(); double E = interaction->InitState().ProbeE(kRfLab); - int nucleon_cluster_pdg = interaction->InitState().Tgt().HitNucPdg(); + int nucleon_cluster_pdg = interaction->InitState().Tgt().HitPartPdg(); double Z=interaction->InitState().Tgt().Z(); double A=interaction->InitState().Tgt().A(); double N=A-Z; diff --git a/src/Physics/Multinucleon/XSection/NievesSimoVacasMECPXSec2016.cxx b/src/Physics/Multinucleon/XSection/NievesSimoVacasMECPXSec2016.cxx index 7c1b2d904..69fc43bb6 100644 --- a/src/Physics/Multinucleon/XSection/NievesSimoVacasMECPXSec2016.cxx +++ b/src/Physics/Multinucleon/XSection/NievesSimoVacasMECPXSec2016.cxx @@ -64,7 +64,7 @@ double NievesSimoVacasMECPXSec2016::XSec( double pv = std::sqrt( std::max(0., Ev*Ev - mv*mv) ); // Invariant mass of the initial hit nucleon - const TLorentzVector& hit_nuc_P4 = init_state.Tgt().HitNucP4(); + const TLorentzVector& hit_nuc_P4 = init_state.Tgt().HitPartP4(); double M = hit_nuc_P4.M(); // Get the outgoing lepton kinetic energy @@ -211,7 +211,7 @@ double NievesSimoVacasMECPXSec2016::XSec( // Delta decay). If a {p,n} hit dinucleon was set we will calculate the // cross-section for that component only (either full or PDD cross-section) bool delta = interaction->ExclTag().KnownResonance(); - bool pn = (interaction->InitState().Tgt().HitNucPdg() == kPdgClusterNP); + bool pn = (interaction->InitState().Tgt().HitPartPdg() == kPdgClusterNP); double xsec_all = 0.; double xsec_pn = 0.; diff --git a/src/Physics/Multinucleon/XSection/SuSAv2MECPXSec.cxx b/src/Physics/Multinucleon/XSection/SuSAv2MECPXSec.cxx index 180a4bf8a..da7d0c333 100644 --- a/src/Physics/Multinucleon/XSection/SuSAv2MECPXSec.cxx +++ b/src/Physics/Multinucleon/XSection/SuSAv2MECPXSec.cxx @@ -128,7 +128,7 @@ double SuSAv2MECPXSec::XSec(const Interaction* interaction, // dinucleon was set we will calculate the cross-section for that // component only - bool pn = (interaction->InitState().Tgt().HitNucPdg() == kPdgClusterNP); + bool pn = (interaction->InitState().Tgt().HitPartPdg() == kPdgClusterNP); // Compute the cross section using the hadron tensor double xsec = tensor->dSigma_dT_dCosTheta_rosenbluth(interaction, Delta_Q_value); diff --git a/src/Physics/NNBarOscillation/NNBarOscPrimaryVtxGenerator.cxx b/src/Physics/NNBarOscillation/NNBarOscPrimaryVtxGenerator.cxx index e2cd34bd5..ccf29aa51 100644 --- a/src/Physics/NNBarOscillation/NNBarOscPrimaryVtxGenerator.cxx +++ b/src/Physics/NNBarOscillation/NNBarOscPrimaryVtxGenerator.cxx @@ -218,7 +218,7 @@ void NNBarOscPrimaryVtxGenerator::GenerateFermiMomentum( Target tgt(initial_nucleus->Pdg()); // start with oscillating neutron - tgt.SetHitNucPdg(kPdgNeutron); + tgt.SetHitPartPdg(kPdgNeutron); // generate nuclear model & fermi momentum fNuclModel->GenerateNucleon(tgt); TVector3 p3 = fNuclModel->Momentum3(); @@ -237,7 +237,7 @@ void NNBarOscPrimaryVtxGenerator::GenerateFermiMomentum( << "|p| = " << p3.Mag(); // then rinse repeat for the annihilation nucleon - tgt.SetHitNucPdg(annihilation_nucleon->Pdg()); + tgt.SetHitPartPdg(annihilation_nucleon->Pdg()); // use nuclear model to generate fermi momentum fNuclModel->GenerateNucleon(tgt); p3 = fNuclModel->Momentum3(); @@ -303,7 +303,7 @@ void NNBarOscPrimaryVtxGenerator::GenerateDecayProducts( assert(annihilation_nucleon); Target tgt(initial_nucleus->Pdg()); - tgt.SetHitNucPdg(kPdgNeutron); + tgt.SetHitPartPdg(kPdgNeutron); // get their momentum 4-vectors and boost into rest frame TLorentzVector * p4_1 = oscillating_neutron->GetP4(); diff --git a/src/Physics/NuElectron/EventGen/NuEInteractionListGenerator.cxx b/src/Physics/NuElectron/EventGen/NuEInteractionListGenerator.cxx index 524d1c689..6a3b32613 100644 --- a/src/Physics/NuElectron/EventGen/NuEInteractionListGenerator.cxx +++ b/src/Physics/NuElectron/EventGen/NuEInteractionListGenerator.cxx @@ -61,10 +61,11 @@ InteractionList * NuEInteractionListGenerator::IMDInteractionList( // clone init state and de-activate the struck nucleon info InitialState init(init_state); - init_state.TgtPtr()->SetHitNucPdg(0); + init_state.TgtPtr()->SetHitPartPdg(kPdgElectron); ProcessInfo proc_info(kScInverseMuDecay, kIntWeakCC); Interaction * interaction = new Interaction(init, proc_info); + interaction->InitStatePtr()->TgtPtr()->SetHitPartPdg(kPdgElectron); intlist->push_back(interaction); @@ -87,10 +88,11 @@ InteractionList * NuEInteractionListGenerator::IMDAnnihilationInteractionList( // clone init state and de-activate the struck nucleon info InitialState init(init_state); - init_state.TgtPtr()->SetHitNucPdg(0); + init_state.TgtPtr()->SetHitPartPdg(kPdgElectron); ProcessInfo proc_info(kScIMDAnnihilation, kIntWeakCC); Interaction * interaction = new Interaction(init, proc_info); + interaction->InitStatePtr()->TgtPtr()->SetHitPartPdg(kPdgElectron); intlist->push_back(interaction); @@ -115,13 +117,13 @@ InteractionList * NuEInteractionListGenerator::NuEELInteractionList( // clone init state and de-activate the struck nucleon info InitialState init(init_state); - init_state.TgtPtr()->SetHitNucPdg(0); // NC if(nupdg == kPdgNuMu || nupdg == kPdgAntiNuMu || nupdg == kPdgNuTau || nupdg == kPdgAntiNuTau) { ProcessInfo proc_info(kScNuElectronElastic, kIntWeakNC); Interaction * interaction = new Interaction(init, proc_info); + interaction->InitStatePtr()->TgtPtr()->SetHitPartPdg(kPdgElectron); intlist->push_back(interaction); } @@ -129,6 +131,7 @@ InteractionList * NuEInteractionListGenerator::NuEELInteractionList( if(nupdg == kPdgNuE || nupdg == kPdgAntiNuE) { ProcessInfo proc_info(kScNuElectronElastic, kIntWeakMix); Interaction * interaction = new Interaction(init, proc_info); + interaction->InitStatePtr()->TgtPtr()->SetHitPartPdg(kPdgElectron); intlist->push_back(interaction); } diff --git a/src/Physics/NuElectron/EventGen/NuEKinematicsGenerator.cxx b/src/Physics/NuElectron/EventGen/NuEKinematicsGenerator.cxx index cc9b4eb56..2e38ee02c 100644 --- a/src/Physics/NuElectron/EventGen/NuEKinematicsGenerator.cxx +++ b/src/Physics/NuElectron/EventGen/NuEKinematicsGenerator.cxx @@ -5,6 +5,10 @@ Costas Andreopoulos University of Liverpool & STFC Rutherford Appleton Laboratory + + Changes required to calculate energy in electron rest frame + were installed by Brinden Carlson (Univ. of Florida) + */ //____________________________________________________________________________ @@ -58,6 +62,17 @@ void NuEKinematicsGenerator::ProcessEventRecord(GHepRecord * evrec) const const EventGeneratorI * evg = rtinfo->RunningThread(); fXSecModel = evg->CrossSectionAlg(); + //Check if kinematics is still valid + //CM energy may have dropped below threshold due to initial state electron velocity + if(!fXSecModel->ValidKinematics(evrec->Summary())) { + LOG("NuEKinematics", pWARN) + << "The current kinematics configuration is unphysical"; + genie::exceptions::EVGThreadException exception; + exception.SetReason("Event below threshold"); + exception.SwitchOnStepBack(); + throw exception; + } + //-- For the subsequent kinematic selection with the rejection method: // Calculate the max differential cross section or retrieve it from the // cache. Throw an exception and quit the evg thread if a non-positive @@ -210,10 +225,10 @@ double NuEKinematicsGenerator::ComputeMaxXSec( double NuEKinematicsGenerator::Energy(const Interaction * interaction) const { // Override the base class Energy() method to cache the max xsec for the -// neutrino energy in the LAB rather than in the hit nucleon rest frame. +// neutrino energy in the electron rest frame. const InitialState & init_state = interaction->InitState(); - double E = init_state.ProbeE(kRfLab); + double E = init_state.ProbeE(kRfHitElRest); return E; } //___________________________________________________________________________ diff --git a/src/Physics/NuElectron/EventGen/NuEPrimaryLeptonGenerator.cxx b/src/Physics/NuElectron/EventGen/NuEPrimaryLeptonGenerator.cxx index d7a0336f8..f822d66db 100644 --- a/src/Physics/NuElectron/EventGen/NuEPrimaryLeptonGenerator.cxx +++ b/src/Physics/NuElectron/EventGen/NuEPrimaryLeptonGenerator.cxx @@ -5,6 +5,9 @@ Costas Andreopoulos University of Liverpool & STFC Rutherford Appleton Laboratory + + Changes required to boost from electron rest frame to lab frame + were installed by Brinden Carlson (Univ. of Florida) */ //____________________________________________________________________________ @@ -47,7 +50,14 @@ void NuEPrimaryLeptonGenerator::ProcessEventRecord(GHepRecord * evrec) const // This method generates the final state primary lepton for NuE events Interaction * interaction = evrec->Summary(); - const InitialState & init_state = interaction->InitState(); + + // Boost vector for [LAB] <-> [Electron Rest Frame] transforms + TVector3 beta = this->EleRestFrame2Lab(*evrec); // Get boost of hit + + // Neutrino 4p + TLorentzVector p4v(*evrec->Probe()->GetP4()); // v 4p @ LAB + p4v.Boost(-1.*beta); + // Get selected kinematics double y = interaction->Kine().y(true); @@ -58,7 +68,7 @@ void NuEPrimaryLeptonGenerator::ProcessEventRecord(GHepRecord * evrec) const assert(pdgc!=0); // Compute the neutrino and muon energy - double Ev = init_state.ProbeE(kRfLab); + double Ev = p4v.E(); double El = (1-y)*Ev; LOG("LeptonicVertex", pINFO) @@ -109,8 +119,9 @@ void NuEPrimaryLeptonGenerator::ProcessEventRecord(GHepRecord * evrec) const TVector3 p3l(pltx,plty,plp); p3l.RotateUz(unit_nudir); - // Lepton 4-momentum in the LAB + // Lepton 4-momentum in the Ele rest frame TLorentzVector p4l(p3l,El); + p4l.Boost(beta); //Boost back to lab // Create a GHepParticle and add it to the event record this->AddToEventRecord(evrec, pdgc, p4l); @@ -119,3 +130,17 @@ void NuEPrimaryLeptonGenerator::ProcessEventRecord(GHepRecord * evrec) const this->SetPolarization(evrec); } //___________________________________________________________________________ +TVector3 NuEPrimaryLeptonGenerator::EleRestFrame2Lab(const GHepRecord & evrec) const +{ +// Velocity for an active Lorentz transform taking the final state primary +// lepton from the [electron rest frame] --> [LAB] + + Interaction * interaction = evrec.Summary(); + const InitialState & init_state = interaction->InitState(); + + const TLorentzVector & pele4 = init_state.Tgt().HitPartP4(); //[@LAB] + TVector3 beta = pele4.BoostVector(); + + return beta; +} +//___________________________________________________________________________ diff --git a/src/Physics/NuElectron/EventGen/NuEPrimaryLeptonGenerator.h b/src/Physics/NuElectron/EventGen/NuEPrimaryLeptonGenerator.h index bd0818d03..0f0ceaefc 100644 --- a/src/Physics/NuElectron/EventGen/NuEPrimaryLeptonGenerator.h +++ b/src/Physics/NuElectron/EventGen/NuEPrimaryLeptonGenerator.h @@ -32,6 +32,8 @@ public : //-- implement the EventRecordVisitorI interface void ProcessEventRecord(GHepRecord * event_rec) const; + + TVector3 EleRestFrame2Lab (const GHepRecord & evrec) const; }; } // genie namespace diff --git a/src/Physics/NuElectron/XSection/BardinIMDRadCorPXSec.cxx b/src/Physics/NuElectron/XSection/BardinIMDRadCorPXSec.cxx index cad76e740..e5a115075 100644 --- a/src/Physics/NuElectron/XSection/BardinIMDRadCorPXSec.cxx +++ b/src/Physics/NuElectron/XSection/BardinIMDRadCorPXSec.cxx @@ -11,7 +11,6 @@ #include #include -#include "Physics/XSectionIntegration/XSecIntegratorI.h" #include "Framework/Conventions/GBuild.h" #include "Framework/Conventions/Constants.h" #include "Framework/Conventions/RefFrame.h" @@ -19,19 +18,20 @@ #include "Framework/Messenger/Messenger.h" #include "Framework/Utils/KineUtils.h" #include "Framework/Numerical/GSLUtils.h" +#include "Physics/NuElectron/XSection/PXSecOnElectron.h" using namespace genie; using namespace genie::constants; //____________________________________________________________________________ BardinIMDRadCorPXSec::BardinIMDRadCorPXSec() : -XSecAlgorithmI("genie::BardinIMDRadCorPXSec") +PXSecOnElectron::PXSecOnElectron("genie::BardinIMDRadCorPXSec","Default") { } //____________________________________________________________________________ BardinIMDRadCorPXSec::BardinIMDRadCorPXSec(string config) : -XSecAlgorithmI("genie::BardinIMDRadCorPXSec", config) +PXSecOnElectron::PXSecOnElectron("genie::BardinIMDRadCorPXSec", config) { } @@ -49,7 +49,7 @@ double BardinIMDRadCorPXSec::XSec( const InitialState & init_state = interaction -> InitState(); - double E = init_state.ProbeE(kRfLab); + double E = init_state.ProbeE(kRfHitElRest); double sig0 = kGF2 * kElectronMass * E / kPi; double re = 0.5 * kElectronMass / E; double r = (kMuonMass2 / kElectronMass2) * re; @@ -96,18 +96,6 @@ double BardinIMDRadCorPXSec::XSec( return xsec; } //____________________________________________________________________________ -double BardinIMDRadCorPXSec::Integral(const Interaction * interaction) const -{ - double xsec = fXSecIntegrator->Integrate(this,interaction); - return xsec; -} -//____________________________________________________________________________ -bool BardinIMDRadCorPXSec::ValidProcess(const Interaction * interaction) const -{ - if(interaction->TestBit(kISkipProcessChk)) return true; - return true; -} -//____________________________________________________________________________ double BardinIMDRadCorPXSec::Fa(double re, double r, double y) const { double y2 = y * y; @@ -251,27 +239,12 @@ double BardinIMDRadCorPXSec::C(int i, int k, double r) const } else return 0.; } //____________________________________________________________________________ -void BardinIMDRadCorPXSec::Configure(const Registry & config) -{ - Algorithm::Configure(config); - this->LoadConfig(); -} -//____________________________________________________________________________ -void BardinIMDRadCorPXSec::Configure(string param_set) -{ - Algorithm::Configure(param_set); - this->LoadConfig(); -} -//____________________________________________________________________________ void BardinIMDRadCorPXSec::LoadConfig(void) { + PXSecOnElectron::LoadConfig(); ////fIntegrator = //// dynamic_cast (this->SubAlg("Integrator")); ///// assert(fIntegrator); - - fXSecIntegrator = - dynamic_cast (this->SubAlg("XSec-Integrator")); - assert(fXSecIntegrator); } //____________________________________________________________________________ // Auxiliary scalar function for internal integration diff --git a/src/Physics/NuElectron/XSection/BardinIMDRadCorPXSec.h b/src/Physics/NuElectron/XSection/BardinIMDRadCorPXSec.h index 4f9998811..1e05173cc 100644 --- a/src/Physics/NuElectron/XSection/BardinIMDRadCorPXSec.h +++ b/src/Physics/NuElectron/XSection/BardinIMDRadCorPXSec.h @@ -19,6 +19,8 @@ \author Costas Andreopoulos University of Liverpool & STFC Rutherford Appleton Laboratory + B. Carlson modified to interface PXSecOnElectron + \created February 14, 2005 \cpright Copyright (c) 2003-2023, The GENIE Collaboration @@ -30,33 +32,24 @@ #define _BARDIN_IMD_RADIATIVE_CORRECTIONS_PARTIAL_XSEC_H_ #include -#include "Framework/EventGen/XSecAlgorithmI.h" +#include "Physics/NuElectron/XSection/PXSecOnElectron.h" namespace genie { -class XSecIntegratorI; - -class BardinIMDRadCorPXSec : public XSecAlgorithmI { +class BardinIMDRadCorPXSec : public PXSecOnElectron { public: BardinIMDRadCorPXSec(); BardinIMDRadCorPXSec(string config); virtual ~BardinIMDRadCorPXSec(); - // XSecAlgorithmI interface implementation - double XSec (const Interaction * i, KinePhaseSpace_t k) const; - double Integral (const Interaction * i) const; - bool ValidProcess (const Interaction * i) const; - - // Override the Algorithm::Configure methods to load configuration - // data to private data members - void Configure (const Registry & config); - void Configure (string param_set); - -private: + // PXSecOnElectron interface implementation + double XSec (const Interaction * i, KinePhaseSpace_t k) const override; +protected: // Load configuration when Algorithm::Configure() is called - void LoadConfig(void); + void LoadConfig(void) override; +private: // Private functions // (symbols follow the notation in Bardin-Dokuchaeva paper) @@ -67,7 +60,6 @@ class BardinIMDRadCorPXSec : public XSecAlgorithmI { // Private data members // const IntegratorI * fIntegrator; ///< num integrator for BardinIMDRadCorIntegrand - const XSecIntegratorI * fXSecIntegrator; ///< differential x-sec integrator }; } // genie namespace diff --git a/src/Physics/NuElectron/XSection/IMDAnnihilationPXSec.cxx b/src/Physics/NuElectron/XSection/IMDAnnihilationPXSec.cxx index 88845a6a2..bd07c3776 100644 --- a/src/Physics/NuElectron/XSection/IMDAnnihilationPXSec.cxx +++ b/src/Physics/NuElectron/XSection/IMDAnnihilationPXSec.cxx @@ -10,13 +10,13 @@ #include "Framework/Algorithm/AlgConfigPool.h" #include "Framework/Conventions/GBuild.h" #include "Framework/Conventions/Controls.h" -#include "Physics/XSectionIntegration/XSecIntegratorI.h" #include "Framework/Conventions/Constants.h" #include "Framework/Conventions/RefFrame.h" #include "Physics/NuElectron/XSection/IMDAnnihilationPXSec.h" #include "Framework/Messenger/Messenger.h" #include "Framework/ParticleData/PDGUtils.h" #include "Framework/Utils/KineUtils.h" +#include "Physics/NuElectron/XSection/PXSecOnElectron.h" using namespace genie; using namespace genie::constants; @@ -24,13 +24,13 @@ using namespace genie::controls; //____________________________________________________________________________ IMDAnnihilationPXSec::IMDAnnihilationPXSec() : -XSecAlgorithmI("genie::IMDAnnihilationPXSec") +PXSecOnElectron::PXSecOnElectron("genie::IMDAnnihilationPXSec","Default") { } //____________________________________________________________________________ IMDAnnihilationPXSec::IMDAnnihilationPXSec(string config) : -XSecAlgorithmI("genie::IMDAnnihilationPXSec", config) +PXSecOnElectron::PXSecOnElectron("genie::IMDAnnihilationPXSec", config) { } @@ -50,7 +50,7 @@ double IMDAnnihilationPXSec::XSec( const InitialState & init_state = interaction -> InitState(); const Kinematics & kinematics = interaction -> Kine(); - double Ev = init_state.ProbeE(kRfLab); + double Ev = init_state.ProbeE(kRfHitElRest); double twoMeEv = 2*kElectronMass*Ev; double ymax = 1 - kMuonMass2/(twoMeEv + kElectronMass2); double y = kinematics.y(); @@ -87,41 +87,8 @@ double IMDAnnihilationPXSec::XSec( return xsec; } //____________________________________________________________________________ -double IMDAnnihilationPXSec::Integral(const Interaction * interaction) const -{ - double xsec = fXSecIntegrator->Integrate(this,interaction); - return xsec; -} -//____________________________________________________________________________ -bool IMDAnnihilationPXSec::ValidProcess(const Interaction * interaction) const -{ - if(interaction->TestBit(kISkipProcessChk)) return true; - return true; -} -//____________________________________________________________________________ -bool IMDAnnihilationPXSec::ValidKinematics(const Interaction* interaction) const -{ - if(interaction->TestBit(kISkipKinematicChk)) return true; - return true; -} -//____________________________________________________________________________ -void IMDAnnihilationPXSec::Configure(const Registry & config) -{ - Algorithm::Configure(config); - this->LoadConfig(); -} -//____________________________________________________________________________ -void IMDAnnihilationPXSec::Configure(string config) -{ - Algorithm::Configure(config); - this->LoadConfig(); -} -//____________________________________________________________________________ void IMDAnnihilationPXSec::LoadConfig(void) { - // load XSec Integrator - fXSecIntegrator = - dynamic_cast (this->SubAlg("XSec-Integrator")); - assert(fXSecIntegrator); + PXSecOnElectron::LoadConfig(); } //____________________________________________________________________________ diff --git a/src/Physics/NuElectron/XSection/IMDAnnihilationPXSec.h b/src/Physics/NuElectron/XSection/IMDAnnihilationPXSec.h index b3a7f9b03..aff05b25b 100644 --- a/src/Physics/NuElectron/XSection/IMDAnnihilationPXSec.h +++ b/src/Physics/NuElectron/XSection/IMDAnnihilationPXSec.h @@ -6,13 +6,15 @@ \brief nuebar + e- -> mu- + numubar [CC] scattering differential cross section \n - Is a concrete implementation of the XSecAlgorithmI interface. \n + Is a concrete implementation of the PXSecOnElectron interface. \n \ref W.J.Marciano and Z.Parsa, Neutrino-electron scattering theory, J.Phys.G: Nucl.Part.Phys. 29 (2003) 2629-2645 \author Rosen Matev (r.matev@gmail.com) + B. Carlson implemented changes to interface PXSecOnElectron + \created October 3, 2011 \cpright Copyright (c) 2003-2023, The GENIE Collaboration @@ -23,35 +25,26 @@ #ifndef _IMD_ANNIHILATION_PXSEC_H_ #define _IMD_ANNIHILATION_PXSEC_H_ -#include "Framework/EventGen/XSecAlgorithmI.h" +#include "Physics/NuElectron/XSection/PXSecOnElectron.h" namespace genie { class IntegratorI; class XSecIntegratorI; -class IMDAnnihilationPXSec : public XSecAlgorithmI { +class IMDAnnihilationPXSec : public PXSecOnElectron { public: IMDAnnihilationPXSec(); IMDAnnihilationPXSec(string config); virtual ~IMDAnnihilationPXSec(); - //-- XSecAlgorithmI interface implementation - double XSec (const Interaction * i, KinePhaseSpace_t k) const; - double Integral (const Interaction * i) const; - bool ValidProcess (const Interaction * i) const; - bool ValidKinematics (const Interaction * i) const; - - //-- overload the Algorithm::Configure() methods to load private data - // members from configuration options - void Configure(const Registry & config); - void Configure(string config); + //-- PXSecOnElectron interface implementation + double XSec (const Interaction * i, KinePhaseSpace_t k) const override; -private: +protected: void LoadConfig (void); - - const XSecIntegratorI * fXSecIntegrator; +private: }; diff --git a/src/Physics/NuElectron/XSection/IMDXSec.cxx b/src/Physics/NuElectron/XSection/IMDXSec.cxx deleted file mode 100644 index b836d05bd..000000000 --- a/src/Physics/NuElectron/XSection/IMDXSec.cxx +++ /dev/null @@ -1,97 +0,0 @@ -//____________________________________________________________________________ -/* - Copyright (c) 2003-2023, The GENIE Collaboration - For the full text of the license visit http://copyright.genie-mc.org - - Costas Andreopoulos - University of Liverpool & STFC Rutherford Appleton Laboratory -*/ -//____________________________________________________________________________ - -#include -#include -#include - -#include "Framework/Conventions/GBuild.h" -#include "Framework/Conventions/Constants.h" -#include "Framework/Conventions/Units.h" -#include "Framework/Conventions/RefFrame.h" -#include "Physics/NuElectron/XSection/IMDXSec.h" -#include "Physics/XSectionIntegration/GSLXSecFunc.h" -#include "Framework/Messenger/Messenger.h" -#include "Framework/Numerical/GSLUtils.h" - -using namespace genie; -using namespace genie::constants; - -//____________________________________________________________________________ -IMDXSec::IMDXSec() : -XSecIntegratorI("genie::IMDXSec") -{ - -} -//____________________________________________________________________________ -IMDXSec::IMDXSec(string config) : -XSecIntegratorI("genie::IMDXSec", config) -{ - -} -//____________________________________________________________________________ -IMDXSec::~IMDXSec() -{ - -} -//____________________________________________________________________________ -double IMDXSec::Integrate( - const XSecAlgorithmI * model, const Interaction * in) const -{ - if(! model->ValidProcess(in) ) return 0.; - - const KPhaseSpace & kps = in->PhaseSpace(); - if(!kps.IsAboveThreshold()) { - LOG("IMDXSec", pDEBUG) << "*** below energy threshold"; - return 0; - } - Range1D_t yl = kps.Limits(kKVy); - - Interaction * interaction = new Interaction(*in); - interaction->SetBit(kISkipProcessChk); - //interaction->SetBit(kISkipKinematicChk); - - double abstol = 1; // We mostly care about relative tolerance - ROOT::Math::IBaseFunctionOneDim * func = new utils::gsl::dXSec_dy_E(model, interaction); - ROOT::Math::IntegrationOneDim::Type ig_type = utils::gsl::Integration1DimTypeFromString(fGSLIntgType); - ROOT::Math::Integrator ig(*func,ig_type,abstol,fGSLRelTol,fGSLMaxEval); - double xsec = ig.Integral(yl.min, yl.max) * (1E-38 * units::cm2); - - //LOG("IMDXSec", pDEBUG) << "XSec[IMD] (E = " << E << ") = " << xsec; - - delete interaction; - delete func; - - return xsec; -} -//____________________________________________________________________________ -void IMDXSec::Configure(const Registry & config) -{ - Algorithm::Configure(config); - this->LoadConfig(); -} -//____________________________________________________________________________ -void IMDXSec::Configure(string config) -{ - Algorithm::Configure(config); - this->LoadConfig(); -} -//____________________________________________________________________________ -void IMDXSec::LoadConfig(void) -{ - // Get GSL integration type & relative tolerance - GetParamDef( "gsl-integration-type", fGSLIntgType, string( "adaptive" ) ) ; - GetParamDef( "gsl-relative-tolerance", fGSLRelTol, 1E-4 ) ; - int max; - GetParamDef( "gsl-max-eval", max, 100000 ) ; - fGSLMaxEval = (unsigned int) max ; - -} -//____________________________________________________________________________ diff --git a/src/Physics/NuElectron/XSection/IMDXSec.h b/src/Physics/NuElectron/XSection/IMDXSec.h deleted file mode 100644 index 8e66faa45..000000000 --- a/src/Physics/NuElectron/XSection/IMDXSec.h +++ /dev/null @@ -1,45 +0,0 @@ -//____________________________________________________________________________ -/*! - -\class genie::IMDXSec - -\brief Computes the Inverse Muon Decay cross section. - -\author Costas Andreopoulos - University of Liverpool & STFC Rutherford Appleton Laboratory - -\created Fabruary 14, 2005 - -\cpright Copyright (c) 2003-2023, The GENIE Collaboration - For the full text of the license visit http://copyright.genie-mc.org -*/ -//____________________________________________________________________________ - -#ifndef _IMD_XSEC_H_ -#define _IMD_XSEC_H_ - -#include "Physics/XSectionIntegration/XSecIntegratorI.h" - -namespace genie { - -class IMDXSec : public XSecIntegratorI { - -public: - IMDXSec(); - IMDXSec(string config); - virtual ~IMDXSec(); - - //! XSecIntegratorI interface implementation - double Integrate(const XSecAlgorithmI * model, const Interaction * i) const; - - //! Overload the Algorithm::Configure() methods to load private data - //! members from configuration options - void Configure(const Registry & config); - void Configure(string config); - -private: - void LoadConfig (void); -}; - -} // genie namespace -#endif // _IMD_XSEC_H_ diff --git a/src/Physics/NuElectron/XSection/LinkDef.h b/src/Physics/NuElectron/XSection/LinkDef.h index 28f9ccc7d..c7813029e 100644 --- a/src/Physics/NuElectron/XSection/LinkDef.h +++ b/src/Physics/NuElectron/XSection/LinkDef.h @@ -6,12 +6,12 @@ #pragma link C++ namespace genie; +#pragma link C++ class genie::PXSecOnElectron; + #pragma link C++ class genie::IMDAnnihilationPXSec; #pragma link C++ class genie::BardinIMDRadCorPXSec; #pragma link C++ class genie::NuElectronPXSec; -#pragma link C++ class genie::IMDXSec; - -#pragma link C++ class genie::NuElectronXSec; +#pragma link C++ class genie::XSecOnElectron; #endif diff --git a/src/Physics/NuElectron/XSection/NuElectronPXSec.cxx b/src/Physics/NuElectron/XSection/NuElectronPXSec.cxx index b39fbd418..7c20956ba 100644 --- a/src/Physics/NuElectron/XSection/NuElectronPXSec.cxx +++ b/src/Physics/NuElectron/XSection/NuElectronPXSec.cxx @@ -5,19 +5,28 @@ Costas Andreopoulos University of Liverpool & STFC Rutherford Appleton Laboratory + + Changes required to implement the Electron Velocity module + were installed by Brinden Carlson (Univ. of Florida) */ //____________________________________________________________________________ #include "Framework/Algorithm/AlgConfigPool.h" #include "Framework/Conventions/GBuild.h" #include "Framework/Conventions/Controls.h" -#include "Physics/XSectionIntegration/XSecIntegratorI.h" #include "Framework/Conventions/Constants.h" #include "Framework/Conventions/RefFrame.h" #include "Physics/NuElectron/XSection/NuElectronPXSec.h" #include "Framework/Messenger/Messenger.h" #include "Framework/ParticleData/PDGUtils.h" #include "Framework/Utils/KineUtils.h" +#include "Physics/NuElectron/XSection/PXSecOnElectron.h" + + +#include "TFile.h" +#include "TGraph.h" +#include +#include using namespace genie; using namespace genie::constants; @@ -25,13 +34,13 @@ using namespace genie::controls; //____________________________________________________________________________ NuElectronPXSec::NuElectronPXSec() : -XSecAlgorithmI("genie::NuElectronPXSec") +PXSecOnElectron::PXSecOnElectron("genie::NuElectronPXSec","Default") { } //____________________________________________________________________________ NuElectronPXSec::NuElectronPXSec(string config) : -XSecAlgorithmI("genie::NuElectronPXSec", config) +PXSecOnElectron::PXSecOnElectron("genie::NuElectronPXSec", config) { } @@ -52,7 +61,8 @@ double NuElectronPXSec::XSec( const Kinematics & kinematics = interaction -> Kine(); const ProcessInfo & proc_info = interaction -> ProcInfo(); - double Ev = init_state.ProbeE(kRfLab); + double Ev = init_state.ProbeE(kRfHitElRest); //Electron rest frame + double me = kElectronMass; double y = kinematics.y(); double A = kGF2*2*me*Ev/kPi; @@ -132,47 +142,20 @@ double NuElectronPXSec::XSec( return xsec; } //____________________________________________________________________________ -double NuElectronPXSec::Integral(const Interaction * interaction) const -{ - double xsec = fXSecIntegrator->Integrate(this,interaction); - return xsec; -} -//____________________________________________________________________________ -bool NuElectronPXSec::ValidProcess(const Interaction * interaction) const -{ - if(interaction->TestBit(kISkipProcessChk)) return true; - return true; -} -//____________________________________________________________________________ bool NuElectronPXSec::ValidKinematics(const Interaction* interaction) const { + //Works for NuEElastic, IMD needs its own check if(interaction->TestBit(kISkipKinematicChk)) return true; return true; } //____________________________________________________________________________ -void NuElectronPXSec::Configure(const Registry & config) -{ - Algorithm::Configure(config); - this->LoadConfig(); -} -//____________________________________________________________________________ -void NuElectronPXSec::Configure(string config) -{ - Algorithm::Configure(config); - this->LoadConfig(); -} -//____________________________________________________________________________ void NuElectronPXSec::LoadConfig(void) { + PXSecOnElectron::LoadConfig(); // weinberg angle double thw ; GetParam( "WeinbergAngle", thw ) ; fSin28w = TMath::Power(TMath::Sin(thw), 2); fSin48w = TMath::Power(TMath::Sin(thw), 4); - - // load XSec Integrator - fXSecIntegrator = - dynamic_cast (this->SubAlg("XSec-Integrator")); - assert(fXSecIntegrator); } //____________________________________________________________________________ diff --git a/src/Physics/NuElectron/XSection/NuElectronPXSec.h b/src/Physics/NuElectron/XSection/NuElectronPXSec.h index e39775d5a..2709b640c 100644 --- a/src/Physics/NuElectron/XSection/NuElectronPXSec.h +++ b/src/Physics/NuElectron/XSection/NuElectronPXSec.h @@ -18,6 +18,9 @@ \author Costas Andreopoulos University of Liverpool & STFC Rutherford Appleton Laboratory + Changes required to implement the Electron Velocity module + were installed by Brinden Carlson (Univ. of Florida) + \created February 10, 2006 \cpright Copyright (c) 2003-2023, The GENIE Collaboration @@ -28,35 +31,26 @@ #ifndef _NU_ELECTRON_PARTIAL_XSEC_H_ #define _NU_ELECTRON_PARTIAL_XSEC_H_ -#include "Framework/EventGen/XSecAlgorithmI.h" +#include "Physics/NuElectron/XSection/PXSecOnElectron.h" namespace genie { -class IntegratorI; -class XSecIntegratorI; - -class NuElectronPXSec : public XSecAlgorithmI { +class NuElectronPXSec : public PXSecOnElectron { public: NuElectronPXSec(); NuElectronPXSec(string config); virtual ~NuElectronPXSec(); - //-- XSecAlgorithmI interface implementation - double XSec (const Interaction * i, KinePhaseSpace_t k) const; - double Integral (const Interaction * i) const; - bool ValidProcess (const Interaction * i) const; - bool ValidKinematics (const Interaction * i) const; + //-- PXSecOnElectron interface implementation + double XSec (const Interaction * i, KinePhaseSpace_t k) const override; - //-- overload the Algorithm::Configure() methods to load private data - // members from configuration options - void Configure(const Registry & config); - void Configure(string config); + //Override since NuEElastic is always valid kinematics + bool ValidKinematics(const Interaction* interaction) const override; +protected: + void LoadConfig (void) override; private: - void LoadConfig (void); - - const XSecIntegratorI * fXSecIntegrator; double fSin28w; // sin^2(theta-weinberg) double fSin48w; diff --git a/src/Physics/NuElectron/XSection/PXSecOnElectron.cxx b/src/Physics/NuElectron/XSection/PXSecOnElectron.cxx new file mode 100644 index 000000000..a891d1518 --- /dev/null +++ b/src/Physics/NuElectron/XSection/PXSecOnElectron.cxx @@ -0,0 +1,138 @@ +//____________________________________________________________________________ +/* + Copyright (c) 2003-2023, The GENIE Collaboration + For the full text of the license visit http://copyright.genie-mc.org + + Brinden Carlson bcarlson1@ufl.edu + University of Florida +*/ +//____________________________________________________________________________ + +#include "Framework/Algorithm/AlgConfigPool.h" +#include "Framework/Conventions/GBuild.h" +#include "Framework/Conventions/Controls.h" +#include "Physics/XSectionIntegration/XSecIntegratorI.h" +#include "Framework/Conventions/Constants.h" +#include "Framework/Conventions/RefFrame.h" +#include "Physics/NuElectron/XSection/PXSecOnElectron.h" +#include "Framework/Messenger/Messenger.h" +#include "Framework/ParticleData/PDGUtils.h" +#include "Framework/Utils/KineUtils.h" +#include "Physics/NuclearState/ElectronVelocity.h" +#include "Framework/Numerical/MathUtils.h" + +#include "TFile.h" +#include "TGraph.h" +#include +#include + +using namespace genie; +using namespace genie::constants; +using namespace genie::controls; + +//____________________________________________________________________________ +PXSecOnElectron::PXSecOnElectron(string name, string config) : +XSecAlgorithmI(name, config) +{ + +} +//____________________________________________________________________________ +PXSecOnElectron::PXSecOnElectron() : +XSecAlgorithmI("genie::PXSecOnElectron") +{ + +} +//____________________________________________________________________________ +PXSecOnElectron::~PXSecOnElectron() +{ + +} +//____________________________________________________________________________ +double PXSecOnElectron::Integral(const Interaction * interaction) const +{ + double xsec_sum = 0; + double xsec_sum2 = 0; + int NInt = 0; //Count number of integrations + bool has_zero = false; //XSec values equal to zero + do{ + NInt++; + Interaction in_curr(*interaction); //Copy interaction object + fElectronVelocity->InitializeVelocity(in_curr); //Modify interaction to give electron random velocity from selected distribution + double xsec = fXSecIntegrator->Integrate(this,&in_curr); // In ele at rest + if (xsec == 0.){ + has_zero = true; + } + + //get gamma - comps orthogonal to beam x,y + //scale = sqrt(1-b_t^2) + auto probe_direction = in_curr.InitState().GetProbeP4(kRfHitElRest)->Vect().Unit(); + auto electron_mom = in_curr.InitState().Tgt().HitPartP4(); + auto transverse_mom = utils::math::GetOrthogonal(electron_mom, probe_direction); + auto gamma_transverse = transverse_mom.Gamma(); + + xsec *= gamma_transverse; //Correct for lorentz factor + xsec_sum+=xsec; + xsec_sum2+=TMath::Power(xsec,2); + double xsec_mean = xsec_sum/NInt; + //var = (sum(xi^2)/N-xsec_mean^2) + //rel_err = sigma/sqrt(n)*mean + double xsec_err = 0; + if (xsec_mean > 0){ + xsec_err = sqrt((xsec_sum2/NInt-TMath::Power(xsec_mean,2))/NInt)/xsec_mean; + } + if (has_zero){ + if (NInt > 10 && xsec_err < fErrTolerance){break;} //Check for xsec values equal to 0 + } + else if (NInt > 1 && xsec_err < fErrTolerance){break;} //Break condition for dipping below set tolerance + } + while ( NInt < fNIntegration); + double xsec_avg = xsec_sum/NInt; + return xsec_avg; +} +//____________________________________________________________________________ +bool PXSecOnElectron::ValidProcess(const Interaction * interaction) const +{ + if(interaction->TestBit(kISkipProcessChk)) return true; + bool is_valid = true; + if(!pdg::IsElectron(interaction->InitState().TgtPtr()->HitPartPdg())) is_valid = false; + return is_valid; +} +//____________________________________________________________________________ +bool PXSecOnElectron::ValidKinematics(const Interaction* interaction) const +{ + //Works for IMD + const auto & kps = interaction->PhaseSpace(); + auto result = kps.IsAboveThreshold(); + return result; +} +//____________________________________________________________________________ +void PXSecOnElectron::Configure(const Registry & config) +{ + Algorithm::Configure(config); + this->LoadConfig(); +} +//____________________________________________________________________________ +void PXSecOnElectron::Configure(string config) +{ + Algorithm::Configure(config); + this->LoadConfig(); +} +//____________________________________________________________________________ +void PXSecOnElectron::LoadConfig(void) +{ + //Integration parameters + GetParam( "N-Integration-Samples", fNIntegration ) ; // + GetParam( "NuE-XSecRelError" , fErrTolerance ) ; // + + // load XSec Integrator + fXSecIntegrator = + dynamic_cast (this->SubAlg("XSec-Integrator")); // + fElectronVelocity = + dynamic_cast (this->SubAlg("Electron-Velocity")); // + if (!fElectronVelocity) { + LOG("PXSecOnElectron", pDEBUG) + << "fElectronVelocity is not initialized correctly."; + exit(78); + } +} +//____________________________________________________________________________ diff --git a/src/Physics/NuElectron/XSection/PXSecOnElectron.h b/src/Physics/NuElectron/XSection/PXSecOnElectron.h new file mode 100644 index 000000000..2a53ccde2 --- /dev/null +++ b/src/Physics/NuElectron/XSection/PXSecOnElectron.h @@ -0,0 +1,66 @@ +//____________________________________________________________________________ +/*! + +\class genie::PXSecOnElectron + +\brief nu/nubar + e- scattering differential cross section \n + The cross section algorithm interfaces nu+e cross sections + Final states are handled by sub modules + + Is a concrete implementation of the XSecAlgorithmI interface. \n + +\author Brinden Carlson bcarlson1@ufl.edu + University of Florida + +\created June 1, 2023 + +\cpright Copyright (c) 2003-2023, The GENIE Collaboration + For the full text of the license visit http://copyright.genie-mc.org +*/ +//____________________________________________________________________________ + +#ifndef _NU_ON_ELECTRON_PARTIAL_XSEC_H_ +#define _NU_ON_ELECTRON_PARTIAL_XSEC_H_ + +#include "Framework/EventGen/XSecAlgorithmI.h" +#include "Physics/NuclearState/ElectronVelocity.h" + +namespace genie { + +class IntegratorI; +class XSecIntegratorI; + +class PXSecOnElectron : public XSecAlgorithmI { + +public: + PXSecOnElectron(); + PXSecOnElectron(string name,string config); + virtual ~PXSecOnElectron(); + + //-- XSecAlgorithmI interface implementation + virtual double XSec (const Interaction * i, KinePhaseSpace_t k) const override = 0; + double Integral (const Interaction * i) const final; + bool ValidProcess (const Interaction * i) const override; + bool ValidKinematics (const Interaction * i) const override; + + //-- overload the Algorithm::Configure() methods to load private data + // members from configuration options + void Configure(const Registry & config) final; + void Configure(string config) final; + +private: + + +protected: + virtual void LoadConfig (void); + + const XSecIntegratorI * fXSecIntegrator; + const ElectronVelocity * fElectronVelocity; + + int fNIntegration; //Max number of integration samples + double fErrTolerance; //Error tolerance acceptable before returning cross section average +}; + +} // genie namespace +#endif // _NU_ON_ELECTRON_PARTIAL_XSEC_H_ + diff --git a/src/Physics/NuElectron/XSection/NuElectronXSec.cxx b/src/Physics/NuElectron/XSection/XSecOnElectron.cxx similarity index 86% rename from src/Physics/NuElectron/XSection/NuElectronXSec.cxx rename to src/Physics/NuElectron/XSection/XSecOnElectron.cxx index 5148ea85a..ec934b512 100644 --- a/src/Physics/NuElectron/XSection/NuElectronXSec.cxx +++ b/src/Physics/NuElectron/XSection/XSecOnElectron.cxx @@ -16,7 +16,7 @@ #include "Framework/Conventions/Constants.h" #include "Framework/Conventions/Units.h" #include "Framework/Conventions/RefFrame.h" -#include "Physics/NuElectron/XSection/NuElectronXSec.h" +#include "Physics/NuElectron/XSection/XSecOnElectron.h" #include "Physics/XSectionIntegration/GSLXSecFunc.h" #include "Framework/Messenger/Messenger.h" #include "Framework/Numerical/GSLUtils.h" @@ -25,24 +25,24 @@ using namespace genie; using namespace genie::constants; //____________________________________________________________________________ -NuElectronXSec::NuElectronXSec() : -XSecIntegratorI("genie::NuElectronXSec") +XSecOnElectron::XSecOnElectron() : +XSecIntegratorI("genie::XSecOnElectron") { } //____________________________________________________________________________ -NuElectronXSec::NuElectronXSec(string config) : -XSecIntegratorI("genie::NuElectronXSec", config) +XSecOnElectron::XSecOnElectron(string config) : +XSecIntegratorI("genie::XSecOnElectron", config) { } //____________________________________________________________________________ -NuElectronXSec::~NuElectronXSec() +XSecOnElectron::~XSecOnElectron() { } //____________________________________________________________________________ -double NuElectronXSec::Integrate( +double XSecOnElectron::Integrate( const XSecAlgorithmI * model, const Interaction * in) const { if(! model->ValidProcess(in) ) return 0.; @@ -71,22 +71,23 @@ double NuElectronXSec::Integrate( delete interaction; delete func; + return xsec; } //____________________________________________________________________________ -void NuElectronXSec::Configure(const Registry & config) +void XSecOnElectron::Configure(const Registry & config) { Algorithm::Configure(config); this->LoadConfig(); } //____________________________________________________________________________ -void NuElectronXSec::Configure(string config) +void XSecOnElectron::Configure(string config) { Algorithm::Configure(config); this->LoadConfig(); } //____________________________________________________________________________ -void NuElectronXSec::LoadConfig(void) +void XSecOnElectron::LoadConfig(void) { // Get GSL integration type & relative tolerance GetParamDef( "gsl-integration-type", fGSLIntgType, string( "adaptive" ) ) ; diff --git a/src/Physics/NuElectron/XSection/NuElectronXSec.h b/src/Physics/NuElectron/XSection/XSecOnElectron.h similarity index 81% rename from src/Physics/NuElectron/XSection/NuElectronXSec.h rename to src/Physics/NuElectron/XSection/XSecOnElectron.h index 156aec5e3..51178b547 100644 --- a/src/Physics/NuElectron/XSection/NuElectronXSec.h +++ b/src/Physics/NuElectron/XSection/XSecOnElectron.h @@ -1,7 +1,7 @@ //____________________________________________________________________________ /*! -\class genie::NuElectronXSec +\class genie::XSecOnElectron \brief nu/nubar + e- scattering cross section. Integrates the loaded differential cross section model. An analytical cross section @@ -19,6 +19,9 @@ \author Costas Andreopoulos University of Liverpool & STFC Rutherford Appleton Laboratory + B. Carlson change name to reflect that cross section applies + to all nu+e interactions + \created February 10, 2006 \cpright Copyright (c) 2003-2023, The GENIE Collaboration @@ -26,19 +29,19 @@ */ //____________________________________________________________________________ -#ifndef _NU_ELECTRON_XSEC_H_ -#define _NU_ELECTRON_XSEC_H_ +#ifndef _X_Sec_On_Electron_H_ +#define _X_Sec_On_Electron_H_ #include "Physics/XSectionIntegration/XSecIntegratorI.h" namespace genie { -class NuElectronXSec : public XSecIntegratorI { +class XSecOnElectron : public XSecIntegratorI { public: - NuElectronXSec(); - NuElectronXSec(string config); - virtual ~NuElectronXSec(); + XSecOnElectron(); + XSecOnElectron(string config); + virtual ~XSecOnElectron(); //! XSecIntegratorI interface implementation double Integrate(const XSecAlgorithmI * model, const Interaction * i) const; @@ -53,4 +56,4 @@ class NuElectronXSec : public XSecIntegratorI { }; } // genie namespace -#endif // _NU_ELECTRON_XSEC_H_ +#endif // _X_Sec_On_Electron_H_ diff --git a/src/Physics/NuclearState/BohrElectronVelocity.cxx b/src/Physics/NuclearState/BohrElectronVelocity.cxx new file mode 100644 index 000000000..8f613d681 --- /dev/null +++ b/src/Physics/NuclearState/BohrElectronVelocity.cxx @@ -0,0 +1,141 @@ +///____________________________________________________________________________ +/* + Copyright (c) 2003-2022, The GENIE Collaboration + For the full text of the license visit http://copyright.genie-mc.org + + \brief It visits the event record & computes a Bohr Velocity for + initial state electrons bound in coloumb potential. + + \author Brinden Carlson + University of Florida & Fermilab + + \created December 5, 2022 + + For the class documentation see the corresponding header file. +*/ +//____________________________________________________________________________ + +#include + +#include +#include +#include +#include + +#include "Framework/Algorithm/AlgFactory.h" +#include "Framework/Algorithm/AlgConfigPool.h" +#include "Framework/Conventions/Constants.h" +#include "Framework/Conventions/Units.h" +#include "Physics/NuclearState/ElectronVelocity.h" + +#include "Physics/NuclearState/NuclearModel.h" +#include "Physics/NuclearState/NuclearModelI.h" +#include "Framework/EventGen/EVGThreadException.h" +#include "Framework/GHEP/GHepRecord.h" +#include "Framework/GHEP/GHepParticle.h" +#include "Framework/GHEP/GHepStatus.h" +#include "Framework/GHEP/GHepFlags.h" +#include "Framework/Interaction/Interaction.h" +#include "Framework/Messenger/Messenger.h" +#include "Physics/NuclearState/FermiMomentumTablePool.h" +#include "Physics/NuclearState/FermiMomentumTable.h" +#include "Framework/Numerical/RandomGen.h" +#include "Framework/ParticleData/PDGLibrary.h" +#include "Framework/ParticleData/PDGUtils.h" +#include "Framework/ParticleData/PDGCodes.h" +#include "Framework/Utils/KineUtils.h" +#include "Physics/NuclearState/NuclearUtils.h" +#include "Physics/NuclearState/BohrElectronVelocity.h" +#include "Physics/NuclearState/ElectronVelocity.h" + +#include +#include + +using namespace genie; +using namespace genie::constants; + +//___________________________________________________________________________ +BohrElectronVelocity::~BohrElectronVelocity() +{ + +} +BohrElectronVelocity::BohrElectronVelocity(const string & config) : +ElectronVelocity::ElectronVelocity("genie::BohrElectronVelocity", config) +{ + +} +BohrElectronVelocity::BohrElectronVelocity() : +ElectronVelocity::ElectronVelocity("genie::BohrElectronVelocity","Default") +{ + +} + +//___________________________________________________________________________ +void BohrElectronVelocity::InitializeVelocity(Interaction & interaction) const{ + InitialState * init_state = interaction.InitStatePtr(); + Target * tgt = init_state -> TgtPtr(); + + unsigned int fZ = tgt->Z(); //Get Z value + double nucleus_mass = tgt->Mass(); + double mu = reduced_mass(nucleus_mass); //Reduced mass + double v = random_bohr_velocity(fZ,mu); //bohr velocity + TVector3 v3 = randomize_direction_sphere(v); //Get spherically uniform random direciton + //-- update the electron 4p + auto p4 = tgt->HitPartP4Ptr(); //Initialize 4 momentum pointer + p4-> Boost(v3); //Boost to new frame +} +//___________________________________________________________________________ + +//____________________________________________________________________________ +double BohrElectronVelocity::reduced_mass(double nucleus_mass) const{ + //Return reduced mass of electron + return kElectronMass*nucleus_mass/(kElectronMass+nucleus_mass); +} + +unsigned BohrElectronVelocity::random_n(unsigned int fZ) const{ + //Isotope minimum z is 118 in accordance with maximum possible in GENIE + std::array fnprobs {2,10,28,60,110,118}; //Cumulative Probability dist. + + //Get random electron orbital from atomic number Z + RandomGen * rnd = RandomGen::Instance(); //Load seed + + for (unsigned int i = 0; iRndDec().Rndm(); + unsigned int n = 0; + unsigned int sel_n = 0; + do { + sel_n = n; + } while (x > fnprobs[n++]); + + return sel_n+1; //Plus 1 to get to n +} + +double BohrElectronVelocity::bohr_velocity(unsigned int fn, unsigned int fZ, double mu) const +{ + return fZ*kAem/fn * kElectronMass/mu; +} + +double BohrElectronVelocity::random_bohr_velocity(unsigned int fZ, double mu) const{ + //Get random bohr velocity from n distribution + unsigned int fn = random_n(fZ); + return bohr_velocity(fn,fZ,mu); +} + +TVector3 BohrElectronVelocity::randomize_direction_sphere(double v) const{ + RandomGen * rnd = RandomGen::Instance(); //Load seed + TRandom3 gen = rnd->RndGen(); //Get generator + double costheta = gen.Uniform(-1,1); //Polar + double phi = gen.Uniform(0,2*kPi); //Azimuthal + double sintheta = sqrt( 1 - costheta*costheta); // which is always positive because the angle is in the 0 -> pi range! it cannot be negative + return TVector3(v*sintheta*TMath::Cos(phi), + v*sintheta*TMath::Sin(phi), + v*costheta); //Return vector with magnitude v and random direction +} + + +//___________________________________________________________________________ \ No newline at end of file diff --git a/src/Physics/NuclearState/BohrElectronVelocity.h b/src/Physics/NuclearState/BohrElectronVelocity.h new file mode 100644 index 000000000..7b94438a0 --- /dev/null +++ b/src/Physics/NuclearState/BohrElectronVelocity.h @@ -0,0 +1,45 @@ +//____________________________________________________________________________ +/*! + +\class genie::BohrElectronVelocity + +\brief It visits the event record & computes a Bohr Velocity for + initial state electrons bound in coloumb potential. + Is a concrete implementation of the ElectronVelocity interface. + +\author Brinden Carlson + University of Florida & Fermilab + +\created December 5, 2022 + +\cpright Copyright (c) 2003-2022, The GENIE Collaboration + For the full text of the license visit http://copyright.genie-mc.org + +*/ +//____________________________________________________________________________ + +// #ifndef _BOHR_ELECTRON_VELOCITY_H_ +// #define _BOHR_ELECTRON_VELOCITY_H_ + +#include "Physics/NuclearState/ElectronVelocity.h" +#include "Framework/GHEP/GHepParticle.h" +#include "Framework/Interaction/Target.h" +#include "Framework/Interaction/Interaction.h" + +namespace genie { + +class BohrElectronVelocity : public ElectronVelocity { +public: + void InitializeVelocity(Interaction & interaction) const final; + BohrElectronVelocity(); + BohrElectronVelocity(const string & config); + ~BohrElectronVelocity(); + +private: + double reduced_mass(double nucleus_mass) const; //Reduced mass calculation + double bohr_velocity(unsigned int fn, unsigned int fZ, double mu) const; //Bohr velocity + unsigned int random_n(unsigned int fZ) const; //Return random energy level from n_dist + double random_bohr_velocity(unsigned int fZ, double mu) const; //Generate random n, then calculate velocity from there + TVector3 randomize_direction_sphere(double v) const; +}; +} \ No newline at end of file diff --git a/src/Physics/NuclearState/EffectiveSF.cxx b/src/Physics/NuclearState/EffectiveSF.cxx index a321eb2ab..ca7822d7c 100644 --- a/src/Physics/NuclearState/EffectiveSF.cxx +++ b/src/Physics/NuclearState/EffectiveSF.cxx @@ -66,7 +66,7 @@ EffectiveSF::~EffectiveSF() //____________________________________________________________________________ bool EffectiveSF::GenerateNucleon(const Target & target) const { - assert(target.HitNucIsSet()); + assert(target.HitPartIsSet()); fCurrRemovalEnergy = 0; fCurrMomentum.SetXYZ(0,0,0); @@ -154,7 +154,7 @@ TH1D * EffectiveSF::ProbDistro(const Target & target) const << "P(cut-off) = " << fPCutOff << ", P(max) = " << fPMax; //-- get information for the nuclear target - int nucleon_pdgc = target.HitNucPdg(); + int nucleon_pdgc = target.HitPartPdg(); assert( pdg::IsProton(nucleon_pdgc) || pdg::IsNeutron(nucleon_pdgc) ); return this->MakeEffectiveSF(target); diff --git a/src/Physics/NuclearState/ElectronVelocity.cxx b/src/Physics/NuclearState/ElectronVelocity.cxx new file mode 100644 index 000000000..d08063453 --- /dev/null +++ b/src/Physics/NuclearState/ElectronVelocity.cxx @@ -0,0 +1,97 @@ +///____________________________________________________________________________ +/* + Copyright (c) 2003-2022, The GENIE Collaboration + For the full text of the license visit http://copyright.genie-mc.org + + \brief It visits the event record & samples a velocity for + initial state electrons from a velocity distribution. + Is a concrete implementation of the EventRecordVisitorI interface. + + \author Brinden Carlson + University of Florida & Fermilab + + \created December 5, 2022 + + For the class documentation see the corresponding header file. +*/ +//____________________________________________________________________________ + +#include + +#include +#include +#include +#include + +#include "Framework/Algorithm/AlgFactory.h" +#include "Framework/Algorithm/AlgConfigPool.h" +#include "Framework/Conventions/Constants.h" +#include "Framework/Conventions/Units.h" +#include "Physics/NuclearState/ElectronVelocity.h" + +#include "Physics/NuclearState/NuclearModel.h" +#include "Physics/NuclearState/NuclearModelI.h" +#include "Framework/EventGen/EVGThreadException.h" +#include "Framework/GHEP/GHepRecord.h" +#include "Framework/GHEP/GHepParticle.h" +#include "Framework/GHEP/GHepStatus.h" +#include "Framework/GHEP/GHepFlags.h" +#include "Framework/Interaction/Interaction.h" +#include "Framework/Messenger/Messenger.h" +#include "Physics/NuclearState/FermiMomentumTablePool.h" +#include "Physics/NuclearState/FermiMomentumTable.h" +#include "Framework/Numerical/RandomGen.h" +#include "Framework/ParticleData/PDGLibrary.h" +#include "Framework/ParticleData/PDGUtils.h" +#include "Framework/ParticleData/PDGCodes.h" +#include "Framework/Utils/KineUtils.h" +#include "Physics/NuclearState/NuclearUtils.h" + +#include +#include + +using namespace genie; + +//___________________________________________________________________________ +ElectronVelocity::ElectronVelocity(const string & name, const string & config) : +EventRecordVisitorI(name, config) +{ + +} +//___________________________________________________________________________ +ElectronVelocity::~ElectronVelocity() +{ + +} +//___________________________________________________________________________ +ElectronVelocity::ElectronVelocity() +{ + +} +//___________________________________________________________________________ +void ElectronVelocity::ProcessEventRecord(GHepRecord * evrec) const +{ + // skip if not a electron target + if(!evrec->Summary()->ProcInfo().IsElectronScattering()) return; + + // give electron initial momentum + this->InitializeVelocity(*evrec->Summary()); + + //Update event record + GHepParticle * electron = evrec->HitElectron(); + electron->SetMomentum(*evrec->Summary()->InitStatePtr()->TgtPtr()->HitPartP4Ptr()); + +} +//___________________________________________________________________________ +void ElectronVelocity::Configure(const Registry & config) +{ + Algorithm::Configure(config); + this->LoadConfig(); +} +//____________________________________________________________________________ +void ElectronVelocity::Configure(string config) +{ + Algorithm::Configure(config); + this->LoadConfig(); +} + diff --git a/src/Physics/NuclearState/ElectronVelocity.h b/src/Physics/NuclearState/ElectronVelocity.h new file mode 100644 index 000000000..cad2967a3 --- /dev/null +++ b/src/Physics/NuclearState/ElectronVelocity.h @@ -0,0 +1,59 @@ +//____________________________________________________________________________ +/*! + +\class genie::ElectronVelocity + +\brief Interface used to visit the event record & samples a velocity for + initial state electrons from a velocity distribution. + Modifies interaction object to modify electron velocity and used to + integrate over velocity distribution when calculating the cross section + Is a concrete implementation of the EventRecordVisitorI interface. + + \author Brinden Carlson + University of Florida & Fermilab + + \created December 5, 2022 + +\cpright Copyright (c) 2003-2022, The GENIE Collaboration + For the full text of the license visit http://copyright.genie-mc.org + +*/ +//____________________________________________________________________________ + +#ifndef _ELECTRON_VELOCITY_H_ +#define _ELECTRON_VELOCITY_H_ + +#include "Framework/EventGen/EventRecordVisitorI.h" +#include "Framework/GHEP/GHepParticle.h" +#include "Framework/Interaction/Target.h" +#include "Framework/Interaction/Interaction.h" + +namespace genie { + +class ElectronVelocity : public EventRecordVisitorI { + +public : + virtual ~ElectronVelocity(); + ElectronVelocity(); + + //-- implement the EventRecordVisitorI interface + void ProcessEventRecord(GHepRecord * event_rec) const override; + + //-- overload the Algorithm::Configure() methods to load private data + // members from configuration options + void Configure(const Registry & config) override; + void Configure(string config) override; + + //Make public to use in NuElectronPXsec + virtual void InitializeVelocity(Interaction & interaction) const = 0; //Give initial velocity + +private: + +protected: + ElectronVelocity(const string & name, const string & config); + virtual void LoadConfig (void){;} + +}; + +} // genie namespace +#endif // _FERMI_MOVER_H_ diff --git a/src/Physics/NuclearState/FGMBodekRitchie.cxx b/src/Physics/NuclearState/FGMBodekRitchie.cxx index 94f72a488..1dfe70d11 100644 --- a/src/Physics/NuclearState/FGMBodekRitchie.cxx +++ b/src/Physics/NuclearState/FGMBodekRitchie.cxx @@ -67,7 +67,7 @@ FGMBodekRitchie::~FGMBodekRitchie() //____________________________________________________________________________ bool FGMBodekRitchie::GenerateNucleon(const Target & target) const { - assert(target.HitNucIsSet()); + assert(target.HitPartIsSet()); fCurrRemovalEnergy = 0; fCurrMomentum.SetXYZ(0,0,0); @@ -139,7 +139,7 @@ TH1D * FGMBodekRitchie::ProbDistro(const Target & target) const //-- get information for the nuclear target //int target_pdgc = pdg::IonPdgCode(target.A(), target.Z()); - int nucleon_pdgc = target.HitNucPdg(); + int nucleon_pdgc = target.HitPartPdg(); assert( pdg::IsProton(nucleon_pdgc) || pdg::IsNeutron(nucleon_pdgc) ); double KF = FermiMomentum( target, nucleon_pdgc ) ; @@ -206,7 +206,7 @@ double FGMBodekRitchie::FermiMomentum( const Target & t, int nucleon_pdg ) const double kF = nuclear::FermiMomentumForIsoscalarNucleonParametrization(t); //-- correct the Fermi momentum for the struck nucleon - assert(t.HitNucIsSet()); + assert(t.HitPartIsSet()); double A = (double) t.A() ; if( pdg::IsProton(nucleon_pdg) ) { diff --git a/src/Physics/NuclearState/FermiMover.cxx b/src/Physics/NuclearState/FermiMover.cxx index 1e483694d..d3a930ac1 100644 --- a/src/Physics/NuclearState/FermiMover.cxx +++ b/src/Physics/NuclearState/FermiMover.cxx @@ -106,7 +106,7 @@ void FermiMover::KickHitNucleon(GHepRecord * evrec) const // do nothing for non-nuclear targets if(!tgt->IsNucleus()) return; - TLorentzVector * p4 = tgt->HitNucP4Ptr(); + TLorentzVector * p4 = tgt->HitPartP4Ptr(); // do nothing if the struct nucleon 4-momentum was set (eg as part of the // initial state selection) diff --git a/src/Physics/NuclearState/LinkDef.h b/src/Physics/NuclearState/LinkDef.h index c9207f1ca..b981b5c92 100644 --- a/src/Physics/NuclearState/LinkDef.h +++ b/src/Physics/NuclearState/LinkDef.h @@ -26,4 +26,7 @@ #pragma link C++ class genie::SecondNucleonEmissionI; #pragma link C++ class genie::SpectralFunction2p2h; +#pragma link C++ class genie::BohrElectronVelocity; +#pragma link C++ class genie::StaticElectronVelocity; + #endif diff --git a/src/Physics/NuclearState/LocalFGM.cxx b/src/Physics/NuclearState/LocalFGM.cxx index f023ad780..6068d95f1 100644 --- a/src/Physics/NuclearState/LocalFGM.cxx +++ b/src/Physics/NuclearState/LocalFGM.cxx @@ -50,9 +50,9 @@ LocalFGM::~LocalFGM() } //____________________________________________________________________________ bool LocalFGM::GenerateNucleon(const Target & target, - double hitNucleonRadius) const + double hitNucleonRadius) const { - assert(target.HitNucIsSet()); + assert(target.HitPartIsSet()); fCurrRemovalEnergy = -99999.0; fCurrMomentum.SetXYZ(0,0,0); @@ -98,9 +98,9 @@ bool LocalFGM::GenerateNucleon(const Target & target, if (fMomDepErmv) { // hit nucleon mass - double nucl_mass = target.HitNucMass(); + double nucl_mass = target.HitPartMass(); // get the local Fermi momentum - double KF = LocalFermiMomentum( target, target.HitNucPdg(), hitNucleonRadius); + double KF = LocalFermiMomentum( target, target.HitPartPdg(), hitNucleonRadius); //initial nucleon kinetic energy at the Fermi surface double T_F = TMath::Sqrt(TMath::Power(nucl_mass,2)+TMath::Power(KF,2)) - nucl_mass; @@ -168,10 +168,10 @@ TH1D * LocalFGM::ProbDistro(const Target & target, double r) const LOG("LocalFGM", pNOTICE) << ", P(max) = " << fPMax; - assert(target.HitNucIsSet()); + assert(target.HitPartIsSet()); //-- get information for the nuclear target - int nucleon_pdgc = target.HitNucPdg(); + int nucleon_pdgc = target.HitPartPdg(); assert(pdg::IsProton(nucleon_pdgc) || pdg::IsNeutron(nucleon_pdgc)); // bool is_p = pdg::IsProton(nucleon_pdgc); diff --git a/src/Physics/NuclearState/NuclearUtils.cxx b/src/Physics/NuclearState/NuclearUtils.cxx index e0cbc6ca2..6e70bd91d 100644 --- a/src/Physics/NuclearState/NuclearUtils.cxx +++ b/src/Physics/NuclearState/NuclearUtils.cxx @@ -162,7 +162,7 @@ double genie::utils::nuclear::NuclQELXSecSuppression( // int target_pdgc = target.Pdg(); - int struck_nucleon_pdgc = target.HitNucPdg(); + int struck_nucleon_pdgc = target.HitPartPdg(); int final_nucleon_pdgc = struck_nucleon_pdgc; if(proc_info.IsWeakCC()) { @@ -186,7 +186,7 @@ double genie::utils::nuclear::NuclQELXSecSuppression( if(lfg){ double hbarc = kLightSpeed*kPlankConstant/genie::units::fermi; Target* tgt = interaction->InitStatePtr()->TgtPtr(); - double radius = tgt->HitNucPosition(); + double radius = tgt->HitPartPosition(); int A = tgt->A(); // kFi @@ -210,7 +210,7 @@ double genie::utils::nuclear::NuclQELXSecSuppression( kft->FindClosestKF(target_pdgc, final_nucleon_pdgc ); } - double Mn = target.HitNucP4Ptr()->M(); // can be off m/shell + double Mn = target.HitPartP4Ptr()->M(); // can be off m/shell const Kinematics & kine = interaction->Kine(); double q2 = kine.q2(); diff --git a/src/Physics/NuclearState/StaticElectronVelocity.cxx b/src/Physics/NuclearState/StaticElectronVelocity.cxx new file mode 100644 index 000000000..bbf657b94 --- /dev/null +++ b/src/Physics/NuclearState/StaticElectronVelocity.cxx @@ -0,0 +1,85 @@ +///____________________________________________________________________________ +/* + Copyright (c) 2003-2022, The GENIE Collaboration + For the full text of the license visit http://copyright.genie-mc.org + + \brief It visits the event record & initializes a static velocity for + initial state electron. + +\author Brinden Carlson + University of Florida & Fermilab + +\created December 5, 2022 + + For the class documentation see the corresponding header file. +*/ +//____________________________________________________________________________ + +#include + +#include +#include +#include +#include + +#include "Framework/Algorithm/AlgFactory.h" +#include "Framework/Algorithm/AlgConfigPool.h" +#include "Framework/Conventions/Constants.h" +#include "Framework/Conventions/Units.h" +#include "Physics/NuclearState/ElectronVelocity.h" + +#include "Physics/NuclearState/NuclearModel.h" +#include "Physics/NuclearState/NuclearModelI.h" +#include "Framework/EventGen/EVGThreadException.h" +#include "Framework/GHEP/GHepRecord.h" +#include "Framework/GHEP/GHepParticle.h" +#include "Framework/GHEP/GHepStatus.h" +#include "Framework/GHEP/GHepFlags.h" +#include "Framework/Interaction/Interaction.h" +#include "Framework/Messenger/Messenger.h" +#include "Physics/NuclearState/FermiMomentumTablePool.h" +#include "Physics/NuclearState/FermiMomentumTable.h" +#include "Framework/Numerical/RandomGen.h" +#include "Framework/ParticleData/PDGLibrary.h" +#include "Framework/ParticleData/PDGUtils.h" +#include "Framework/ParticleData/PDGCodes.h" +#include "Framework/Utils/KineUtils.h" +#include "Physics/NuclearState/NuclearUtils.h" +#include "Physics/NuclearState/StaticElectronVelocity.h" +#include "Physics/NuclearState/ElectronVelocity.h" + +#include +#include + +using namespace genie; +using namespace genie::constants; +//using namespace std; + +//___________________________________________________________________________ +StaticElectronVelocity::~StaticElectronVelocity() +{ + +} +StaticElectronVelocity::StaticElectronVelocity(const string & config) : +ElectronVelocity::ElectronVelocity("genie::StaticElectronVelocity", config) +{ + +} +StaticElectronVelocity::StaticElectronVelocity() : +ElectronVelocity::ElectronVelocity("genie::StaticElectronVelocity","Default") +{ + +} + +//___________________________________________________________________________ +void StaticElectronVelocity::InitializeVelocity(Interaction & interaction) const{ + InitialState * init_state = interaction.InitStatePtr(); + Target * tgt = init_state -> TgtPtr(); + + TLorentzVector * p4 = tgt->HitPartP4Ptr(); //Initialize 4 momentum pointer + //These should be initialized like this by just in case + p4->SetVectM(TVector3(), kElectronMass); +} +//___________________________________________________________________________ + +//____________________________________________________________________________ diff --git a/src/Physics/NuclearState/StaticElectronVelocity.h b/src/Physics/NuclearState/StaticElectronVelocity.h new file mode 100644 index 000000000..d2a1e0f55 --- /dev/null +++ b/src/Physics/NuclearState/StaticElectronVelocity.h @@ -0,0 +1,36 @@ +//____________________________________________________________________________ +/*! + +\class genie::StaticElectronVelocity + +\brief It visits the event record & initializes a static velocity for + initial state electron. + +\author Brinden Carlson + University of Florida & Fermilab + +\created December 5, 2022 + +\cpright Copyright (c) 2003-2022, The GENIE Collaboration + For the full text of the license visit http://copyright.genie-mc.org + +*/ +//____________________________________________________________________________ + +#include "Physics/NuclearState/ElectronVelocity.h" +#include "Framework/GHEP/GHepParticle.h" +#include "Framework/Interaction/Target.h" +#include "Framework/Interaction/Interaction.h" + +namespace genie { + +class StaticElectronVelocity : public ElectronVelocity { +public: + void InitializeVelocity(Interaction & interaction) const final; + + StaticElectronVelocity(); + StaticElectronVelocity(const string & config); + ~StaticElectronVelocity(); + +}; +} \ No newline at end of file diff --git a/src/Physics/NucleonDecay/NucleonDecayPrimaryVtxGenerator.cxx b/src/Physics/NucleonDecay/NucleonDecayPrimaryVtxGenerator.cxx index 5f00f609a..3fe45fb1a 100644 --- a/src/Physics/NucleonDecay/NucleonDecayPrimaryVtxGenerator.cxx +++ b/src/Physics/NucleonDecay/NucleonDecayPrimaryVtxGenerator.cxx @@ -55,7 +55,7 @@ void NucleonDecayPrimaryVtxGenerator::ProcessEventRecord( Interaction * interaction = event->Summary(); fCurrInitStatePdg = interaction->InitState().Tgt().Pdg(); fCurrDecayMode = (NucleonDecayMode_t) interaction->ExclTag().DecayMode(); - fCurrDecayedNucleon = interaction->InitState().Tgt().HitNucPdg(); + fCurrDecayedNucleon = interaction->InitState().Tgt().HitPartPdg(); LOG("NucleonDecay", pNOTICE) << "Simulating decay " << utils::nucleon_decay::AsString(fCurrDecayMode, fCurrDecayedNucleon) @@ -240,7 +240,7 @@ void NucleonDecayPrimaryVtxGenerator::GenerateFermiMomentum( // generate a Fermi momentum & removal energy Target tgt(initial_nucleus->Pdg()); - tgt.SetHitNucPdg(decayed_nucleon->Pdg()); + tgt.SetHitPartPdg(decayed_nucleon->Pdg()); fNuclModel->GenerateNucleon(tgt); TVector3 p3 = fNuclModel->Momentum3(); double w = fNuclModel->RemovalEnergy(); diff --git a/src/Physics/QuasiElastic/EventGen/QELEventGenerator.cxx b/src/Physics/QuasiElastic/EventGen/QELEventGenerator.cxx index 186b3da98..4e5614817 100644 --- a/src/Physics/QuasiElastic/EventGen/QELEventGenerator.cxx +++ b/src/Physics/QuasiElastic/EventGen/QELEventGenerator.cxx @@ -101,7 +101,7 @@ void QELEventGenerator::ProcessEventRecord(GHepRecord * evrec) const // cross section (important when using the local Fermi gas model) Target* tgt = interaction->InitState().TgtPtr(); double hitNucPos = nucleon->X4()->Vect().Mag(); - tgt->SetHitNucPosition( hitNucPos ); + tgt->SetHitPartPosition( hitNucPos ); //-- For the subsequent kinematic selection with the rejection method: // Calculate the max differential cross section or retrieve it from the @@ -216,7 +216,7 @@ void QELEventGenerator::ProcessEventRecord(GHepRecord * evrec) const // struck nucleon mass (can be off the mass shell) const InitialState & init_state = interaction->InitState(); double E = init_state.ProbeE(kRfHitNucRest); - double M = init_state.Tgt().HitNucP4().M(); + double M = init_state.Tgt().HitPartP4().M(); LOG("QELKinematics", pNOTICE) << "E = " << E << ", M = "<< M; // The hadronic inv. mass is equal to the recoil nucleon on-shell mass. @@ -268,7 +268,7 @@ void QELEventGenerator::ProcessEventRecord(GHepRecord * evrec) const -1, -1, -1, interaction->KinePtr()->HadSystP4(), x4l); // Store struck nucleon momentum and binding energy - TLorentzVector p4ptr = interaction->InitStatePtr()->TgtPtr()->HitNucP4(); + TLorentzVector p4ptr = interaction->InitStatePtr()->TgtPtr()->HitPartP4(); LOG("QELEvent",pNOTICE) << "pn: " << p4ptr.X() << ", " << p4ptr.Y() << ", " << p4ptr.Z() << ", " << p4ptr.E(); nucleon->SetMomentum(p4ptr); @@ -448,7 +448,7 @@ double QELEventGenerator::ComputeMaxXSec(const Interaction * in) const // TODO: document this, won't work for spectral functions double dummy_w = -1.; double prob = fNuclModel->Prob(pNi_next, dummy_w, tgt, - tgt.HitNucPosition()); + tgt.HitPartPosition()); double costh0_max = genie::utils::CosTheta0Max( *interaction ); diff --git a/src/Physics/QuasiElastic/EventGen/QELEventGeneratorSM.cxx b/src/Physics/QuasiElastic/EventGen/QELEventGeneratorSM.cxx index 072f19807..86b69717b 100644 --- a/src/Physics/QuasiElastic/EventGen/QELEventGeneratorSM.cxx +++ b/src/Physics/QuasiElastic/EventGen/QELEventGeneratorSM.cxx @@ -106,7 +106,7 @@ void QELEventGeneratorSM::ProcessEventRecord(GHepRecord * evrec) const GHepParticle * nucleon = evrec->HitNucleon(); // Store position of nucleon double hitNucPos = nucleon->X4()->Vect().Mag(); - tgt->SetHitNucPosition( hitNucPos ); + tgt->SetHitPartPosition( hitNucPos ); // Get the random number generators RandomGen * rnd = RandomGen::Instance(); @@ -268,7 +268,7 @@ void QELEventGeneratorSM::ProcessEventRecord(GHepRecord * evrec) const outNucleonMom.Rotate(psi, unit_nudir); // set 4-momentum of struck nucleon - TLorentzVector * p4 = tgt->HitNucP4Ptr(); + TLorentzVector * p4 = tgt->HitPartP4Ptr(); p4->SetPx( inNucleonMom.Px() ); p4->SetPy( inNucleonMom.Py() ); p4->SetPz( inNucleonMom.Pz() ); @@ -278,7 +278,7 @@ void QELEventGeneratorSM::ProcessEventRecord(GHepRecord * evrec) const assert(rpdgc); double W = PDGLibrary::Instance()->Find(rpdgc)->Mass(); LOG("QELEvent", pNOTICE) << "Selected: W = "<< W; - double M = init_state.Tgt().HitNucP4().M(); + double M = init_state.Tgt().HitPartP4().M(); double E = init_state.ProbeE(kRfHitNucRest); // (W,Q2) -> (x,y) diff --git a/src/Physics/QuasiElastic/EventGen/QELEventGeneratorSuSA.cxx b/src/Physics/QuasiElastic/EventGen/QELEventGeneratorSuSA.cxx index 71ac4a97e..803337e3a 100644 --- a/src/Physics/QuasiElastic/EventGen/QELEventGeneratorSuSA.cxx +++ b/src/Physics/QuasiElastic/EventGen/QELEventGeneratorSuSA.cxx @@ -433,7 +433,7 @@ void QELEventGeneratorSuSA::GenerateNucleon(GHepRecord * event) const // this sets the pdg of each nucleon and its momentum from user chosen nuclear model double hitNucPos = initial_nucleon->X4()->Vect().Mag(); - tgt.SetHitNucPdg(initial_nucleon_pdg); + tgt.SetHitPartPdg(initial_nucleon_pdg); fNuclModel->GenerateNucleon(tgt,hitNucPos); p3i = fNuclModel->Momentum3(); diff --git a/src/Physics/QuasiElastic/EventGen/QELInteractionListGenerator.cxx b/src/Physics/QuasiElastic/EventGen/QELInteractionListGenerator.cxx index 3505bd962..931d9a519 100644 --- a/src/Physics/QuasiElastic/EventGen/QELInteractionListGenerator.cxx +++ b/src/Physics/QuasiElastic/EventGen/QELInteractionListGenerator.cxx @@ -89,11 +89,11 @@ InteractionList * QELInteractionListGenerator::CreateInteractionListCC( } if (isnu && hasN) { - target->SetHitNucPdg(kPdgNeutron); + target->SetHitPartPdg(kPdgNeutron); intlist->push_back(interaction); } else if (isnubar && hasP) { - target->SetHitNucPdg(kPdgProton); + target->SetHitPartPdg(kPdgProton); intlist->push_back(interaction); } else { @@ -143,7 +143,7 @@ InteractionList * QELInteractionListGenerator::CreateInteractionListNC( delete interaction; continue; } - target->SetHitNucPdg(nuclpdg[i]); + target->SetHitPartPdg(nuclpdg[i]); intlist->push_back(interaction); } @@ -235,7 +235,7 @@ InteractionList * delete interaction; continue; } - target->SetHitNucPdg(nuclpdg[i]); + target->SetHitPartPdg(nuclpdg[i]); xcls->SetCharm(charmpdg[i]); intlist->push_back(interaction); @@ -285,7 +285,7 @@ InteractionList * delete interaction; continue; } - target->SetHitNucPdg(nuclpdg[i]); + target->SetHitPartPdg(nuclpdg[i]); xcls->SetStrange(strangepdg[i]); intlist->push_back(interaction); diff --git a/src/Physics/QuasiElastic/EventGen/QELKinematicsGenerator.cxx b/src/Physics/QuasiElastic/EventGen/QELKinematicsGenerator.cxx index 64609920d..ec106af3b 100644 --- a/src/Physics/QuasiElastic/EventGen/QELKinematicsGenerator.cxx +++ b/src/Physics/QuasiElastic/EventGen/QELKinematicsGenerator.cxx @@ -73,7 +73,7 @@ void QELKinematicsGenerator::ProcessEventRecord(GHepRecord * evrec) const // store the struck nucleon position for use by the xsec method double hitNucPos = evrec->HitNucleon()->X4()->Vect().Mag(); - interaction->InitStatePtr()->TgtPtr()->SetHitNucPosition(hitNucPos); + interaction->InitStatePtr()->TgtPtr()->SetHitPartPosition(hitNucPos); //-- Note: The kinematic generator would be using the free nucleon cross // section (even for nuclear targets) so as not to double-count nuclear @@ -178,7 +178,7 @@ void QELKinematicsGenerator::ProcessEventRecord(GHepRecord * evrec) const // struck nucleon mass (can be off the mass shell) const InitialState & init_state = interaction->InitState(); double E = init_state.ProbeE(kRfHitNucRest); - double M = init_state.Tgt().HitNucP4().M(); + double M = init_state.Tgt().HitPartP4().M(); LOG("QELKinematics", pNOTICE) << "E = " << E << ", M = "<< M; @@ -248,7 +248,7 @@ void QELKinematicsGenerator::SpectralFuncExperimentalCode( // store the struck nucleon position for use by the xsec method double hitNucPos = evrec->HitNucleon()->X4()->Vect().Mag(); - interaction->InitStatePtr()->TgtPtr()->SetHitNucPosition(hitNucPos); + interaction->InitStatePtr()->TgtPtr()->SetHitPartPosition(hitNucPos); //-- Note: The kinematic generator would be using the free nucleon cross // section (even for nuclear targets) so as not to double-count nuclear @@ -260,14 +260,14 @@ void QELKinematicsGenerator::SpectralFuncExperimentalCode( interaction->SetBit(kIAssumeFreeNucleon); //-- Assume scattering off a nucleon on the mass shell (PWIA prescription) - double Mn = interaction->InitState().Tgt().HitNucMass(); // PDG mass, take it to be on-shell - double pxn = interaction->InitState().Tgt().HitNucP4().Px(); - double pyn = interaction->InitState().Tgt().HitNucP4().Py(); - double pzn = interaction->InitState().Tgt().HitNucP4().Pz(); - double En = interaction->InitState().Tgt().HitNucP4().Energy(); + double Mn = interaction->InitState().Tgt().HitPartMass(); // PDG mass, take it to be on-shell + double pxn = interaction->InitState().Tgt().HitPartP4().Px(); + double pyn = interaction->InitState().Tgt().HitPartP4().Py(); + double pzn = interaction->InitState().Tgt().HitPartP4().Pz(); + double En = interaction->InitState().Tgt().HitPartP4().Energy(); double En0 = TMath::Sqrt(pxn*pxn + pyn*pyn + pzn*pzn + Mn*Mn); double Eb = En0 - En; - interaction->InitStatePtr()->TgtPtr()->HitNucP4Ptr()->SetE(En0); + interaction->InitStatePtr()->TgtPtr()->HitPartP4Ptr()->SetE(En0); //-- Get the limits for the generated Q2 const KPhaseSpace & kps = interaction->PhaseSpace(); diff --git a/src/Physics/QuasiElastic/XSection/AhrensNCELPXSec.cxx b/src/Physics/QuasiElastic/XSection/AhrensNCELPXSec.cxx index eeccb0546..d0a48f510 100644 --- a/src/Physics/QuasiElastic/XSection/AhrensNCELPXSec.cxx +++ b/src/Physics/QuasiElastic/XSection/AhrensNCELPXSec.cxx @@ -56,7 +56,7 @@ double AhrensNCELPXSec::XSec( double E = init_state.ProbeE(kRfHitNucRest); double Q2 = kinematics.Q2(); - double M = target.HitNucMass(); + double M = target.HitPartMass(); double M2 = TMath::Power(M, 2.); double E2 = TMath::Power(E, 2.); double qmv2 = TMath::Power(1 + Q2/fMv2, 2); @@ -66,7 +66,7 @@ double AhrensNCELPXSec::XSec( int nusign = 1; int nucsign = 1; int nupdgc = init_state.ProbePdg(); - int nucpdgc = target.HitNucPdg(); + int nucpdgc = target.HitPartPdg(); if( pdg::IsAntiNeutrino(nupdgc) ) nusign = -1; if( pdg::IsNeutron(nucpdgc) ) nucsign = -1; diff --git a/src/Physics/QuasiElastic/XSection/BBA03ELFormFactorsModel.cxx b/src/Physics/QuasiElastic/XSection/BBA03ELFormFactorsModel.cxx index d582bcd60..087edf1fc 100644 --- a/src/Physics/QuasiElastic/XSection/BBA03ELFormFactorsModel.cxx +++ b/src/Physics/QuasiElastic/XSection/BBA03ELFormFactorsModel.cxx @@ -64,7 +64,7 @@ double BBA03ELFormFactorsModel::Gen(const Interaction * interaction) const const Target & tgt = interaction->InitState().Tgt(); - double M = tgt.HitNucMass(); // Mnucl + double M = tgt.HitPartMass(); // Mnucl double M2 = TMath::Power(M,2); // Mnucl^2 double t = -q2/(4*M2); // q2<0 double a = fGenA; // Krutov et al. parameter a diff --git a/src/Physics/QuasiElastic/XSection/BBA05ELFormFactorsModel.cxx b/src/Physics/QuasiElastic/XSection/BBA05ELFormFactorsModel.cxx index 07eb5a122..6bb0cd6ff 100644 --- a/src/Physics/QuasiElastic/XSection/BBA05ELFormFactorsModel.cxx +++ b/src/Physics/QuasiElastic/XSection/BBA05ELFormFactorsModel.cxx @@ -139,7 +139,7 @@ double BBA05ELFormFactorsModel::tau(const Interaction * interaction) const const Target & target = interaction->InitState().Tgt(); double q2 = kine.q2(); // momentum transfer, <0 - double M2 = TMath::Power(target.HitNucMass(),2); // Mnucl^2 + double M2 = TMath::Power(target.HitPartMass(),2); // Mnucl^2 double t = -q2/(4*M2); return t; diff --git a/src/Physics/QuasiElastic/XSection/LwlynSmithFF.cxx b/src/Physics/QuasiElastic/XSection/LwlynSmithFF.cxx index 28198c1e8..7eed4b4f1 100644 --- a/src/Physics/QuasiElastic/XSection/LwlynSmithFF.cxx +++ b/src/Physics/QuasiElastic/XSection/LwlynSmithFF.cxx @@ -173,7 +173,7 @@ double LwlynSmithFF::Fp(const Interaction * interaction) const // get struck nucleon mass & set pion mass const InitialState & init_state = interaction->InitState(); - double MN = init_state.Tgt().HitNucMass(); + double MN = init_state.Tgt().HitPartMass(); double MN2 = TMath::Power(MN, 2); double Mpi = kPionMass; double Mpi2 = TMath::Power(Mpi, 2); @@ -249,7 +249,7 @@ double LwlynSmithFF::tau(const Interaction * interaction) const const Kinematics & kinematics = interaction->Kine(); const InitialState & init_state = interaction->InitState(); double q2 = kinematics.q2(); - double Mnucl = init_state.Tgt().HitNucMass(); + double Mnucl = init_state.Tgt().HitPartMass(); double Mnucl2 = TMath::Power(Mnucl, 2); //-- calculate q^2 / (4*Mnuc^2) diff --git a/src/Physics/QuasiElastic/XSection/LwlynSmithFFNC.cxx b/src/Physics/QuasiElastic/XSection/LwlynSmithFFNC.cxx index 6e0082795..7cd35241e 100644 --- a/src/Physics/QuasiElastic/XSection/LwlynSmithFFNC.cxx +++ b/src/Physics/QuasiElastic/XSection/LwlynSmithFFNC.cxx @@ -83,7 +83,7 @@ double LwlynSmithFFNC::Fp(const Interaction * interaction) const //-- get struck nucleon mass & pion pass const InitialState & init_state = interaction->InitState(); - double MN = init_state.Tgt().HitNucMass(); + double MN = init_state.Tgt().HitPartMass(); double MN2 = TMath::Power(MN, 2); double Mpi2 = TMath::Power(kPionMass, 2); diff --git a/src/Physics/QuasiElastic/XSection/LwlynSmithQELCCPXSec.cxx b/src/Physics/QuasiElastic/XSection/LwlynSmithQELCCPXSec.cxx index 5d743afbc..a67886ab6 100644 --- a/src/Physics/QuasiElastic/XSection/LwlynSmithQELCCPXSec.cxx +++ b/src/Physics/QuasiElastic/XSection/LwlynSmithQELCCPXSec.cxx @@ -76,7 +76,7 @@ double LwlynSmithQELCCPXSec::XSec( double E = init_state.ProbeE(kRfHitNucRest); double E2 = TMath::Power(E,2); double ml = interaction->FSPrimLepton()->Mass(); - double M = target.HitNucMass(); + double M = target.HitPartMass(); double q2 = kinematics.q2(); // One of the xsec terms changes sign for antineutrinos @@ -153,7 +153,7 @@ double LwlynSmithQELCCPXSec::XSec( double R = nuclear::NuclQELXSecSuppression("Default", 0.5, interaction); //----- number of scattering centers in the target - int nucpdgc = target.HitNucPdg(); + int nucpdgc = target.HitPartPdg(); int NNucl = (pdg::IsProton(nucpdgc)) ? target.Z() : target.N(); #ifdef __GENIE_LOW_LEVEL_MESG_ENABLED__ @@ -183,7 +183,7 @@ double LwlynSmithQELCCPXSec::FullDifferentialXSec(const Interaction* interactio if ( fDoPauliBlocking && tgt.IsNucleus() && !interaction->TestBit(kIAssumeFreeNucleon) ) { int final_nucleon_pdg = interaction->RecoilNucleonPdg(); double kF = fPauliBlocker->GetFermiMomentum(tgt, final_nucleon_pdg, - tgt.HitNucPosition()); + tgt.HitPartPosition()); double pNf = outNucleonMom.P(); if ( pNf < kF ) return 0.; } @@ -194,7 +194,7 @@ double LwlynSmithQELCCPXSec::FullDifferentialXSec(const Interaction* interactio TLorentzVector * tempNeutrino = init_state.GetProbeP4(kRfLab); TLorentzVector neutrinoMom = *tempNeutrino; delete tempNeutrino; - TLorentzVector * inNucleonMom = init_state.TgtPtr()->HitNucP4Ptr(); + TLorentzVector * inNucleonMom = init_state.TgtPtr()->HitPartP4Ptr(); // *** CALCULATION OF "q" and "qTilde" *** // According to the de Forest prescription for handling the off-shell @@ -204,9 +204,9 @@ double LwlynSmithQELCCPXSec::FullDifferentialXSec(const Interaction* interactio // and off-shell energies of the hit nucleon has been subtracted from the // energy transfer q0. - // HitNucMass() looks up the PDGLibrary (on-shell) value for the initial + // HitPartMass() looks up the PDGLibrary (on-shell) value for the initial // struck nucleon - double mNi = init_state.Tgt().HitNucMass(); + double mNi = init_state.Tgt().HitPartMass(); // Hadronic matrix element for CC neutrino interactions should really use // the "nucleon mass," i.e., the mean of the proton and neutrino masses. @@ -291,7 +291,7 @@ double LwlynSmithQELCCPXSec::FullDifferentialXSec(const Interaction* interactio // Number of scattering centers in the target const Target & target = init_state.Tgt(); - int nucpdgc = target.HitNucPdg(); + int nucpdgc = target.HitPartPdg(); int NNucl = (pdg::IsProton(nucpdgc)) ? target.Z() : target.N(); #ifdef __GENIE_LOW_LEVEL_MESG_ENABLED__ @@ -334,7 +334,7 @@ double LwlynSmithQELCCPXSec::Integral(const Interaction * in) const Target * tgt = in_curr.InitState().TgtPtr(); // get nuclear masses (init & final state nucleus) - int nucleon_pdgc = tgt->HitNucPdg(); + int nucleon_pdgc = tgt->HitPartPdg(); bool is_p = pdg::IsProton(nucleon_pdgc); int Zi = tgt->Z(); int Ai = tgt->A(); @@ -364,13 +364,13 @@ double LwlynSmithQELCCPXSec::Integral(const Interaction * in) const for(int inuc=0;inucGenerateVertex(&in_curr,tgt->A()); - tgt->SetHitNucPosition(nucpos.Mag()); + tgt->SetHitPartPosition(nucpos.Mag()); // Generate a nucleon fNuclModel->GenerateNucleon(*tgt, nucpos.Mag()); TVector3 p3N = fNuclModel->Momentum3(); double EN = Mi - TMath::Sqrt(p3N.Mag2() + Mf*Mf); - TLorentzVector* p4N = tgt->HitNucP4Ptr(); + TLorentzVector* p4N = tgt->HitPartP4Ptr(); p4N->SetPx (p3N.Px()); p4N->SetPy (p3N.Py()); p4N->SetPz (p3N.Pz()); @@ -396,7 +396,7 @@ bool LwlynSmithQELCCPXSec::ValidProcess(const Interaction * interaction) const if(!proc_info.IsQuasiElastic()) return false; - int nuc = init_state.Tgt().HitNucPdg(); + int nuc = init_state.Tgt().HitPartPdg(); int nu = init_state.ProbePdg(); bool isP = pdg::IsProton(nuc); diff --git a/src/Physics/QuasiElastic/XSection/NewQELXSec.cxx b/src/Physics/QuasiElastic/XSection/NewQELXSec.cxx index 40bd28036..1d66b4e67 100644 --- a/src/Physics/QuasiElastic/XSection/NewQELXSec.cxx +++ b/src/Physics/QuasiElastic/XSection/NewQELXSec.cxx @@ -120,7 +120,7 @@ double NewQELXSec::Integrate(const XSecAlgorithmI* model, const Interaction* in) double probeE = interaction->InitState().ProbeE( kRfLab ); if ( !tgt->IsNucleus() || probeE > E_lab_cutoff ) { - tgt->SetHitNucPosition(0.); + tgt->SetHitPartPosition(0.); if ( tgt->IsNucleus() ) nucl_model->GenerateNucleon(*tgt, 0.); else { @@ -147,7 +147,7 @@ double NewQELXSec::Integrate(const XSecAlgorithmI* model, const Interaction* in) // hurt to do this for other models) TVector3 vertex_pos = vtx_gen->GenerateVertex( interaction, tgt->A() ); double radius = vertex_pos.Mag(); - tgt->SetHitNucPosition( radius ); + tgt->SetHitPartPosition( radius ); // Sample a new nucleon 3-momentum and removal energy (this will be applied // to the nucleon via a call to genie::utils::ComputeFullQELPXSec(), so diff --git a/src/Physics/QuasiElastic/XSection/NievesQELCCPXSec.cxx b/src/Physics/QuasiElastic/XSection/NievesQELCCPXSec.cxx index afe33592f..dbe2dff76 100644 --- a/src/Physics/QuasiElastic/XSection/NievesQELCCPXSec.cxx +++ b/src/Physics/QuasiElastic/XSection/NievesQELCCPXSec.cxx @@ -92,9 +92,9 @@ double NievesQELCCPXSec::XSec(const Interaction * interaction, const InitialState & init_state = interaction -> InitState(); const Target & target = init_state.Tgt(); - // HitNucMass() looks up the PDGLibrary (on-shell) value for the initial + // HitPartMass() looks up the PDGLibrary (on-shell) value for the initial // struck nucleon - double mNi = target.HitNucMass(); + double mNi = target.HitPartMass(); // Hadronic matrix element for CC neutrino interactions should really use // the "nucleon mass," i.e., the mean of the proton and neutrino masses. @@ -106,15 +106,15 @@ double NievesQELCCPXSec::XSec(const Interaction * interaction, // to be on-shell (this will be needed later for the tensor contraction, // in which the nucleon is treated in this way) double inNucleonOnShellEnergy = std::sqrt( std::pow(mNi, 2) - + std::pow(target.HitNucP4().P(), 2) ); + + std::pow(target.HitPartP4().P(), 2) ); // The Nieves CCQE model follows the de Forest prescription: free nucleon // (i.e., on-shell) form factors and spinors are used, but an effective // value of the 4-momentum transfer "qTilde" is used when computing the // contraction of the hadronic tensor. See comments in the // FullDifferentialXSec() method of LwlynSmithQELCCPXSec for more details. - TLorentzVector inNucleonMomOnShell( target.HitNucP4().Vect(), - inNucleonOnShellEnergy ); + TLorentzVector inNucleonMomOnShell( target.HitPartP4().Vect(), + inNucleonOnShellEnergy ); // Get the four kinematic vectors and caluclate GFactor // Create copies of all kinematics, so they can be rotated @@ -127,7 +127,7 @@ double NievesQELCCPXSec::XSec(const Interaction * interaction, TLorentzVector* tempNeutrino = init_state.GetProbeP4(kRfLab); TLorentzVector neutrinoMom = *tempNeutrino; delete tempNeutrino; - TLorentzVector inNucleonMom = target.HitNucP4(); + TLorentzVector inNucleonMom = target.HitPartP4(); TLorentzVector leptonMom = kinematics.FSLeptonP4(); TLorentzVector outNucleonMom = kinematics.HadSystP4(); @@ -135,7 +135,7 @@ double NievesQELCCPXSec::XSec(const Interaction * interaction, if ( fDoPauliBlocking && target.IsNucleus() && !interaction->TestBit(kIAssumeFreeNucleon) ) { int final_nucleon_pdg = interaction->RecoilNucleonPdg(); double kF = fPauliBlocker->GetFermiMomentum(target, final_nucleon_pdg, - target.HitNucPosition()); + target.HitPartPosition()); double pNf = outNucleonMom.P(); if ( pNf < kF ) return 0.; } @@ -154,7 +154,7 @@ double NievesQELCCPXSec::XSec(const Interaction * interaction, double plLocal = leptonMom.P(); bool is_neutrino = pdg::IsNeutrino(init_state.ProbePdg()); - double r = target.HitNucPosition(); + double r = target.HitPartPosition(); if ( fCoulomb ) { // Coulomb potential @@ -337,7 +337,7 @@ double NievesQELCCPXSec::XSec(const Interaction * interaction, } // Number of scattering centers in the target - int nucpdgc = target.HitNucPdg(); + int nucpdgc = target.HitPartPdg(); int NNucl = (pdg::IsProton(nucpdgc)) ? target.Z() : target.N(); xsec *= NNucl; // nuclear xsec @@ -371,7 +371,7 @@ bool NievesQELCCPXSec::ValidProcess(const Interaction * interaction) const if(!proc_info.IsQuasiElastic()) return false; - int nuc = init_state.Tgt().HitNucPdg(); + int nuc = init_state.Tgt().HitPartPdg(); int nu = init_state.ProbePdg(); bool isP = pdg::IsProton(nuc); @@ -927,13 +927,13 @@ const TLorentzVector inNucleonMomOnShell, const TLorentzVector leptonMom, const TLorentzVector qTildeP4, double M, bool is_neutrino, const Target& target, bool assumeFreeNucleon) const { - double r = target.HitNucPosition(); + double r = target.HitPartPosition(); bool tgtIsNucleus = target.IsNucleus(); int tgt_pdgc = target.Pdg(); int A = target.A(); int Z = target.Z(); int N = target.N(); - bool hitNucIsProton = pdg::IsProton( target.HitNucPdg() ); + bool hitNucIsProton = pdg::IsProton( target.HitPartPdg() ); const double k[4] = {neutrinoMom.E(),neutrinoMom.Px(),neutrinoMom.Py(),neutrinoMom.Pz()}; const double kPrime[4] = {leptonMom.E(),leptonMom.Px(), @@ -1266,7 +1266,7 @@ void NievesQELCCPXSec::CompareNievesTensors(const Interaction* in) const Target & target = init_state.Tgt(); // Parameters required for LmunuAnumu - double M = target.HitNucMass(); + double M = target.HitPartMass(); double ml = interaction->FSPrimLepton()->Mass(); bool is_neutrino = pdg::IsNeutrino(init_state.ProbePdg()); diff --git a/src/Physics/QuasiElastic/XSection/QELUtils.cxx b/src/Physics/QuasiElastic/XSection/QELUtils.cxx index 4e81b57a4..05cc0ee30 100644 --- a/src/Physics/QuasiElastic/XSection/QELUtils.cxx +++ b/src/Physics/QuasiElastic/XSection/QELUtils.cxx @@ -35,7 +35,7 @@ namespace { TVector3 COMframe2Lab(const genie::InitialState& initialState) { TLorentzVector* k4 = initialState.GetProbeP4( genie::kRfLab ); - TLorentzVector* p4 = initialState.TgtPtr()->HitNucP4Ptr(); + TLorentzVector* p4 = initialState.TgtPtr()->HitPartP4Ptr(); TLorentzVector totMom = *k4 + *p4; TVector3 beta = totMom.BoostVector(); @@ -58,7 +58,7 @@ double genie::utils::EnergyDeltaFunctionSolutionQEL( // vice-versa TLorentzVector* probe = inter.InitStatePtr()->GetProbeP4( kRfLab ); const TLorentzVector& hit_nucleon = inter.InitStatePtr()->TgtPtr() - ->HitNucP4(); + ->HitPartP4(); TLorentzVector total_p4 = (*probe) + hit_nucleon; TVector3 beta_COM_to_lab = total_p4.BoostVector(); TVector3 beta_lab_to_COM = -beta_COM_to_lab; @@ -244,10 +244,10 @@ double genie::utils::CosTheta0Max(const genie::Interaction& interaction) { // Possibly off-shell initial struck nucleon total energy // (BindHitNucleon() should have been called previously if needed) - const TLorentzVector& p4Ni = interaction.InitState().Tgt().HitNucP4(); + const TLorentzVector& p4Ni = interaction.InitState().Tgt().HitPartP4(); double ENi = p4Ni.E(); // On-shell mass of initial struck nucleon - double mNi = interaction.InitState().Tgt().HitNucMass(); + double mNi = interaction.InitState().Tgt().HitPartMass(); // On-shell initial struck nucleon energy double ENi_on_shell = std::sqrt( mNi*mNi + p4Ni.Vect().Mag2() ); // Energy needed to put initial nucleon on the mass shell @@ -263,14 +263,14 @@ void genie::utils::BindHitNucleon(genie::Interaction& interaction, genie::QELEvGen_BindingMode_t hitNucleonBindingMode) { genie::Target* tgt = interaction.InitState().TgtPtr(); - TLorentzVector* p4Ni = tgt->HitNucP4Ptr(); + TLorentzVector* p4Ni = tgt->HitPartP4Ptr(); // Initial nucleon 3-momentum (lab frame) TVector3 p3Ni = nucl_model.Momentum3(); // Look up the (on-shell) mass of the initial nucleon TDatabasePDG* tb = TDatabasePDG::Instance(); - double mNi = tb->GetParticle( tgt->HitNucPdg() )->Mass(); + double mNi = tb->GetParticle( tgt->HitPartPdg() )->Mass(); // Set the (possibly off-shell) initial nucleon energy based on // the selected binding energy mode. Always put the initial nucleon @@ -308,7 +308,7 @@ void genie::utils::BindHitNucleon(genie::Interaction& interaction, // Determine the mass and proton numbers for the remnant nucleus int Af = tgt->A() - 1; int Zf = tgt->Z(); - if ( genie::pdg::IsProton( tgt->HitNucPdg()) ) --Zf; + if ( genie::pdg::IsProton( tgt->HitPartPdg()) ) --Zf; Mf = genie::PDGLibrary::Instance()->Find( genie::pdg::IonPdgCode(Af, Zf) )->Mass(); // Deduce the binding energy from the final nucleus mass @@ -359,7 +359,7 @@ void genie::utils::BindHitNucleon(genie::Interaction& interaction, // Get the Fermi energies for the initial and final nucleons. Include // the radial dependence if using the LFG. - double hit_nucleon_radius = tgt->HitNucPosition(); + double hit_nucleon_radius = tgt->HitPartPosition(); // Average of the proton and neutron masses. It may actually be better // to use the exact on-shell masses here. However, the original paper @@ -369,7 +369,7 @@ void genie::utils::BindHitNucleon(genie::Interaction& interaction, const double mN = genie::constants::kNucleonMass; double kF_Ni = nucl_model.LocalFermiMomentum( *tgt, - tgt->HitNucPdg(), hit_nucleon_radius ); + tgt->HitPartPdg(), hit_nucleon_radius ); double EFermi_Ni = std::sqrt( std::max(0., mN*mN + kF_Ni*kF_Ni) ); double kF_Nf = nucl_model.LocalFermiMomentum( *tgt, @@ -404,7 +404,7 @@ void genie::utils::BindHitNucleon(genie::Interaction& interaction, Eb = Mf - Mi + mNi; LOG( "QELEvent", pDEBUG ) << "Qvalue = " << Qvalue - << ", Q_LFG = " << Q_LFG << " at radius = " << tgt->HitNucPosition(); + << ", Q_LFG = " << Q_LFG << " at radius = " << tgt->HitPartPosition(); } // The (lab-frame) off-shell initial nucleon energy is the difference diff --git a/src/Physics/QuasiElastic/XSection/RosenbluthPXSec.cxx b/src/Physics/QuasiElastic/XSection/RosenbluthPXSec.cxx index f18d6d3c5..8d1467fa6 100644 --- a/src/Physics/QuasiElastic/XSection/RosenbluthPXSec.cxx +++ b/src/Physics/QuasiElastic/XSection/RosenbluthPXSec.cxx @@ -59,10 +59,10 @@ double RosenbluthPXSec::XSec( const Target & target = init_state.Tgt(); const ProcessInfo & proc_info = interaction->ProcInfo(); - int nucpdgc = target.HitNucPdg(); + int nucpdgc = target.HitPartPdg(); double E = init_state.ProbeE(kRfHitNucRest); double Q2 = kinematics.Q2(); - double M = target.HitNucMass(); + double M = target.HitPartMass(); double E2 = E*E; double E3 = E*E2; @@ -151,7 +151,7 @@ bool RosenbluthPXSec::ValidProcess(const Interaction * interaction) const const InitialState & init_state = interaction->InitState(); - int hitnuc = init_state.Tgt().HitNucPdg(); + int hitnuc = init_state.Tgt().HitPartPdg(); bool is_pn = (pdg::IsProton(hitnuc) || pdg::IsNeutron(hitnuc)); if (!is_pn) return false; diff --git a/src/Physics/QuasiElastic/XSection/SmithMonizQELCCPXSec.cxx b/src/Physics/QuasiElastic/XSection/SmithMonizQELCCPXSec.cxx index bf3baee6c..06968c54b 100644 --- a/src/Physics/QuasiElastic/XSection/SmithMonizQELCCPXSec.cxx +++ b/src/Physics/QuasiElastic/XSection/SmithMonizQELCCPXSec.cxx @@ -137,7 +137,7 @@ bool SmithMonizQELCCPXSec::ValidProcess(const Interaction * interaction) const if(!proc_info.IsQuasiElastic()) return false; - int nuc = init_state.Tgt().HitNucPdg(); + int nuc = init_state.Tgt().HitPartPdg(); int nu = init_state.ProbePdg(); bool isP = pdg::IsProton(nuc); @@ -210,14 +210,14 @@ double SmithMonizQELCCPXSec::d3sQES_dQ2dvdkF_SM(const Interaction * interaction) double v = kinematics.GetKV(kKVv); double kF = kinematics.GetKV(kKVPn); double kkF = kF*kF; - int nucl_pdg_ini = target.HitNucPdg(); + int nucl_pdg_ini = target.HitPartPdg(); int nucl_pdg_fin = genie::pdg::SwitchProtonNeutron(nucl_pdg_ini); PDGLibrary * pdglib = PDGLibrary::Instance(); TParticlePDG * nucl_fin = pdglib->Find( nucl_pdg_fin ); double E_BIN = sm_utils->GetBindingEnergy(); - double m_ini = target.HitNucMass(); + double m_ini = target.HitPartMass(); double mm_ini = m_ini*m_ini; double m_fin = nucl_fin -> Mass(); // Mass of final hadron or hadron system (GeV) double mm_fin = m_fin*m_fin; @@ -392,7 +392,7 @@ double SmithMonizQELCCPXSec::d2sQES_dQ2dv_SM(const Interaction * interaction) co double xsec = 0.5*Sum*(rkF.max-rkF.min); - int nucpdgc = target.HitNucPdg(); + int nucpdgc = target.HitPartPdg(); int NNucl = (pdg::IsProton(nucpdgc)) ? target.Z() : target.N(); xsec *= NNucl; // nuclear xsec @@ -414,7 +414,7 @@ double SmithMonizQELCCPXSec::dsQES_dQ2_SM(const Interaction * interaction) const double E = init_state.ProbeE(kRfHitNucRest); double E2 = TMath::Power(E,2); double ml = interaction->FSPrimLepton()->Mass(); - double M = target.HitNucMass(); + double M = target.HitPartMass(); double q2 = kinematics.q2(); // One of the xsec terms changes sign for antineutrinos @@ -464,7 +464,7 @@ double SmithMonizQELCCPXSec::dsQES_dQ2_SM(const Interaction * interaction) const xsec *= fQES_Pauli; } - int nucpdgc = target.HitNucPdg(); + int nucpdgc = target.HitPartPdg(); int NNucl = (pdg::IsProton(nucpdgc)) ? target.Z() : target.N(); xsec *= NNucl; // nuclear xsec diff --git a/src/Physics/QuasiElastic/XSection/SmithMonizUtils.cxx b/src/Physics/QuasiElastic/XSection/SmithMonizUtils.cxx index c49d46419..44632540e 100644 --- a/src/Physics/QuasiElastic/XSection/SmithMonizUtils.cxx +++ b/src/Physics/QuasiElastic/XSection/SmithMonizUtils.cxx @@ -125,14 +125,14 @@ void SmithMonizUtils::SetInteraction(const Interaction * interaction) // neutrino energy (GeV) E_nu = interaction->InitState().ProbeE(kRfLab); - assert(target.HitNucIsSet()); + assert(target.HitPartIsSet()); // get lepton&nuclear masses (init & final state nucleus) // mass of final charged lepton (GeV) m_lep = interaction->FSPrimLepton()->Mass(); mm_lep = TMath::Power(m_lep, 2); - int nucl_pdg_ini = target.HitNucPdg(); - m_ini = target.HitNucMass(); + int nucl_pdg_ini = target.HitPartPdg(); + m_ini = target.HitPartMass(); mm_ini = TMath::Power(m_ini, 2); int nucl_pdg_fin = genie::pdg::SwitchProtonNeutron(nucl_pdg_ini); TParticlePDG * nucl_fin = pdglib->Find( nucl_pdg_fin ); diff --git a/src/Physics/QuasiElastic/XSection/SuSAv2QELPXSec.cxx b/src/Physics/QuasiElastic/XSection/SuSAv2QELPXSec.cxx index 54980017f..f8f6b0f94 100644 --- a/src/Physics/QuasiElastic/XSection/SuSAv2QELPXSec.cxx +++ b/src/Physics/QuasiElastic/XSection/SuSAv2QELPXSec.cxx @@ -501,7 +501,7 @@ double SuSAv2QELPXSec::XSecScaling(double xsec, const Interaction* interaction, // behavior for all targets by scaling by Z/2 or N/2 as appropriate. // Do the same for NC. TODO: double-check that this is the right // thing to do when we SuSAv2 NC hadronic tensors are added to GENIE. - int hit_nuc_pdg = tgt.HitNucPdg(); + int hit_nuc_pdg = tgt.HitPartPdg(); if ( pdg::IsProton(hit_nuc_pdg) ) xsec *= tgt.Z() / 2.; else if ( pdg::IsNeutron(hit_nuc_pdg) ) xsec *= tgt.N() / 2.; // We should never get here if ValidProcess() is working correctly @@ -557,7 +557,7 @@ bool SuSAv2QELPXSec::ValidProcess(const Interaction* interaction) const // not free nucleons. if ( !init_state.Tgt().IsNucleus() ) return false; - int nuc = init_state.Tgt().HitNucPdg(); + int nuc = init_state.Tgt().HitPartPdg(); int nu = init_state.ProbePdg(); bool isP = pdg::IsProton(nuc); diff --git a/src/Physics/Resonance/EventGen/RESInteractionListGenerator.cxx b/src/Physics/Resonance/EventGen/RESInteractionListGenerator.cxx index 1ae0207fb..f801d92f9 100644 --- a/src/Physics/Resonance/EventGen/RESInteractionListGenerator.cxx +++ b/src/Physics/Resonance/EventGen/RESInteractionListGenerator.cxx @@ -116,7 +116,7 @@ InteractionList * RESInteractionListGenerator::CreateInteractionList( // add the struck nucleon Target * target = interaction->InitStatePtr()->TgtPtr(); - target->SetHitNucPdg(hit_nucleon[i]); + target->SetHitPartPdg(hit_nucleon[i]); // add the baryon resonance in the exclusive tag XclsTag * xcls = interaction->ExclTagPtr(); diff --git a/src/Physics/Resonance/EventGen/RESKinematicsGenerator.cxx b/src/Physics/Resonance/EventGen/RESKinematicsGenerator.cxx index d46a83d81..3689f4ad5 100644 --- a/src/Physics/Resonance/EventGen/RESKinematicsGenerator.cxx +++ b/src/Physics/Resonance/EventGen/RESKinematicsGenerator.cxx @@ -192,7 +192,8 @@ void RESKinematicsGenerator::ProcessEventRecord(GHepRecord * evrec) const // compute x,y for selected W,Q2 // note: hit nucleon can be off the mass-shell double gx=-1, gy=-1; - double M = init_state.Tgt().HitNucP4().M(); + double M = init_state.Tgt().HitPartP4().M(); + //double M = init_state.Tgt().HitPartMass(); kinematics::WQ2toXY(E,M,gW,gQ2,gx,gy); // set the cross section for the selected kinematics diff --git a/src/Physics/Resonance/EventGen/RSPPInteractionListGenerator.cxx b/src/Physics/Resonance/EventGen/RSPPInteractionListGenerator.cxx index ec5e840d1..63423c6e3 100644 --- a/src/Physics/Resonance/EventGen/RSPPInteractionListGenerator.cxx +++ b/src/Physics/Resonance/EventGen/RSPPInteractionListGenerator.cxx @@ -114,7 +114,7 @@ InteractionList * RSPPInteractionListGenerator::CreateInteractionList( Target * target = interaction->InitStatePtr()->TgtPtr(); - target->SetHitNucPdg(struck_nucleon); + target->SetHitPartPdg(struck_nucleon); this->AddFinalStateInfo(interaction, nucc_channels[i]); intlist->push_back(interaction); @@ -135,7 +135,7 @@ InteractionList * RSPPInteractionListGenerator::CreateInteractionList( Target * target = interaction->InitStatePtr()->TgtPtr(); - target->SetHitNucPdg(struck_nucleon); + target->SetHitPartPdg(struck_nucleon); this->AddFinalStateInfo(interaction, nunc_channels[i]); intlist->push_back(interaction); diff --git a/src/Physics/Resonance/XSection/BSKLNBaseRESPXSec2014.cxx b/src/Physics/Resonance/XSection/BSKLNBaseRESPXSec2014.cxx index 0ebcbd1eb..192a5d8a3 100644 --- a/src/Physics/Resonance/XSection/BSKLNBaseRESPXSec2014.cxx +++ b/src/Physics/Resonance/XSection/BSKLNBaseRESPXSec2014.cxx @@ -105,7 +105,7 @@ double BSKLNBaseRESPXSec2014::XSec( bool is_delta = utils::res::IsDelta (resonance); // Get the neutrino, hit nucleon & weak current - int nucpdgc = target.HitNucPdg(); + int nucpdgc = target.HitPartPdg(); int probepdgc = init_state.ProbePdg(); bool is_nu = pdg::IsNeutrino (probepdgc); bool is_nubar = pdg::IsAntiNeutrino (probepdgc); @@ -139,7 +139,7 @@ double BSKLNBaseRESPXSec2014::XSec( // Compute auxiliary & kinematical factors double E = init_state.ProbeE(kRfHitNucRest); - double Mnuc = target.HitNucMass(); + double Mnuc = target.HitPartMass(); double W2 = TMath::Power(W, 2); double Mnuc2 = TMath::Power(Mnuc, 2); double k = 0.5 * (W2 - Mnuc2)/Mnuc; @@ -722,7 +722,7 @@ bool BSKLNBaseRESPXSec2014::ValidProcess(const Interaction * interaction) const if(!proc_info.IsResonant()) return false; if(!xcls.KnownResonance()) return false; - int hitnuc = init_state.Tgt().HitNucPdg(); + int hitnuc = init_state.Tgt().HitPartPdg(); bool is_pn = (pdg::IsProton(hitnuc) || pdg::IsNeutron(hitnuc)); if (!is_pn) return false; diff --git a/src/Physics/Resonance/XSection/BostedChristyEMPXSec.cxx b/src/Physics/Resonance/XSection/BostedChristyEMPXSec.cxx index 6f1f9dc01..41aeed6c4 100644 --- a/src/Physics/Resonance/XSection/BostedChristyEMPXSec.cxx +++ b/src/Physics/Resonance/XSection/BostedChristyEMPXSec.cxx @@ -625,7 +625,7 @@ bool BostedChristyEMPXSec::ValidProcess(const Interaction * interaction) const if(!proc_info.IsResonant() ) return false; - int hitnuc = init_state.Tgt().HitNucPdg(); + int hitnuc = init_state.Tgt().HitPartPdg(); bool is_pn = (pdg::IsProton(hitnuc) || pdg::IsNeutron(hitnuc)); if (!is_pn) return false; diff --git a/src/Physics/Resonance/XSection/P33PaschosLalakulichPXSec.cxx b/src/Physics/Resonance/XSection/P33PaschosLalakulichPXSec.cxx index d40626225..98d19b894 100644 --- a/src/Physics/Resonance/XSection/P33PaschosLalakulichPXSec.cxx +++ b/src/Physics/Resonance/XSection/P33PaschosLalakulichPXSec.cxx @@ -62,7 +62,7 @@ double P33PaschosLalakulichPXSec::XSec( double E2 = TMath::Power(E,2); double Q2 = kinematics.Q2(); double W = kinematics.W(); - double MN = target.HitNucMass(); + double MN = target.HitPartMass(); double MN2 = TMath::Power(MN,2); double Mmu2 = kMuonMass2; double Mpi2 = kPionMass2; @@ -250,7 +250,7 @@ double P33PaschosLalakulichPXSec::XSec( if( interaction->TestBit(kIAssumeFreeNucleon) ) return xsec; //-- number of scattering centers in the target - bool isp = pdg::IsProton(target.HitNucPdg()); + bool isp = pdg::IsProton(target.HitPartPdg()); int NNucl = (isp) ? target.Z() : target.N(); xsec*=NNucl; // nuclear xsec (no nuclear suppression factor) diff --git a/src/Physics/Resonance/XSection/ReinSehgalRESPXSec.cxx b/src/Physics/Resonance/XSection/ReinSehgalRESPXSec.cxx index 4c314977b..59121236e 100644 --- a/src/Physics/Resonance/XSection/ReinSehgalRESPXSec.cxx +++ b/src/Physics/Resonance/XSection/ReinSehgalRESPXSec.cxx @@ -92,7 +92,7 @@ double ReinSehgalRESPXSec::XSec( bool is_delta = utils::res::IsDelta (resonance); // Get the neutrino, hit nucleon & weak current - int nucpdgc = target.HitNucPdg(); + int nucpdgc = target.HitPartPdg(); int probepdgc = init_state.ProbePdg(); bool is_nu = pdg::IsNeutrino (probepdgc); bool is_nubar = pdg::IsAntiNeutrino (probepdgc); @@ -126,7 +126,7 @@ double ReinSehgalRESPXSec::XSec( // Compute auxiliary & kinematical factors double E = init_state.ProbeE(kRfHitNucRest); - double Mnuc = target.HitNucMass(); + double Mnuc = target.HitPartMass(); double W2 = TMath::Power(W, 2); double Mnuc2 = TMath::Power(Mnuc, 2); double k = 0.5 * (W2 - Mnuc2)/Mnuc; @@ -395,7 +395,7 @@ bool ReinSehgalRESPXSec::ValidProcess(const Interaction * interaction) const if(!proc_info.IsResonant()) return false; if(!xcls.KnownResonance()) return false; - int hitnuc = init_state.Tgt().HitNucPdg(); + int hitnuc = init_state.Tgt().HitPartPdg(); bool is_pn = (pdg::IsProton(hitnuc) || pdg::IsNeutron(hitnuc)); if (!is_pn) return false; diff --git a/src/Physics/Resonance/XSection/ReinSehgalRESXSec.cxx b/src/Physics/Resonance/XSection/ReinSehgalRESXSec.cxx index 58ba32621..14afffea7 100644 --- a/src/Physics/Resonance/XSection/ReinSehgalRESXSec.cxx +++ b/src/Physics/Resonance/XSection/ReinSehgalRESXSec.cxx @@ -72,7 +72,7 @@ double ReinSehgalRESXSec::Integrate( const Target & target = init_state.Tgt(); InteractionType_t it = proc_info.InteractionTypeId(); - int nucleon_pdgc = target.HitNucPdg(); + int nucleon_pdgc = target.HitPartPdg(); int nu_pdgc = init_state.ProbePdg(); //-- Get neutrino energy in the struck nucleon rest frame diff --git a/src/Physics/Resonance/XSection/ReinSehgalRESXSecFast.cxx b/src/Physics/Resonance/XSection/ReinSehgalRESXSecFast.cxx index ac726d393..2387c6b6e 100644 --- a/src/Physics/Resonance/XSection/ReinSehgalRESXSecFast.cxx +++ b/src/Physics/Resonance/XSection/ReinSehgalRESXSecFast.cxx @@ -75,7 +75,7 @@ double ReinSehgalRESXSecFast::Integrate( const Target & target = init_state.Tgt(); InteractionType_t it = proc_info.InteractionTypeId(); - int nucleon_pdgc = target.HitNucPdg(); + int nucleon_pdgc = target.HitPartPdg(); int nu_pdgc = init_state.ProbePdg(); //-- Get neutrino energy in the struck nucleon rest frame diff --git a/src/Physics/Resonance/XSection/ReinSehgalRESXSecWithCache.cxx b/src/Physics/Resonance/XSection/ReinSehgalRESXSecWithCache.cxx index 6994c1244..9a9a96c4b 100644 --- a/src/Physics/Resonance/XSection/ReinSehgalRESXSecWithCache.cxx +++ b/src/Physics/Resonance/XSection/ReinSehgalRESXSecWithCache.cxx @@ -82,12 +82,12 @@ void ReinSehgalRESXSecWithCache::CacheResExcitationXSec( TLorentzVector p4(0,0,0,0); int nu_code = in->InitState().ProbePdg(); - int nuc_code = in->InitState().Tgt().HitNucPdg(); + int nuc_code = in->InitState().Tgt().HitPartPdg(); int tgt_code = (nuc_code==kPdgProton) ? kPdgTgtFreeP : kPdgTgtFreeN; Interaction * interaction = new Interaction(*in); interaction->InitStatePtr()->SetPdgs(tgt_code, nu_code); - interaction->InitStatePtr()->TgtPtr()->SetHitNucPdg(nuc_code); + interaction->InitStatePtr()->TgtPtr()->SetHitPartPdg(nuc_code); InteractionType_t wkcur = interaction->ProcInfo().InteractionTypeId(); unsigned int nres = fResList.NResonances(); diff --git a/src/Physics/Resonance/XSection/ReinSehgalRESXSecWithCacheFast.cxx b/src/Physics/Resonance/XSection/ReinSehgalRESXSecWithCacheFast.cxx index f2b6c1651..6c9ebf9aa 100644 --- a/src/Physics/Resonance/XSection/ReinSehgalRESXSecWithCacheFast.cxx +++ b/src/Physics/Resonance/XSection/ReinSehgalRESXSecWithCacheFast.cxx @@ -97,12 +97,12 @@ void ReinSehgalRESXSecWithCacheFast::CacheResExcitationXSec( TLorentzVector p4(0,0,0,0); int nu_code = in->InitState().ProbePdg(); - int nuc_code = in->InitState().Tgt().HitNucPdg(); + int nuc_code = in->InitState().Tgt().HitPartPdg(); int tgt_code = (nuc_code==kPdgProton) ? kPdgTgtFreeP : kPdgTgtFreeN; Interaction * interaction = new Interaction(*in); interaction->InitStatePtr()->SetPdgs(tgt_code, nu_code); - interaction->InitStatePtr()->TgtPtr()->SetHitNucPdg(nuc_code); + interaction->InitStatePtr()->TgtPtr()->SetHitPartPdg(nuc_code); InteractionType_t wkcur = interaction->ProcInfo().InteractionTypeId(); unsigned int nres = fResList.NResonances(); diff --git a/src/Physics/Resonance/XSection/ReinSehgalSPPXSec.cxx b/src/Physics/Resonance/XSection/ReinSehgalSPPXSec.cxx index fd4c49339..858a89f89 100644 --- a/src/Physics/Resonance/XSection/ReinSehgalSPPXSec.cxx +++ b/src/Physics/Resonance/XSection/ReinSehgalSPPXSec.cxx @@ -67,7 +67,7 @@ double ReinSehgalSPPXSec::Integrate( const Target & target = init_state.Tgt(); InteractionType_t it = proc_info.InteractionTypeId(); - int nucleon_pdgc = target.HitNucPdg(); + int nucleon_pdgc = target.HitPartPdg(); int nu_pdgc = init_state.ProbePdg(); // Get neutrino energy in the struck nucleon rest frame diff --git a/src/Physics/Strange/EventGen/SKHadronicSystemGenerator.cxx b/src/Physics/Strange/EventGen/SKHadronicSystemGenerator.cxx index 7e54426a4..fe62212aa 100644 --- a/src/Physics/Strange/EventGen/SKHadronicSystemGenerator.cxx +++ b/src/Physics/Strange/EventGen/SKHadronicSystemGenerator.cxx @@ -89,7 +89,7 @@ void SKHadronicSystemGenerator::CalculateHadronicSystem_AtharSingleKaon(GHepReco TLorentzVector p4fsl = p4fsl_lab; // Transform the neutrino and final-state lepton to the struck nucleon rest frame - const TLorentzVector pnuc4 = interaction->InitState().Tgt().HitNucP4(); // 4-momentum of struck nucleon in lab frame + const TLorentzVector pnuc4 = interaction->InitState().Tgt().HitPartP4(); // 4-momentum of struck nucleon in lab frame TVector3 beta = pnuc4.BoostVector(); p4nu.Boost(-1.*beta); p4fsl.Boost(-1.*beta); diff --git a/src/Physics/Strange/EventGen/SKInteractionListGenerator.cxx b/src/Physics/Strange/EventGen/SKInteractionListGenerator.cxx index ebef0cf8e..be37a7403 100644 --- a/src/Physics/Strange/EventGen/SKInteractionListGenerator.cxx +++ b/src/Physics/Strange/EventGen/SKInteractionListGenerator.cxx @@ -104,7 +104,7 @@ InteractionList * SKInteractionListGenerator::CreateInteractionList( delete interaction; continue; } - target->SetHitNucPdg(inuclpdg[i]); + target->SetHitPartPdg(inuclpdg[i]); xcls->SetStrange(kaonpdg[i]); if( fnuclpdg[i] == kPdgProton ) xcls->SetNProtons(1); else xcls->SetNNeutrons(1); diff --git a/src/Physics/Strange/EventGen/SKKinematicsGenerator.cxx b/src/Physics/Strange/EventGen/SKKinematicsGenerator.cxx index 031721cf1..858160507 100644 --- a/src/Physics/Strange/EventGen/SKKinematicsGenerator.cxx +++ b/src/Physics/Strange/EventGen/SKKinematicsGenerator.cxx @@ -90,7 +90,7 @@ void SKKinematicsGenerator::CalculateKin_AtharSingleKaon(GHepRecord * evrec) con // Determine lepton and kaon masses int leppdg = interaction->FSPrimLeptonPdg(); - const TLorentzVector pnuc4 = interaction->InitState().Tgt().HitNucP4(); // 4-momentum of struck nucleon in lab frame + const TLorentzVector pnuc4 = interaction->InitState().Tgt().HitPartP4(); // 4-momentum of struck nucleon in lab frame TVector3 beta = pnuc4.BoostVector(); TLorentzVector P4_nu = *(interaction->InitStatePtr()->GetProbeP4(kRfHitNucRest)); // struck nucleon rest frame diff --git a/src/Physics/Strange/XSection/AlamSimoAtharVacasSKXSec.cxx b/src/Physics/Strange/XSection/AlamSimoAtharVacasSKXSec.cxx index 25de67566..1c5f44f3c 100644 --- a/src/Physics/Strange/XSection/AlamSimoAtharVacasSKXSec.cxx +++ b/src/Physics/Strange/XSection/AlamSimoAtharVacasSKXSec.cxx @@ -74,7 +74,7 @@ double AlamSimoAtharVacasSKXSec::Integrate( // cross section spline list. // Cross section for PP scales with number of protons, NP and NN scale // with number of neutrons - int nucpdgc = init_state.Tgt().HitNucPdg(); + int nucpdgc = init_state.Tgt().HitPartPdg(); int NNucl = (pdg::IsProton(nucpdgc)) ? init_state.Tgt().Z() : init_state.Tgt().N(); double Ev = init_state.ProbeE(kRfHitNucRest); diff --git a/src/Physics/Strange/XSection/PaisQELLambdaPXSec.cxx b/src/Physics/Strange/XSection/PaisQELLambdaPXSec.cxx index 1d3aa04a0..47b96657e 100644 --- a/src/Physics/Strange/XSection/PaisQELLambdaPXSec.cxx +++ b/src/Physics/Strange/XSection/PaisQELLambdaPXSec.cxx @@ -69,7 +69,7 @@ double PaisQELLambdaPXSec::XSec( //resonance mass & nucleon mass - double Mnuc = target.HitNucMass(); + double Mnuc = target.HitPartMass(); double Mnuc2 = TMath::Power(Mnuc,2); //----- Calculate the differential cross section dxsec/dQ^2 @@ -126,7 +126,7 @@ double PaisQELLambdaPXSec::XSec( if( interaction->TestBit(kIAssumeFreeNucleon) ) return xsec; //----- Nuclear cross section (simple scaling here) - int nuc = target.HitNucPdg(); + int nuc = target.HitPartPdg(); int NNucl = (pdg::IsProton(nuc)) ? target.Z() : target.N(); xsec *= NNucl; @@ -169,8 +169,8 @@ bool PaisQELLambdaPXSec::ValidProcess( if(!proc_info.IsQuasiElastic()) return false; if(!proc_info.IsWeak()) return false; - bool isP = pdg::IsProton ( init_state.Tgt().HitNucPdg() ); - bool isN = pdg::IsNeutron( init_state.Tgt().HitNucPdg() ); + bool isP = pdg::IsProton ( init_state.Tgt().HitPartPdg() ); + bool isN = pdg::IsNeutron( init_state.Tgt().HitPartPdg() ); int pdgc = xcls.StrangeHadronPdg(); @@ -194,7 +194,7 @@ bool PaisQELLambdaPXSec::ValidKinematics( //resonance, final state primary lepton & nucleon mass double MR = this -> MHyperon (interaction); double ml = interaction->FSPrimLepton()->Mass(); - double Mnuc = init_state.Tgt().HitNucP4Ptr()->M(); + double Mnuc = init_state.Tgt().HitPartP4Ptr()->M(); double Mnuc2 = TMath::Power(Mnuc,2); //resonance threshold diff --git a/src/Physics/XSectionIntegration/GSLXSecFunc.cxx b/src/Physics/XSectionIntegration/GSLXSecFunc.cxx index 4525a9339..2bcd2cdee 100644 --- a/src/Physics/XSectionIntegration/GSLXSecFunc.cxx +++ b/src/Physics/XSectionIntegration/GSLXSecFunc.cxx @@ -428,7 +428,7 @@ double genie::utils::gsl::d2XSec_dWdQ2_E::DoEval(const double * xin) const fInteraction->ProcInfo().IsDarkMatterDeepInelastic()) { double x=0,y=0; double E = fInteraction->InitState().ProbeE(kRfHitNucRest); - double M = fInteraction->InitState().Tgt().HitNucP4Ptr()->M(); + double M = fInteraction->InitState().Tgt().HitPartP4Ptr()->M(); kinematics::WQ2toXY(E,M,W,Q2,x,y); fInteraction->KinePtr()->Setx(x); diff --git a/src/contrib/corey/testXsec.C b/src/contrib/corey/testXsec.C index 4aea76367..b9361e310 100644 --- a/src/contrib/corey/testXsec.C +++ b/src/contrib/corey/testXsec.C @@ -83,7 +83,7 @@ void testXsec(const Char_t* outfn="VLExsecNT.root") { genie::Interaction * interaction = new genie::Interaction(init_state, proc_info); Target * target = interaction->InitStatePtr()->TgtPtr(); - target->SetHitNucPdg(kPdgProton); + target->SetHitPartPdg(kPdgProton); Int_t i=0; for (i = 0; i < nknots; i++) { TLorentzVector p4(0,0,E[i]*1e-3,E[i]*1e-3); @@ -98,7 +98,7 @@ void testXsec(const Char_t* outfn="VLExsecNT.root") { genie::Interaction * interaction_n = new genie::Interaction(init_state_n, proc_info_n); Target * target_n = interaction_n->InitStatePtr()->TgtPtr(); - target_n->SetHitNucPdg(kPdgNeutron); + target_n->SetHitPartPdg(kPdgNeutron); for (i = 0; i < nknots; i++) { TLorentzVector n4(0,0,E[i]*1e-3,E[i]*1e-3); interaction_n->InitStatePtr()->SetProbeP4(n4); diff --git a/src/contrib/electron_motion/test_parallel_orthogonal_genie.C b/src/contrib/electron_motion/test_parallel_orthogonal_genie.C new file mode 100644 index 000000000..4e19bb789 --- /dev/null +++ b/src/contrib/electron_motion/test_parallel_orthogonal_genie.C @@ -0,0 +1,58 @@ +/* +Checks the GetParallel and GetOrthogonal functions in MathUtils.h +*/ + +#include "Framework/Numerical/MathUtils.h" +#include "TVector3.h" +#include "TLorentzVector.h" + +using namespace genie::utils::math; + +void test_parallel_orthogonal_genie() { + // Define a unit vector along z-axis + TVector3 unitVec(0., 0., 1.); + std::cout << "unitVec: " << unitVec.X() << " , " << unitVec.Y() << " , " + << unitVec.Z() << std::endl; + + std::cout << "***************************************************************"< +#include +#include + +using namespace genie ; +using std::to_string; + +void make_dists(TString filename = "gntp.0.ghep.root", TString dir="",bool print_to_pdf=false, + bool print_summary=false){ + TFile infile(dir+filename); + //TFile infile('gntp.0.ghep.root'); + + // Get the GENIE GHEP tree and set its branch address + TTree * tree = dynamic_cast ( infile.Get("gtree") ); + + std::string title_car = "Velocity Distributions"; + const char *char_title_car = title_car.c_str(); + + std::string title_mom = "Momentum Distributions"; + const char *char_title_mom = title_mom.c_str(); + + std::string title_ang = "Angular Distributions"; + const char *char_title_ang = title_ang.c_str(); + + std::string title_y = "y Distribution"; + const char *char_title_y = title_y.c_str(); + + std::string title_xsec = "xsec"; + const char *char_title_xsec = title_xsec.c_str(); + + + //SEt histograms + TH1F *vx_dist = new TH1F("vx",char_title_car,20,-0.15,0.15); + TH1F *vy_dist = new TH1F("vy",char_title_car,20,-0.15,0.15); + TH1F *vz_dist = new TH1F("vz",char_title_car,20,-0.15,0.15); + + TH1F *px_dist = new TH1F("px",char_title_mom,20,-1e-4,1e-4); + TH1F *py_dist = new TH1F("py",char_title_mom,20,-1e-4,1e-4); + TH1F *pz_dist = new TH1F("pz",char_title_mom,20,-1e-4,1e-4); + + //2D histogram with cos theta and phi of velocities + TH2F *ang_dist = new TH2F("ang",char_title_ang,20,-1,1,20,-3.1415,3.1415); + + //y distribution + TH1F *y_dist = new TH1F("y",char_title_y,20,0,1); + + //xsec distribution + TH1F *xsec_dist = new TH1F("xsec",char_title_xsec,20,1e-13,1e-16); + + //Scatter plot of E_l theta_e^2 vs theta_l + std::vector E_l; //final lepton energy + std::vector Etheta2_l; //final lepton etheta^2 + std::vector theta_l; //final lepton angle + + //Scatter plot of E_l theta_e^2 vs theta_l for final state lepton in electron rest frame + std::vector E_l_erf; //final lepton energy in electron rest frame + std::vector Etheta2_l_erf; //final lepton etheta^2 in electron rest frame + std::vector theta_l_erf; //final lepton angle in electron rest frame + + //Differences between distributions in electron rest frame and lab frame + std::vector E_l_diff; //final lepton energy + std::vector Etheta2_l_diff; //final lepton etheta^2 + std::vector theta_l_diff; //final lepton angle + + NtpMCEventRecord * mcrec = 0; + tree->SetBranchAddress( "gmcrec", &mcrec); + + // Event loop + for(Long64_t i=0; i < tree->GetEntries(); i++){ + tree->GetEntry(i); + + EventRecord & event = *( mcrec->event ); + + const Interaction & inter = *( event.Summary() ) ; + + const ProcessInfo & proc_info = inter.ProcInfo() ; + + if (proc_info.IsElectronScattering()){ + GHepParticle * electron = event.HitElectron(); //Find initial electron + GHepParticle * fs_lepton = event.FinalStatePrimaryLepton(); //Find final state lepton + GHepParticle * init_neutrino = event.Probe(); //Find initial neutrino + + const TLorentzVector & pe = *( electron -> P4() ) ; //Get its 4 momentum + const TLorentzVector & ple = *( fs_lepton -> P4() ) ; //Get final state lepton 4 momentum + + //Get velocity from four momentum + double vx = pe.Px()/electron->Energy(); + double vy = pe.Py()/electron->Energy(); + double vz = pe.Pz()/electron->Energy(); + + double fs_vx = ple.Px()/fs_lepton->Energy(); + double fs_vy = ple.Py()/fs_lepton->Energy(); + double fs_vz = ple.Pz()/fs_lepton->Energy(); + + //Get angles + double costheta = vz/(sqrt(pow(vx,2)+pow(vy,2)+pow(vz,2))); + double phi = vy/abs(vy)*acos(vx/(sqrt(pow(vx,2)+pow(vy,2)))); + + double fs_costheta = fs_vz/(sqrt(pow(fs_vx,2)+pow(fs_vy,2)+pow(fs_vz,2))); + + //Fill vectors + E_l.push_back(ple.E()); + theta_l.push_back(acos(fs_costheta)); + Etheta2_l.push_back(pow(acos(fs_costheta),2)*ple.E()); + + //Fill histograms + vx_dist->Fill(vx); + vy_dist->Fill(vy); + vz_dist->Fill(vz); + + //Fill momentum distributions + px_dist->Fill(pe.Px()); + py_dist->Fill(pe.Py()); + pz_dist->Fill(pe.Pz()); + + //Fill 2d histogram with angles + ang_dist->Fill(costheta,phi); + + //Fill y distribution + y_dist->Fill(inter.Kine().y(true)); + + //Fill xsec distribution + xsec_dist->Fill(event.XSec()/init_neutrino->Energy()); //normalize to neutrino energy + + //Boost final state lepton to initial electron rest frame + TLorentzVector ple_boosted = ple; + ple_boosted.Boost(-pe.BoostVector()); + + //Extract values for final state lepton in electron rest frame + double E_l_erf_val = ple_boosted.E(); + double fs_costheta_erf_val = ple_boosted.Pz()/ple_boosted.P(); + double Etheta2_l_erf_val = pow(acos(fs_costheta_erf_val),2)*ple_boosted.E(); + + //Fill vectors + E_l_erf.push_back(E_l_erf_val); + theta_l_erf.push_back(acos(fs_costheta_erf_val)); + Etheta2_l_erf.push_back(Etheta2_l_erf_val); + + //Extract values for final state lepton in electron rest frame and compare to lab frame + double E_l_diff_val = E_l_erf_val - ple.E(); + double fs_costheta_diff_val = fs_costheta_erf_val - fs_costheta; + double Etheta2_l_diff_val = Etheta2_l_erf_val - Etheta2_l[i]; + + //Fill vectors + E_l_diff.push_back(E_l_diff_val); + theta_l_diff.push_back(fs_costheta_diff_val); + Etheta2_l_diff.push_back(Etheta2_l_diff_val); + + //Print out values + if (print_summary){ + std::cout<<"Event "<Draw("HIST"); + vx_dist->SetLineColor(kBlack); + //vx_dist->SetLineWidth + vx_dist->SetFillColorAlpha(kBlue,0.35); + vx_dist->GetXaxis()->SetTitle("v [c]"); + vx_dist->SetStats(kFALSE); + vx_dist->Write(); + + vy_dist->Draw("SAME"); + vy_dist->SetLineColor(kBlack); + vy_dist->SetFillColorAlpha(kRed,0.35); + vy_dist->GetXaxis()->SetTitle("v [c]"); + vy_dist->Write(); + + vz_dist->Draw("SAME"); + vz_dist->SetLineColor(kBlack); + vz_dist->SetFillColorAlpha(kGreen,0.35); + vy_dist->GetXaxis()->SetTitle("v [c]"); + vz_dist->Write(); + + if (print_to_pdf){ + auto legend = new TLegend(0.1,0.7,0.3,0.9); + //legend->SetHeader("The Legend Title","C"); // option "C" allows to center the header + legend->AddEntry(vx_dist,"vx"); + legend->AddEntry(vy_dist,"vy"); + legend->AddEntry(vz_dist,"vz"); + legend->Draw(); + + std::string file_out = "Plots/vdist.pdf"; + const char *fo = file_out.c_str(); + + canvas.Print(fo); + } + + TCanvas canvas2("canvas2"); + ang_dist->Draw("COLZ"); + ang_dist->GetXaxis()->SetTitle("cos#theta"); + ang_dist->GetYaxis()->SetTitle("#phi"); + ang_dist->Write(); + + if (print_to_pdf){ + std::string file_out2 = "Plots/angdist.pdf"; + const char *fo2 = file_out2.c_str(); + canvas2.Print(fo2); + } + + TCanvas canvas3("canvas3"); + y_dist->Draw(); + y_dist->GetXaxis()->SetTitle("y"); + // Set y limit to be from 0 to 600 + y_dist->Write(); + + if (print_to_pdf){ + std::string file_out3 = "Plots/ydist.pdf"; + const char *fo3 = file_out3.c_str(); + canvas3.Print(fo3); + } + + //Scatter plot of E_l theta_e^2 vs theta_l + TCanvas canvas4("canvas4"); + TGraph *graph = new TGraph(theta_l.size(),&theta_l[0],&Etheta2_l[0]); + graph->SetTitle("Etheta2"); + graph->SetMarkerStyle(20); + graph->SetMarkerSize(0.5); + graph->SetLineWidth(0); + graph->Draw("AP"); + graph->GetXaxis()->SetTitle("#theta_{l}"); + graph->GetYaxis()->SetTitle("E_{l}#theta_{l}^{2}"); + graph->Write(); + + if (print_to_pdf){ + std::string file_out4 = "Plots/etheta2.pdf"; + const char *fo4 = file_out4.c_str(); + canvas4.Print(fo4); + } + //Scatter plot of E_l vs theta_l + TCanvas canvas6("canvas6"); + TGraph *g2 = new TGraph(theta_l.size(),&theta_l[0],&E_l[0]); + g2->SetTitle("El"); + g2->SetMarkerStyle(20); + g2->SetMarkerSize(0.5); + g2->SetLineWidth(0); + g2->Draw("AP"); + g2->GetXaxis()->SetTitle("#theta_{l}"); + g2->GetYaxis()->SetTitle("E_{l}"); + g2->Write(); + + if (print_to_pdf){ + std::string file_out6 = "Plots/etheta.pdf"; + const char *fo6 = file_out6.c_str(); + canvas6.Print(fo6); + } + + //Momentum distribution + TCanvas canvas5("canvas5"); + px_dist->Draw("HIST"); + px_dist->SetLineColor(kBlack); + //px_dist->SetLineWidth + px_dist->SetFillColorAlpha(kBlue,0.35); + px_dist->GetXaxis()->SetTitle("p [c]"); + px_dist->SetStats(kFALSE); + px_dist->Write(); + + py_dist->Draw("SAME"); + py_dist->SetLineColor(kBlack); + py_dist->SetFillColorAlpha(kRed,0.35); + py_dist->GetXaxis()->SetTitle("p [c]"); + py_dist->Write(); + + pz_dist->Draw("SAME"); + pz_dist->SetLineColor(kBlack); + pz_dist->SetFillColorAlpha(kGreen,0.35); + py_dist->GetXaxis()->SetTitle("p [c]"); + pz_dist->Write(); + + if (print_to_pdf){ + auto legend = new TLegend(0.1,0.7,0.3,0.9); + //legend->SetHeader("The Legend Title","C"); // option "C" allows to center the header + legend->AddEntry(px_dist,"px"); + legend->AddEntry(py_dist,"py"); + legend->AddEntry(pz_dist,"pz"); + legend->Draw(); + + std::string file_out5 = "Plots/pdist.pdf"; + const char *fo5 = file_out5.c_str(); + + canvas5.Print(fo5); + } + + TCanvas canvas7("canvas7"); + xsec_dist->Draw("HIST"); + xsec_dist->GetXaxis()->SetTitle("xsec/E_{#nu}"); + xsec_dist->Write(); + if (print_to_pdf){ + std::string file_out7 = "Plots/xsec.pdf"; + const char *fo7 = file_out7.c_str(); + canvas7.Print(fo7); + } + + //Scatter plot of E_l vs theta_l for final state lepton in electron rest frame + TCanvas canvas8("canvas8"); + TGraph *g3 = new TGraph(theta_l_erf.size(),&theta_l_erf[0],&E_l_erf[0]); + g3->SetTitle("El (electron rest frame)"); + g3->SetMarkerStyle(20); + g3->SetMarkerSize(0.5); + g3->SetLineWidth(0); + g3->Draw("AP"); + g3->GetXaxis()->SetTitle("#theta_{l}"); + g3->GetYaxis()->SetTitle("E_{l}"); + g3->Write(); + + if (print_to_pdf){ + std::string file_out8 = "Plots/etheta_erf.pdf"; + const char *fo8 = file_out8.c_str(); + canvas8.Print(fo8); + } + + //Scatter plot of E_l theta_l^2 vs theta_l for final state lepton in electron rest frame + TCanvas canvas9("canvas9"); + TGraph *g4 = new TGraph(theta_l_erf.size(),&theta_l_erf[0],&Etheta2_l_erf[0]); + g4->SetTitle("Etheta2 (electron rest frame)"); + g4->SetMarkerStyle(20); + g4->SetMarkerSize(0.5); + g4->SetLineWidth(0); + g4->Draw("AP"); + g4->GetXaxis()->SetTitle("#theta_{l}"); + g4->GetYaxis()->SetTitle("E_{l}#theta_{l}^{2}"); + g4->Write(); + if (print_to_pdf){ + std::string file_out9 = "Plots/etheta2_erf.pdf"; + const char *fo9 = file_out9.c_str(); + canvas9.Print(fo9); + } + + //Differences between distributions in electron rest frame and lab frame + TCanvas canvas10("canvas10"); + TGraph *g5 = new TGraph(theta_l_diff.size(),&theta_l_diff[0],&E_l_diff[0]); + g5->SetTitle("El (electron rest frame - lab frame)"); + g5->SetMarkerStyle(20); + g5->SetMarkerSize(0.5); + g5->SetLineWidth(0); + g5->Draw("AP"); + g5->GetXaxis()->SetTitle("#theta_{l}"); + g5->GetYaxis()->SetTitle("E_{l}"); + g5->Write(); + if (print_to_pdf){ + std::string file_out10 = "Plots/etheta_diff.pdf"; + const char *fo10 = file_out10.c_str(); + canvas10.Print(fo10); + } + + TCanvas canvas11("canvas11"); + TGraph *g6 = new TGraph(theta_l_diff.size(),&theta_l_diff[0],&Etheta2_l_diff[0]); + g6->SetTitle("Etheta2 (electron rest frame - lab frame)"); + g6->SetMarkerStyle(20); + g6->SetMarkerSize(0.5); + g6->SetLineWidth(0); + g6->Draw("AP"); + g6->GetXaxis()->SetTitle("#theta_{l}"); + g6->GetYaxis()->SetTitle("E_{l}#theta_{l}^{2}"); + g6->Write(); + if (print_to_pdf){ + std::string file_out11 = "Plots/etheta2_diff.pdf"; + const char *fo11 = file_out11.c_str(); + canvas11.Print(fo11); + } + + file1->Close(); +} + +void validateNUE(TString filename = "gntp.0.ghep.root",TString dir="",bool print_to_pdf=false, + bool print_summary=false){ + //Make all distributions + gSystem->Exec("mkdir -p Plots"); + make_dists(filename,dir,print_to_pdf,print_summary); +} diff --git a/src/contrib/test/gtestFermiP.cxx b/src/contrib/test/gtestFermiP.cxx index 42765e437..5800a0a1a 100644 --- a/src/contrib/test/gtestFermiP.cxx +++ b/src/contrib/test/gtestFermiP.cxx @@ -66,7 +66,7 @@ int main(int /*argc*/, char ** /*argv*/) //-- Loop over targets/models & generate 'target nucleons' for(unsigned int it = 0; it < kNTargets; it++) { - nucltgt[it]->SetHitNucPdg(kPdgProton); + nucltgt[it]->SetHitPartPdg(kPdgProton); const Target & target = *nucltgt[it]; LOG("test", pNOTICE) << "** Using target : " << target;; for(unsigned int im = 0; im < kNModels; im++) { diff --git a/src/contrib/test/gtestHadronization.cxx b/src/contrib/test/gtestHadronization.cxx index c8bdf1ac3..7cf959cb0 100644 --- a/src/contrib/test/gtestHadronization.cxx +++ b/src/contrib/test/gtestHadronization.cxx @@ -210,7 +210,7 @@ int main(int argc, char ** argv) ProcessInfo proc (kScDeepInelastic, it); Interaction intr (init, proc); - intr.InitStatePtr()->TgtPtr()->SetHitNucPdg(NucCode[inuc]); + intr.InitStatePtr()->TgtPtr()->SetHitPartPdg(NucCode[inuc]); // hit quark loop (if requested) int nqrk=1; diff --git a/src/contrib/test/gtestInteraction.cxx b/src/contrib/test/gtestInteraction.cxx index ab7054888..601e0fc1c 100644 --- a/src/contrib/test/gtestInteraction.cxx +++ b/src/contrib/test/gtestInteraction.cxx @@ -50,8 +50,8 @@ int main(int /*argc*/, char ** /*argv*/) TLorentzVector pnucl(0,0,0,kNucleonMass); - interaction.InitStatePtr()->TgtPtr()->SetHitNucP4(pnucl); - interaction.InitStatePtr()->TgtPtr()->SetHitNucPdg(kPdgProton); + interaction.InitStatePtr()->TgtPtr()->SetHitPartP4(pnucl); + interaction.InitStatePtr()->TgtPtr()->SetHitPartPdg(kPdgProton); interaction.InitStatePtr()->TgtPtr()->SetHitQrkPdg(kPdgUQuark); //-- get a 'read-only' InitialState and print it (check that struck nucleon @@ -73,7 +73,7 @@ int main(int /*argc*/, char ** /*argv*/) //-- instead of using the long syntax above, get a writable Target object first Target * wtgt = interaction.InitStatePtr()->TgtPtr(); - wtgt->SetHitNucPdg(kPdgProton); + wtgt->SetHitPartPdg(kPdgProton); LOG("test", pINFO) << "Printing target after changing struck nucl"; LOG("test", pINFO) << "\n" << *wtgt; diff --git a/src/scripts/gcint/loadlibs.C b/src/scripts/gcint/loadlibs.C index 971dadcf3..1129286a0 100644 --- a/src/scripts/gcint/loadlibs.C +++ b/src/scripts/gcint/loadlibs.C @@ -104,6 +104,9 @@ int loadlibs() gSystem->Load("libEGPythia6"); gSystem->Load("libGeom"); gSystem->Load("libTree"); + gSystem->Load("libMinuit"); + gSystem->Load("libGenVector"); + gSystem->Load("libMathMore"); // libxml2 and log4cpp libs gSystem->Load("libxml2"); @@ -112,6 +115,7 @@ int loadlibs() // GSL gSystem->Load("libgslcblas"); gSystem->Load("libgsl"); + gSystem->Load("libm"); //~ load_libs_from_command("gsl-config --libs"); // not guaranteed to be in the right order //