24 #include <TPolyMarker.h>
29 #include <TGeoVolume.h>
30 #include <TGeoManager.h>
32 #include <TGComboBox.h>
34 #include <TGButtonGroup.h>
35 #include <TGTextEntry.h>
42 extern JApplication *
japp;
65 TGLayoutHints *hints =
new TGLayoutHints(kLHintsNormal|kLHintsExpandX|kLHintsExpandY|kLHintsLeft, 5,5,5,5);
66 TGLayoutHints *lhints =
new TGLayoutHints(kLHintsNormal, 2,2,2,2);
67 TGLayoutHints *chints =
new TGLayoutHints(kLHintsCenterY|kLHintsCenterX, 2,2,2,2);
68 TGLayoutHints *xhints =
new TGLayoutHints(kLHintsNormal|kLHintsExpandX, 2,2,2,2);
70 topframe =
new TGHorizontalFrame(
this, 800, 500);
71 mid1frame =
new TGHorizontalFrame(
this, 800, 500);
72 mid2frame =
new TGHorizontalFrame(
this, 800, 500);
73 botframe =
new TGHorizontalFrame(
this, 400, 50);
85 for (
int k=0;k<10;k++){
87 sprintf(str1,
"Candidate%d",k+1);
90 sprintf(str2,
"Hits Track Candidate %d",k+1);
92 sprintf(str2,
"Hits Track Candidate %d",k+1);
94 sprintf(str2,
".......................");
101 TGGroupFrame *
trackinfo =
new TGGroupFrame(
topframe,
" trk: type: p: theta: phi: z: ", kHorizontalFrame);
102 topframe->AddFrame(trackinfo, hints);
104 vector<string> colnames;
105 colnames.push_back(
"trk");
106 colnames.push_back(
"type");
107 colnames.push_back(
"p");
108 colnames.push_back(
"theta");
109 colnames.push_back(
"phi");
110 colnames.push_back(
"z");
112 for(
unsigned int i=0; i<colnames.size(); i++){
114 tf[colnames[i]] =
new TGVerticalFrame(trackinfo);
115 trackinfo->AddFrame(
tf[colnames[i]], xhints);
122 for (
int k=0;k<10;k++){
123 TGLabel *lab =
new TGLabel(
tf[colnames[i]],
"-----");
124 tf[colnames[i]]->AddFrame(lab, chints);
130 for (
int k=0;k<10;k++){
133 stringstream trkno, type, p, theta, phi, z;
134 trkno<<setprecision(4)<<k+1;
135 candlabs[
"trk"][k]->SetText(trkno.str().c_str());
137 double mass = trk->
mass();
138 if(fabs(mass-0.13957)<1.0E-4)type<<
"pi";
139 else if(fabs(mass-0.93827)<1.0E-4)type<<
"proton";
140 else if(fabs(mass-0.493677)<1.0E-4)type<<
"K";
141 else if(fabs(mass-0.000511)<1.0E-4)type<<
"e";
142 else if (fabs(mass)<1.
e-4 && fabs(trk->
charge())<1.
e-4) type <<
"gamma";
144 if (fabs(trk->
charge())>1.
e-4){
145 type<<(trk->
charge()>0 ?
"+":
"-");
148 candlabs[
"type"][row]->SetText(type.str().c_str());
150 p<<setprecision(3)<<fixed<<trk->
momentum().Mag();
151 candlabs[
"p"][row]->SetText(p.str().c_str());
153 theta<<setprecision(2)<<fixed<<trk->
momentum().Theta()*TMath::RadToDeg();
154 candlabs[
"theta"][row]->SetText(theta.str().c_str());
156 double myphi = trk->
momentum().Phi();
157 if(myphi<0.0)myphi+=2.0*M_PI;
158 phi<<setprecision(2)<<fixed<<myphi;
159 candlabs[
"phi"][row]->SetText(phi.str().c_str());
161 z<<setprecision(2)<<fixed<<trk->
position().Z();
162 candlabs[
"z"][row]->SetText(z.str().c_str());
165 candlabs[
"trk"][row]->SetText(
"------");
166 candlabs[
"type"][row]->SetText(
"------");
167 candlabs[
"p"][row]->SetText(
"------");
168 candlabs[
"theta"][row]->SetText(
"------");
169 candlabs[
"phi"][row]->SetText(
"------");
170 candlabs[
"z"][row]->SetText(
"------");
178 trackinfoWB =
new TGGroupFrame(
mid1frame,
" trk: type: p: theta: phi: z: chisq/Ndof: Ndof: cand:",
187 trackinfoTB =
new TGGroupFrame(
mid2frame,
" trk: type: p: theta: phi: z: chisq/Ndof: Ndof: cand:",
198 map<string, TGCheckButton*>::iterator iter =
checkbuttons.begin();
200 iter->second->Connect(
"Clicked()",
"hdv_mainframe", hdvmf,
"DoMyRedraw()");
207 SetWindowName(
"Hall-D Event Viewer Debugger");
208 SetIconName(
"HDView");
210 done->Connect(
"Clicked()",
"hdv_debugerframe",
this,
"DoDone()");
211 this->Connect(
"CloseWindow()",
"hdv_debuggerframe",
this,
"DoDone()");
212 this->DontCallClose();
214 SetWindowName(
"Hall-D Event View Debugger");
215 SetIconName(
"HDDebugView");
218 Resize(GetDefaultSize());
239 for (
int k=0;k<10;k++){
241 sprintf(str1,
"Candidate%d",k+1);
244 sprintf(str2,
"Hits Track Candidate %d",k+1);
246 sprintf(str2,
"Hits Track Candidate %d",k+1);
248 sprintf(str2,
".......................");
253 for (
int k=0;k<10;k++){
257 stringstream trkno, type, p, theta, phi, z;
258 trkno<<setprecision(4)<<k+1;
260 candlabs[
"trk"][row]->SetText(trkno.str().c_str());
262 double mass = trk->
mass();
263 if(fabs(mass-0.13957)<1.0E-4)type<<
"pi";
264 else if(fabs(mass-0.93827)<1.0E-4)type<<
"proton";
265 else if(fabs(mass-0.493677)<1.0E-4)type<<
"K";
266 else if(fabs(mass-0.000511)<1.0E-4)type<<
"e";
267 else if (fabs(mass)<1.
e-4 && fabs(trk->
charge())<1.
e-4) type <<
"gamma";
269 if (fabs(trk->
charge())>1.
e-4){
270 type<<(trk->
charge()>0 ?
"+":
"-");
272 candlabs[
"type"][row]->SetText(type.str().c_str());
274 p<<setprecision(3)<<fixed<<trk->
momentum().Mag();
275 candlabs[
"p"][row]->SetText(p.str().c_str());
277 theta<<setprecision(2)<<fixed<<trk->
momentum().Theta()*TMath::RadToDeg();
278 candlabs[
"theta"][row]->SetText(theta.str().c_str());
280 double myphi = trk->
momentum().Phi();
281 if(myphi<0.0)myphi+=2.0*M_PI;
282 phi<<setprecision(2)<<fixed<<myphi;
283 candlabs[
"phi"][row]->SetText(phi.str().c_str());
285 z<<setprecision(2)<<fixed<<trk->
position().Z();
286 candlabs[
"z"][row]->SetText(z.str().c_str());
289 candlabs[
"trk"][row]->SetText(
"------");
290 candlabs[
"type"][row]->SetText(
"------");
291 candlabs[
"p"][row]->SetText(
"------");
292 candlabs[
"theta"][row]->SetText(
"------");
293 candlabs[
"phi"][row]->SetText(
"------");
294 candlabs[
"z"][row]->SetText(
"------");
301 map<string, TGCheckButton*>::iterator iter =
checkbuttons.begin();
303 iter->second->Connect(
"Clicked()",
"hdv_mainframe",
hdvmf,
"DoMyRedraw()");
307 Resize(GetDefaultSize());
318 TGLayoutHints *lhints =
new TGLayoutHints(kLHintsNormal, 2,2,2,2);
319 TGLayoutHints *xhints =
new TGLayoutHints(kLHintsNormal|kLHintsExpandX, 2,2,2,2);
320 TGLayoutHints *chints =
new TGLayoutHints(kLHintsCenterY|kLHintsCenterX, 2,2,2,2);
325 sprintf(str1,
"WireBased%d",k+1);
329 sprintf(str2,
"Hits Wire Based Track %d",k+1);
331 sprintf(str2,
"Hits Wire Based Track %d",k+1);
334 sprintf(str2,
".......................");
345 vector<string> colnamesw;
346 colnamesw.push_back(
"trk");
347 colnamesw.push_back(
"type");
348 colnamesw.push_back(
"p");
349 colnamesw.push_back(
"theta");
350 colnamesw.push_back(
"phi");
351 colnamesw.push_back(
"z");
352 colnamesw.push_back(
"chisq/Ndof");
353 colnamesw.push_back(
"Ndof");
354 colnamesw.push_back(
"cand");
356 for(
unsigned int i=0; i<colnamesw.size(); i++){
367 TGLabel *lab =
new TGLabel(
tfWB[colnamesw[i]],
"-----");
368 tfWB[colnamesw[i]]->AddFrame(lab, chints);
371 wblabs[colnamesw[i]] = tv;
382 stringstream trkno, type, p, theta, phi, z, chisq_per_dof, Ndof, cand;
383 trkno<<setprecision(4)<<k+1;
386 wblabs[
"trk"][row]->SetText(trkno.str().c_str());
388 double mass = trk->
mass();
389 if(fabs(mass-0.13957)<1.0E-4)type<<
"pi";
390 else if(fabs(mass-0.93827)<1.0E-4)type<<
"proton";
391 else if(fabs(mass-0.493677)<1.0E-4)type<<
"K";
392 else if(fabs(mass-0.000511)<1.0E-4)type<<
"e";
393 else if (fabs(mass)<1.
e-4 && fabs(trk->
charge())<1.
e-4) type <<
"gamma";
395 if (fabs(trk->
charge())>1.
e-4){
396 type<<(trk->
charge()>0 ?
"+":
"-");
399 wblabs[
"type"][row]->SetText(type.str().c_str());
401 p<<setprecision(3)<<fixed<<trk->
momentum().Mag();
402 wblabs[
"p"][row]->SetText(p.str().c_str());
404 theta<<setprecision(2)<<fixed<<trk->
momentum().Theta()*TMath::RadToDeg();
405 wblabs[
"theta"][row]->SetText(theta.str().c_str());
407 double myphi = trk->
momentum().Phi();
408 if(myphi<0.0)myphi+=2.0*M_PI;
409 phi<<setprecision(2)<<fixed<<myphi;
410 wblabs[
"phi"][row]->SetText(phi.str().c_str());
412 z<<setprecision(2)<<fixed<<trk->
position().Z();
413 wblabs[
"z"][row]->SetText(z.str().c_str());
415 chisq_per_dof<<setprecision(1)<<fixed<<trk->
chisq/trk->
Ndof;
419 wblabs[
"chisq/Ndof"][row]->SetText(chisq_per_dof.str().c_str());
420 wblabs[
"Ndof"][row]->SetText(Ndof.str().c_str());
421 wblabs[
"cand"][row]->SetText(cand.str().c_str());
424 wblabs[
"trk"][k]->SetText(
"-----");
425 wblabs[
"type"][k]->SetText(
"-----");
426 wblabs[
"p"][k]->SetText(
"-----");
427 wblabs[
"theta"][k]->SetText(
"-----");
428 wblabs[
"phi"][k]->SetText(
"-----");
429 wblabs[
"z"][k]->SetText(
"-----");
430 wblabs[
"chisq/Ndof"][k]->SetText(
"-----");
431 wblabs[
"Ndof"][k]->SetText(
"-----");
432 wblabs[
"cand"][k]->SetText(
"-----");
446 TGLayoutHints *lhints =
new TGLayoutHints(kLHintsNormal, 2,2,2,2);
447 TGLayoutHints *xhints =
new TGLayoutHints(kLHintsNormal|kLHintsExpandX, 2,2,2,2);
448 TGLayoutHints *chints =
new TGLayoutHints(kLHintsCenterY|kLHintsCenterX, 2,2,2,2);
453 sprintf(str1,
"TimeBased%d",k+1);
457 sprintf(str2,
"Hits Time Based Track %d",k+1);
459 sprintf(str2,
"Hits Time Based Track %d",k+1);
462 sprintf(str2,
".......................");
473 vector<string> colnamesw;
474 colnamesw.push_back(
"trk");
475 colnamesw.push_back(
"type");
476 colnamesw.push_back(
"p");
477 colnamesw.push_back(
"theta");
478 colnamesw.push_back(
"phi");
479 colnamesw.push_back(
"z");
480 colnamesw.push_back(
"chisq/Ndof");
481 colnamesw.push_back(
"Ndof");
482 colnamesw.push_back(
"cand");
484 for(
unsigned int i=0; i<colnamesw.size(); i++){
495 TGLabel *lab =
new TGLabel(
tfTB[colnamesw[i]],
"-----");
496 tfTB[colnamesw[i]]->AddFrame(lab, chints);
499 tblabs[colnamesw[i]] = tv;
510 stringstream trkno, type, p, theta, phi, z, chisq_per_dof, Ndof, cand;
511 trkno<<setprecision(4)<<k+1;
514 tblabs[
"trk"][row]->SetText(trkno.str().c_str());
516 double mass = trk->
mass();
517 if(fabs(mass-0.13957)<1.0E-4)type<<
"pi";
518 else if(fabs(mass-0.93827)<1.0E-4)type<<
"proton";
519 else if(fabs(mass-0.493677)<1.0E-4)type<<
"K";
520 else if(fabs(mass-0.000511)<1.0E-4)type<<
"e";
521 else if (fabs(mass)<1.
e-4 && fabs(trk->
charge())<1.
e-4) type <<
"gamma";
523 if (fabs(trk->
charge())>1.
e-4){
524 type<<(trk->
charge()>0 ?
"+":
"-");
527 tblabs[
"type"][row]->SetText(type.str().c_str());
529 p<<setprecision(3)<<fixed<<trk->
momentum().Mag();
530 tblabs[
"p"][row]->SetText(p.str().c_str());
532 theta<<setprecision(2)<<fixed<<trk->
momentum().Theta()*TMath::RadToDeg();
533 tblabs[
"theta"][row]->SetText(theta.str().c_str());
535 double myphi = trk->
momentum().Phi();
536 if(myphi<0.0)myphi+=2.0*M_PI;
537 phi<<setprecision(2)<<fixed<<myphi;
538 tblabs[
"phi"][row]->SetText(phi.str().c_str());
540 z<<setprecision(2)<<fixed<<trk->
position().Z();
541 tblabs[
"z"][row]->SetText(z.str().c_str());
543 chisq_per_dof<<setprecision(1)<<fixed<<trk->
chisq/trk->
Ndof;
547 tblabs[
"chisq/Ndof"][row]->SetText(chisq_per_dof.str().c_str());
548 tblabs[
"Ndof"][row]->SetText(Ndof.str().c_str());
549 tblabs[
"cand"][row]->SetText(cand.str().c_str());
552 tblabs[
"trk"][k]->SetText(
"-----");
553 tblabs[
"type"][k]->SetText(
"-----");
554 tblabs[
"p"][k]->SetText(
"-----");
555 tblabs[
"theta"][k]->SetText(
"-----");
556 tblabs[
"phi"][k]->SetText(
"-----");
557 tblabs[
"z"][k]->SetText(
"-----");
558 tblabs[
"chisq/Ndof"][k]->SetText(
"-----");
559 tblabs[
"Ndof"][k]->SetText(
"-----");
560 tblabs[
"cand"][k]->SetText(
"-----");
map< string, vector< TGLabel * > > tblabs
float chisq
Chi-squared for the track (not chisq/dof!)
map< string, TGCheckButton * > checkbuttons
float chisq
Chi-squared for the track (not chisq/dof!)
vector< const DTrackTimeBased * > subTrackTimeBased
sprintf(text,"Post KinFit Cut")
hdv_debugerframe(hdv_mainframe *hdvmf, const TGWindow *p, UInt_t w, UInt_t h)
const DVector3 & position(void) const
TGGroupFrame * hitdrawoptsTB
map< string, TGVerticalFrame * > tf
oid_t candidateid
id of DTrackCandidate corresponding to this track
TGGroupFrame * trackinfoTB
TGGroupFrame * hitdrawopts
TGGroupFrame * hitdrawoptsWB
map< string, vector< TGLabel * > > candlabs
vector< const DKinematicData * > TrackCandidates
map< string, TGVerticalFrame * > tfTB
TGHorizontalFrame * mid2frame
TGHorizontalFrame * mid1frame
TGGroupFrame * trackinfoWB
int Ndof
Number of degrees of freedom in the fit.
double charge(void) const
vector< const DTrackWireBased * > subTrackWireBased
TGHorizontalFrame * topframe
int Ndof
Number of degrees of freedom in the fit.
const DVector3 & momentum(void) const
TGHorizontalFrame * botframe
map< string, TGVerticalFrame * > tfWB
oid_t candidateid
which DTrackCandidate this came from
map< string, vector< TGLabel * > > wblabs
void AddCheckButtons(map< string, TGCheckButton * > &checkbuttons)