From d5757c090577817dbbe55dbdccdba2e878eed1f7 Mon Sep 17 00:00:00 2001 From: Wesley Ketchum Date: Tue, 22 Oct 2024 15:38:19 +0200 Subject: [PATCH] cleanup some compile warnings and fix failing Hcal and Run_SimCore_basic tests --- SimCore/include/SimCore/Event/HepMC3GenEvent.h | 2 +- SimCore/include/SimCore/Reweight/GenieReweightProducer.h | 2 ++ SimCore/src/SimCore/G4User/PrimaryGeneratorAction.cxx | 1 + SimCore/src/SimCore/Generators/GenieGenerator.cxx | 6 +++--- 4 files changed, 7 insertions(+), 4 deletions(-) diff --git a/SimCore/include/SimCore/Event/HepMC3GenEvent.h b/SimCore/include/SimCore/Event/HepMC3GenEvent.h index deac2cfd2..ef65a22d6 100644 --- a/SimCore/include/SimCore/Event/HepMC3GenEvent.h +++ b/SimCore/include/SimCore/Event/HepMC3GenEvent.h @@ -16,7 +16,7 @@ namespace ldmx { class HepMC3GenEvent : public HepMC3::GenEventData { public: - // HepMC3GenEvent() : HepMC3::GenEventData() {} + // ~HepMC3GenEvent() {} // HepMC3GenEvent(const HepMC3::GenEvent& event) : HepMC3::GenEvent(event) {} void Clear(); diff --git a/SimCore/include/SimCore/Reweight/GenieReweightProducer.h b/SimCore/include/SimCore/Reweight/GenieReweightProducer.h index 964bfeee5..57b863003 100644 --- a/SimCore/include/SimCore/Reweight/GenieReweightProducer.h +++ b/SimCore/include/SimCore/Reweight/GenieReweightProducer.h @@ -99,6 +99,8 @@ class GenieReweightProducer : public framework::Producer { return genie::rew::EGSyst::kINukeTwkDial_FrPiProd_N; case ldmx::EventWeights::VariationType ::kGENIE_HadrNuclTwkDial_FormZone: return genie::rew::EGSyst::kHadrNuclTwkDial_FormZone; + default: + return genie::rew::EGSyst::kNullSystematic; } return genie::rew::EGSyst::kNullSystematic; } diff --git a/SimCore/src/SimCore/G4User/PrimaryGeneratorAction.cxx b/SimCore/src/SimCore/G4User/PrimaryGeneratorAction.cxx index eae6d9963..a60f168bd 100644 --- a/SimCore/src/SimCore/G4User/PrimaryGeneratorAction.cxx +++ b/SimCore/src/SimCore/G4User/PrimaryGeneratorAction.cxx @@ -72,6 +72,7 @@ void PrimaryGeneratorAction::GeneratePrimaries(G4Event* event) { // Make our information container and give it to geant4 // G4Event owns the event information and will delete it auto event_info = new UserEventInformation; + event->SetUserInformation(event_info); PrimaryGenerator::Factory::get().apply([event](const auto& generator) { generator->GeneratePrimaryVertex(event); diff --git a/SimCore/src/SimCore/Generators/GenieGenerator.cxx b/SimCore/src/SimCore/Generators/GenieGenerator.cxx index 07e2be530..daa08207a 100644 --- a/SimCore/src/SimCore/Generators/GenieGenerator.cxx +++ b/SimCore/src/SimCore/Generators/GenieGenerator.cxx @@ -147,7 +147,7 @@ bool GenieGenerator::validateConfig() { std::cout << "Will renormalize abundances to unity!" << std::endl; } - for (size_t i_a; i_a < abundances_.size(); ++i_a) { + for (size_t i_a=0; i_a < abundances_.size(); ++i_a) { abundances_[i_a] = abundances_[i_a] / abundance_sum; if (verbosity_ > 0) @@ -164,7 +164,7 @@ bool GenieGenerator::validateConfig() { << direction_[2] << ")" << std::endl; ret = false; } - for (size_t i_d; i_d < direction_.size(); ++i_d) + for (size_t i_d=0; i_d < direction_.size(); ++i_d) direction_[i_d] = direction_[i_d] / std::sqrt(dir_total_sq); xsec_by_target_.resize(targets_.size(), -999.); @@ -330,7 +330,7 @@ void GenieGenerator::GeneratePrimaryVertex(G4Event* event) { initial_e.SetPdgCode(11); double elec_i_p = std::sqrt(energy_ * energy_ - - (double)initial_e.GetMass() * (double)initial_e.GetMass()); + initial_e.GetMass() * initial_e.GetMass()); initial_e.SetMomentum(elec_i_p * direction_[0], elec_i_p * direction_[1], elec_i_p * direction_[2], energy_); TLorentzVector e_p4;