BOSS 8.0.0
BESIII Offline Software System
Loading...
Searching...
No Matches
ValidRecTofTrackAlg.cxx
Go to the documentation of this file.
2#include "GaudiKernel/IHistogramSvc.h"
3#include "GaudiKernel/MsgStream.h"
4#include "GaudiKernel/SmartDataPtr.h"
5
6#include "DstEvent/TofHitStatus.h"
7#include "TofRecEvent/RecTofTrack.h"
8
10ValidRecTofTrackAlg::ValidRecTofTrackAlg( const std::string& name, ISvcLocator* pSvcLocator )
11 : Algorithm( name, pSvcLocator ) {}
12
14 MsgStream log( msgSvc(), name() );
15 log << MSG::INFO << "ValidRecTofTrackAlg initialize !" << endmsg;
16
17 NTuplePtr nt1( ntupleSvc(), "FILE201/tof" );
18 if ( nt1 ) m_tuple_tof = nt1;
19 else
20 {
21 m_tuple_tof =
22 ntupleSvc()->book( "FILE201/tof", CLID_ColumnWiseTuple, "Validation of TOF" );
23 if ( m_tuple_tof )
24 {
25 m_tuple_tof->addItem( "run", m_run );
26 m_tuple_tof->addItem( "evt", m_event );
27 m_tuple_tof->addItem( "toftrk", m_tofTrackID );
28 m_tuple_tof->addItem( "trk", m_trackID );
29 m_tuple_tof->addItem( "tofid", m_tofID );
30 m_tuple_tof->addItem( "status", m_status );
31 m_tuple_tof->addItem( "raw", m_raw );
32 m_tuple_tof->addItem( "readout", m_readout );
33 m_tuple_tof->addItem( "counter", m_counter );
34 m_tuple_tof->addItem( "cluster", m_cluster );
35 m_tuple_tof->addItem( "barrel", m_barrel );
36 m_tuple_tof->addItem( "east", m_east );
37 m_tuple_tof->addItem( "layer", m_layer );
38 m_tuple_tof->addItem( "ncounter", m_ncounter );
39 m_tuple_tof->addItem( "neast", m_neast );
40 m_tuple_tof->addItem( "nwest", m_nwest );
41 m_tuple_tof->addItem( "path", m_path );
42 m_tuple_tof->addItem( "zrhit", m_zrhit );
43 m_tuple_tof->addItem( "ph", m_ph );
44 m_tuple_tof->addItem( "tof", m_tof );
45 m_tuple_tof->addItem( "etof", m_errtof );
46 m_tuple_tof->addItem( "beta", m_beta );
47 m_tuple_tof->addItem( "texpe", m_texpe );
48 m_tuple_tof->addItem( "texpmu", m_texpmu );
49 m_tuple_tof->addItem( "texppi", m_texppi );
50 m_tuple_tof->addItem( "texpk", m_texpk );
51 m_tuple_tof->addItem( "texpp", m_texpp );
52 m_tuple_tof->addItem( "toffe", m_toffe );
53 m_tuple_tof->addItem( "toffmu", m_toffmu );
54 m_tuple_tof->addItem( "toffpi", m_toffpi );
55 m_tuple_tof->addItem( "toffk", m_toffk );
56 m_tuple_tof->addItem( "toffp", m_toffp );
57 m_tuple_tof->addItem( "toffpb", m_toffpb );
58 m_tuple_tof->addItem( "sige", m_sigmae );
59 m_tuple_tof->addItem( "sigmu", m_sigmamu );
60 m_tuple_tof->addItem( "sigpi", m_sigmapi );
61 m_tuple_tof->addItem( "sigk", m_sigmak );
62 m_tuple_tof->addItem( "sigp", m_sigmap );
63 m_tuple_tof->addItem( "sigpb", m_sigmapb );
64 m_tuple_tof->addItem( "qual", m_quality );
65 m_tuple_tof->addItem( "t0", m_t0 );
66 m_tuple_tof->addItem( "et0", m_errt0 );
67 m_tuple_tof->addItem( "ez", m_errz );
68 m_tuple_tof->addItem( "phi", m_phi );
69 m_tuple_tof->addItem( "ephi", m_errphi );
70 m_tuple_tof->addItem( "e", m_energy );
71 m_tuple_tof->addItem( "ee", m_errenergy );
72 }
73 }
74
75 log << MSG::INFO << "Finish ValidRecTofTrackAlg initialize!" << endmsg;
76 return StatusCode::SUCCESS;
77}
78
80 MsgStream log( msgSvc(), name() );
81 SmartDataPtr<RecTofTrackCol> tofTracks( eventSvc(), "/Event/Recon/RecTofTrackCol" );
82 if ( !tofTracks )
83 {
84 log << MSG::ERROR << "Unable to retrieve RecTofTrackCol" << endmsg;
85 return StatusCode::FAILURE;
86 }
87 else
88 {
89 log << MSG::DEBUG << "RecTofTrackCol retrieved of size " << tofTracks->size() << endmsg;
90 for ( RecTofTrackCol::iterator it = tofTracks->begin(); it != tofTracks->end(); it++ )
91 {
92 m_run = 0.0;
93 m_event = 0.0;
94 m_tofTrackID = ( *it )->tofTrackID();
95 m_trackID = ( *it )->trackID();
96 m_tofID = ( *it )->tofID();
97 unsigned int status = ( *it )->status();
98 TofHitStatus* tofhits = new TofHitStatus;
99 tofhits->setStatus( status );
100 m_status = ( *it )->status();
101 m_raw = tofhits->is_raw();
102 m_readout = tofhits->is_readout();
103 m_counter = tofhits->is_counter();
104 m_cluster = tofhits->is_cluster();
105 m_barrel = tofhits->is_barrel();
106 m_east = tofhits->is_east();
107 m_layer = tofhits->layer();
108 m_ncounter = tofhits->ncounter();
109 m_neast = tofhits->neast();
110 m_nwest = tofhits->nwest();
111 delete tofhits;
112 m_path = ( *it )->path();
113 m_zrhit = ( *it )->zrhit();
114 m_ph = ( *it )->ph();
115 m_tof = ( *it )->tof();
116 m_errtof = ( *it )->errtof();
117 m_beta = ( *it )->beta();
118 m_texpe = ( *it )->texpElectron();
119 m_texpmu = ( *it )->texpMuon();
120 m_texppi = ( *it )->texpPion();
121 m_texpk = ( *it )->texpKaon();
122 m_texpp = ( *it )->texpProton();
123 m_toffe = ( *it )->toffsetElectron();
124 m_toffmu = ( *it )->toffsetMuon();
125 m_toffpi = ( *it )->toffsetPion();
126 m_toffk = ( *it )->toffsetKaon();
127 m_toffp = ( *it )->toffsetProton();
128 m_toffpb = ( *it )->toffsetAntiProton();
129 m_sigmae = ( *it )->sigmaElectron();
130 m_sigmamu = ( *it )->sigmaMuon();
131 m_sigmapi = ( *it )->sigmaPion();
132 m_sigmak = ( *it )->sigmaKaon();
133 m_sigmap = ( *it )->sigmaProton();
134 m_sigmapb = ( *it )->sigmaAntiProton();
135 m_quality = ( *it )->quality();
136 m_t0 = ( *it )->t0();
137 m_errt0 = ( *it )->errt0();
138 m_errz = ( *it )->errz();
139 m_phi = ( *it )->phi();
140 m_errphi = ( *it )->errphi();
141 m_energy = ( *it )->energy();
142 m_errenergy = ( *it )->errenergy();
143
144 m_tuple_tof->write();
145 }
146 }
147 return StatusCode::SUCCESS;
148}
149
151 MsgStream log( msgSvc(), name() );
152 log << MSG::INFO << "Finalizing..." << endmsg;
153 return StatusCode::SUCCESS;
154}
DECLARE_COMPONENT(BesBdkRc)
INTupleSvc * ntupleSvc()
IMessageSvc * msgSvc()
void setStatus(unsigned int status)
ValidRecTofTrackAlg(const std::string &name, ISvcLocator *pSvcLocator)