18#include "Gaudi/Property.h"
35 ISvcLocator* pSvcLocator ) :
37 m_ntsvc(
"THistSvc/THistSvc", name),
46 "key to the event-info instance to histogram-ize.");
61 if (!
m_ntsvc.retrieve().isSuccess()) {
63 return StatusCode::FAILURE;
67 m_hist =
new TH1F(
"h1",
"histogram title", 100,0.,100.);
68 if (!
m_ntsvc->regHist(
"/stat/simple1D/h1",
m_hist).isSuccess()) {
71 return StatusCode::FAILURE;
74 return StatusCode::SUCCESS;
81 return StatusCode::SUCCESS;
93 return StatusCode::FAILURE;
96 int event = evt->eventNumber();
99 m_hist->Fill(
float(event), 1.);
101 return StatusCode::SUCCESS;
AthAlgorithm(const std::string &name, ISvcLocator *pSvcLocator)
Constructor with parameters:
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
ServiceHandle< StoreGateSvc > & evtStore()
std::string m_evtInfoName
key to the event-info
ServiceHandle< ITHistSvc > m_ntsvc
handle to the n-tuple svc
virtual ~Hist()
Destructor:
Hist()
Default constructor:
virtual StatusCode initialize()
virtual StatusCode execute()
virtual StatusCode finalize()
TH1F * m_hist
pointer to our histogram
EventInfo_v1 EventInfo
Definition of the latest event info version.