IAP GITLAB

Skip to content
Snippets Groups Projects
Commit 99521d16 authored by Felix Riehn's avatar Felix Riehn Committed by Alan Coleman
Browse files

printouts

parent 9fd8732d
No related branches found
No related tags found
1 merge request!594Neutrino interactions with pythia 8310
...@@ -20,9 +20,14 @@ namespace corsika::pythia8 { ...@@ -20,9 +20,14 @@ namespace corsika::pythia8 {
, handle_nc_(handleNC) , handle_nc_(handleNC)
, handle_cc_(handleCC) , handle_cc_(handleCC)
, pythiaMain_{CORSIKA_Pythia8_XML_DIR, false} { , pythiaMain_{CORSIKA_Pythia8_XML_DIR, false} {
Pythia8::RndmEngine* rndm = new corsika::pythia8::Random(); Pythia8::RndmEngine* rndm = new corsika::pythia8::Random();
pythiaMain_.setRndmEnginePtr(rndm); pythiaMain_.setRndmEnginePtr(rndm);
CORSIKA_LOG_INFO("configure Pythia for primary neutrino interactions. NC={}, CC={}",
handle_nc_, handle_cc_);
CORSIKA_LOG_INFO("minimal Q2 in DIS: {} GeV2", minQ2_ / 1_GeV / 1_GeV);
// CORSIKA_LOG_INFO("Pythia8 MPI init file: {}", mpiInitFile.native()); // CORSIKA_LOG_INFO("Pythia8 MPI init file: {}", mpiInitFile.native());
// Main Pythia object for managing the cascade evolution. // Main Pythia object for managing the cascade evolution.
// Can also do decays, but no hard processes. // Can also do decays, but no hard processes.
...@@ -105,27 +110,25 @@ namespace corsika::pythia8 { ...@@ -105,27 +110,25 @@ namespace corsika::pythia8 {
FourMomentum const& projectileP4, FourMomentum const& projectileP4,
FourMomentum const& targetP4) { FourMomentum const& targetP4) {
CORSIKA_LOG_INFO("Pythia::NeutrinoInteraction: doInteraction: {} E={}GeV", CORSIKA_LOG_INFO("Primary {} - p interaction with E_nu = {} GeV", projectileId,
projectileId, projectileP4.getTimeLikeComponent() / 1_GeV); projectileP4.getTimeLikeComponent() / 1_GeV);
// allow just one call to NeutrinoInteraction // allow just one call to NeutrinoInteraction
if (!count_) { if (!count_) {
double eProton = Proton::mass / 1_GeV; // 0.93827; double const eProton = Proton::mass / 1_GeV; // 0.93827;
double eElectron = projectileP4.getTimeLikeComponent() / 1_GeV; // 270.5; double const eElectron = projectileP4.getTimeLikeComponent() / 1_GeV; // 270.5;
double Q2min = minQ2_ / 1_GeV; double const Q2min = minQ2_ / 1_GeV / 1_GeV;
int const idNow = static_cast<int>(get_PDG(projectileId));
// Set up incoming beams, for frame with unequal beam energies. // Set up incoming beams, for frame with unequal beam energies.
// projectile is along -z // projectile is along -z
pythiaMain_.readString("Beams:frameType = 2"); pythiaMain_.readString("Beams:frameType = 2");
// BeamA = proton. // BeamA = proton.(+z)
pythiaMain_.readString("Beams:idA = 2212"); pythiaMain_.readString("Beams:idA = 2212");
pythiaMain_.settings.parm("Beams:eA", eProton); pythiaMain_.settings.parm("Beams:eA", eProton);
// BeamB = electron. // BeamB = neutrino (-z direction)
int const idNow = static_cast<int>(get_PDG(projectileId)); pythiaMain_.settings.mode("Beams:idB", idNow);
pythiaMain_.readString("Beams:idB = 12");
// pythiaMain_.settings.parm("Beams:idA", idNow);
pythiaMain_.settings.parm("Beams:eB", eElectron); pythiaMain_.settings.parm("Beams:eB", eElectron);
// Set up DIS process within some phase space. // Set up DIS process within some phase space.
...@@ -175,7 +178,7 @@ namespace corsika::pythia8 { ...@@ -175,7 +178,7 @@ namespace corsika::pythia8 {
MomentumVector Plab_final{labFrameBoost.getOriginalCS()}; MomentumVector Plab_final{labFrameBoost.getOriginalCS()};
auto Elab_final = HEPEnergyType::zero(); auto Elab_final = HEPEnergyType::zero();
CORSIKA_LOG_INFO("pythia stack size {}", eventMain.size()); CORSIKA_LOG_INFO("particles generated in neutrino interaction:");
for (int i = 0; i < eventMain.size(); ++i) { for (int i = 0; i < eventMain.size(); ++i) {
if (eventMain[i].isFinal()) { if (eventMain[i].isFinal()) {
auto const& p8p = eventMain[i]; auto const& p8p = eventMain[i];
...@@ -195,6 +198,8 @@ namespace corsika::pythia8 { ...@@ -195,6 +198,8 @@ namespace corsika::pythia8 {
auto pnew = auto pnew =
view.addSecondary(std::make_tuple(pyId, Ekin, pyPlab.normalized())); view.addSecondary(std::make_tuple(pyId, Ekin, pyPlab.normalized()));
CORSIKA_LOG_INFO("id = {}, E = {} GeV, p = {} GeV", pyId, Ekin / 1_GeV,
pyPlab.getComponents() / 1_GeV);
Plab_final += pnew.getMomentum(); Plab_final += pnew.getMomentum();
Elab_final += pnew.getEnergy(); Elab_final += pnew.getEnergy();
} }
...@@ -249,6 +254,8 @@ namespace corsika::pythia8 { ...@@ -249,6 +254,8 @@ namespace corsika::pythia8 {
"Elab_final= {}" "Elab_final= {}"
", Plab_final= {}", ", Plab_final= {}",
Elab_final / 1_GeV, (Plab_final / 1_GeV).getComponents()); Elab_final / 1_GeV, (Plab_final / 1_GeV).getComponents());
} else {
CORSIKA_LOG_ERROR("Only one primary neutrino interaction allowed!");
} }
count_++; count_++;
} }
......
...@@ -20,6 +20,8 @@ ...@@ -20,6 +20,8 @@
namespace corsika::pythia8 { namespace corsika::pythia8 {
using HEPEnergyTypeSqr = decltype(1_GeV * 1_GeV);
class NeutrinoInteraction : public InteractionProcess<NeutrinoInteraction> { class NeutrinoInteraction : public InteractionProcess<NeutrinoInteraction> {
public: public:
...@@ -68,7 +70,7 @@ namespace corsika::pythia8 { ...@@ -68,7 +70,7 @@ namespace corsika::pythia8 {
bool const print_listing_ = false; bool const print_listing_ = false;
bool const handle_nc_; bool const handle_nc_;
bool const handle_cc_; bool const handle_cc_;
HEPEnergyType const minQ2_ = 25_GeV; HEPEnergyTypeSqr minQ2_ = 25_GeV * 1_GeV;
Pythia8::Pythia pythiaMain_; Pythia8::Pythia pythiaMain_;
}; };
} // namespace corsika::pythia8 } // namespace corsika::pythia8
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment