本文整理汇总了C++中StatusCode::isFailure方法的典型用法代码示例。如果您正苦于以下问题:C++ StatusCode::isFailure方法的具体用法?C++ StatusCode::isFailure怎么用?C++ StatusCode::isFailure使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类StatusCode
的用法示例。
在下文中一共展示了StatusCode::isFailure方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: log
//-----------------------------------------------------------------------------
StatusCode RootHistCnv::PersSvc::createRep(DataObject* pObject,
IOpaqueAddress*& refpAddress)
//-----------------------------------------------------------------------------
{
// There are objects in the HDS to be stored
if( m_outputEnabled && undefFileName != m_defFileName ) {
SmartDataPtr<DataObject> top(dataProvider(), stat_dir);
if ( 0 != top ) {
IRegistry* pReg = top->registry();
if ( pReg ) {
if ( top.ptr() == pObject ) {
TDirectory* pDir = m_hfile;
refpAddress = new RootObjAddress( repSvcType(),
CLID_DataObject,
stat_dir,
m_defFileName,
long(pDir),
long(0));
return StatusCode::SUCCESS;
}
else {
StatusCode sc = ConversionSvc::createRep(pObject, refpAddress);
if( sc.isFailure() ) {
MsgStream log( msgSvc(), name() );
log << MSG::ERROR
<< "Error while creating persistent Histogram:"
<< pReg->identifier()
<< endmsg;
}
return sc;
}
}
}
MsgStream err( msgSvc(), name() );
err << MSG::ERROR
<< "Internal error while creating Histogram persistent representations"
<< endmsg;
return StatusCode::FAILURE;
} else {
if (m_outputEnabled && !m_prtWar) {
m_prtWar = true;
MsgStream log( msgSvc(), name() );
log << MSG::WARNING
<< "no ROOT output file name, "
<< "Histograms cannot be persistified" << endmsg;
}
}
return StatusCode::SUCCESS;
}
示例2: initialize
// ============================================================================
// Initialization
// ============================================================================
StatusCode RecordOutputStream::initialize() {
StatusCode sc = GaudiAlgorithm::initialize(); // must be executed first
if ( sc.isFailure() ) return sc; // error printed already by GaudiAlgorithm
if ( msgLevel(MSG::DEBUG) ) debug() << "==> Initialize" << endmsg;
if (m_streamName.empty()) {
m_streamName = "Deferred:" + name();
debug() << "Using default OutputStreamName: '"
<< m_streamName << "'" << endmsg;
}
m_flagLocation = locationRoot() + "/" + m_streamName;
return StatusCode::SUCCESS;
}
示例3: initialize
StatusCode NoiseCaloCellsTool::initialize() {
StatusCode sc = GaudiTool::initialize();
if (sc.isFailure()) return sc;
//Initialize random service
if(service( "RndmGenSvc" , m_randSvc ).isFailure()) {
error() << "Couldn't get RndmGenSvc" << endmsg;
return StatusCode::FAILURE;
}
m_gauss.initialize(m_randSvc, Rndm::Gauss(0,m_cellNoise));
info() << "Sigma of the cell noise: " << m_cellNoise << " MeV" << endmsg;
info() << "Filter noise threshold: " << m_filterThreshold << "*sigma" << endmsg;
return sc;
}
示例4: parse
// ============================================================================
StatusCode Gaudi::Parsers::parse
( std::vector<Gaudi::StringKey>& result ,
const std::string& input )
{
result.clear() ;
typedef std::vector<std::string> Strings ;
Strings _result ;
StatusCode sc = parse ( _result , input ) ;
if ( sc.isFailure() ) { return sc ; } // RETURN
result.reserve ( _result.size() ) ;
//
std::copy ( _result.begin() ,
_result.end () , std::back_inserter ( result ) ) ;
//
return StatusCode::SUCCESS ;
}
示例5: initialize
//------------------------------------------------------------------------------
StatusCode MyAlgorithm::initialize() {
//------------------------------------------------------------------------------
MsgStream log(msgSvc(), name());
StatusCode sc;
log << MSG::INFO << "initializing...." << endmsg;
sc = toolSvc()->retrieveTool(m_toolName, m_tool, this );
if( sc.isFailure() ) {
log << MSG::ERROR<< "Error retrieving the tool" << endmsg;
return sc;
}
log << MSG::INFO << "....initialization done" << endmsg;
return StatusCode::SUCCESS;
}
示例6: Char
// ============================================================================
Tuples::TupleObj::Char* Tuples::TupleObj::chars
( const std::string& name ,
const char minv ,
const char maxv )
{
Chars::iterator found = m_chars.find( name ) ;
if( m_chars.end() != found ) { return found->second ; }
Char* item = new Char() ;
m_chars[ name ] = item ;
const StatusCode sc = tuple()->addItem( name , *item , minv , maxv );
if( sc.isFailure() )
{ Error ( "chars ('" + name + "'): item is not added", sc ) ; }
if ( !addItem ( name , "I" ) )
{ Error ( "chars ('" + name + "'): item is not unique" ) ; }
return item ;
}
示例7: UInt
// ============================================================================
Tuples::TupleObj::UInt* Tuples::TupleObj::uints
( const std::string& name ,
const unsigned int minv ,
const unsigned int maxv )
{
UInts::iterator found = m_uints.find( name ) ;
if( m_uints.end() != found ) { return found->second ; }
UInt* item = new UInt() ;
m_uints[ name ] = item ;
const StatusCode sc = tuple()->addItem( name , *item , minv , maxv );
if( sc.isFailure() )
{ Error ( "uints ('" + name + "'): item is not added", sc ) ; }
if ( !addItem ( name , "I" ) )
{ Error ( "uints ('" + name + "'): item is not unique" ) ; }
return item ;
}
示例8: ULongLong
// ============================================================================
Tuples::TupleObj::ULongLong* Tuples::TupleObj::ulonglongs
( const std::string& name ,
const unsigned long long minv ,
const unsigned long long maxv )
{
ULongLongs::iterator found = m_ulonglongs.find( name ) ;
if( m_ulonglongs.end() != found ) { return found->second ; }
ULongLong* item = new ULongLong() ;
m_ulonglongs[ name ] = item ;
const StatusCode sc = tuple()->addItem( name , *item , minv , maxv );
if( sc.isFailure() )
{ Error ( "ulonglongs ('" + name + "'): item is not added", sc ) ; }
if ( !addItem ( name , "ULL" ) )
{ Error ( "ulonglongs ('" + name + "'): item is not unique" ) ; }
return item ;
}
示例9: initialize
//=============================================================================
// Initialization
//=============================================================================
StatusCode TbTracking::initialize() {
// Initialise the base class.
StatusCode sc = TbAlgorithm::initialize();
if (sc.isFailure()) return sc;
// Setup the track fit tool.
m_trackFit = tool<ITbTrackFit>("TbTrackFit", "Fitter", this);
// Set up the cluster finder.
m_clusterFinder =
new TbClusterFinder(m_ClusterFinderSearchAlgorithm, m_nPlanes);
// setup Kalman histos
setup_hists();
return StatusCode::SUCCESS;
}
示例10: initialize
//=============================================================================
// Initialization
//=============================================================================
StatusCode TbChargeCalib::initialize() {
// Initialise the base class.
StatusCode sc = TbAlgorithm::initialize();
if (sc.isFailure()) return sc;
info() << "Booking histograms for Chargecalib ... " << endmsg;
m_ToTHists.reserve(256*256);
for( unsigned int i = 0 ; i < 256*256; ++i){
const std::string name = "c=" + std::to_string( i/256 ) + ", r=" + std::to_string(i%256);
if( i % 256 == 0 ) info() << "Booked histogram for column " << i << endmsg;
m_ToTHists.push_back(book1D(name, name, 0.5, 200.5, 200));
setAxisLabels(m_ToTHists[i], "ToT", "Entries");
}
info() << "Booked 60000 ish hists" << endmsg;
return StatusCode::SUCCESS;
}
示例11: initialize
//=============================================================================
// Initialisation
//=============================================================================
StatusCode TbKalmanTrackFit::initialize() {
// Initialise the base class.
StatusCode sc = GaudiTool::initialize();
if (sc.isFailure()) return sc;
// Get the straight-line fit tool (used for seeding the Kalman filter).
m_fitter = tool<ITbTrackFit>("TbTrackFit", "StraightLineFitter", this);
// Get the number of telescope planes.
const auto nPlanes = geomSvc()->modules().size();
// Set the flags whether a plane is masked or not.
m_masked.resize(nPlanes, false);
for (const unsigned int plane : m_maskedPlanes) {
m_masked[plane] = true;
m_fitter->maskPlane(plane);
}
return StatusCode::SUCCESS;
}
示例12: FArray
// ============================================================================
// retrieve (book on demand) array-items for ntuple (fixed)
// ============================================================================
Tuples::TupleObj::FArray* Tuples::TupleObj::fArray
( const std::string& name ,
const Tuples::TupleObj::MIndex& rows )
{
// existing array ?
FArrays::iterator found = m_arraysf.find( name ) ;
if( m_arraysf.end() != found ) { return found->second ; }
// create new array
FArray* array = new FArray () ;
m_arraysf[ name] = array ;
const StatusCode sc = tuple() -> addItem ( name , rows , *array) ;
if( sc.isFailure() )
{ Error ( "array ('" + name + "'): item is not added", sc ) ; }
if ( !addItem ( name , "FArray" ) )
{ Error ( "array ('" + name + "'): item is not unique" ) ; }
return array ;
}
示例13: execute
StatusCode execute() {
info() << "Getting " << m_paths.size() << " objects from " << m_dataSvc << endmsg;
bool missing = false;
for (auto& p: m_paths) {
info() << "Getting '" << p << "'" << endmsg;
DataObject *obj;
StatusCode sc = m_dataProvider->retrieveObject(p, obj);
if (sc.isFailure()) {
warning() << "Cannot retrieve object '" << p << "'" << endmsg;
missing = true;
}
}
return (missing && ! m_ignoreMissing)
? StatusCode::FAILURE
: StatusCode::SUCCESS;
}
示例14: reinitialize
// Re-initialize
StatusCode EventSelector::reinitialize() {
if ( FSMState() != Gaudi::StateMachine::INITIALIZED ) {
MsgStream logger(msgSvc(), name());
logger << MSG::ERROR << "Cannot reinitialize: service not in state initialized" << endmsg;
return StatusCode::FAILURE;
}
if( m_streamSpecsLast != m_streamSpecs ) {
StatusCode status = m_streamtool->clear();
if ( status.isFailure() ) return status;
m_streamSpecsLast = m_streamSpecs;
m_reconfigure = true;
return m_streamtool->addStreams(m_streamSpecs);
}
return StatusCode::SUCCESS;
}
示例15: initialize
//=============================================================================
// Initialize
//=============================================================================
StatusCode HTBlob::initialize()
{
debug() << "Initializing HTBlob..." << endmsg;
StatusCode sc = this->MinervaHistoTool::initialize();
if( sc.isFailure() ) { return Error( "Failed to initialize!", sc ); }
try {
m_mathTool = tool<IMinervaMathTool>("MinervaMathTool");
}
catch( GaudiException& e ) {
error() << "Could not obtain tool: MinervaMathTool!" << endmsg;
return StatusCode::FAILURE;
}
return sc;
}