1#include "ValidRecTofTrack/ValidRecTofTrackAlg.h"
2#include "GaudiKernel/MsgStream.h"
3#include "GaudiKernel/SmartDataPtr.h"
4#include "GaudiKernel/IHistogramSvc.h"
6#include "TofRecEvent/RecTofTrack.h"
7#include "DstEvent/TofHitStatus.h"
13 MsgStream log(
msgSvc(), name() );
14 log << MSG::INFO <<
"ValidRecTofTrackAlg initialize !" << endreq;
17 if ( nt1 ) m_tuple_tof = nt1;
19 m_tuple_tof=
ntupleSvc()->book(
"FILE201/tof",CLID_ColumnWiseTuple,
"Validation of TOF" );
21 m_tuple_tof->addItem(
"run", m_run );
22 m_tuple_tof->addItem(
"evt", m_event );
23 m_tuple_tof->addItem(
"toftrk", m_tofTrackID );
24 m_tuple_tof->addItem(
"trk", m_trackID );
25 m_tuple_tof->addItem(
"tofid", m_tofID );
26 m_tuple_tof->addItem(
"status", m_status );
27 m_tuple_tof->addItem(
"raw", m_raw );
28 m_tuple_tof->addItem(
"readout", m_readout );
29 m_tuple_tof->addItem(
"counter", m_counter );
30 m_tuple_tof->addItem(
"cluster", m_cluster );
31 m_tuple_tof->addItem(
"barrel", m_barrel );
32 m_tuple_tof->addItem(
"east", m_east );
33 m_tuple_tof->addItem(
"layer", m_layer );
34 m_tuple_tof->addItem(
"ncounter",m_ncounter );
35 m_tuple_tof->addItem(
"neast", m_neast );
36 m_tuple_tof->addItem(
"nwest", m_nwest );
37 m_tuple_tof->addItem(
"path", m_path );
38 m_tuple_tof->addItem(
"zrhit", m_zrhit );
39 m_tuple_tof->addItem(
"ph", m_ph );
40 m_tuple_tof->addItem(
"tof", m_tof );
41 m_tuple_tof->addItem(
"etof", m_errtof );
42 m_tuple_tof->addItem(
"beta", m_beta );
43 m_tuple_tof->addItem(
"texpe", m_texpe );
44 m_tuple_tof->addItem(
"texpmu", m_texpmu );
45 m_tuple_tof->addItem(
"texppi", m_texppi );
46 m_tuple_tof->addItem(
"texpk", m_texpk );
47 m_tuple_tof->addItem(
"texpp", m_texpp );
48 m_tuple_tof->addItem(
"toffe", m_toffe );
49 m_tuple_tof->addItem(
"toffmu", m_toffmu );
50 m_tuple_tof->addItem(
"toffpi", m_toffpi );
51 m_tuple_tof->addItem(
"toffk", m_toffk );
52 m_tuple_tof->addItem(
"toffp", m_toffp );
53 m_tuple_tof->addItem(
"toffpb", m_toffpb );
54 m_tuple_tof->addItem(
"sige", m_sigmae );
55 m_tuple_tof->addItem(
"sigmu", m_sigmamu );
56 m_tuple_tof->addItem(
"sigpi", m_sigmapi );
57 m_tuple_tof->addItem(
"sigk", m_sigmak );
58 m_tuple_tof->addItem(
"sigp", m_sigmap );
59 m_tuple_tof->addItem(
"sigpb", m_sigmapb );
60 m_tuple_tof->addItem(
"qual", m_quality );
61 m_tuple_tof->addItem(
"t0", m_t0 );
62 m_tuple_tof->addItem(
"et0", m_errt0 );
63 m_tuple_tof->addItem(
"ez", m_errz );
64 m_tuple_tof->addItem(
"phi", m_phi );
65 m_tuple_tof->addItem(
"ephi", m_errphi );
66 m_tuple_tof->addItem(
"e", m_energy );
67 m_tuple_tof->addItem(
"ee", m_errenergy );
71 log << MSG::INFO <<
"Finish ValidRecTofTrackAlg initialize!" << endreq;
72 return StatusCode::SUCCESS;
77 MsgStream log(
msgSvc(), name());
78 SmartDataPtr<RecTofTrackCol> tofTracks(eventSvc(),
"/Event/Recon/RecTofTrackCol");
80 log << MSG::ERROR <<
"Unable to retrieve RecTofTrackCol" << endreq;
81 return StatusCode::FAILURE;
84 log << MSG::DEBUG <<
"RecTofTrackCol retrieved of size "<< tofTracks->size() << endreq;
85 for(RecTofTrackCol::iterator it=tofTracks->begin(); it!=tofTracks->end(); it++) {
88 m_tofTrackID = (*it)->tofTrackID();
89 m_trackID = (*it)->trackID();
90 m_tofID = (*it)->tofID();
91 unsigned int status = (*it)->status();
94 m_status = (*it)->status();
101 m_layer = tofhits->
layer();
103 m_neast = tofhits->
neast();
104 m_nwest = tofhits->
nwest();
106 m_path = (*it)->path();
107 m_zrhit = (*it)->zrhit();
109 m_tof = (*it)->tof();
110 m_errtof = (*it)->errtof();
111 m_beta = (*it)->beta();
112 m_texpe = (*it)->texpElectron();
113 m_texpmu = (*it)->texpMuon();
114 m_texppi = (*it)->texpPion();
115 m_texpk = (*it)->texpKaon();
116 m_texpp = (*it)->texpProton();
117 m_toffe = (*it)->toffsetElectron();
118 m_toffmu = (*it)->toffsetMuon();
119 m_toffpi = (*it)->toffsetPion();
120 m_toffk = (*it)->toffsetKaon();
121 m_toffp = (*it)->toffsetProton();
122 m_toffpb = (*it)->toffsetAntiProton();
123 m_sigmae = (*it)->sigmaElectron();
124 m_sigmamu = (*it)->sigmaMuon();
125 m_sigmapi = (*it)->sigmaPion();
126 m_sigmak = (*it)->sigmaKaon();
127 m_sigmap = (*it)->sigmaProton();
128 m_sigmapb = (*it)->sigmaAntiProton();
129 m_quality = (*it)->quality();
131 m_errt0 = (*it)->errt0();
132 m_errz = (*it)->errz();
133 m_phi = (*it)->phi();
134 m_errphi = (*it)->errphi();
135 m_energy = (*it)->energy();
136 m_errenergy = (*it)->errenergy();
138 m_tuple_tof->write();
141 return StatusCode::SUCCESS;
146 MsgStream log(
msgSvc(), name());
147 log << MSG::INFO <<
"Finalizing..." << endreq;
148 return StatusCode::SUCCESS;
unsigned int ncounter() const
unsigned int layer() const
void setStatus(unsigned int status)
unsigned int nwest() const
unsigned int neast() const
ValidRecTofTrackAlg(const std::string &name, ISvcLocator *pSvcLocator)