1#include "TofRec/TofCheckData.h"
2#include "DstEvent/TofHitStatus.h"
5TofCheckData::TofCheckData( NTuple::Tuple*& trk, NTuple::Tuple*& cbtrk, NTuple::Tuple*& cetrk, NTuple::Tuple*& cetftrk ):trk_tuple(trk),cbtrk_tuple(cbtrk),cetrk_tuple(cetrk),cetftrk_tuple(cetftrk) {
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(
"strip", trk_strip );
19 trk_tuple->addItem(
"raw", trk_raw );
20 trk_tuple->addItem(
"readout", trk_readout );
21 trk_tuple->addItem(
"counter", trk_counter );
22 trk_tuple->addItem(
"cluster", trk_cluster );
23 trk_tuple->addItem(
"barrel", trk_barrel );
24 trk_tuple->addItem(
"east", trk_east );
25 trk_tuple->addItem(
"layer", trk_layer );
26 trk_tuple->addItem(
"over", trk_overflow );
27 trk_tuple->addItem(
"cluster", trk_cluster );
28 trk_tuple->addItem(
"multihit", trk_multihit );
29 trk_tuple->addItem(
"ncounter", trk_ncounter );
30 trk_tuple->addItem(
"neast", trk_neast );
31 trk_tuple->addItem(
"nwest", trk_nwest );
32 trk_tuple->addItem(
"mrpc", trk_mrpc );
33 trk_tuple->addItem(
"path", trk_path );
34 trk_tuple->addItem(
"zrhit", trk_zrhit );
35 trk_tuple->addItem(
"ph", trk_ph );
36 trk_tuple->addItem(
"tof", trk_tof );
37 trk_tuple->addItem(
"errtof", trk_errtof );
38 trk_tuple->addItem(
"beta", trk_beta );
39 trk_tuple->addItem(
"texpe", trk_texpe );
40 trk_tuple->addItem(
"texpmu", trk_texpmu );
41 trk_tuple->addItem(
"texppi", trk_texppi );
42 trk_tuple->addItem(
"texpk", trk_texpk );
43 trk_tuple->addItem(
"texpp", trk_texpp );
44 trk_tuple->addItem(
"offe", trk_offe );
45 trk_tuple->addItem(
"offmu", trk_offmu );
46 trk_tuple->addItem(
"offpi", trk_offpi );
47 trk_tuple->addItem(
"offk", trk_offk );
48 trk_tuple->addItem(
"offp", trk_offp );
49 trk_tuple->addItem(
"sige", trk_sige );
50 trk_tuple->addItem(
"sigmu", trk_sigmu );
51 trk_tuple->addItem(
"sigpi", trk_sigpi );
52 trk_tuple->addItem(
"sigk", trk_sigk );
53 trk_tuple->addItem(
"sigp", trk_sigp );
54 trk_tuple->addItem(
"qual", trk_quality );
55 trk_tuple->addItem(
"t0", trk_t0 );
56 trk_tuple->addItem(
"errt0", trk_errt0 );
57 trk_tuple->addItem(
"errz", trk_errz );
58 trk_tuple->addItem(
"phi", trk_phi );
59 trk_tuple->addItem(
"errphi", trk_errphi );
60 trk_tuple->addItem(
"e", trk_energy );
61 trk_tuple->addItem(
"erre", trk_errenergy );
65 std::cerr<<
" Error: invalid pionter in TofCheckData(NTuple::Tuple*) for cbtrk_tple"<<std::endl;
68 cbtrk_tuple->addItem(
"run", cbtrk_run );
69 cbtrk_tuple->addItem(
"event", cbtrk_event );
70 cbtrk_tuple->addItem(
"tofid", cbtrk_tofid );
71 cbtrk_tuple->addItem(
"qual", cbtrk_qual );
72 cbtrk_tuple->addItem(
"texp", cbtrk_texp );
73 cbtrk_tuple->addItem(
"tdc1", cbtrk_tdc1 );
74 cbtrk_tuple->addItem(
"tdc2", cbtrk_tdc2 );
75 cbtrk_tuple->addItem(
"adc1", cbtrk_adc1 );
76 cbtrk_tuple->addItem(
"adc2", cbtrk_adc2 );
77 cbtrk_tuple->addItem(
"zhit", cbtrk_zhit );
78 cbtrk_tuple->addItem(
"dzhit", cbtrk_dzhit );
79 cbtrk_tuple->addItem(
"sint", cbtrk_sintheta );
80 cbtrk_tuple->addItem(
"p", cbtrk_p );
81 cbtrk_tuple->addItem(
"q", cbtrk_q );
82 cbtrk_tuple->addItem(
"path", cbtrk_path );
86 std::cerr<<
" Error: invalid pionter in TofCheckData(NTuple::Tuple*) for cetrk_tple"<<std::endl;
89 cetrk_tuple->addItem(
"run", cetrk_run );
90 cetrk_tuple->addItem(
"event", cetrk_event );
91 cetrk_tuple->addItem(
"tofid", cetrk_tofid );
92 cetrk_tuple->addItem(
"qual", cetrk_qual );
93 cetrk_tuple->addItem(
"texp", cetrk_texp );
94 cetrk_tuple->addItem(
"tdc", cetrk_tdc );
95 cetrk_tuple->addItem(
"adc", cetrk_adc );
96 cetrk_tuple->addItem(
"rhit", cetrk_rhit );
97 cetrk_tuple->addItem(
"drhit", cetrk_drhit );
99 cetrk_tuple->addItem(
"p", cetrk_p );
100 cetrk_tuple->addItem(
"q", cetrk_q );
101 cetrk_tuple->addItem(
"path", cetrk_path );
105 std::cerr<<
" Error: invalid pionter in TofCheckData(NTuple::Tuple*) for cetftrk_tple"<<std::endl;
108 cetftrk_tuple->addItem(
"run", cetftrk_run );
109 cetftrk_tuple->addItem(
"event", cetftrk_event );
110 cetftrk_tuple->addItem(
"tofid", cetftrk_tofid );
111 cetftrk_tuple->addItem(
"qual", cetftrk_qual );
112 cetftrk_tuple->addItem(
"texp", cetftrk_texp );
113 cetftrk_tuple->addItem(
"tdc1", cetftrk_tdc1 );
114 cetftrk_tuple->addItem(
"tdc2", cetftrk_tdc2 );
115 cetftrk_tuple->addItem(
"adc1", cetftrk_adc1 );
116 cetftrk_tuple->addItem(
"adc2", cetftrk_adc2 );
117 cetftrk_tuple->addItem(
"zhit", cetftrk_zhit );
118 cetftrk_tuple->addItem(
"dzhit", cetftrk_dzhit );
119 cetftrk_tuple->addItem(
"sint", cetftrk_sintheta );
120 cetftrk_tuple->addItem(
"p", cetftrk_p );
121 cetftrk_tuple->addItem(
"q", cetftrk_q );
122 cetftrk_tuple->addItem(
"path", cetftrk_path );
133 double kappa = kalTrack->
kappa();
134 if( kappa>0 ) {
charge = 1; }
136 if(
abs(kappa)<1.0e-6 ) { kappa = 1.0e-6; }
137 p[0] =
abs(sqrt( 1.0 + kalTrack->
tanl()*kalTrack->
tanl() ) / kappa);
139 kappa = kalTrack->
kappa();
140 if(
abs(kappa)<1.0e-6 ) { kappa = 1.0e-6; }
141 p[1] =
abs(sqrt( 1.0 + kalTrack->
tanl()*kalTrack->
tanl() ) / kappa );
143 kappa = kalTrack->
kappa();
144 if(
abs(kappa)<1.0e-6 ) { kappa = 1.0e-6; }
145 p[2] =
abs(sqrt( 1.0 + kalTrack->
tanl()*kalTrack->
tanl() ) / kappa );
147 kappa = kalTrack->
kappa();
148 if(
abs(kappa)<1.0e-6 ) { kappa = 1.0e-6; }
149 p[3] =
abs(sqrt( 1.0 + kalTrack->
tanl()*kalTrack->
tanl() ) / kappa );
151 kappa = kalTrack->
kappa();
152 if(
abs(kappa)<1.0e-6 ) { kappa = 1.0e-6; }
153 p[4] =
abs(sqrt( 1.0 + kalTrack->
tanl()*kalTrack->
tanl() ) / kappa );
158 trk_trackid = recTof->
trackID();
160 for(
unsigned int i=0; i<5; i++ ) {
163 trk_tofid = recTof->
tofID();
164 trk_strip = recTof->
strip();
167 trk_raw = hitStatus->
is_raw();
172 trk_east = hitStatus->
is_east();
173 trk_layer = hitStatus->
layer();
176 trk_ncounter = hitStatus->
ncounter();
177 trk_neast = hitStatus->
neast();
178 trk_nwest = hitStatus->
nwest();
179 trk_mrpc = hitStatus->
is_mrpc();
189 trk_path = recTof->
path();
190 trk_zrhit = recTof->
zrhit();
191 trk_ph = recTof->
ph();
192 trk_tof = recTof->
tof();
193 trk_errtof = recTof->
errtof();
194 trk_beta = recTof->
beta();
210 trk_quality = recTof->
quality();
211 trk_t0 = recTof->
t0();
212 trk_errt0 = recTof->
errt0();
213 trk_errz = recTof->
errz();
214 trk_phi = recTof->
phi();
215 trk_errphi = recTof->
errphi();
216 trk_energy = recTof->
energy();
227 cbtrk_tofid = recBTof->
mod();
228 cbtrk_qual = recBTof->
qual();
229 cbtrk_texp = recBTof->
tpred(1);
230 cbtrk_tdc1 = recBTof->
tdc1();
231 cbtrk_tdc2 = recBTof->
tdc2();
232 cbtrk_adc1 = recBTof->
adc1();
233 cbtrk_adc2 = recBTof->
adc2();
234 cbtrk_zhit = recBTof->
zHit();
235 cbtrk_dzhit = recBTof->
dzHit();
236 cbtrk_sintheta = recBTof->
sinTheta();
237 cbtrk_p = recBTof->
p();
238 cbtrk_q = recBTof->
Q();
239 cbtrk_path = recBTof->
path();
240 cbtrk_tuple->write();
249 cetrk_tofid = recETof->
mod();
250 cetrk_qual = recETof->
qual();
251 cetrk_texp = recETof->
tpred(1);
252 cetrk_tdc = recETof->
tdc();
253 cetrk_adc = recETof->
adc();
254 cetrk_rhit = recETof->
rHit();
255 cetrk_drhit = recETof->
drHit();
257 cetrk_p = recETof->
p();
258 cetrk_q = recETof->
Q();
259 cetrk_path = recETof->
path();
260 cetrk_tuple->write();
268 cetftrk_tofid = recBTof->
mod();
269 cetftrk_qual = recBTof->
qual();
270 cetftrk_texp = recBTof->
tpred(1);
271 cetftrk_tdc1 = recBTof->
tdc1();
272 cetftrk_tdc2 = recBTof->
tdc2();
273 cetftrk_adc1 = recBTof->
adc1();
274 cetftrk_adc2 = recBTof->
adc2();
275 cetftrk_zhit = recBTof->
zHit();
276 cetftrk_dzhit = recBTof->
dzHit();
277 cetftrk_sintheta = recBTof->
sinTheta();
278 cetftrk_p = recBTof->
p();
279 cetftrk_q = recBTof->
Q();
280 cetftrk_path = recBTof->
path();
281 cetftrk_tuple->write();
287 RecTofTrackCol::iterator iter_tof = recTofTrackCol.begin();
288 for( ; iter_tof!=recTofTrackCol.end(); iter_tof++ ) {
289 RecMdcKalTrackCol::iterator iter_kal = kalTrackCol.begin();
290 for( ; iter_kal!=kalTrackCol.end(); iter_kal++ ) {
291 if( (*iter_tof)->trackID() == (*iter_kal)->trackId() )
break;
293 Fill( eventHeader, *iter_tof, *iter_kal, iter_kal!=kalTrackCol.end() );
299 RecBTofCalHitCol::iterator iter_btof = recBTofCalHitCol.begin();
300 for( ; iter_btof!=recBTofCalHitCol.end(); iter_btof++ ) {
301 if( fabs( (*iter_btof)->dzHit() - 1.0 )<1.0e-6 ) {
305 FillETF( eventHeader, *iter_btof );
312 RecETofCalHitCol::iterator iter_etof = recETofCalHitCol.begin();
313 for( ; iter_etof!=recETofCalHitCol.end(); iter_etof++ ) {
314 Fill( eventHeader, *iter_etof );
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
void FillCol(Event::EventHeader &, RecTofTrackCol &, RecMdcKalTrackCol &)
void Fill(Event::EventHeader &, RecTofTrack *&, RecMdcKalTrack *&, bool)
TofCheckData(NTuple::Tuple *&trk, NTuple::Tuple *&cbtrk, NTuple::Tuple *&cetrk, NTuple::Tuple *&cetftrk)
void FillETF(Event::EventHeader &, RecBTofCalHit *&)
void FillBarrel(Event::EventHeader &, RecBTofCalHit *&)
unsigned int ncounter() const
unsigned int layer() const
void setStatus(unsigned int status)
unsigned int nwest() const
unsigned int neast() const