| 267 |
// Software infos |
// Software infos |
| 268 |
// |
// |
| 269 |
fshowsi = new TGTextButton(hframedec[9], "Show Data"); |
fshowsi = new TGTextButton(hframedec[9], "Show Data"); |
| 270 |
fshowsi->Connect("Clicked()","PAMevcontrol", this,"showorbdata()"); |
fshowsi->Connect("Clicked()","PAMevcontrol", this,"showsidata()"); |
| 271 |
if ( !cvar->RUN ) fshoworb->SetState(kButtonDisabled); |
if ( !cvar->RUN ) fshoworb->SetState(kButtonDisabled); |
| 272 |
hframedec[9]->AddFrame(fshoworb, new TGLayoutHints(kLHintsTop | kLHintsLeft | kLHintsCenterY|kLHintsExpandX,5,2,5,5)); |
hframedec[9]->AddFrame(fshoworb, new TGLayoutHints(kLHintsTop | kLHintsLeft | kLHintsCenterY|kLHintsExpandX,5,2,5,5)); |
| 273 |
// |
// |
| 274 |
// All data |
// All data |
| 275 |
// |
// |
| 276 |
fshowall = new TGTextButton(hframedec[10], "Show Data"); |
fshowall = new TGTextButton(hframedec[10], "Show Data"); |
| 277 |
fshowall->Connect("Clicked()","PAMevcontrol", this,"showorbdata()"); |
fshowall->Connect("Clicked()","PAMevcontrol", this,"showalldata()"); |
| 278 |
hframedec[10]->AddFrame(fshowall, new TGLayoutHints(kLHintsTop | kLHintsLeft | kLHintsCenterY|kLHintsExpandX,5,5,5,5)); |
hframedec[10]->AddFrame(fshowall, new TGLayoutHints(kLHintsTop | kLHintsLeft | kLHintsCenterY|kLHintsExpandX,5,5,5,5)); |
| 279 |
// |
// |
| 280 |
// for (Int_t fr=0; fr<11; fr++) gf->AddFrame(hframedec[fr], new TGLayoutHints(kLHintsTop | kLHintsLeft | kLHintsCenterY|kLHintsExpandX,1,1,1,1)); |
// for (Int_t fr=0; fr<11; fr++) gf->AddFrame(hframedec[fr], new TGLayoutHints(kLHintsTop | kLHintsLeft | kLHintsCenterY|kLHintsExpandX,1,1,1,1)); |
| 443 |
|
|
| 444 |
void PAMevcontrol::DIALOG(Int_t ty, TString warn){ |
void PAMevcontrol::DIALOG(Int_t ty, TString warn){ |
| 445 |
// |
// |
| 446 |
// ty = 0 -> INFO, ty = 1 -> WARNING, ty = 3 -> ERROR |
// ty = 0 -> INFO, ty = 1 -> WARNING, ty = 2 -> ERROR |
| 447 |
// |
// |
| 448 |
Int_t retval; |
Int_t retval; |
| 449 |
TString title; |
TString title; |
| 476 |
|
|
| 477 |
|
|
| 478 |
void PAMevcontrol::showorbdata(){ |
void PAMevcontrol::showorbdata(){ |
| 479 |
printf("orb \n"); |
cvar->showorb = !cvar->showorb; |
| 480 |
|
if ( !cvar->showorb ) fshoworb->SetText("Show Data"); |
| 481 |
|
if ( cvar->showorb ) fshoworb->SetText("Hide Data"); |
| 482 |
|
// printf("orb \n"); |
| 483 |
}; |
}; |
| 484 |
|
|
| 485 |
void PAMevcontrol::showtrgdata(){ |
void PAMevcontrol::showtrgdata(){ |
| 486 |
printf("trg \n"); |
cvar->showtrg = !cvar->showtrg; |
| 487 |
|
if ( !cvar->showtrg ) fshowtrg->SetText("Show Data"); |
| 488 |
|
if ( cvar->showtrg ) fshowtrg->SetText("Hide Data"); |
| 489 |
|
// printf("trg \n"); |
| 490 |
}; |
}; |
| 491 |
|
|
| 492 |
void PAMevcontrol::showrundata(){ |
void PAMevcontrol::showrundata(){ |
| 493 |
printf("run \n"); |
cvar->showrun = !cvar->showrun; |
| 494 |
|
if ( !cvar->showrun ) fshowrun->SetText("Show Data"); |
| 495 |
|
if ( cvar->showrun ) fshowrun->SetText("Hide Data"); |
| 496 |
|
// printf("run \n"); |
| 497 |
}; |
}; |
| 498 |
|
|
| 499 |
void PAMevcontrol::showcaldata(){ |
void PAMevcontrol::showcaldata(){ |
| 500 |
printf("cal \n"); |
cvar->showcal = !cvar->showcal; |
| 501 |
|
if ( !cvar->showcal ) fshowcal->SetText("Show Data"); |
| 502 |
|
if ( cvar->showcal ) fshowcal->SetText("Hide Data"); |
| 503 |
|
// printf("cal \n"); |
| 504 |
}; |
}; |
| 505 |
|
|
| 506 |
void PAMevcontrol::chkcalost(){ |
void PAMevcontrol::chkcalost(){ |
| 517 |
}; |
}; |
| 518 |
|
|
| 519 |
void PAMevcontrol::showtrkdata(){ |
void PAMevcontrol::showtrkdata(){ |
| 520 |
printf("trk \n"); |
cvar->showtrk = !cvar->showtrk; |
| 521 |
|
if ( !cvar->showtrk ) fshowtrk->SetText("Show Data"); |
| 522 |
|
if ( cvar->showtrk ) fshowtrk->SetText("Hide Data"); |
| 523 |
|
// printf("trk \n"); |
| 524 |
}; |
}; |
| 525 |
|
|
| 526 |
void PAMevcontrol::showtofdata(){ |
void PAMevcontrol::showtofdata(){ |
| 527 |
printf("tof \n"); |
cvar->showtof = !cvar->showtof; |
| 528 |
|
if ( !cvar->showtof ) fshowtof->SetText("Show Data"); |
| 529 |
|
if ( cvar->showtof ) fshowtof->SetText("Hide Data"); |
| 530 |
|
// printf("tof \n"); |
| 531 |
}; |
}; |
| 532 |
|
|
| 533 |
void PAMevcontrol::showacdata(){ |
void PAMevcontrol::showacdata(){ |
| 534 |
printf("ac \n"); |
cvar->showac = !cvar->showac; |
| 535 |
|
if ( !cvar->showac ) fshowac->SetText("Show Data"); |
| 536 |
|
if ( cvar->showac ) fshowac->SetText("Hide Data"); |
| 537 |
|
// printf("ac \n"); |
| 538 |
}; |
}; |
| 539 |
|
|
| 540 |
void PAMevcontrol::shownddata(){ |
void PAMevcontrol::shownddata(){ |
| 541 |
printf("nd \n"); |
cvar->shownd = !cvar->shownd; |
| 542 |
|
if ( !cvar->shownd ) fshownd->SetText("Show Data"); |
| 543 |
|
if ( cvar->shownd ) fshownd->SetText("Hide Data"); |
| 544 |
|
// printf("nd \n"); |
| 545 |
}; |
}; |
| 546 |
|
|
| 547 |
void PAMevcontrol::shows4data(){ |
void PAMevcontrol::shows4data(){ |
| 548 |
printf("s4 \n"); |
cvar->shows4 = !cvar->shows4; |
| 549 |
|
if ( !cvar->shows4 ) fshows4->SetText("Show Data"); |
| 550 |
|
if ( cvar->shows4 ) fshows4->SetText("Hide Data"); |
| 551 |
|
// printf("s4 \n"); |
| 552 |
}; |
}; |
| 553 |
|
|
| 554 |
void PAMevcontrol::showsidata(){ |
void PAMevcontrol::showsidata(){ |
| 555 |
printf("si \n"); |
cvar->showsi = !cvar->showsi; |
| 556 |
|
if ( !cvar->showsi ) fshowsi->SetText("Show Data"); |
| 557 |
|
if ( cvar->showsi ) fshowsi->SetText("Hide Data"); |
| 558 |
|
// printf("si \n"); |
| 559 |
}; |
}; |
| 560 |
|
|
| 561 |
void PAMevcontrol::showalldata(){ |
void PAMevcontrol::showalldata(){ |
| 562 |
printf("all \n"); |
cvar->showall = !cvar->showall; |
| 563 |
|
if ( !cvar->showall ) fshowall->SetText("Show Data"); |
| 564 |
|
if ( cvar->showall ) fshowall->SetText("Hide Data"); |
| 565 |
|
// printf("all \n"); |
| 566 |
}; |
}; |
| 567 |
|
|
| 568 |
void PAMevcontrol::SetFilename() { |
void PAMevcontrol::SetFilename() { |
| 569 |
TGTextEntry *entry = (TGTextEntry*)gTQSender; |
TGTextEntry *entry = (TGTextEntry*)gTQSender; |
| 570 |
TString text = entry->GetText(); |
TString text = entry->GetText(); |
| 571 |
cvar->thefilename=text.Data(); |
cvar->thefilename=text.Data(); |
| 572 |
|
cvar->i = 0; |
| 573 |
cvar->nevents = 0; |
cvar->nevents = 0; |
| 574 |
cvar->firstevno = 0; |
cvar->firstevno = 0; |
| 575 |
cvar->lastevno = 0; |
cvar->lastevno = 0; |
| 602 |
cout<<"PSW "<<psw<<endl; |
cout<<"PSW "<<psw<<endl; |
| 603 |
cout<<"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"<<endl; |
cout<<"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"<<endl; |
| 604 |
TSQLServer *dbc = TSQLServer::Connect(host.Data(),user.Data(),psw.Data()); |
TSQLServer *dbc = TSQLServer::Connect(host.Data(),user.Data(),psw.Data()); |
| 605 |
|
// |
| 606 |
|
TSQLResult *pResult; |
| 607 |
|
TSQLRow *Row; |
| 608 |
|
// |
| 609 |
if( dbc && dbc->IsConnected() ){ |
if( dbc && dbc->IsConnected() ){ |
| 610 |
// |
// |
| 611 |
// Starting from level2 |
// Retrieve the file |
| 612 |
// |
// |
| 613 |
if ( clev->file == 2 ){ |
if ( clev->file == 2 ){ |
| 614 |
|
// |
| 615 |
|
// Starting from level2 |
| 616 |
|
// |
| 617 |
GL_ROOT glroot = GL_ROOT(); |
GL_ROOT glroot = GL_ROOT(); |
| 618 |
if( !glroot.Query_GL_ROOT(cvar->idroot,dbc) ){ |
if( !glroot.Query_GL_ROOT(cvar->idroot,dbc) ){ |
| 619 |
// |
// |
| 632 |
cvar->thefilter=""; |
cvar->thefilter=""; |
| 633 |
cvar->selex = true; |
cvar->selex = true; |
| 634 |
}; |
}; |
| 635 |
cvar->i = -(cvar->EVF + cvar->i -1); |
cvar->i = cvar->EVF + cvar->i ; |
| 636 |
//cvar->refresh = true; |
//cvar->refresh = true; |
| 637 |
// cvar->file = 0; |
// cvar->file = 0; |
| 638 |
// |
// |
| 639 |
} else { |
} else { |
| 640 |
stringstream warning; |
stringstream warning; |
| 641 |
warning.str(""); |
warning.str(""); |
| 642 |
warning << " Problems getting Level0 file "; |
warning << " Problems getting Level0 file "; |
| 643 |
DIALOG(2,warning.str().c_str()); |
DIALOG(2,warning.str().c_str()); |
| 644 |
}; |
}; |
| 645 |
} else { |
} else { |
| 646 |
// |
// |
| 647 |
// starting from L0 |
// starting from L0 |
| 648 |
// |
// |
| 649 |
stringstream warning; |
stringstream query; |
| 650 |
warning.str(""); |
query.str(""); |
| 651 |
warning << " Not yet implemented "; |
query << " SELECT ID FROM GL_ROOT WHERE NAME='"<< gSystem->BaseName(cvar->thefilename.Data()) <<"' order by INSERT_TIME desc limit 1;"; |
| 652 |
DIALOG(2,warning.str().c_str()); |
// printf(" query is %s \n",query.str().c_str()); |
| 653 |
|
pResult = dbc->Query(query.str().c_str()); |
| 654 |
|
Row = pResult->Next(); |
| 655 |
|
UInt_t idrl0 = 0; |
| 656 |
|
if ( Row ){ |
| 657 |
|
idrl0 = (UInt_t)atoll(Row->GetField(0)); |
| 658 |
|
}; |
| 659 |
|
// |
| 660 |
|
query.str(""); |
| 661 |
|
query << " SELECT ID,ID_ROOT_L2,EV_FROM FROM GL_RUN WHERE EV_FROM<="<<cvar->i<<" AND EV_TO>="<< cvar->i<<" AND ID_ROOT_L0="<< idrl0 <<";"; |
| 662 |
|
// printf(" query is %s \n",query.str().c_str()); |
| 663 |
|
pResult = dbc->Query(query.str().c_str()); |
| 664 |
|
Row = pResult->Next(); |
| 665 |
|
UInt_t idrl2 = 0; |
| 666 |
|
UInt_t idrlun = 0; |
| 667 |
|
UInt_t evfrom = 0; |
| 668 |
|
if ( Row ){ |
| 669 |
|
idrlun = (UInt_t)atoll(Row->GetField(0)); |
| 670 |
|
idrl2 = (UInt_t)atoll(Row->GetField(1)); |
| 671 |
|
evfrom = (UInt_t)atoll(Row->GetField(2)); |
| 672 |
|
}; |
| 673 |
|
// |
| 674 |
|
query.str(""); |
| 675 |
|
query << " SELECT ID,NEVENTS FROM GL_RUN WHERE ID_ROOT_L2="<< idrl2 <<" order by RUNHEADER_TIME asc;"; |
| 676 |
|
// printf(" query is %s \n",query.str().c_str()); |
| 677 |
|
pResult = dbc->Query(query.str().c_str()); |
| 678 |
|
Row = pResult->Next(); |
| 679 |
|
UInt_t coren = 0; |
| 680 |
|
while ( Row ){ |
| 681 |
|
if ( (UInt_t)atoll(Row->GetField(0)) == idrlun ) break; |
| 682 |
|
coren += (UInt_t)atoll(Row->GetField(1)); |
| 683 |
|
Row = pResult->Next(); |
| 684 |
|
}; |
| 685 |
|
coren += cvar->i - evfrom; |
| 686 |
|
// |
| 687 |
|
GL_ROOT glroot = GL_ROOT(); |
| 688 |
|
if( !glroot.Query_GL_ROOT(idrl2,dbc) ){ |
| 689 |
|
// |
| 690 |
|
cvar->i = coren; |
| 691 |
|
// |
| 692 |
|
cvar->thefilename= glroot.PATH + glroot.NAME; |
| 693 |
|
cvar->nevents = 0; |
| 694 |
|
cvar->firstevno = 0; |
| 695 |
|
cvar->lastevno = 0; |
| 696 |
|
if ( cvar->fl0 ) { |
| 697 |
|
cvar->fl0 = false; |
| 698 |
|
ffl0->SetState(kButtonUp); |
| 699 |
|
}; |
| 700 |
|
cvar->restart = true; |
| 701 |
|
cvar->waitforever = false; |
| 702 |
|
// |
| 703 |
|
if ( cvar->thefilter != "" ){ |
| 704 |
|
cvar->thefilter=""; |
| 705 |
|
cvar->selex = true; |
| 706 |
|
}; |
| 707 |
|
// |
| 708 |
|
} else { |
| 709 |
|
stringstream warning; |
| 710 |
|
warning.str(""); |
| 711 |
|
warning << " Problems getting Level2 file "; |
| 712 |
|
DIALOG(2,warning.str().c_str()); |
| 713 |
|
}; |
| 714 |
|
// stringstream warning; |
| 715 |
|
// warning.str(""); |
| 716 |
|
// warning << " Not yet implemented "; |
| 717 |
|
// DIALOG(2,warning.str().c_str()); |
| 718 |
}; |
}; |
| 719 |
// |
// |
| 720 |
} else { |
} else { |
| 742 |
ffl0->SetState(kButtonDown); |
ffl0->SetState(kButtonDown); |
| 743 |
}; |
}; |
| 744 |
}; |
}; |
| 745 |
|
if ( clev->file == 2 ){ |
| 746 |
|
fgetl0->SetText("Get L0 file"); |
| 747 |
|
} else { |
| 748 |
|
fgetl0->SetText("Get L2 file"); |
| 749 |
|
}; |
| 750 |
} |
} |
| 751 |
|
|
| 752 |
void PAMevcontrol::SetSearching() { |
void PAMevcontrol::SetSearching() { |
| 760 |
void PAMevcontrol::RefreshButtons() { |
void PAMevcontrol::RefreshButtons() { |
| 761 |
if ( cvar->jumprog ){ |
if ( cvar->jumprog ){ |
| 762 |
jbwc1->SetState(kButtonDown); |
jbwc1->SetState(kButtonDown); |
| 763 |
|
jbwc0->SetState(kButtonUp); |
| 764 |
} else { |
} else { |
| 765 |
|
jbwc1->SetState(kButtonUp); |
| 766 |
jbwc0->SetState(kButtonDown); |
jbwc0->SetState(kButtonDown); |
| 767 |
}; |
}; |
| 768 |
if ( cvar->fl0 ){ |
if ( cvar->fl0 ){ |
| 773 |
// if ( cvar->tracknds4) ftrks4->SetState(kButtonDown); |
// if ( cvar->tracknds4) ftrks4->SetState(kButtonDown); |
| 774 |
if ( cvar->bw ){ |
if ( cvar->bw ){ |
| 775 |
bwc1->SetState(kButtonDown); |
bwc1->SetState(kButtonDown); |
| 776 |
|
bwc0->SetState(kButtonUp); |
| 777 |
} else { |
} else { |
| 778 |
bwc0->SetState(kButtonDown); |
bwc0->SetState(kButtonDown); |
| 779 |
|
bwc1->SetState(kButtonUp); |
| 780 |
}; |
}; |
| 781 |
if ( cvar->PALETTE) fchkpalette->SetState(kButtonDown); else fchkpalette->SetState(kButtonUp); |
if ( cvar->PALETTE) fchkpalette->SetState(kButtonDown); else fchkpalette->SetState(kButtonUp); |
| 782 |
if ( cvar->VINFOS ) fchknames->SetState(kButtonDown); else fchknames->SetState(kButtonUp); |
if ( cvar->VINFOS ) fchknames->SetState(kButtonDown); else fchknames->SetState(kButtonUp); |
| 1016 |
} |
} |
| 1017 |
|
|
| 1018 |
void PAMevcontrol::forcel0() { |
void PAMevcontrol::forcel0() { |
| 1019 |
if ( cvar->fl0 ) { |
cvar->fl0 = !cvar->fl0; |
| 1020 |
cvar->fl0 = false; |
cvar->alrforc = false; |
| 1021 |
} else { |
cvar->i--; |
| 1022 |
cvar->fl0 = true; |
cvar->nevents = 0; |
| 1023 |
}; |
cvar->firstevno = 0; |
| 1024 |
cvar->alrforc = false; |
cvar->lastevno = 0; |
| 1025 |
cvar->i--; |
cvar->refresh = true; |
|
cvar->nevents = 0; |
|
|
cvar->firstevno = 0; |
|
|
cvar->lastevno = 0; |
|
|
cvar->refresh = true; |
|
| 1026 |
} |
} |
| 1027 |
|
|
| 1028 |
void PAMevcontrol::clearselfi(){ |
void PAMevcontrol::clearselfi(){ |