// Model to do recornrms // // Parameters are specnum Spectrum number // cornorm New correction norm #include #include #include #include #include #include "xsTypes.h" extern "C" void recorn (const RealArray& energyArray, const RealArray& params, int spectrumNumber, RealArray& fluxArray, RealArray& fluxErrArray, const string& initString) { size_t specnum = static_cast(params[0]+.5); Real cornorm = params[1]; // Reset the correction norm for the requested spectrum, but only // if the requested spectrum matches the spectrumNumber // currently being evaluated. Note that for recorn, each spectrum // is always assigned a UniqueEnergy obj. if (specnum == static_cast(spectrumNumber)) { const size_t nAllSpectra = XSContainer::datasets->numberOfSpectra(); if ( specnum > nAllSpectra ) { tcout << "Spectrum " << specnum << " has not been loaded." << std::endl; } SpectralData* sd = XSContainer::datasets->lookup(specnum); if (sd) { sd->correctionScale(cornorm); // tcout << " Spectrum " << specnum << " correction norm set to " // << cornorm << std::endl; } } size_t N(energyArray.size()); fluxArray.resize(N-1); fluxErrArray.resize(0); fluxArray = 1.0; return; }