CMS 3D CMS Logo

Public Member Functions

global_linear_1 Class Reference

#include <global_linear.h>

Inheritance diagram for global_linear_1:
AlgoImpl

List of all members.

Public Member Functions

bool checkParameters ()
 subclass must check the supplied parameters ParE_, ParS_
 global_linear_1 (AlgoPos *, std::string label)
DDRotationMatrix rotation ()
 subclass must calculate a rotation matrix
void stream (std::ostream &) const
DDTranslation translation ()
 subclass must calculate a translation std::vector
 ~global_linear_1 ()

Detailed Description

Definition at line 66 of file global_linear.h.


Constructor & Destructor Documentation

global_linear_1::global_linear_1 ( AlgoPos a,
std::string  label 
)

Definition at line 97 of file global_linear.cc.

 : AlgoImpl(a,label)
{ }
global_linear_1::~global_linear_1 ( )

Definition at line 101 of file global_linear.cc.

{ }

Member Function Documentation

bool global_linear_1::checkParameters ( ) [virtual]

subclass must check the supplied parameters ParE_, ParS_

whether they are correct and should select this paricular algorithm.

If the parameters are correct by should not select this particular algorithm, checkParamters must return false otherwise true.

The std::string err_ is to be used to be extended with error information in case any errors have been detected. Error information must be attached to err_ because of the possibility of already contained error information.

In case of errors: If an DDException is thrown by the algorithm implementation, further processing of any other implementations of the algorithm will be stopped. If no exception is thrown, checkParamters must return false. It's preferable not to throw an exception in case of errors. The algorithm implementation will throw if all checkParamters() of all registered algorithm implementations have returned false.

Implements AlgoImpl.

Definition at line 104 of file global_linear.cc.

References AlgoImpl::err_, AlgoImpl::ParE_, query::result, and findQualityFiles::size.

{

                 /* besides the automatic generated checking for the input params, 
                    we have to decide, whether the params are correct and should
                    select this implementation 
                 */
                  
                  bool result = true;   
                  
                  // check for valid delta-value
                  if (ParE_["delta"][0] == 0.) {
                    err_ += "\tdelta must not be 0\n";
                    result = false;
                  }
                  
                  // check for presence of base
                  if (ParE_["base"].size()) {
                    result = false; // don't select this implementation, because base is present
                  }  
                  
                  return result;  
                    
}
DDRotationMatrix global_linear_1::rotation ( ) [virtual]

subclass must calculate a rotation matrix

depending on the current position curr_ in the range [start_,end_,incr_] and the user supplied parameters ParE_, ParS_

Implements AlgoImpl.

Definition at line 149 of file global_linear.cc.

{

                // there are no rotations involved in this algorithm.
                // simply returns the unit matrix.
                return DDRotationMatrix();
                
}   
void global_linear_1::stream ( std::ostream &  os) const

Definition at line 164 of file global_linear.cc.

{
  os << "global_linear_0::stream(): not implemented.";
}
DDTranslation global_linear_1::translation ( ) [virtual]

subclass must calculate a translation std::vector

depending on the current position curr_ in the range [start_,end_,incr_] and the user supplied parameters ParE_, ParS_

Implements AlgoImpl.

Definition at line 130 of file global_linear.cc.

References funct::cos(), AlgoImpl::curr_, delta, evf::evtn::offset(), AlgoImpl::ParE_, phi, funct::sin(), and theta().

{

                 // we can safely fetch all parameters, because they
                 // have been checked already ...
                 double theta  = ParE_["theta"][0]/rad;
                 double phi    = ParE_["phi"][0]/rad;
                 double offset = ParE_["offset"][0];
                 double delta  = ParE_["delta"][0];
   
                 DDTranslation direction( sin(theta)*cos(phi),
                                          sin(theta)*sin(phi),
                                          cos(theta) );
                            
                 return (offset + double(curr_)*delta)*direction;
                
}