BOSS 8.0.0
BESIII Offline Software System
Loading...
Searching...
No Matches
DedxSimSvc Class Reference

#include <DedxSimSvc.h>

Inheritance diagram for DedxSimSvc:

Public Member Functions

 DedxSimSvc (const std::string &name, ISvcLocator *svcloc)
 ~DedxSimSvc ()
virtual StatusCode initialize ()
virtual StatusCode finalize ()
void handle (const Incident &)
int getVersion ()
int gethistNo ()
int getRangeNo ()
int getThetaNo ()
std::vector< TH1F > * getHist ()
std::vector< double > * getRange ()

Detailed Description

Definition at line 18 of file DedxSimSvc.h.

Constructor & Destructor Documentation

◆ DedxSimSvc()

DedxSimSvc::DedxSimSvc ( const std::string & name,
ISvcLocator * svcloc )

Definition at line 32 of file DedxSimSvc.cxx.

33 : base_class( name, svcloc ) {}

Referenced by DedxSimSvc().

◆ ~DedxSimSvc()

DedxSimSvc::~DedxSimSvc ( )

Definition at line 35 of file DedxSimSvc.cxx.

35{}

Member Function Documentation

◆ finalize()

StatusCode DedxSimSvc::finalize ( )
virtual

Definition at line 76 of file DedxSimSvc.cxx.

76 {
77 MsgStream log( msgSvc(), name() );
78 log << MSG::INFO << name() << "DedxSimSvc::finalize()" << endmsg;
79 return StatusCode::SUCCESS;
80}
IMessageSvc * msgSvc()

◆ getHist()

std::vector< TH1F > * DedxSimSvc::getHist ( )
inline

Definition at line 33 of file DedxSimSvc.h.

33{ return m_dedx_hists; }

◆ gethistNo()

int DedxSimSvc::gethistNo ( )
inline

Definition at line 30 of file DedxSimSvc.h.

30{ return m_numDedxHists; }

◆ getRange()

std::vector< double > * DedxSimSvc::getRange ( )
inline

Definition at line 34 of file DedxSimSvc.h.

34{ return m_bgRange; }

◆ getRangeNo()

int DedxSimSvc::getRangeNo ( )
inline

Definition at line 31 of file DedxSimSvc.h.

31{ return m_numBg; }

◆ getThetaNo()

int DedxSimSvc::getThetaNo ( )
inline

Definition at line 32 of file DedxSimSvc.h.

32{ return m_numTheta; }

◆ getVersion()

int DedxSimSvc::getVersion ( )
inline

Definition at line 29 of file DedxSimSvc.h.

29{ return m_version; }

◆ handle()

void DedxSimSvc::handle ( const Incident & inc)

Definition at line 82 of file DedxSimSvc.cxx.

82 {
83 MsgStream log( msgSvc(), name() );
84 log << MSG::DEBUG << "handle: " << inc.type() << endmsg;
85
86 if ( inc.type() == "NewRun" )
87 {
88 log << MSG::DEBUG << "New Run" << endmsg;
89 SmartDataPtr<Event::EventHeader> evt( m_eventSvc, "/Event/EventHeader" );
90 int runNo=0;
91 if ( evt )
92 {
93 runNo = evt->runNumber();
94 log << MSG::DEBUG << "The runNumber of current event is " << runNo << endmsg;
95 }
96 else { log << MSG::ERROR << "ERROR accessing Event" << endmsg; }
97 if ( runNo < m_runfrom || runNo > m_runto ) { update_param_svc(); }
98 }
99}
int runNo
Definition DQA_TO_DB.cxx:13

◆ initialize()

StatusCode DedxSimSvc::initialize ( )
virtual

Definition at line 47 of file DedxSimSvc.cxx.

47 {
48 MsgStream log( msgSvc(), name() );
49 log << MSG::INFO << name() << "DedxSimSvc::initialize()" << endmsg;
50
51 StatusCode sc = Service::initialize();
52 if ( sc.isFailure() ) return sc;
53
54 IIncidentSvc* incsvc;
55 sc = service( "IncidentSvc", incsvc );
56 int priority = 100;
57 if ( sc.isSuccess() ) { incsvc->addListener( this, "NewRun", priority ); }
58 sc = serviceLocator()->service( "EventDataSvc", m_eventSvc, true );
59 if ( sc.isFailure() )
60 {
61 log << MSG::ERROR << "Unable to find EventDataSvc " << endmsg;
62 return sc;
63 }
64
65 m_runfrom = -999999;
66 m_runto = -999999;
67 m_version = -1;
68 m_numDedxHists = 0;
69 m_numBg = 0;
70 m_numTheta = 0;
71 m_dedx_hists = nullptr;
72 m_bgRange = nullptr;
73 return StatusCode::SUCCESS;
74}

The documentation for this class was generated from the following files: