Beispiel #1
0
/** Initialize the algorithm's properties.
 */
void 
ConvertToQ3DdE::init()
{
      CompositeWorkspaceValidator<> *ws_valid = new CompositeWorkspaceValidator<>;
      ws_valid->add(new WorkspaceUnitValidator<>("DeltaE"));
      ws_valid->add(new HistogramValidator<>);
      ws_valid->add(new InstrumentValidator<>);


    declareProperty(new WorkspaceProperty<MatrixWorkspace>("InputWorkspace","",Direction::Input,ws_valid),
        "An input Matrix Workspace 2D, processed by Convert to energy (homer) algorithm and its x-axis has to be in the units of energy transfer with energy in mev.");
    declareProperty(new WorkspaceProperty<IMDEventWorkspace>("OutputWorkspace","",Direction::Output),
        "Name of the output MDEventWorkspace. If the workspace already exists, then the events will be added to it.");

     BoundedValidator<double> *minEn = new BoundedValidator<double>();
     minEn->setLower(0);
     declareProperty("EnergyInput",0.000000001,minEn,"The value for the incident energy of the neutrons leaving the source (meV)",Direction::InOut);

     // this property is mainly for subalgorithms to set-up as they have to identify 
    declareProperty(new PropertyWithValue<bool>("UsePreprocessedDetectors", true, Direction::Input), 
        "Store the part of the detectors transfromation into reciprocal space to save/reuse it later;");
    // // this property is mainly for subalgorithms to set-up as they have to identify 
    //declareProperty(new ArrayProperty<double>("u"), "first base vecotor");
    //declareProperty(new ArrayProperty<double>("v"), "second base vecotors");


     declareProperty(new ArrayProperty<double>("MinQdE_values"),
         "An array containing minimal values for Q[A^-1] and energy transfer[meV] in a form qx_min,qy_min,qz_min, dE min\n"
         "(momentum and energy transfer values lower that this one will be ignored if this is set.\n"
         " If a minimal output workspace range is higer then specified, the workspace range will be used intstead)" );

     declareProperty(new ArrayProperty<double>("MaxQdE_values"),
         "An array containing maximal values for Q[A^-1] and energy transfer[meV] in a form qx_max,qy_max,qz_max, dE_max\n"
         "(momentum and energy transfer values higher that this one will be ignored if this is set.\n"
         " If a maximal output workspace ranges is lower, then one of specified, the workspace range will be used instead)" );


}
Beispiel #2
0
ArrayBoundedValidator<TYPE>::ArrayBoundedValidator(BoundedValidator<TYPE> &bv)
{
  this->boundVal = dynamic_cast<BoundedValidator<TYPE> *>(bv.clone());
}
ArrayBoundedValidator<TYPE>::ArrayBoundedValidator(BoundedValidator<TYPE> &bv) {
  this->boundVal =
      boost::dynamic_pointer_cast<BoundedValidator<TYPE>>(bv.clone());
}