21 if (sr->
mc.
nu[0].visEinslcNeutronBirks < 0.001)
29 std::vector<caf::SRProngProxy*> prongs;
32 prongs.push_back(static_cast<caf::SRProngProxy*>(&png));
34 prongs.push_back(&png);
38 for (
auto & png : prongs){
54 if (png->truth.motherpdg != 2112)
60 double visE = png->truth.visEinslc;
64 double moreE = (
RNG(sr)->Uniform() <
fProb) ? visE * (scale - 1) : 0;
70 png->weightedCalE += moreE;
71 if (png->weightedCalE < 0)
72 png->weightedCalE = 0;
76 std::map<int, double> addedEbyTrkID;
77 for (
auto & prim : sr->
mc.
nu[0].prim){
82 double visE = prim.visEinslcBirks + prim.daughterVisEinslcBirks;
85 visE = prim.visEinslc + prim.daughterVisEinslc;
89 double moreE = (
RNG(sr)->Uniform() <
fProb) ? visE * (scale - 1) : 0;
91 addedEbyTrkID[prim.trkID] += moreE;
97 std::vector<caf::SRProngProxy*> otherNeutronProngs;
98 for (
auto & png : prongs){
100 for (
const auto & mother : png->truth.motherlist){
101 if (addedEbyTrkID.find(mother) != addedEbyTrkID.end()){
109 if (png->truth.motherpdg == 2112 && png->calE <=
fThreshE)
110 otherNeutronProngs.push_back(png);
114 double E = addedEbyTrkID.at(motherTrk);
119 png->weightedCalE +=
E;
120 if (png->weightedCalE < 0)
121 png->weightedCalE = 0;
123 addedEbyTrkID.erase(motherTrk);
129 for (
auto & png : otherNeutronProngs){
130 if (addedEbyTrkID.empty())
133 png->calE += addedEbyTrkID.begin()->second;
136 png->weightedCalE += addedEbyTrkID.begin()->second;
137 if (png->weightedCalE < 0)
138 png->weightedCalE = 0;
140 addedEbyTrkID.erase(addedEbyTrkID.begin());
caf::Proxy< caf::SRFuzzyK > fuzzyk
Cuts and Vars for the 2020 FD DiF Study.
caf::Proxy< std::vector< caf::SRProng > > png2d
void Shift(double sigma, caf::SRProxy *sr, double &weight) const override
Perform the systematic shift.
caf::Proxy< caf::SRNumuEnergy > numu
Proxy for caf::StandardRecord.
caf::Proxy< std::vector< caf::SRNeutrino > > nu
caf::Proxy< short int > nnu
Proxy for caf::SRFuzzyKProng.
const NeutronVisEScaleSyst2018 kNeutronVisEScalePrimariesSyst2018(false)
caf::Proxy< caf::SREnergyBranch > energy
const NeutronVisEScaleSyst2018 kNeutronVisEScaleProngsSyst2018(true)
caf::Proxy< caf::SRElastic > elastic
caf::Proxy< std::vector< caf::SRFuzzyKProng > > png
caf::Proxy< float > hadcalE
TRandom * RNG(const caf::SRProxy *sr) const
Get the random number generator.
caf::Proxy< caf::SRTruthBranch > mc
caf::Proxy< bool > IsValid
caf::Proxy< caf::SRSlice > slc
caf::Proxy< caf::SRVertexBranch > vtx