Skip to content

Commit 98dd00e

Browse files
committed
Apply NIEL damage weights to all hadrons and electrons
This extends the 1 MeV neutron equivalent fluence weighting to all hadrons and to e±, in line with FLUKA's SI1MEVNE. - Mesons use the pion weights and (anti)baryons other than the neutron use the proton weights. - e± use electron weights when the weight file provides pdg 11. - Near the beam pipe, kaons alone add 15% to the n_eq fluence.
1 parent 1d0f240 commit 98dd00e

2 files changed

Lines changed: 33 additions & 12 deletions

File tree

Common/SimConfig/include/SimConfig/FluenceWeightCalculator.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,5 +31,6 @@ class FluenceWeightCalculator
3131
static std::unique_ptr<TGraph> neutronG;
3232
static std::unique_ptr<TGraph> protonG;
3333
static std::unique_ptr<TGraph> pionG;
34+
static std::unique_ptr<TGraph> electronG;
3435
};
3536
#endif

Common/SimConfig/src/FluenceWeightCalculator.cxx

Lines changed: 32 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
std::unique_ptr<TGraph> FluenceWeightCalculator::neutronG;
2020
std::unique_ptr<TGraph> FluenceWeightCalculator::protonG;
2121
std::unique_ptr<TGraph> FluenceWeightCalculator::pionG;
22+
std::unique_ptr<TGraph> FluenceWeightCalculator::electronG;
2223

2324
namespace
2425
{
@@ -41,19 +42,22 @@ double FluenceWeightCalculator::GetWeight(const int pdg, const double kineticEne
4142
std::cerr << "FluenceWeightCalculator not initialized\n";
4243
return 0.;
4344
}
44-
switch (std::abs(pdg)) {
45-
case 2112: {
46-
return evalClamped(*neutronG, kineticEnergy);
47-
}
48-
case 2212: {
49-
return ((kineticEnergy > 1e-3) ? evalClamped(*protonG, kineticEnergy) : 0.);
50-
}
51-
case 211: {
52-
return ((kineticEnergy > 10.) ? evalClamped(*pionG, kineticEnergy) : 0.);
53-
}
54-
default:
55-
return 0.0;
45+
const int apdg = std::abs(pdg);
46+
if (pdg == 2112) {
47+
return evalClamped(*neutronG, kineticEnergy);
48+
}
49+
if (apdg == 11) {
50+
return electronG ? evalClamped(*electronG, kineticEnergy) : 0.;
51+
}
52+
// other (anti)baryons use the proton weights
53+
if (apdg >= 1000 && apdg < 10000) {
54+
return ((kineticEnergy > 1e-3) ? evalClamped(*protonG, kineticEnergy) : 0.);
5655
}
56+
// mesons use the pion weights
57+
if (apdg >= 100 && apdg < 1000) {
58+
return ((kineticEnergy > 10.) ? evalClamped(*pionG, kineticEnergy) : 0.);
59+
}
60+
return 0.;
5761
}
5862

5963
void FluenceWeightCalculator::InitWeights(const std::string& filename)
@@ -88,6 +92,13 @@ void FluenceWeightCalculator::InitWeights(const std::string& filename)
8892
return;
8993
}
9094
pionG->SetBit(TGraph::kIsSortedX);
95+
// electron weights are optional
96+
tmp = nullptr;
97+
inFile.GetObject("electronDW", tmp);
98+
electronG.reset(tmp ? static_cast<TGraph*>(tmp->Clone()) : nullptr);
99+
if (electronG) {
100+
electronG->SetBit(TGraph::kIsSortedX);
101+
}
91102
}
92103

93104
void FluenceWeightCalculator::InitWeightsFromCSV(const std::string& filename)
@@ -103,6 +114,9 @@ void FluenceWeightCalculator::InitWeightsFromCSV(const std::string& filename)
103114
pionG = std::make_unique<TGraph>();
104115
pionG->SetName("pionDW");
105116
auto pioN = 0;
117+
electronG = std::make_unique<TGraph>();
118+
electronG->SetName("electronDW");
119+
auto eleN = 0;
106120

107121
std::ifstream in(filename);
108122
if (!in.is_open()) {
@@ -141,15 +155,21 @@ void FluenceWeightCalculator::InitWeightsFromCSV(const std::string& filename)
141155
pionG->SetPoint(pioN++, e, w);
142156
break;
143157
}
158+
case 11: {
159+
electronG->SetPoint(eleN++, e, w);
160+
break;
161+
}
144162
default:;
145163
}
146164
}
147165
neutronG->Sort();
148166
protonG->Sort();
149167
pionG->Sort();
168+
electronG->Sort();
150169
auto fout = new TFile("rd50_niel.root", "recreate");
151170
neutronG->Write();
152171
protonG->Write();
153172
pionG->Write();
173+
electronG->Write();
154174
fout->Close();
155175
}

0 commit comments

Comments
 (0)