00001
00002
00003 #ifndef GAUDIALG_GaudiAlgorithm_H
00004 #define GAUDIALG_GaudiAlgorithm_H 1
00005
00006
00007
00008 #include <vector>
00009 #include <string>
00010
00011
00012
00013 #include "GaudiKernel/Algorithm.h"
00014
00015
00016
00017 #include "GaudiAlg/GaudiAlg.h"
00018 #include "GaudiAlg/GaudiCommon.h"
00019
00020
00021
00022 class INTupleSvc ;
00023 template<class T> class AlgFactory ;
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059
00060
00094
00095 class GAUDI_API GaudiAlgorithm: public GaudiCommon<Algorithm>
00096 {
00097
00098 friend class AlgFactory<GaudiAlgorithm>;
00099 public:
00100
00106 virtual StatusCode initialize();
00107
00113 virtual StatusCode execute ();
00114
00120 virtual StatusCode finalize ();
00121
00128 virtual StatusCode sysExecute () ;
00129
00130 public:
00131
00132
00133
00134
00135
00136
00169 inline void put ( IDataProviderSvc* svc ,
00170 DataObject* object ,
00171 const std::string& address ,
00172 const bool useRootInTES = true ) const
00173 {
00174 GaudiCommon<Algorithm>::put ( svc , object , address , useRootInTES ) ;
00175 }
00176
00208 inline void put ( DataObject* object ,
00209 const std::string& address ,
00210 const bool useRootInTES = true ) const
00211 {
00212 GaudiCommon<Algorithm>::put ( evtSvc() , object , address , useRootInTES ) ;
00213 }
00214
00247 template < class TYPE >
00248 inline typename Gaudi::Utils::GetData<TYPE>::return_type
00249 get ( IDataProviderSvc* svc ,
00250 const std::string& location ,
00251 const bool useRootInTES = true ) const
00252 {
00253 return GaudiCommon<Algorithm>::get<TYPE> ( svc , location , useRootInTES ) ;
00254 }
00255
00282 template < class TYPE >
00283 inline typename Gaudi::Utils::GetData<TYPE>::return_type
00284 get ( const std::string& location,
00285 const bool useRootInTES = true ) const
00286 {
00287 return GaudiCommon<Algorithm>::get<TYPE> ( evtSvc() , location , useRootInTES ) ;
00288 }
00289
00308 template < class TYPE >
00309 inline TYPE* getDet ( IDataProviderSvc* svc ,
00310 const std::string& location ) const
00311 {
00312 return GaudiCommon<Algorithm>::get<TYPE> ( svc , location , false ) ;
00313 }
00314
00332 template < class TYPE >
00333 inline TYPE* getDet ( const std::string& location ) const
00334 {
00335 return GaudiCommon<Algorithm>::get<TYPE> ( detSvc() , location , false ) ;
00336 }
00337
00364 template < class TYPE >
00365 inline bool exist ( IDataProviderSvc* svc ,
00366 const std::string& location ,
00367 const bool useRootInTES = true ) const
00368 {
00369 return GaudiCommon<Algorithm>::exist<TYPE> ( svc , location , useRootInTES ) ;
00370 }
00371
00397 template < class TYPE >
00398 inline bool exist ( const std::string& location ,
00399 const bool useRootInTES = true ) const
00400 {
00401 return GaudiCommon<Algorithm>::exist<TYPE> ( evtSvc() , location , useRootInTES ) ;
00402 }
00403
00420 template < class TYPE >
00421 inline bool existDet ( IDataProviderSvc* svc ,
00422 const std::string& location ) const
00423 {
00424 return GaudiCommon<Algorithm>::exist<TYPE> ( svc , location , false ) ;
00425 }
00426
00442 template < class TYPE >
00443 inline bool existDet ( const std::string& location ) const
00444 {
00445 return GaudiCommon<Algorithm>::exist<TYPE> ( detSvc() , location , false ) ;
00446 }
00447
00475 template < class TYPE , class TYPE2 >
00476 inline TYPE* getOrCreate ( IDataProviderSvc* svc ,
00477 const std::string& location ,
00478 const bool useRootInTES = true ) const
00479 {
00480 return GaudiCommon<Algorithm>::getOrCreate<TYPE,TYPE2> ( svc , location , useRootInTES ) ;
00481 }
00482
00509 template < class TYPE , class TYPE2 >
00510 inline TYPE* getOrCreate ( const std::string& location ,
00511 const bool useRootInTES = true ) const
00512 {
00513 return GaudiCommon<Algorithm>::getOrCreate<TYPE,TYPE2> ( evtSvc() , location , useRootInTES ) ;
00514 }
00515 public:
00516
00522 GaudiAlgorithm ( const std::string& name ,
00523 ISvcLocator* pSvcLocator );
00524
00526 virtual ~GaudiAlgorithm();
00527
00528 public:
00529
00533 SmartIF<INTupleSvc>& evtColSvc () const;
00534
00535 private:
00536
00537
00538 GaudiAlgorithm();
00539
00540
00541 GaudiAlgorithm ( const GaudiAlgorithm& );
00542
00543
00544 GaudiAlgorithm& operator = ( const GaudiAlgorithm& );
00545
00546 private:
00547
00548
00549 mutable SmartIF<INTupleSvc> m_evtColSvc ;
00550
00551 std::vector<std::string> m_vetoObjs;
00553 std::vector<std::string> m_requireObjs;
00554
00555 };
00556
00557
00558
00559 #endif // GAUDIALG_GaudiAlgorithm_H
00560
00561
00562