Skip to content

Commit

Permalink
Testing IDataProviderSvc
Browse files Browse the repository at this point in the history
  • Loading branch information
delitez committed Aug 8, 2022
1 parent 0dc4b08 commit 010a7ce
Show file tree
Hide file tree
Showing 2 changed files with 72 additions and 0 deletions.
44 changes: 44 additions & 0 deletions k4ActsTracking/src/components/objectTEST.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
#include "objectTEST.h"

#include <iostream>
#include <string>
#include <filesystem>
#include <unistd.h>
#include "PropagatorAlg.h"

//using std::filesystem::current_path;


DECLARE_COMPONENT(objectTest)

objectTest::objectTest(const std::string& aName, ISvcLocator* aSvcLoc) : GaudiAlgorithm(aName, aSvcLoc) {}

objectTest::~objectTest() {}

StatusCode objectTest::initialize() {return StatusCode::SUCCESS; }

StatusCode objectTest::execute() {

typedef std::vector<int> MyTestVector;
DataObject *pObject;
//std::string objectPath = "./testDir";

StatusCode sc = eventSvc()->registerObject(".", pObject);

if( sc.isFailure() ) {
std::cout << "CANNOT initialize sc" << std::endl;
return StatusCode::FAILURE;
}
else{
std::cout << "CAN initialize sc" << std::endl;
}

MyTestVector *tv = 0;
tv = dynamic_cast<MyTestVector *> (pObject);


std::cout << "Object Test is alive!" << std::endl;
return StatusCode::SUCCESS;
}

StatusCode objectTest::finalize() { return StatusCode::SUCCESS; }
28 changes: 28 additions & 0 deletions k4ActsTracking/src/components/objectTEST.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#pragma once

// GAUDI
#include "Gaudi/Property.h"
#include "GaudiAlg/GaudiAlgorithm.h"
#include "GaudiKernel/IDataProviderSvc.h"
//#include "GaudiKernel/RegistryEntry.h"

class objectTest : public GaudiAlgorithm {
public:
explicit objectTest(const std::string&, ISvcLocator*);
virtual ~objectTest();
/** Initialize.
* @return status code
*/
virtual StatusCode initialize() final;
/** Execute.
* @return status code
*/
virtual StatusCode execute() final;
/** Finalize.
* @return status code
*/
virtual StatusCode finalize() final;

private:

};

0 comments on commit 010a7ce

Please sign in to comment.