Skip to content

Commit

Permalink
more earth -> detector renaming, clean up some earthparams -> Detecto…
Browse files Browse the repository at this point in the history
…rParams instances
  • Loading branch information
nickkamp1 committed Jan 11, 2024
1 parent 89eeabe commit 6260c0e
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 25 deletions.
2 changes: 1 addition & 1 deletion projects/detector/private/MaterialModel.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ void MaterialModel::AddModelFile(std::string matratio) {
throw(std::runtime_error("Cannot open matratio file!"));
}

// check earthmodel file
// check detectormodel file
std::ifstream in(fname.c_str(), std::ifstream::in);

if (in.fail())
Expand Down
4 changes: 2 additions & 2 deletions projects/detector/private/pybindings/DetectorModel.h
Original file line number Diff line number Diff line change
Expand Up @@ -208,8 +208,8 @@ void register_DetectorModel(pybind11::module_ & m) {
LI::geometry::Geometry::IntersectionList (*)(
LI::geometry::Geometry::IntersectionList const &)
)(&DetectorModel::GetOuterBounds))
.def("GetOuterBounds", [](LI::detector::DetectorModel const & earth, LI::geometry::Geometry::IntersectionList const & intersections){
return earth.GetOuterBounds(intersections);
.def("GetOuterBounds", [](LI::detector::DetectorModel const & detector, LI::geometry::Geometry::IntersectionList const & intersections){
return detector.GetOuterBounds(intersections);
})
.def("GetOuterBounds", (
LI::geometry::Geometry::IntersectionList (DetectorModel::*)(
Expand Down
8 changes: 4 additions & 4 deletions projects/injection/private/Weighter.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -410,10 +410,10 @@ void LeptonWeighter::Initialize() {
for(unsigned int gen_idx : common_generation_dist_idxs) {
// These are common to all injectors, so we pull information from the first injector
std::shared_ptr<LI::distributions::WeightableDistribution> dist = generation_distribution_state[0][gen_idx].second;
std::shared_ptr<LI::detector::DetectorModel> dist_earth = injectors[0]->GetDetectorModel();
std::shared_ptr<LI::detector::DetectorModel> dist_detector = injectors[0]->GetDetectorModel();
std::shared_ptr<LI::interactions::InteractionCollection> dist_interactions = injectors[0]->GetInteractions();
std::function<bool(std::tuple<std::shared_ptr<LI::distributions::WeightableDistribution>, std::shared_ptr<LI::detector::DetectorModel>, std::shared_ptr<LI::interactions::InteractionCollection>>)> predicate = [&] (std::tuple<std::shared_ptr<LI::distributions::WeightableDistribution>, std::shared_ptr<LI::detector::DetectorModel>, std::shared_ptr<LI::interactions::InteractionCollection>> p) -> bool {
return std::get<0>(p)->AreEquivalent(std::get<1>(p), std::get<2>(p), dist, dist_earth, dist_interactions);
return std::get<0>(p)->AreEquivalent(std::get<1>(p), std::get<2>(p), dist, dist_detector, dist_interactions);
};
auto it = std::find_if(unique_distributions.begin(), unique_distributions.end(), predicate);
if(it != unique_distributions.end()) {
Expand Down Expand Up @@ -452,10 +452,10 @@ void LeptonWeighter::Initialize() {
continue;
std::shared_ptr<LI::distributions::WeightableDistribution> dist = gen_dists[gen_idx].second;
// These are common to all injectors, so we pull information from the first injector
std::shared_ptr<LI::detector::DetectorModel> dist_earth = injectors[injector_idx]->GetDetectorModel();
std::shared_ptr<LI::detector::DetectorModel> dist_detector = injectors[injector_idx]->GetDetectorModel();
std::shared_ptr<LI::interactions::InteractionCollection> dist_interactions = injectors[injector_idx]->GetInteractions();
std::function<bool(std::tuple<std::shared_ptr<LI::distributions::WeightableDistribution>, std::shared_ptr<LI::detector::DetectorModel>, std::shared_ptr<LI::interactions::InteractionCollection>>)> predicate = [&] (std::tuple<std::shared_ptr<LI::distributions::WeightableDistribution>, std::shared_ptr<LI::detector::DetectorModel>, std::shared_ptr<LI::interactions::InteractionCollection>> p) -> bool {
return std::get<0>(p)->AreEquivalent(std::get<1>(p), std::get<2>(p), dist, dist_earth, dist_interactions);
return std::get<0>(p)->AreEquivalent(std::get<1>(p), std::get<2>(p), dist, dist_detector, dist_interactions);
};
auto it = std::find_if(unique_distributions.begin(), unique_distributions.end(), predicate);
if(it != unique_distributions.end()) {
Expand Down
8 changes: 4 additions & 4 deletions projects/injection/private/test/CCM_HNL_TEST.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@ bool inelastic = true;
std::string tot_xsec_table_path = "/home/nwkamp/Research/Pheno/Neutrissimos2/Sandbox/xsec_tables/tot_xsec_Enu/";
std::string diff_xsec_table_path = "/home/nwkamp/Research/Pheno/Neutrissimos2/Sandbox/xsec_tables/";

std::string material_file = "/home/nwkamp/Research/CCM/DipoleAnalysis/sources/LeptonInjectorDevPrivate/resources/earthparams/materials/CCM.dat";
std::string earth_file = "/home/nwkamp/Research/CCM/DipoleAnalysis/sources/LeptonInjectorDevPrivate/resources/earthparams/densities/PREM_ccm.dat";
std::string material_file = "/home/nwkamp/Research/CCM/DipoleAnalysis/sources/LeptonInjectorDevPrivate/resources/DetectorParams/materials/CCM.dat";
std::string detector_file = "/home/nwkamp/Research/CCM/DipoleAnalysis/sources/LeptonInjectorDevPrivate/resources/DetectorParams/densities/PREM_ccm.dat";

double hnl_mass = 0.01375; // in GeV; The HNL mass we are injecting
double dipole_coupling = 1.0e-6; // in GeV^-1; the effective dipole coupling strength
Expand Down Expand Up @@ -166,12 +166,12 @@ TEST(Injector, Generation)
using ParticleType = Particle::ParticleType;


// Load the earth model
// Load the detector model
std::shared_ptr<DetectorModel> detector_model = std::make_shared<DetectorModel>();
std::cout << "Loading MaterialModel...\n";
detector_model->LoadMaterialModel(material_file);
std::cout << "Loading DetectorModel...\n";
detector_model->LoadDetectorModel(earth_file);
detector_model->LoadDetectorModel(detector_file);

// random class instance
std::shared_ptr<LI_random> random = std::make_shared<LI_random>();
Expand Down
16 changes: 8 additions & 8 deletions projects/injection/private/test/Injector_TEST.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -212,18 +212,18 @@ TEST(Injector, Generation)
using ParticleType = Particle::ParticleType;

#ifdef AUSTIN
std::string material_file = "/home/austin/programs/LIDUNE/sources/LeptonInjectorDUNE/resources/earthparams/materials/Minerva.dat";
std::string earth_file = "/home/austin/programs/LIDUNE/sources/LeptonInjectorDUNE/resources/earthparams/densities/PREM_minerva.dat";
std::string material_file = "/home/austin/programs/LIDUNE/sources/LeptonInjectorDUNE/resources/DetectorParams/materials/Minerva.dat";
std::string detector_file = "/home/austin/programs/LIDUNE/sources/LeptonInjectorDUNE/resources/DetectorParams/densities/PREM_minerva.dat";
std::string flux_file = "/home/austin/nu-dipole/fluxes/LE_FHC_numu.txt";
z_samp = false;
in_invGeV = false;
#else
std::string material_file = "/home/nwkamp/Research/Pheno/Neutrissimos2/sources/LeptonInjectorDUNE/resources/earthparams/materials/Minerva.dat";
std::string earth_file = "/home/nwkamp/Research/Pheno/Neutrissimos2/sources/LeptonInjectorDUNE/resources/earthparams/densities/PREM_minerva.dat";
std::string material_file = "/home/nwkamp/Research/Pheno/Neutrissimos2/sources/LeptonInjectorDUNE/resources/DetectorParams/materials/Minerva.dat";
std::string detector_file = "/home/nwkamp/Research/Pheno/Neutrissimos2/sources/LeptonInjectorDUNE/resources/DetectorParams/densities/PREM_minerva.dat";
std::string flux_file = "/home/nwkamp/Research/Pheno/Neutrissimos2/Sandbox/NUMI_Flux_Tables/ME_FHC_numu.txt";
if(miniboone) {
material_file = "/home/nwkamp/Research/Pheno/Neutrissimos2/sources/LeptonInjectorDUNE/resources/earthparams/materials/MiniBooNE.dat";
earth_file = "/home/nwkamp/Research/Pheno/Neutrissimos2/sources/LeptonInjectorDUNE/resources/earthparams/densities/PREM_miniboone.dat";
material_file = "/home/nwkamp/Research/Pheno/Neutrissimos2/sources/LeptonInjectorDUNE/resources/DetectorParams/materials/MiniBooNE.dat";
detector_file = "/home/nwkamp/Research/Pheno/Neutrissimos2/sources/LeptonInjectorDUNE/resources/DetectorParams/densities/PREM_miniboone.dat";
flux_file = "/home/nwkamp/Research/Pheno/Neutrissimos2/Sandbox/BNB_Flux_Tables/BNB_numu_flux.txt";
inelastic = true;
}
Expand Down Expand Up @@ -274,10 +274,10 @@ TEST(Injector, Generation)
cross_sections.push_back(hf_xs);
cross_sections.push_back(hc_xs);

// Load the earth model
// Load the detector model
std::shared_ptr<DetectorModel> detector_model = std::make_shared<DetectorModel>();
detector_model->LoadMaterialModel(material_file);
detector_model->LoadDetectorModel(earth_file);
detector_model->LoadDetectorModel(detector_file);

// Setup the primary type and mass
//std::shared_ptr<PrimaryInjector> primary_injector = std::make_shared<PrimaryInjector>(primary_type, hnl_mass);
Expand Down
12 changes: 6 additions & 6 deletions projects/interactions/private/test/ElasticScattering_TEST.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -58,12 +58,12 @@ TEST(ElasticScattering, Generation)
using ParticleType = Particle::ParticleType;

#ifdef AUSTIN
std::string material_file = "/home/austin/programs/LIDUNE/sources/LeptonInjectorDUNE/resources/earthparams/materials/Minerva.dat";
std::string earth_file = "/home/austin/programs/LIDUNE/sources/LeptonInjectorDUNE/resources/earthparams/densities/PREM_minerva.dat";
std::string material_file = "/home/austin/programs/LIDUNE/sources/LeptonInjectorDUNE/resources/DetectorParams/materials/Minerva.dat";
std::string detector_file = "/home/austin/programs/LIDUNE/sources/LeptonInjectorDUNE/resources/DetectorParams/densities/PREM_minerva.dat";
std::string flux_file = "/home/austin/nu-dipole/fluxes/LE_FHC_numu.txt";
#else
std::string material_file = "/home/nwkamp/Research/Pheno/Neutrissimos2/sources/LeptonInjectorDUNE/resources/earthparams/materials/Minerva.dat";
std::string earth_file = "/home/nwkamp/Research/Pheno/Neutrissimos2/sources/LeptonInjectorDUNE/resources/earthparams/densities/PREM_minerva.dat";
std::string material_file = "/home/nwkamp/Research/Pheno/Neutrissimos2/sources/LeptonInjectorDUNE/resources/DetectorParams/materials/Minerva.dat";
std::string detector_file = "/home/nwkamp/Research/Pheno/Neutrissimos2/sources/LeptonInjectorDUNE/resources/DetectorParams/densities/PREM_minerva.dat";
std::string flux_file = "/home/nwkamp/Research/Pheno/Neutrissimos2/Sandbox/NUMI_Flux_Tables/ME_FHC_numu.txt";
#endif

Expand All @@ -82,10 +82,10 @@ TEST(ElasticScattering, Generation)
std::shared_ptr<ElasticScattering> es_xs = std::make_shared<ElasticScattering>();
cross_sections.push_back(es_xs);

// Load the earth model
// Load the detector model
std::shared_ptr<DetectorModel> detector_model = std::make_shared<DetectorModel>();
detector_model->LoadMaterialModel(material_file);
detector_model->LoadDetectorModel(earth_file);
detector_model->LoadDetectorModel(detector_file);

// Setup the primary type and mass
//std::shared_ptr<PrimaryInjector> primary_injector = std::make_shared<PrimaryInjector>(primary_type, hnl_mass);
Expand Down

0 comments on commit 6260c0e

Please sign in to comment.