22 bool parameters_pass =
true;
35 double HadronMass = 0.13957010;
43 TLorentzVector HadronVec;
44 double HadronPx = flux.ftpx;
45 double HadronPy = flux.ftpy;
46 double HadronPz = flux.ftpz;
47 double HadronE = sqrt(HadronPx*HadronPx +
50 HadronMass*HadronMass);
51 HadronVec.SetPxPyPzE(HadronPx,HadronPy,HadronPz,HadronE);
61 double ThetaOfInterest;
62 if(HadronVec.Theta() > 0.195){
63 ThetaOfInterest = 0.195;
66 ThetaOfInterest = HadronVec.Theta();
73 TLorentzVector ProtonVec;
74 double ProtonMass = 0.9382720;
77 double ProtonPz = 8.89;
78 double ProtonE = sqrt(ProtonPx*ProtonPx +
81 ProtonMass*ProtonMass);
82 ProtonVec.SetPxPyPzE(ProtonPx,ProtonPy,ProtonPz,ProtonE);
87 double CV = c1 * pow(HadronVec.P(), c2) *
88 (1. - HadronVec.P()/(ProtonVec.P() - c9)) *
89 exp(-1. * c3 * pow(HadronVec.P(), c4) / pow(ProtonVec.P(), c5)) *
90 exp(-1. * c6 * ThetaOfInterest *(HadronVec.P() - c7 * ProtonVec.P() * pow(cos(ThetaOfInterest), c8)));
93 if((HadronVec.P()) > ((ProtonVec.P()) - (c9))){
132 std::vector< double > HARPCrossSectionAnalysisBins;
133 HARPCrossSectionAnalysisBins.resize(
int(Ntbins*Npbins));
136 for(
int pbin = 0; pbin < Npbins; pbin++){
137 for(
int tbin = 0; tbin < Ntbins; tbin++){
138 HARPCrossSectionAnalysisBins[anaBin] =
HARPXSec[0][pbin][tbin];
149 std::vector< double > smearedHARPCrossSectionAnalysisBins =
151 HARPCrossSectionAnalysisBins.clear();
158 for(
int check = 0;
check < int(smearedHARPCrossSectionAnalysisBins.size());
check++){
159 if(smearedHARPCrossSectionAnalysisBins[
check] < 0){ parameters_pass =
false;}
167 TMatrixD* smearedHARPXSec =
new TMatrixD(Npbins,Ntbins);
170 for(
int pbin = 0; pbin < Npbins; pbin++){
171 for(
int tbin = 0; tbin < Ntbins; tbin++){
172 smearedHARPXSec[0][pbin][tbin] = smearedHARPCrossSectionAnalysisBins[anaBin];
188 std::vector< TH1F > MomentumBins;
189 MomentumBins.resize(Ntbins);
191 MomentumBins[
bin] = TH1F(
"HARPp",
";;;", Npbins, HARPmomentumBins);
192 MomentumBins[
bin].SetBit(kCanDelete);
196 std::vector< TSpline3 > SplinesVsMomentum;
197 SplinesVsMomentum.resize(Ntbins);
199 for(
int tbin = 0; tbin < Ntbins; tbin++){
200 for(
int pbin = 0; pbin < Npbins; pbin++){
205 MomentumBins[tbin].SetBinContent(pbin+1, smearedHARPXSec[0][pbin][tbin]);
230 SplinesVsMomentum[tbin] = TSpline3(&(MomentumBins[tbin]),
"b2e2",0,0);
233 MomentumBins.clear();
234 delete smearedHARPXSec;
241 TH1F*
ThetaBins =
new TH1F(
"HARPt",
";;;", Ntbins, HARPthetaBins);
242 ThetaBins->SetBit(kCanDelete);
243 for(
int tbin = 0; tbin < Ntbins; tbin++){
244 ThetaBins->SetBinContent(tbin+1, SplinesVsMomentum[tbin].Eval(HadronVec.P()));
254 TSpline3* FinalSpline =
new TSpline3(ThetaBins,
"b2e2",0,0);
256 double RW = FinalSpline->Eval(ThetaOfInterest);
258 SplinesVsMomentum.clear();
281 if(RW < 0 || CV < 0){
284 else if(fabs(CV) < 1.
e-12){
291 if(weight < 0) weight = 0;
292 if(weight > 30) weight = 30;
294 std::cout <<
"SW+Splines : Failed to get a finite weight" << std::endl;
298 std::pair<bool, double>
output(parameters_pass, weight);
std::vector< double > HARPmomentumBounds
std::pair< bool, double > PHSWCSVWeightCalc(simb::MCFlux flux, std::vector< float > rand)
constexpr details::BinObj< T > bin(T value)
Returns a wrapper to print the specified data in binary format.
bool isfinite(Vector const &v)
Returns whether all components of the vector are finite.
BEGIN_PROLOG must be more than must be less than pi ThetaBins
process_name tightIsolTest check
std::vector< double > SWParam
std::vector< double > HARPthetaBounds
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