BOSS 8.0.0
BESIII Offline Software System
Loading...
Searching...
No Matches
ServiceAccessor.h
Go to the documentation of this file.
1#ifndef ServiceAccessor_H
2#define ServiceAccessor_H
3
4#include "GaudiKernel/Bootstrap.h"
5#include "GaudiKernel/IMessageSvc.h"
6#include "GaudiKernel/ISvcLocator.h"
7#include "GaudiKernel/MsgStream.h"
8
9#include "GaudiKernel/IHistogramSvc.h"
10
11// access the message service
12inline IMessageSvc* msgSvc() {
13 static IMessageSvc* mS = 0;
14 if ( !mS )
15 {
16 ISvcLocator* svcLocator = Gaudi::svcLocator();
17 svcLocator->service( "MessageSvc", mS );
18 }
19 return mS;
20}
21
22// access the histogram service
23inline IHistogramSvc* histoSvc() {
24 static IHistogramSvc* hS = 0;
25 StatusCode status;
26 if ( !hS )
27 {
28 ISvcLocator* svcLocator = Gaudi::svcLocator();
29 status = svcLocator->service( "HistogramDataSvc", hS );
30 }
31 return hS;
32}
33
34// access store gate
35
36#include "StoreGate/StoreGateSvc.h"
37
38inline StoreGateSvc* storeGateSvc() {
39 static StoreGateSvc* sG = 0;
40 StatusCode status;
41 if ( !sG )
42 {
43 ISvcLocator* svcLocator = Gaudi::svcLocator();
44 status = svcLocator->service( "StoreGateSvc", sG );
45 }
46 return sG;
47}
48
49#include "GaudiKernel/INTupleSvc.h"
50
51inline INTupleSvc* ntupleSvc() {
52 static INTupleSvc* nS = 0;
53 StatusCode status;
54 if ( !nS )
55 {
56 ISvcLocator* svcLocator = Gaudi::svcLocator();
57 status = svcLocator->service( "NTupleSvc", nS );
58 }
59 return nS;
60}
61
62#endif
INTupleSvc * ntupleSvc()
StoreGateSvc * storeGateSvc()
IHistogramSvc * histoSvc()
IMessageSvc * msgSvc()