00001
00002
00003
00004
00005
00006
00007
00008
00009
00010 #include "AtlfastAlgs/SGtester.h"
00011
00012 #include "AtlfastUtils/TesIO.h"
00013 #include "AtlfastEvent/CollectionDefs.h"
00014 #include "AtlfastAlgs/AssocTypeRecoverer.h"
00015 #include "AtlfastAlgs/AssocTypeConverter.h"
00016 #include "AtlfastUtils/CastAwayConst.h"
00017 #include "AtlfastUtils/HeaderPrinter.h"
00018
00019 #include <algorithm>
00020 #include <vector>
00021
00022
00023 #include "GaudiKernel/DataSvc.h"
00024 #include "StoreGate/DataHandle.h"
00025 #include "GaudiKernel/ISvcLocator.h"
00026 #include "GaudiKernel/MsgStream.h"
00027
00028 #include "StoreGate/tools/ClassID_traits.h"
00029 namespace Atlfast{
00030 class MyBigClass{
00031 public:
00032 MyBigClass(){
00033 for(int i=0; i!=1000; ++i){
00034 m_vec.push_back(i);
00035 }
00036 }
00037 private:
00038 std::vector<int> m_vec;
00039 };
00040 }
00041 CLASS_DEF(DataVector<Atlfast::MyBigClass>, 2350, 0)
00042 CLASS_DEF(DataVector<Atlfast::TwoCptCell>, 2351, 0)
00043 namespace Atlfast {
00044
00045
00046
00047
00048 SGtester::SGtester
00049 ( const std::string& name, ISvcLocator* pSvcLocator )
00050 : Algorithm( name, pSvcLocator ){
00051
00052 m_outputLocation1 = "/Event/SGtesterLocation1";
00053 m_outputLocation2 = "/Event/SGtesterLocation2";
00054 }
00055
00056
00057 SGtester::~SGtester() {
00058 if(m_tesIO){
00059 delete m_tesIO;
00060 }
00061 }
00062
00063
00064
00065
00066
00067
00068 StatusCode SGtester::initialize(){
00069
00070 MsgStream log( messageService(), name() ) ;
00071 log << MSG::DEBUG<< "Cluster Maker initialising " << endreq;
00072
00073
00074
00075 m_tesIO = new TesIO();
00076
00077 HeaderPrinter hp("Atlfast SGtester: ", log);
00078 hp.add("Output Location1 ", m_outputLocation1);
00079 hp.add("Output Location2 ", m_outputLocation2);
00080 hp.print();
00081
00082 return StatusCode::SUCCESS ;
00083 }
00084
00085
00086
00087
00088
00089 StatusCode SGtester::finalize(){
00090 return StatusCode::SUCCESS ;
00091 }
00092
00093
00094
00095
00096
00097
00098
00099
00100
00101
00102
00103
00104
00105 StatusCode SGtester::execute( ){
00106 MsgStream log( messageService(), name() ) ;
00107 std::string message;
00108
00109
00110
00111
00112
00113
00114
00115 DataVector<ITwoCptCell>* v1 = new DataVector<ITwoCptCell>;
00116
00117 for(int i =0; i!=10000; ++i){
00118
00119
00120 ITwoCptCell* c = new TwoCptCell;
00121 v1->push_back(c);
00122 }
00123
00124
00125
00126
00127
00128 TesIoStat stat;
00129 stat = m_tesIO -> store(v1, m_outputLocation1);
00130 message = stat ? "v1":"Failed to store v1 ";
00131 log<<MSG::DEBUG<<message<<endreq;
00132
00133
00134
00135
00136 return stat ;
00137
00138 }
00139
00140 }
00141
00142
00143
00144
00145
00146
00147
00148
00149
00150
00151
00152
00153
00154