4#include "GaudiKernel/MsgStream.h"
5#include "GaudiKernel/AlgFactory.h"
6#include "GaudiKernel/ISvcLocator.h"
7#include "GaudiKernel/SmartDataPtr.h"
8#include "GaudiKernel/IDataProviderSvc.h"
9#include "GaudiKernel/PropertyMgr.h"
42extern NTuple::Item<long>
g_ntrk;
58extern IHistogram1D*
g_nhit;
65 Algorithm(name, pSvcLocator)
68 declareProperty(
"bunchtime", m_bunchtime_MC=8.0);
69 declareProperty(
"T0cal", m_mdc_tcal=200.0);
77 MsgStream log(
msgSvc(), name());
78 log << MSG::INFO <<
"in initialize()" << endreq;
82 if ( nt ) m_tuple = nt;
84 m_tuple=
ntupleSvc()->book(
"FILE102/n1",CLID_ColumnWiseTuple,
"MdcRecEvent");
87 m_tuple->addItem (
"NtrackMC",
g_ntrkMC,0,50);
94 m_tuple->addItem (
"Ntrack",
g_ntrk, 0, 50);
111 m_tuple->addItem (
"Testime",
g_estime);
114 log << MSG::ERROR <<
"Cannot book N-tuple:" << long(m_tuple) << endmsg;
128 g_hitmap[0] =
histoSvc()->book(
"hm0",
"2d hitmap1", 80, -80., 80., 80, -80., 80. );
129 g_hitmap[1] =
histoSvc()->book(
"hm1",
"2d hitmap2", 80, -80., 80., 80, -80., 80. );
130 g_hitmap[2] =
histoSvc()->book(
"hm2",
"2d hitmap3", 80, -80., 80., 80, -80., 80. );
131 g_hitmap[3] =
histoSvc()->book(
"hm3",
"2d hitmap4", 80, -80., 80., 80, -80., 80. );
132 g_hitmap[4] =
histoSvc()->book(
"hm4",
"2d hitmap5", 80, -80., 80., 80, -80., 80. );
133 g_hitmap[5] =
histoSvc()->book(
"hm5",
"2d hitmap6", 80, -80., 80., 80, -80., 80. );
134 g_hitmap[6] =
histoSvc()->book(
"hm6",
"2d hitmap7", 80, -80., 80., 80, -80., 80. );
135 g_hitmap[7] =
histoSvc()->book(
"hm7",
"2d hitmap8", 80, -80., 80., 80, -80., 80. );
136 g_hitmap[8] =
histoSvc()->book(
"hm8",
"2d hitmap9", 80, -80., 80., 80, -80., 80. );
137 g_hitmap[9] =
histoSvc()->book(
"hm9",
"2d hitmap10", 80, -80., 80., 80, -80., 80. );
138 g_hitmap[10] =
histoSvc()->book(
"hm10",
"2d hitmap11", 80, -80., 80., 80, -80., 80. );
174 StatusCode sc = service(
"BesTimerSvc", m_timersvc);
175 if( sc.isFailure() ) {
176 log << MSG::WARNING << name() <<
": Unable to locate BesTimer Service" << endreq;
177 return StatusCode::FAILURE;
180 m_timer[1] = m_timersvc->
addItem(
"Execution");
184 return StatusCode::SUCCESS;
190 MsgStream log(
msgSvc(), name());
191 log << MSG::DEBUG <<
"in execute()" << endreq;
207 StatusCode status = m_tuple->write();
208 if (!status.isSuccess()) {
209 log << MSG::ERROR <<
"Can't fill ntuple!" << endreq;
214 return StatusCode::SUCCESS;
220 MsgStream log(
msgSvc(), name());
221 log << MSG::INFO <<
"in finalize()" << endreq;
225 log << MSG::DEBUG <<
"num_2Dtrk: " <<
num_2Dtrk
232 return StatusCode::SUCCESS;
238 MsgStream log(
msgSvc(), name());
239 log << MSG::INFO <<
"in beginRun()" << endreq;
243 return StatusCode::SUCCESS;
IHistogram1D * g_nstereohit
NTuple::Array< float > g_pz
NTuple::Array< float > g_theta
NTuple::Array< float > g_pxMC
NTuple::Array< float > g_pzMC
NTuple::Array< float > g_pyMC
NTuple::Array< float > g_dr
IHistogram2D * g_hitmap[20]
NTuple::Array< float > g_kappa
NTuple::Item< long > g_eventNo
NTuple::Item< float > g_eventtime
NTuple::Array< float > g_ptMC
NTuple::Item< float > g_estime
NTuple::Array< float > g_dz
NTuple::Array< float > g_tanl
NTuple::Item< long > g_ntrk
NTuple::Item< long > g_ntrkMC
NTuple::Array< float > g_phi0MC
NTuple::Array< float > g_py
NTuple::Array< float > g_px
NTuple::Array< float > g_pt
NTuple::Array< float > g_p
NTuple::Array< float > g_phi0
NTuple::Array< float > g_vx
IHistogram1D * g_naxialhit
NTuple::Array< float > g_vy
NTuple::Array< float > g_theta0MC
NTuple::Array< float > g_vz
NTuple::Array< float > g_phi
IHistogramSvc * histoSvc()
void propName(std::string name)
float elapsed(void) const
void event()
track finder core
void init()
initializer(creates geometry)
void begin_run()
begin run function(reads constants)
void setT0cal(double t0cal)
set crude mdc time calibconst (~200 ns) for t0 calculation
void setAlgorithmPointer(Algorithm *)
returns FTFinder pointer
void setBunchtime(double bunchtime)
set bunchtime for MC events
virtual void print(void)=0
virtual BesTimer * addItem(const std::string &name)=0
IHistogram1D * g_nstereohit
NTuple::Array< float > g_pz
NTuple::Array< float > g_theta
NTuple::Array< float > g_pxMC
NTuple::Array< float > g_pzMC
NTuple::Array< float > g_pyMC
NTuple::Array< float > g_dr
IHistogram2D * g_hitmap[20]
NTuple::Array< float > g_kappa
NTuple::Item< long > g_eventNo
NTuple::Item< float > g_eventtime
NTuple::Array< float > g_ptMC
NTuple::Item< float > g_estime
NTuple::Array< float > g_dz
NTuple::Array< float > g_tanl
NTuple::Item< long > g_ntrk
NTuple::Item< long > g_ntrkMC
NTuple::Array< float > g_phi0MC
NTuple::Array< float > g_py
NTuple::Array< float > g_px
NTuple::Array< float > g_pt
NTuple::Array< float > g_p
NTuple::Array< float > g_phi0
NTuple::Array< float > g_vx
IHistogram1D * g_naxialhit
NTuple::Array< float > g_vy
NTuple::Array< float > g_theta0MC
NTuple::Array< float > g_vz
NTuple::Array< float > g_phi