1#include "TofRec/TofCheckData.h"
2#include "DstEvent/TofHitStatus.h"
5TofCheckData::TofCheckData( NTuple::Tuple*& trk, NTuple::Tuple*& cbtrk, NTuple::Tuple*& cetrk ):trk_tuple(trk),cbtrk_tuple(cbtrk),cetrk_tuple(cetrk) {
8 std::cerr<<
" Error: invalid pionter in TofCheckData(NTuple::Tuple*) for trk_tple"<<std::endl;
11 trk_tuple->addItem(
"run", trk_run );
12 trk_tuple->addItem(
"event", trk_event );
13 trk_tuple->addItem(
"toftrackid", trk_toftrackid );
14 trk_tuple->addItem(
"trackid", trk_trackid );
15 trk_tuple->addItem(
"charge", trk_charge );
16 trk_tuple->addItem(
"p", 5, trk_p );
17 trk_tuple->addItem(
"tofid", trk_tofid );
18 trk_tuple->addItem(
"raw", trk_raw );
19 trk_tuple->addItem(
"readout", trk_readout );
20 trk_tuple->addItem(
"counter", trk_counter );
21 trk_tuple->addItem(
"cluster", trk_cluster );
22 trk_tuple->addItem(
"barrel", trk_barrel );
23 trk_tuple->addItem(
"east", trk_east );
24 trk_tuple->addItem(
"layer", trk_layer );
25 trk_tuple->addItem(
"over", trk_overflow );
26 trk_tuple->addItem(
"cluster", trk_cluster );
27 trk_tuple->addItem(
"multihit", trk_multihit );
28 trk_tuple->addItem(
"ncounter", trk_ncounter );
29 trk_tuple->addItem(
"neast", trk_neast );
30 trk_tuple->addItem(
"nwest", trk_nwest );
31 trk_tuple->addItem(
"path", trk_path );
32 trk_tuple->addItem(
"zrhit", trk_zrhit );
33 trk_tuple->addItem(
"ph", trk_ph );
34 trk_tuple->addItem(
"tof", trk_tof );
35 trk_tuple->addItem(
"errtof", trk_errtof );
36 trk_tuple->addItem(
"beta", trk_beta );
37 trk_tuple->addItem(
"texpe", trk_texpe );
38 trk_tuple->addItem(
"texpmu", trk_texpmu );
39 trk_tuple->addItem(
"texppi", trk_texppi );
40 trk_tuple->addItem(
"texpk", trk_texpk );
41 trk_tuple->addItem(
"texpp", trk_texpp );
42 trk_tuple->addItem(
"offe", trk_offe );
43 trk_tuple->addItem(
"offmu", trk_offmu );
44 trk_tuple->addItem(
"offpi", trk_offpi );
45 trk_tuple->addItem(
"offk", trk_offk );
46 trk_tuple->addItem(
"offp", trk_offp );
47 trk_tuple->addItem(
"sige", trk_sige );
48 trk_tuple->addItem(
"sigmu", trk_sigmu );
49 trk_tuple->addItem(
"sigpi", trk_sigpi );
50 trk_tuple->addItem(
"sigk", trk_sigk );
51 trk_tuple->addItem(
"sigp", trk_sigp );
52 trk_tuple->addItem(
"qual", trk_quality );
53 trk_tuple->addItem(
"t0", trk_t0 );
54 trk_tuple->addItem(
"errt0", trk_errt0 );
55 trk_tuple->addItem(
"errz", trk_errz );
56 trk_tuple->addItem(
"phi", trk_phi );
57 trk_tuple->addItem(
"errphi", trk_errphi );
58 trk_tuple->addItem(
"e", trk_energy );
59 trk_tuple->addItem(
"erre", trk_errenergy );
63 std::cerr<<
" Error: invalid pionter in TofCheckData(NTuple::Tuple*) for cbtrk_tple"<<std::endl;
66 cbtrk_tuple->addItem(
"run", cbtrk_run );
67 cbtrk_tuple->addItem(
"event", cbtrk_event );
68 cbtrk_tuple->addItem(
"tofid", cbtrk_tofid );
69 cbtrk_tuple->addItem(
"qual", cbtrk_qual );
70 cbtrk_tuple->addItem(
"texp", cbtrk_texp );
71 cbtrk_tuple->addItem(
"tdc1", cbtrk_tdc1 );
72 cbtrk_tuple->addItem(
"tdc2", cbtrk_tdc2 );
73 cbtrk_tuple->addItem(
"adc1", cbtrk_adc1 );
74 cbtrk_tuple->addItem(
"adc2", cbtrk_adc2 );
75 cbtrk_tuple->addItem(
"zhit", cbtrk_zhit );
76 cbtrk_tuple->addItem(
"dzhit", cbtrk_dzhit );
77 cbtrk_tuple->addItem(
"sint", cbtrk_sintheta );
78 cbtrk_tuple->addItem(
"p", cbtrk_p );
79 cbtrk_tuple->addItem(
"q", cbtrk_q );
80 cbtrk_tuple->addItem(
"path", cbtrk_path );
84 std::cerr<<
" Error: invalid pionter in TofCheckData(NTuple::Tuple*) for cetrk_tple"<<std::endl;
87 cetrk_tuple->addItem(
"run", cetrk_run );
88 cetrk_tuple->addItem(
"event", cetrk_event );
89 cetrk_tuple->addItem(
"tofid", cetrk_tofid );
90 cetrk_tuple->addItem(
"qual", cetrk_qual );
91 cetrk_tuple->addItem(
"texp", cetrk_texp );
92 cetrk_tuple->addItem(
"tdc", cetrk_tdc );
93 cetrk_tuple->addItem(
"adc", cetrk_adc );
94 cetrk_tuple->addItem(
"rhit", cetrk_rhit );
95 cetrk_tuple->addItem(
"drhit", cetrk_drhit );
97 cetrk_tuple->addItem(
"p", cetrk_p );
98 cetrk_tuple->addItem(
"q", cetrk_q );
99 cetrk_tuple->addItem(
"path", cetrk_path );
110 double kappa = kalTrack->
kappa();
111 if( kappa>0 ) { charge = 1; }
112 else { charge = -1; }
113 if(
abs(kappa)<1.0e-6 ) { kappa = 1.0e-6; }
114 p[0] =
abs(sqrt( 1.0 + kalTrack->
tanl()*kalTrack->
tanl() ) / kappa);
116 kappa = kalTrack->
kappa();
117 if(
abs(kappa)<1.0e-6 ) { kappa = 1.0e-6; }
118 p[1] =
abs(sqrt( 1.0 + kalTrack->
tanl()*kalTrack->
tanl() ) / kappa );
120 kappa = kalTrack->
kappa();
121 if(
abs(kappa)<1.0e-6 ) { kappa = 1.0e-6; }
122 p[2] =
abs(sqrt( 1.0 + kalTrack->
tanl()*kalTrack->
tanl() ) / kappa );
124 kappa = kalTrack->
kappa();
125 if(
abs(kappa)<1.0e-6 ) { kappa = 1.0e-6; }
126 p[3] =
abs(sqrt( 1.0 + kalTrack->
tanl()*kalTrack->
tanl() ) / kappa );
128 kappa = kalTrack->
kappa();
129 if(
abs(kappa)<1.0e-6 ) { kappa = 1.0e-6; }
130 p[4] =
abs(sqrt( 1.0 + kalTrack->
tanl()*kalTrack->
tanl() ) / kappa );
135 trk_trackid = recTof->
trackID();
137 for(
unsigned int i=0; i<5; i++ ) {
140 trk_tofid = recTof->
tofID();
143 trk_raw = hitStatus->
is_raw();
148 trk_east = hitStatus->
is_east();
149 trk_layer = hitStatus->
layer();
152 trk_ncounter = hitStatus->
ncounter();
153 trk_neast = hitStatus->
neast();
154 trk_nwest = hitStatus->
nwest();
156 trk_path = recTof->
path();
157 trk_zrhit = recTof->
zrhit();
158 trk_ph = recTof->
ph();
159 trk_tof = recTof->
tof();
160 trk_errtof = recTof->
errtof();
161 trk_beta = recTof->
beta();
177 trk_quality = recTof->
quality();
178 trk_t0 = recTof->
t0();
179 trk_errt0 = recTof->
errt0();
180 trk_errz = recTof->
errz();
181 trk_phi = recTof->
phi();
182 trk_errphi = recTof->
errphi();
183 trk_energy = recTof->
energy();
194 cbtrk_tofid = recBTof->
mod();
195 cbtrk_qual = recBTof->
qual();
196 cbtrk_texp = recBTof->
tpred(1);
197 cbtrk_tdc1 = recBTof->
tdc1();
198 cbtrk_tdc2 = recBTof->
tdc2();
199 cbtrk_adc1 = recBTof->
adc1();
200 cbtrk_adc2 = recBTof->
adc2();
201 cbtrk_zhit = recBTof->
zHit();
202 cbtrk_dzhit = recBTof->
dzHit();
203 cbtrk_sintheta = recBTof->
sinTheta();
204 cbtrk_p = recBTof->
p();
205 cbtrk_q = recBTof->
Q();
206 cbtrk_path = recBTof->
path();
207 cbtrk_tuple->write();
216 cetrk_tofid = recETof->
mod();
217 cetrk_qual = recETof->
qual();
218 cetrk_texp = recETof->
tpred(1);
219 cetrk_tdc = recETof->
tdc();
220 cetrk_adc = recETof->
adc();
221 cetrk_rhit = recETof->
rHit();
222 cetrk_drhit = recETof->
drHit();
224 cetrk_p = recETof->
p();
225 cetrk_q = recETof->
Q();
226 cetrk_path = recETof->
path();
227 cetrk_tuple->write();
233 RecTofTrackCol::iterator iter_tof = recTofTrackCol.begin();
234 for( ; iter_tof!=recTofTrackCol.end(); iter_tof++ ) {
235 RecMdcKalTrackCol::iterator iter_kal = kalTrackCol.begin();
236 for( ; iter_kal!=kalTrackCol.end(); iter_kal++ ) {
237 if( (*iter_tof)->trackID() == (*iter_kal)->trackId() )
break;
239 Fill( eventHeader, *iter_tof, *iter_kal, iter_kal!=kalTrackCol.end() );
245 RecBTofCalHitCol::iterator iter_btof = recBTofCalHitCol.begin();
246 for( ; iter_btof!=recBTofCalHitCol.end(); iter_btof++ ) {
247 Fill( eventHeader, *iter_btof );
253 RecETofCalHitCol::iterator iter_etof = recETofCalHitCol.begin();
254 for( ; iter_etof!=recETofCalHitCol.end(); iter_etof++ ) {
255 Fill( eventHeader, *iter_etof );
double abs(const EvtComplex &c)
ObjectVector< RecMdcKalTrack > RecMdcKalTrackCol
ObjectVector< RecBTofCalHit > RecBTofCalHitCol
ObjectVector< RecETofCalHit > RecETofCalHitCol
ObjectVector< RecTofTrack > RecTofTrackCol
const double tanl(void) const
static void setPidType(PidType pidType)
const double kappa(void) const
double texpProton() const
double toffsetProton() const
unsigned int status() const
double texpElectron() const
double toffsetMuon() const
double sigmaElectron() const
double toffsetElectron() const
double toffsetKaon() const
double toffsetPion() const
double sigmaProton() const
TofCheckData(NTuple::Tuple *&trk, NTuple::Tuple *&cbtrk, NTuple::Tuple *&cetrk)
void FillCol(Event::EventHeader &, RecTofTrackCol &, RecMdcKalTrackCol &)
void Fill(Event::EventHeader &, RecTofTrack *&, RecMdcKalTrack *&, bool)
unsigned int ncounter() const
unsigned int layer() const
void setStatus(unsigned int status)
unsigned int nwest() const
unsigned int neast() const