Skip to content

Commit

Permalink
Updated code to deal with indirect. Refs #5875.
Browse files Browse the repository at this point in the history
  • Loading branch information
AndreiSavici committed Jul 1, 2013
1 parent dd15210 commit c14c672
Showing 1 changed file with 21 additions and 1 deletion.
22 changes: 21 additions & 1 deletion Code/Mantid/Framework/MDAlgorithms/src/ConvertToMDHelper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,27 @@ namespace MDAlgorithms
}
else//indirect
{
double Ef=DBL_MAX;
double Ef=-DBL_MAX,Eftemp=Ef;
const Geometry::ParameterMap& pmap = ws->constInstrumentParameters();
for(size_t i=0;i<ws->getNumberHistograms();i++)
{
Geometry::IDetector_const_sptr spDet;
try
{
spDet= ws->getDetector(i);
Geometry::Parameter_sptr par = pmap.getRecursive(spDet.get(),"eFixed");
if(par) Eftemp=par->value<double>();
if(Eftemp>Ef) Ef=Eftemp;
}
catch(...)
{
continue;
}
if(Ef<=0)
{
throw std::runtime_error("Could not find a fixed final energy for indirect geometry instrument.");
}
}
qmax=std::sqrt(energyToK*Ef)+std::sqrt(energyToK*(Ef+deltaEmax));
}
}
Expand Down

0 comments on commit c14c672

Please sign in to comment.