示例#1
0
  double Integral
  ( const Genfun::AbsFunction&                 function  ,
    const double                               a         ,
    const GaudiMath::Integration::Inf          b         ,
    const double                               epsabs    ,
    const double                               epsrel    ,
    const size_t                               size      )
  {
    if ( 1 != function.dimensionality() )
      { throw GaudiException
          ("GaudiMath::Integral: illegal function dimension" ,
           "*GaudiMath*" , StatusCode::FAILURE ); }

    const Genfun::AbsFunction& one   =
      Genfun::GaudiMathImplementation::Constant ( 1.0 , 1 ) ;

    const Genfun::AbsFunction& cross =
      Genfun::FunctionDirectProduct (&one , &function ) ;

    const Genfun::AbsFunction& result =
      Genfun::GaudiMathImplementation::NumericalDefiniteIntegral
      ( cross , 1 , a , b , epsabs , epsrel , size ) ;

    return result( Genfun::Argument(1) ) ;
  }
示例#2
0
FastSimModelTracker::FastSimModelTracker(const std::string& aModelName, G4Region* aEnvelope, const std::string& aSmearToolName):
  G4VFastSimulationModel(aModelName, aEnvelope),
  m_toolSvc("ToolSvc","ToolSvc") {
  if( m_toolSvc->retrieveTool(aSmearToolName, m_smearTool, 0, false).isFailure())
    throw GaudiException("Smearing tool "+aSmearToolName+" not found",
                         "FastSimModelTracker", StatusCode::FAILURE);
}
GaudiTuples<GaudiHistoTool>::GaudiTuples( const std::string & /* name */,
                                          ISvcLocator * /* pSvcLocator */ )
  : GaudiHistoTool ( "ERROR" , "ERROR" , 0 )
{
  throw GaudiException( "Invalid GaudiTuples<GaudiTool> constructor",
                        "GaudiTuples", StatusCode::FAILURE );
}
示例#4
0
  double Integral
  ( const Genfun::AbsFunction&                 function  ,
    const GaudiMath::Integration::Inf          /* a  */  ,
    const GaudiMath::Integration::Inf          /* b  */  ,
    const double                               epsabs    ,
    const double                               epsrel    ,
    const size_t                               size      )
  {
    if ( 1 != function.dimensionality() )
      { throw GaudiException
          ("GaudiMath::Integral: illegal function dimension" ,
           "*GaudiMath*" , StatusCode::FAILURE ); }

    const Genfun::AbsFunction& one   =
      Genfun::GaudiMathImplementation::Constant ( 1.0 , 1 ) ;

    const Genfun::AbsFunction& cross =
      Genfun::FunctionDirectProduct (&one , &function ) ;

    // FIXME: (MCl) the static_cast below are needed to avoid warnings and to
    // match the signature in NumericalDefiniteIntegral.h (around line 288).
    const Genfun::AbsFunction& result =
      Genfun::GaudiMathImplementation::NumericalDefiniteIntegral
      ( cross , 1 , static_cast<float>(epsabs) , static_cast<float>(epsrel) , size ) ;

    return result( Genfun::Argument(1) ) ;
  }
GaudiTuples<GaudiHistoAlg>::GaudiTuples( const std::string& /* type */  ,
                                         const std::string& /* name */  ,
                                         const IInterface*  /* parent */ )
  : GaudiHistoAlg ( "ERROR" , 0 )
{
  throw GaudiException( "Invalid GaudiTuples<GaudiAlgorithm> constructor",
                        "GaudiTuples", StatusCode::FAILURE );
}
示例#6
0
IRegistry* DataSvcFileEntriesTool::i_getRootNode() {
  DataObject * obj = 0;
  StatusCode sc = m_dataSvc->retrieveObject(m_rootNode, obj);
  if (sc.isFailure()) {
    throw GaudiException("Cannot get " + m_rootNode + " from " + m_dataSvcName, name(), StatusCode::FAILURE);
  }
  return obj->registry();
}
示例#7
0
std::string format( const char* fmt, ... )
{
  const int buffsize = 2048;
  static char buffer[buffsize];
  va_list arguments;
  va_start( arguments, fmt );
  if( vsprintf(buffer, fmt, arguments) >= buffsize )
    throw GaudiException("Insufficient buffer size (2048) when formatting message",
                         "MsgStream", 0);
  return std::string(buffer);
}
示例#8
0
Containers::KeyedObjectManager<T>::KeyedObjectManager()
: m_direct(0)
{
  if ( sizeof(typename T::map_type) > sizeof(m_setup.buffer) )    {
    throw GaudiException("Basic STL contaier sizes are incompatible",
                         "KeyedContainer",
                         0);
  }
  m_setup.s = ::new(m_setup.buffer+sizeof(m_setup.s)) T();
  m_keyCtxt = -1;
}
示例#9
0
/// todo: implement the scanning as an IDataStoreAgent
void DataSvcFileEntriesTool::i_collectLeaves(IRegistry* reg) {
  MsgStream log(msgSvc(), name());
  // I do not put sanity checks on the pointers because I know how I'm calling the function
  IOpaqueAddress *addr = reg->address();
  if (addr) { // we consider only objects that are in a file
    if (outputLevel() <= MSG::VERBOSE)
      log << MSG::VERBOSE << "::i_collectLeaves added " << reg->identifier() << endmsg;
    m_leaves.push_back(reg->object()); // add this object
    // Origin of the current object
    const std::string& base = addr->par()[0];
    // Compare with the origin seen during BeginEvent
    if ( !m_ignoreOriginChange && (m_initialBase != base) )
      throw GaudiException("Origin of data has changed ('"
                           + m_initialBase + "' !=  '" + base
                           + "'), probably OutputStream was called before "
                               "InputCopyStream: check options",
                           name(), StatusCode::FAILURE);

    std::vector<IRegistry*> lfs; // leaves of the current object
    StatusCode sc = m_dataMgrSvc->objectLeaves(reg, lfs);
    if (sc.isSuccess()) {
      for(std::vector<IRegistry*>::iterator i = lfs.begin(); i != lfs.end(); ++i)  {
        // Continue if the leaf has the same database as the parent
        if ( (*i)->address() && (*i)->address()->par()[0] == base )  {
          DataObject* obj = 0;
          sc = m_dataSvc->retrieveObject(reg, (*i)->name(), obj);
          if (sc.isSuccess())  {
            i_collectLeaves(*i);
          } else {
            throw GaudiException("Cannot get " + (*i)->identifier() + " from " + m_dataSvcName, name(), StatusCode::FAILURE);
          }
        }
      }
    }
  }
}
示例#10
0
void Containers::invalidContainerOperation()   {
  throw GaudiException("Keyed Container cannot satisfy request - severe problem!",
                       "KeyedContainer",
                       0);
}
示例#11
0
void Containers::containerIsInconsistent()   {
  throw GaudiException("Keyed Container structures are inconsistent - severe problem!",
                       "KeyedContainer",
                       0);
}
示例#12
0
void Containers::cannotInsertToContainer()   {
  throw GaudiException("Cannot insert element to Keyed Container!",
                       "KeyedContainer",
                       0);
}
示例#13
0
void Containers::cannotAssignObjectKey()   {
  throw GaudiException("Cannot assign key to keyed object! Object already has a key.",
                       "KeyedObject",
                       0);
}
示例#14
0
void AuditorSvc::afterExecute(INamedInterface*,const StatusCode&) {
  throw GaudiException("The method afterExecute is obsolete do not call it.",
                       "AuditorSvc::afterExecute" , StatusCode::FAILURE);
}