Skip to content

Commit

Permalink
Fix test compilation
Browse files Browse the repository at this point in the history
  • Loading branch information
cnweaver committed Dec 27, 2021
1 parent 845c621 commit 4577e8b
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions test/cross_section_consistency.test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,16 @@ int main(){
nus.InitializeInteractions();
auto is = nus.GetInteractionStructure();

unsigned int nTargets = is->targets.size();
for(unsigned int trg = 0; trg < nTargets; trg++){
for(unsigned int rho = 0; rho < 2; rho++){
for(unsigned int flv = 0; flv < numneu; flv++){
for(unsigned int ei = 1; ei < nus.GetNumE(); ei++){
// initialze muon state
double total_CC_xs = is->sigma_CC[rho][flv][ei];
double total_CC_xs = is->sigma_CC[trg][rho][flv][ei];
if(total_CC_xs < 0.)
std::cout << "Error: negative cross sections." << std::endl;
double total_NC_xs = is->sigma_NC[rho][flv][ei];
double total_NC_xs = is->sigma_NC[trg][rho][flv][ei];
if(total_NC_xs < 0.)
std::cout << "Error: negative cross sections." << std::endl;
/*
Expand All @@ -41,16 +43,16 @@ int main(){
std::cout << "Error: CC cross sectiosn are not unitarity: "<< ei << " " << total_dNdECC + begincap_dNdECC << std::endl;
*/
double total_dNdENC = 0;
double begincap_dNdENC = energies[0]*is->dNdE_NC[rho][flv][ei][0];
double begincap_dNdENC = energies[0]*is->dNdE_NC[trg][rho][flv][ei][0];
double m = 0;
for(unsigned int ef = 0; ef < ei; ef++){
//total_dNdENC += is->dNdE_NC[rho][flv][ei][ef]*(energies[ef+1]-energies[ef]);
//total_dNdENC += (is->dNdE_NC[rho][flv][ei][ef+1]+is->dNdE_NC[rho][flv][ei][ef])*(energies[ef+1]-energies[ef])/2.;
if(ef + 1 == ei)
total_dNdENC += (is->dNdE_NC[rho][flv][ei][ef])*(energies[ef+1]-energies[ef]) + m*(energies[ef+1]-energies[ef])*(energies[ef+1]-energies[ef]);
total_dNdENC += (is->dNdE_NC[trg][rho][flv][ei][ef])*(energies[ef+1]-energies[ef]) + m*(energies[ef+1]-energies[ef])*(energies[ef+1]-energies[ef]);
else
total_dNdENC += (is->dNdE_NC[rho][flv][ei][ef+1] + is->dNdE_NC[rho][flv][ei][ef])*(energies[ef+1]-energies[ef])/2.;
m = (is->dNdE_NC[rho][flv][ei][ef+1]-is->dNdE_NC[rho][flv][ei][ef])/(energies[ef+1]-energies[ef]);
total_dNdENC += (is->dNdE_NC[trg][rho][flv][ei][ef+1] + is->dNdE_NC[trg][rho][flv][ei][ef])*(energies[ef+1]-energies[ef])/2.;
m = (is->dNdE_NC[trg][rho][flv][ei][ef+1]-is->dNdE_NC[trg][rho][flv][ei][ef])/(energies[ef+1]-energies[ef]);
//std::cout << ef << " " << std::endl;
//total_dNdENC += (is->dNdE_NC[rho][flv][ei][ef])*(energies[ef+1]-energies[ef]);
}
Expand All @@ -59,6 +61,7 @@ int main(){
}
}
}
}

return 0;
}

0 comments on commit 4577e8b

Please sign in to comment.