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