22 bool parameters_pass =
true;
25 double HadronMass = 0.4976;
39 TLorentzVector HadronVec;
40 double HadronPx = flux.ftpx;
41 double HadronPy = flux.ftpy;
42 double HadronPz = flux.ftpz;
43 double HadronE = sqrt(HadronPx*HadronPx +
46 HadronMass*HadronMass);
47 HadronVec.SetPxPyPzE(HadronPx,HadronPy,HadronPz,HadronE);
52 TLorentzVector ProtonVec;
53 double ProtonMass = 0.9382720;
56 double ProtonPz = 8.89;
57 double ProtonE = sqrt(ProtonPx*ProtonPx +
60 ProtonMass*ProtonMass);
61 ProtonVec.SetPxPyPzE(ProtonPx,ProtonPy,ProtonPz,ProtonE);
78 double CV = c1 * pow(HadronVec.P(), c2) *
79 (1. - HadronVec.P()/(ProtonVec.P() - c9)) *
80 exp(-1. * c3 * pow(HadronVec.P(), c4) / pow(ProtonVec.P(), c5)) *
81 exp(-1. * c6 * HadronVec.Theta() *(HadronVec.P() - c7 * ProtonVec.P() * pow(cos(HadronVec.Theta()), c8)));
84 if((HadronVec.P()) > ((ProtonVec.P()) - (c9))){
95 double smeared_c1 = SWK0FitSmeared.at(0);
96 double smeared_c2 = SWK0FitSmeared.at(1);
97 double smeared_c3 = SWK0FitSmeared.at(2);
98 double smeared_c4 = SWK0FitSmeared.at(3);
99 double smeared_c5 = SWK0FitSmeared.at(4);
100 double smeared_c6 = SWK0FitSmeared.at(5);
101 double smeared_c7 = SWK0FitSmeared.at(6);
102 double smeared_c8 = SWK0FitSmeared.at(7);
103 double smeared_c9 = SWK0FitSmeared.at(8);
109 parameters_pass =
false;
112 double RW = smeared_c1 * pow(HadronVec.P(), smeared_c2) *
113 (1. - HadronVec.P()/(ProtonVec.P() - smeared_c9)) *
114 exp(-1. * smeared_c3 * pow(HadronVec.P(), smeared_c4) / pow(ProtonVec.P(), smeared_c5)) *
115 exp(-1. * smeared_c6 * HadronVec.Theta() *(HadronVec.P() - smeared_c7 * ProtonVec.P() * pow(cos(HadronVec.Theta()), smeared_c8)));
118 if((HadronVec.P()) > ((ProtonVec.P()) - (smeared_c9))){
124 if(RW < 0 || CV < 0){
127 else if(fabs(CV) < 1.e-12){
134 if(weight < 0) weight = 0;
135 if(weight > 30) weight = 30;
137 std::cout <<
"SW : Failed to get a finite weight" << std::endl;
141 std::pair<bool, double>
output(parameters_pass, weight);
std::vector< double > FitVal
std::pair< bool, double > PHSWWeightCalc(simb::MCFlux flux, std::vector< float > rand)
bool isfinite(Vector const &v)
Returns whether all components of the vector are finite.
BEGIN_PROLOG sequence::SlidingWindowTriggerPatternsOppositeWindows END_PROLOG simSlidingORM6O6 effSlidingORW output
std::vector< std::vector< double > > MultiGaussianSmearing(std::vector< double > const ¢ralValue, std::vector< std::vector< double > > const &inputCovarianceMatrix, int n_multisims, CLHEP::RandGaussQ &GaussRandom)
BEGIN_PROLOG could also be cout