BOSS 7.0.9
BESIII Offline Software System
Loading...
Searching...
No Matches
ValidRecTofTrackAlg.cxx
Go to the documentation of this file.
2#include "GaudiKernel/MsgStream.h"
3#include "GaudiKernel/SmartDataPtr.h"
4#include "GaudiKernel/IHistogramSvc.h"
5
8
9
10ValidRecTofTrackAlg::ValidRecTofTrackAlg(const std::string& name, ISvcLocator* pSvcLocator) : Algorithm(name, pSvcLocator) { }
11
13 MsgStream log( msgSvc(), name() );
14 log << MSG::INFO << "ValidRecTofTrackAlg initialize !" << endreq;
15
16 NTuplePtr nt1(ntupleSvc(),"FILE201/tof");
17 if ( nt1 ) m_tuple_tof = nt1;
18 else {
19 m_tuple_tof=ntupleSvc()->book("FILE201/tof",CLID_ColumnWiseTuple,"Validation of TOF" );
20 if( m_tuple_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 );
68 }
69 }
70
71 log << MSG::INFO << "Finish ValidRecTofTrackAlg initialize!" << endreq;
72 return StatusCode::SUCCESS;
73}
74
75
77 MsgStream log(msgSvc(), name());
78 SmartDataPtr<RecTofTrackCol> tofTracks(eventSvc(),"/Event/Recon/RecTofTrackCol");
79 if( ! tofTracks ) {
80 log << MSG::ERROR << "Unable to retrieve RecTofTrackCol" << endreq;
81 return StatusCode::FAILURE;
82 }
83 else {
84 log << MSG::DEBUG << "RecTofTrackCol retrieved of size "<< tofTracks->size() << endreq;
85 for(RecTofTrackCol::iterator it=tofTracks->begin(); it!=tofTracks->end(); it++) {
86 m_run = 0.0;
87 m_event = 0.0;
88 m_tofTrackID = (*it)->tofTrackID();
89 m_trackID = (*it)->trackID();
90 m_tofID = (*it)->tofID();
91 unsigned int status = (*it)->status();
92 TofHitStatus* tofhits = new TofHitStatus;
93 tofhits->setStatus( status );
94 m_status = (*it)->status();
95 m_raw = tofhits->is_raw();
96 m_readout = tofhits->is_readout();
97 m_counter = tofhits->is_counter();
98 m_cluster = tofhits->is_cluster();
99 m_barrel = tofhits->is_barrel();
100 m_east = tofhits->is_east();
101 m_layer = tofhits->layer();
102 m_ncounter = tofhits->ncounter();
103 m_neast = tofhits->neast();
104 m_nwest = tofhits->nwest();
105 delete tofhits;
106 m_path = (*it)->path();
107 m_zrhit = (*it)->zrhit();
108 m_ph = (*it)->ph();
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();
130 m_t0 = (*it)->t0();
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();
137
138 m_tuple_tof->write();
139 }
140 }
141 return StatusCode::SUCCESS;
142}
143
144
146 MsgStream log(msgSvc(), name());
147 log << MSG::INFO << "Finalizing..." << endreq;
148 return StatusCode::SUCCESS;
149}
INTupleSvc * ntupleSvc()
IMessageSvc * msgSvc()
bool is_barrel() const
Definition: TofHitStatus.h:26
unsigned int ncounter() const
Definition: TofHitStatus.h:31
unsigned int layer() const
Definition: TofHitStatus.h:28
bool is_cluster() const
Definition: TofHitStatus.h:25
void setStatus(unsigned int status)
unsigned int nwest() const
Definition: TofHitStatus.h:33
bool is_counter() const
Definition: TofHitStatus.h:24
bool is_east() const
Definition: TofHitStatus.h:27
bool is_readout() const
Definition: TofHitStatus.h:23
unsigned int neast() const
Definition: TofHitStatus.h:32
bool is_raw() const
Definition: TofHitStatus.h:22
ValidRecTofTrackAlg(const std::string &name, ISvcLocator *pSvcLocator)