| 46 |
#include <TArrow.h> |
#include <TArrow.h> |
| 47 |
#include <TStyle.h> |
#include <TStyle.h> |
| 48 |
// |
// |
| 49 |
|
#include <PamLevel2.h> |
| 50 |
|
// |
| 51 |
#include <FEVpamevcontrol.h> |
#include <FEVpamevcontrol.h> |
| 52 |
// |
// |
| 53 |
ClassImp(PAMevcontrol); |
ClassImp(PAMevcontrol); |
| 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)); |
| 310 |
}; |
}; |
| 311 |
bwc0->Connect("Pressed()", "PAMevcontrol",this,"radiocolor()"); |
bwc0->Connect("Pressed()", "PAMevcontrol",this,"radiocolor()"); |
| 312 |
bwc1->Connect("Pressed()", "PAMevcontrol",this,"radiobw()"); |
bwc1->Connect("Pressed()", "PAMevcontrol",this,"radiobw()"); |
| 313 |
hframe4->AddFrame(group,new TGLayoutHints(kLHintsTop | kLHintsLeft | kLHintsCenterY|kLHintsExpandX,1,5,5,5)); |
hframe4->AddFrame(group,new TGLayoutHints(kLHintsTop | kLHintsLeft | kLHintsCenterY|kLHintsExpandX,5,2,5,5)); |
| 314 |
// |
// |
| 315 |
// |
// |
| 316 |
ftrks4 = new TGCheckButton(hframe5, "Track in S4/ND"); |
// ftrks4 = new TGCheckButton(hframe5, "Track in S4/ND"); |
| 317 |
ftrks4->Connect("Clicked()","PAMevcontrol",this,"radiotrack()"); |
// ftrks4->Connect("Clicked()","PAMevcontrol",this,"radiotrack()"); |
| 318 |
if ( cvar->tracknds4) ftrks4->SetState(kButtonDown); |
// if ( cvar->tracknds4) ftrks4->SetState(kButtonDown); |
| 319 |
hframe5->AddFrame(ftrks4, new TGLayoutHints(kLHintsTop | kLHintsLeft | kLHintsCenterY|kLHintsExpandX,5,2,5,5)); |
// hframe5->AddFrame(ftrks4, new TGLayoutHints(kLHintsTop | kLHintsLeft | kLHintsCenterY|kLHintsExpandX,5,2,5,5)); |
| 320 |
ffl0 = new TGCheckButton(hframe5, "Force LEVEL0"); |
|
| 321 |
|
fgetl0 = new TGTextButton(hframe5, "Get L0 file"); |
| 322 |
|
fgetl0->Connect("Clicked()","PAMevcontrol", this,"getl0file()"); |
| 323 |
|
hframe5->AddFrame(fgetl0, new TGLayoutHints(kLHintsTop | kLHintsLeft | kLHintsCenterY|kLHintsExpandX,5,5,5,5)); |
| 324 |
|
|
| 325 |
|
ffl0 = new TGCheckButton(hframe5, "Force RAW"); |
| 326 |
ffl0->Connect("Clicked()","PAMevcontrol",this,"forcel0()"); |
ffl0->Connect("Clicked()","PAMevcontrol",this,"forcel0()"); |
| 327 |
if ( cvar->fl0 ) ffl0->SetState(kButtonDown); |
if ( cvar->fl0 ) ffl0->SetState(kButtonDown); |
| 328 |
if ( !cvar->fl0 ) ffl0->SetState(kButtonUp); |
if ( !cvar->fl0 ) ffl0->SetState(kButtonUp); |
| 329 |
hframe5->AddFrame(ffl0, new TGLayoutHints(kLHintsTop | kLHintsLeft | kLHintsCenterY|kLHintsExpandX,5,2,5,5)); |
hframe5->AddFrame(ffl0, new TGLayoutHints(kLHintsTop | kLHintsLeft | kLHintsCenterY|kLHintsExpandX,2,5,5,5)); |
| 330 |
// |
// |
| 331 |
hframe4->AddFrame(hframe5, new TGLayoutHints(kLHintsTop | kLHintsLeft | kLHintsCenterY|kLHintsExpandX,10,5,5,5)); |
hframe4->AddFrame(hframe5, new TGLayoutHints(kLHintsTop | kLHintsLeft | kLHintsCenterY|kLHintsExpandX,10,5,5,5)); |
| 332 |
gf2->AddFrame(hframe4, new TGLayoutHints(kLHintsExpandX)); |
gf2->AddFrame(hframe4, new TGLayoutHints(kLHintsExpandX)); |
| 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; |
| 450 |
EMsgBoxIcon mb_icon = kMBIconStop; |
EMsgBoxIcon mb_icon = kMBIconStop; |
| 451 |
if ( ty == 0 ){ |
if ( ty == 2 ){ |
| 452 |
|
title="ERROR!!"; |
| 453 |
|
mb_icon = kMBIconStop; |
| 454 |
|
new TGMsgBox(gClient->GetRoot(), this, title.Data(), warn.Data(), mb_icon, kMBOk, &retval); |
| 455 |
|
} else { |
| 456 |
|
if ( ty == 0 ){ |
| 457 |
title="INFO"; |
title="INFO"; |
| 458 |
mb_icon = kMBIconAsterisk; |
mb_icon = kMBIconAsterisk; |
| 459 |
}; |
}; |
| 460 |
if ( ty == 1 ){ |
if ( ty == 1 ){ |
| 461 |
title="WARNING!"; |
title="WARNING!"; |
| 462 |
mb_icon = kMBIconExclamation; |
mb_icon = kMBIconExclamation; |
| 463 |
|
}; |
| 464 |
|
const TGPicture *icon_pic; |
| 465 |
|
switch (mb_icon) { |
| 466 |
|
case kMBIconStop: |
| 467 |
|
icon_pic = gClient->GetPicture("mb_stop_s.xpm"); |
| 468 |
|
if (!icon_pic) Error("TGMsgBox", "mb_stop_s.xpm not found"); |
| 469 |
|
break; |
| 470 |
|
|
| 471 |
|
case kMBIconQuestion: |
| 472 |
|
icon_pic = gClient->GetPicture("mb_question_s.xpm"); |
| 473 |
|
if (!icon_pic) Error("TGMsgBox", "mb_question_s.xpm not found"); |
| 474 |
|
break; |
| 475 |
|
|
| 476 |
|
case kMBIconExclamation: |
| 477 |
|
icon_pic = gClient->GetPicture("mb_exclamation_s.xpm"); |
| 478 |
|
if (!icon_pic) Error("TGMsgBox", "mb_exclamation_s.xpm not found"); |
| 479 |
|
break; |
| 480 |
|
|
| 481 |
|
case kMBIconAsterisk: |
| 482 |
|
icon_pic = gClient->GetPicture("mb_asterisk_s.xpm"); |
| 483 |
|
if (!icon_pic) Error("TGMsgBox", "mb_asterisk_s.xpm not found"); |
| 484 |
|
break; |
| 485 |
|
|
| 486 |
|
default: |
| 487 |
|
icon_pic = 0; |
| 488 |
|
break; |
| 489 |
|
} |
| 490 |
|
// |
| 491 |
|
TGTransientFrame *compofra = new TGTransientFrame(gClient->GetRoot(), 0, 200, 80, kHorizontalFrame); |
| 492 |
|
TGHorizontalFrame *fIconFrame = new TGHorizontalFrame(compofra, 98, 78); |
| 493 |
|
TGIcon *fIcon = new TGIcon(fIconFrame, icon_pic, icon_pic->GetWidth(), icon_pic->GetHeight()); |
| 494 |
|
fIconFrame->AddFrame(fIcon, new TGLayoutHints(kLHintsCenterX|kLHintsCenterY, 1, 1, 1, 1)); |
| 495 |
|
compofra->AddFrame(fIconFrame, new TGLayoutHints(kLHintsCenterX|kLHintsCenterY, 1, 1, 1, 1)); |
| 496 |
|
// |
| 497 |
|
TGHorizontalFrame *fLabelFrame = new TGHorizontalFrame(compofra, 98, 78); |
| 498 |
|
TGLabel *la=new TGLabel(fLabelFrame,warn.Data()); |
| 499 |
|
la->SetTextJustify(kLHintsCenterX); |
| 500 |
|
fLabelFrame->AddFrame(la, new TGLayoutHints(kLHintsCenterX|kLHintsCenterY, 1, 1, 1, 1)); |
| 501 |
|
compofra->AddFrame(fLabelFrame, new TGLayoutHints(kLHintsCenterX|kLHintsCenterY, 1, 1, 1, 1)); |
| 502 |
|
// |
| 503 |
|
compofra->SetWindowName(title.Data()); |
| 504 |
|
compofra->MapSubwindows(); |
| 505 |
|
compofra->Resize(compofra->GetDefaultWidth(),80); |
| 506 |
|
compofra->CenterOnParent(); |
| 507 |
|
compofra->MapWindow(); |
| 508 |
|
// |
| 509 |
|
Int_t kkk = 0; |
| 510 |
|
while ( kkk < 200 ){ |
| 511 |
|
gSystem->ProcessEvents(); |
| 512 |
|
gSystem->Sleep(10); |
| 513 |
|
kkk++; |
| 514 |
|
}; |
| 515 |
|
if ( compofra ){ |
| 516 |
|
la->Delete(); |
| 517 |
|
fLabelFrame->Delete(); |
| 518 |
|
fIcon->Delete(); |
| 519 |
|
fIconFrame->Delete(); |
| 520 |
|
compofra->DestroyWindow(); |
| 521 |
|
compofra->Delete(); |
| 522 |
|
}; |
| 523 |
}; |
}; |
| 524 |
if ( ty == 2 ){ |
// |
|
title="ERROR!!"; |
|
|
mb_icon = kMBIconStop; |
|
|
}; |
|
|
new TGMsgBox(gClient->GetRoot(), this, title.Data(), warn.Data(), mb_icon, kMBOk, &retval); |
|
| 525 |
} |
} |
| 526 |
|
|
| 527 |
void PAMevcontrol::refreshdec(Int_t n){ |
void PAMevcontrol::refreshdec(Int_t n){ |
| 537 |
|
|
| 538 |
|
|
| 539 |
void PAMevcontrol::showorbdata(){ |
void PAMevcontrol::showorbdata(){ |
| 540 |
printf("orb \n"); |
cvar->showorb = !cvar->showorb; |
| 541 |
|
if ( !cvar->showorb ) fshoworb->SetText("Show Data"); |
| 542 |
|
if ( cvar->showorb ) fshoworb->SetText("Hide Data"); |
| 543 |
|
// printf("orb \n"); |
| 544 |
}; |
}; |
| 545 |
|
|
| 546 |
void PAMevcontrol::showtrgdata(){ |
void PAMevcontrol::showtrgdata(){ |
| 547 |
printf("trg \n"); |
cvar->showtrg = !cvar->showtrg; |
| 548 |
|
if ( !cvar->showtrg ) fshowtrg->SetText("Show Data"); |
| 549 |
|
if ( cvar->showtrg ) fshowtrg->SetText("Hide Data"); |
| 550 |
|
// printf("trg \n"); |
| 551 |
}; |
}; |
| 552 |
|
|
| 553 |
void PAMevcontrol::showrundata(){ |
void PAMevcontrol::showrundata(){ |
| 554 |
printf("run \n"); |
cvar->showrun = !cvar->showrun; |
| 555 |
|
if ( !cvar->showrun ) fshowrun->SetText("Show Data"); |
| 556 |
|
if ( cvar->showrun ) fshowrun->SetText("Hide Data"); |
| 557 |
|
// printf("run \n"); |
| 558 |
}; |
}; |
| 559 |
|
|
| 560 |
void PAMevcontrol::showcaldata(){ |
void PAMevcontrol::showcaldata(){ |
| 561 |
printf("cal \n"); |
cvar->showcal = !cvar->showcal; |
| 562 |
|
if ( !cvar->showcal ) fshowcal->SetText("Show Data"); |
| 563 |
|
if ( cvar->showcal ) fshowcal->SetText("Hide Data"); |
| 564 |
|
// printf("cal \n"); |
| 565 |
}; |
}; |
| 566 |
|
|
| 567 |
void PAMevcontrol::chkcalost(){ |
void PAMevcontrol::chkcalost(){ |
| 568 |
if ( cvar->CALO ) { |
if ( cvar->CALOT ) { |
| 569 |
cvar->CALO = 0; |
cvar->CALOT = 0; |
| 570 |
} else { |
} else { |
| 571 |
cvar->CALO = 1; |
cvar->CALOT = 1; |
| 572 |
}; |
}; |
| 573 |
cvar->i--; |
cvar->i--; |
| 574 |
cvar->nevents = 0; |
cvar->nevents = 0; |
| 578 |
}; |
}; |
| 579 |
|
|
| 580 |
void PAMevcontrol::showtrkdata(){ |
void PAMevcontrol::showtrkdata(){ |
| 581 |
printf("trk \n"); |
cvar->showtrk = !cvar->showtrk; |
| 582 |
|
if ( !cvar->showtrk ) fshowtrk->SetText("Show Data"); |
| 583 |
|
if ( cvar->showtrk ) fshowtrk->SetText("Hide Data"); |
| 584 |
|
// printf("trk \n"); |
| 585 |
}; |
}; |
| 586 |
|
|
| 587 |
void PAMevcontrol::showtofdata(){ |
void PAMevcontrol::showtofdata(){ |
| 588 |
printf("tof \n"); |
cvar->showtof = !cvar->showtof; |
| 589 |
|
if ( !cvar->showtof ) fshowtof->SetText("Show Data"); |
| 590 |
|
if ( cvar->showtof ) fshowtof->SetText("Hide Data"); |
| 591 |
|
// printf("tof \n"); |
| 592 |
}; |
}; |
| 593 |
|
|
| 594 |
void PAMevcontrol::showacdata(){ |
void PAMevcontrol::showacdata(){ |
| 595 |
printf("ac \n"); |
cvar->showac = !cvar->showac; |
| 596 |
|
if ( !cvar->showac ) fshowac->SetText("Show Data"); |
| 597 |
|
if ( cvar->showac ) fshowac->SetText("Hide Data"); |
| 598 |
|
// printf("ac \n"); |
| 599 |
}; |
}; |
| 600 |
|
|
| 601 |
void PAMevcontrol::shownddata(){ |
void PAMevcontrol::shownddata(){ |
| 602 |
printf("nd \n"); |
cvar->shownd = !cvar->shownd; |
| 603 |
|
if ( !cvar->shownd ) fshownd->SetText("Show Data"); |
| 604 |
|
if ( cvar->shownd ) fshownd->SetText("Hide Data"); |
| 605 |
|
// printf("nd \n"); |
| 606 |
}; |
}; |
| 607 |
|
|
| 608 |
void PAMevcontrol::shows4data(){ |
void PAMevcontrol::shows4data(){ |
| 609 |
printf("s4 \n"); |
cvar->shows4 = !cvar->shows4; |
| 610 |
|
if ( !cvar->shows4 ) fshows4->SetText("Show Data"); |
| 611 |
|
if ( cvar->shows4 ) fshows4->SetText("Hide Data"); |
| 612 |
|
// printf("s4 \n"); |
| 613 |
}; |
}; |
| 614 |
|
|
| 615 |
void PAMevcontrol::showsidata(){ |
void PAMevcontrol::showsidata(){ |
| 616 |
printf("si \n"); |
cvar->showsi = !cvar->showsi; |
| 617 |
|
if ( !cvar->showsi ) fshowsi->SetText("Show Data"); |
| 618 |
|
if ( cvar->showsi ) fshowsi->SetText("Hide Data"); |
| 619 |
|
// printf("si \n"); |
| 620 |
}; |
}; |
| 621 |
|
|
| 622 |
void PAMevcontrol::showalldata(){ |
void PAMevcontrol::showalldata(){ |
| 623 |
printf("all \n"); |
cvar->showall = !cvar->showall; |
| 624 |
|
if ( !cvar->showall ) fshowall->SetText("Show Data"); |
| 625 |
|
if ( cvar->showall ) fshowall->SetText("Hide Data"); |
| 626 |
|
// printf("all \n"); |
| 627 |
}; |
}; |
| 628 |
|
|
| 629 |
void PAMevcontrol::SetFilename() { |
void PAMevcontrol::SetFilename() { |
| 630 |
TGTextEntry *entry = (TGTextEntry*)gTQSender; |
TGTextEntry *entry = (TGTextEntry*)gTQSender; |
| 631 |
TString text = entry->GetText(); |
TString text = entry->GetText(); |
| 632 |
cvar->thefilename=text.Data(); |
cvar->thefilename=text.Data(); |
| 633 |
|
cvar->i = 0; |
| 634 |
cvar->nevents = 0; |
cvar->nevents = 0; |
| 635 |
cvar->firstevno = 0; |
cvar->firstevno = 0; |
| 636 |
cvar->lastevno = 0; |
cvar->lastevno = 0; |
| 642 |
cvar->waitforever = false; |
cvar->waitforever = false; |
| 643 |
} |
} |
| 644 |
|
|
| 645 |
|
void PAMevcontrol::getl0file() { |
| 646 |
|
// |
| 647 |
|
TString host = "mysql://localhost/pamelaprod"; |
| 648 |
|
TString user = "anonymous"; |
| 649 |
|
TString psw = ""; |
| 650 |
|
const char *pamdbhost=gSystem->Getenv("PAM_DBHOST"); |
| 651 |
|
const char *pamdbuser=gSystem->Getenv("PAM_DBUSER"); |
| 652 |
|
const char *pamdbpsw=gSystem->Getenv("PAM_DBPSW"); |
| 653 |
|
if ( !pamdbhost ) pamdbhost = ""; |
| 654 |
|
if ( !pamdbuser ) pamdbuser = ""; |
| 655 |
|
if ( !pamdbpsw ) pamdbpsw = ""; |
| 656 |
|
if ( strcmp(pamdbhost,"") ) host = pamdbhost; |
| 657 |
|
if ( strcmp(pamdbuser,"") ) user = pamdbuser; |
| 658 |
|
if ( strcmp(pamdbpsw,"") ) psw = pamdbpsw; |
| 659 |
|
cout<<"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"<<endl; |
| 660 |
|
cout<<"Connecting to DB"<<endl; |
| 661 |
|
cout<<"HOST "<<host<<endl; |
| 662 |
|
cout<<"USER "<<user<<endl; |
| 663 |
|
cout<<"PSW "<<psw<<endl; |
| 664 |
|
cout<<"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"<<endl; |
| 665 |
|
TSQLServer *dbc = TSQLServer::Connect(host.Data(),user.Data(),psw.Data()); |
| 666 |
|
// |
| 667 |
|
TSQLResult *pResult; |
| 668 |
|
TSQLRow *Row; |
| 669 |
|
// |
| 670 |
|
if( dbc && dbc->IsConnected() ){ |
| 671 |
|
// |
| 672 |
|
// Retrieve the file |
| 673 |
|
// |
| 674 |
|
if ( clev->file == 2 ){ |
| 675 |
|
// |
| 676 |
|
// Starting from level2 |
| 677 |
|
// |
| 678 |
|
GL_ROOT glroot = GL_ROOT(); |
| 679 |
|
if( !glroot.Query_GL_ROOT(cvar->idroot,dbc) ){ |
| 680 |
|
// |
| 681 |
|
cvar->thefilename= glroot.PATH + glroot.NAME; |
| 682 |
|
cvar->nevents = 0; |
| 683 |
|
cvar->firstevno = 0; |
| 684 |
|
cvar->lastevno = 0; |
| 685 |
|
if ( cvar->fl0 ) { |
| 686 |
|
cvar->fl0 = false; |
| 687 |
|
ffl0->SetState(kButtonUp); |
| 688 |
|
}; |
| 689 |
|
cvar->restart = true; |
| 690 |
|
cvar->waitforever = false; |
| 691 |
|
// |
| 692 |
|
if ( cvar->thefilter != "" ){ |
| 693 |
|
cvar->thefilter=""; |
| 694 |
|
cvar->selex = true; |
| 695 |
|
}; |
| 696 |
|
cvar->i = cvar->EVF + cvar->i ; |
| 697 |
|
//cvar->refresh = true; |
| 698 |
|
// cvar->file = 0; |
| 699 |
|
// |
| 700 |
|
} else { |
| 701 |
|
stringstream warning; |
| 702 |
|
warning.str(""); |
| 703 |
|
warning << " Problems getting Level0 file "; |
| 704 |
|
DIALOG(2,warning.str().c_str()); |
| 705 |
|
}; |
| 706 |
|
} else { |
| 707 |
|
// |
| 708 |
|
// starting from L0 |
| 709 |
|
// |
| 710 |
|
stringstream query; |
| 711 |
|
query.str(""); |
| 712 |
|
query << " SELECT ID FROM GL_ROOT WHERE NAME='"<< gSystem->BaseName(cvar->thefilename.Data()) <<"' order by INSERT_TIME desc limit 1;"; |
| 713 |
|
// printf(" query is %s \n",query.str().c_str()); |
| 714 |
|
pResult = dbc->Query(query.str().c_str()); |
| 715 |
|
Row = pResult->Next(); |
| 716 |
|
UInt_t idrl0 = 0; |
| 717 |
|
if ( Row ){ |
| 718 |
|
idrl0 = (UInt_t)atoll(Row->GetField(0)); |
| 719 |
|
}; |
| 720 |
|
// |
| 721 |
|
query.str(""); |
| 722 |
|
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 <<";"; |
| 723 |
|
// printf(" query is %s \n",query.str().c_str()); |
| 724 |
|
pResult = dbc->Query(query.str().c_str()); |
| 725 |
|
Row = pResult->Next(); |
| 726 |
|
UInt_t idrl2 = 0; |
| 727 |
|
UInt_t idrlun = 0; |
| 728 |
|
UInt_t evfrom = 0; |
| 729 |
|
if ( Row ){ |
| 730 |
|
idrlun = (UInt_t)atoll(Row->GetField(0)); |
| 731 |
|
idrl2 = (UInt_t)atoll(Row->GetField(1)); |
| 732 |
|
evfrom = (UInt_t)atoll(Row->GetField(2)); |
| 733 |
|
}; |
| 734 |
|
// |
| 735 |
|
query.str(""); |
| 736 |
|
query << " SELECT ID,NEVENTS FROM GL_RUN WHERE ID_ROOT_L2="<< idrl2 <<" order by RUNHEADER_TIME asc;"; |
| 737 |
|
// printf(" query is %s \n",query.str().c_str()); |
| 738 |
|
pResult = dbc->Query(query.str().c_str()); |
| 739 |
|
Row = pResult->Next(); |
| 740 |
|
UInt_t coren = 0; |
| 741 |
|
while ( Row ){ |
| 742 |
|
if ( (UInt_t)atoll(Row->GetField(0)) == idrlun ) break; |
| 743 |
|
coren += (UInt_t)atoll(Row->GetField(1)); |
| 744 |
|
Row = pResult->Next(); |
| 745 |
|
}; |
| 746 |
|
coren += cvar->i - evfrom; |
| 747 |
|
// |
| 748 |
|
GL_ROOT glroot = GL_ROOT(); |
| 749 |
|
if( !glroot.Query_GL_ROOT(idrl2,dbc) ){ |
| 750 |
|
// |
| 751 |
|
cvar->i = coren; |
| 752 |
|
// |
| 753 |
|
cvar->thefilename= glroot.PATH + glroot.NAME; |
| 754 |
|
cvar->nevents = 0; |
| 755 |
|
cvar->firstevno = 0; |
| 756 |
|
cvar->lastevno = 0; |
| 757 |
|
if ( cvar->fl0 ) { |
| 758 |
|
cvar->fl0 = false; |
| 759 |
|
ffl0->SetState(kButtonUp); |
| 760 |
|
}; |
| 761 |
|
cvar->restart = true; |
| 762 |
|
cvar->waitforever = false; |
| 763 |
|
// |
| 764 |
|
if ( cvar->thefilter != "" ){ |
| 765 |
|
cvar->thefilter=""; |
| 766 |
|
cvar->selex = true; |
| 767 |
|
}; |
| 768 |
|
// |
| 769 |
|
} else { |
| 770 |
|
stringstream warning; |
| 771 |
|
warning.str(""); |
| 772 |
|
warning << " Problems getting Level2 file "; |
| 773 |
|
DIALOG(2,warning.str().c_str()); |
| 774 |
|
}; |
| 775 |
|
// stringstream warning; |
| 776 |
|
// warning.str(""); |
| 777 |
|
// warning << " Not yet implemented "; |
| 778 |
|
// DIALOG(2,warning.str().c_str()); |
| 779 |
|
}; |
| 780 |
|
// |
| 781 |
|
} else { |
| 782 |
|
stringstream warning; |
| 783 |
|
warning.str(""); |
| 784 |
|
warning << " Problems connectiong to DB! "; |
| 785 |
|
DIALOG(2,warning.str().c_str()); |
| 786 |
|
}; |
| 787 |
|
dbc->Close(); |
| 788 |
|
}; |
| 789 |
|
|
| 790 |
void PAMevcontrol::CheckLevel() { |
void PAMevcontrol::CheckLevel() { |
| 791 |
if ( clev->file == 2 ){ |
if ( clev->file == 2 ){ |
| 792 |
ffl0->SetState(kButtonDisabled); |
ffl0->SetState(kButtonDisabled); |
| 793 |
if ( !cvar->tracknds4 ) { |
// if ( !cvar->tracknds4 ) { |
| 794 |
ftrks4->SetState(kButtonUp); |
// ftrks4->SetState(kButtonUp); |
| 795 |
} else { |
// } else { |
| 796 |
ftrks4->SetState(kButtonDown); |
// ftrks4->SetState(kButtonDown); |
| 797 |
}; |
// }; |
| 798 |
} else { |
} else { |
| 799 |
ftrks4->SetState(kButtonDisabled); |
//ftrks4->SetState(kButtonDisabled); |
| 800 |
if ( !cvar->fl0 ) { |
if ( !cvar->fl0 ) { |
| 801 |
ffl0->SetState(kButtonUp); |
ffl0->SetState(kButtonUp); |
| 802 |
} else { |
} else { |
| 803 |
ffl0->SetState(kButtonDown); |
ffl0->SetState(kButtonDown); |
| 804 |
}; |
}; |
| 805 |
}; |
}; |
| 806 |
|
if ( clev->file == 2 ){ |
| 807 |
|
fgetl0->SetText("Get L0 file"); |
| 808 |
|
} else { |
| 809 |
|
fgetl0->SetText("Get L2 file"); |
| 810 |
|
}; |
| 811 |
} |
} |
| 812 |
|
|
| 813 |
void PAMevcontrol::SetSearching() { |
void PAMevcontrol::SetSearching() { |
| 821 |
void PAMevcontrol::RefreshButtons() { |
void PAMevcontrol::RefreshButtons() { |
| 822 |
if ( cvar->jumprog ){ |
if ( cvar->jumprog ){ |
| 823 |
jbwc1->SetState(kButtonDown); |
jbwc1->SetState(kButtonDown); |
| 824 |
|
jbwc0->SetState(kButtonUp); |
| 825 |
} else { |
} else { |
| 826 |
|
jbwc1->SetState(kButtonUp); |
| 827 |
jbwc0->SetState(kButtonDown); |
jbwc0->SetState(kButtonDown); |
| 828 |
}; |
}; |
| 829 |
if ( cvar->fl0 ){ |
if ( cvar->fl0 ){ |
| 831 |
} else { |
} else { |
| 832 |
ffl0->SetState(kButtonUp); |
ffl0->SetState(kButtonUp); |
| 833 |
}; |
}; |
| 834 |
if ( cvar->tracknds4) ftrks4->SetState(kButtonDown); |
// if ( cvar->tracknds4) ftrks4->SetState(kButtonDown); |
| 835 |
if ( cvar->bw ){ |
if ( cvar->bw ){ |
| 836 |
bwc1->SetState(kButtonDown); |
bwc1->SetState(kButtonDown); |
| 837 |
|
bwc0->SetState(kButtonUp); |
| 838 |
} else { |
} else { |
| 839 |
bwc0->SetState(kButtonDown); |
bwc0->SetState(kButtonDown); |
| 840 |
|
bwc1->SetState(kButtonUp); |
| 841 |
}; |
}; |
| 842 |
if ( cvar->PALETTE) fchkpalette->SetState(kButtonDown); else fchkpalette->SetState(kButtonUp); |
if ( cvar->PALETTE) fchkpalette->SetState(kButtonDown); else fchkpalette->SetState(kButtonUp); |
| 843 |
if ( cvar->VINFOS ) fchknames->SetState(kButtonDown); else fchknames->SetState(kButtonUp); |
if ( cvar->VINFOS ) fchknames->SetState(kButtonDown); else fchknames->SetState(kButtonUp); |
| 844 |
if ( cvar->INFOS ) fchkinfo->SetState(kButtonDown); else fchkinfo->SetState(kButtonUp); |
if ( cvar->INFOS ) fchkinfo->SetState(kButtonDown); else fchkinfo->SetState(kButtonUp); |
| 845 |
if ( cvar->CALO ) fchkcalo->SetState(kButtonDown); else fchkcalo->SetState(kButtonUp); |
// |
| 846 |
if ( cvar->CALOT ) fchkcalost->SetState(kButtonDown); else fchkcalost->SetState(kButtonUp); |
if ( cvar->CALOT ) fchkcalost->SetState(kButtonDown); else fchkcalost->SetState(kButtonUp); |
| 847 |
if ( cvar->ND ) fchknd->SetState(kButtonDown); else fchknd->SetState(kButtonUp); |
if ( cvar->CALO ){ |
| 848 |
if ( cvar->S4 ) fchks4->SetState(kButtonDown); else fchks4->SetState(kButtonUp); |
fchkcalo->SetState(kButtonDown); |
| 849 |
if ( cvar->TRK ) fchktrk->SetState(kButtonDown); else fchktrk->SetState(kButtonUp); |
fshowcal->SetState(kButtonUp); |
| 850 |
if ( cvar->AC ) fchkac->SetState(kButtonDown); else fchkac->SetState(kButtonUp); |
} else { |
| 851 |
if ( cvar->TOF ) fchktof->SetState(kButtonDown); else fchktof->SetState(kButtonUp); |
fchkcalo->SetState(kButtonUp); |
| 852 |
|
fchkcalost->SetState(kButtonDisabled); |
| 853 |
|
fshowcal->SetState(kButtonDisabled); |
| 854 |
|
}; |
| 855 |
|
// |
| 856 |
|
if ( cvar->ND ){ |
| 857 |
|
fchknd->SetState(kButtonDown); |
| 858 |
|
fshownd->SetState(kButtonUp); |
| 859 |
|
} else { |
| 860 |
|
fchknd->SetState(kButtonUp); |
| 861 |
|
fshownd->SetState(kButtonDisabled); |
| 862 |
|
}; |
| 863 |
|
// |
| 864 |
|
if ( cvar->S4 ){ |
| 865 |
|
fchks4->SetState(kButtonDown); |
| 866 |
|
fshows4->SetState(kButtonUp); |
| 867 |
|
} else { |
| 868 |
|
fchks4->SetState(kButtonUp); |
| 869 |
|
fshows4->SetState(kButtonDisabled); |
| 870 |
|
}; |
| 871 |
|
// |
| 872 |
|
if ( cvar->TRK ){ |
| 873 |
|
fchktrk->SetState(kButtonDown); |
| 874 |
|
fshowtrk->SetState(kButtonUp); |
| 875 |
|
} else { |
| 876 |
|
fchktrk->SetState(kButtonUp); |
| 877 |
|
fshowtrk->SetState(kButtonDisabled); |
| 878 |
|
} |
| 879 |
|
// |
| 880 |
|
if ( cvar->AC ){ |
| 881 |
|
fchkac->SetState(kButtonDown); |
| 882 |
|
fshowac->SetState(kButtonUp); |
| 883 |
|
} else { |
| 884 |
|
fchkac->SetState(kButtonUp); |
| 885 |
|
fshowac->SetState(kButtonDisabled); |
| 886 |
|
}; |
| 887 |
|
// |
| 888 |
|
if ( cvar->TOF ){ |
| 889 |
|
fchktof->SetState(kButtonDown); |
| 890 |
|
fshowtof->SetState(kButtonUp); |
| 891 |
|
} else { |
| 892 |
|
fchktof->SetState(kButtonUp); |
| 893 |
|
fshowtof->SetState(kButtonDisabled); |
| 894 |
|
}; |
| 895 |
|
// |
| 896 |
|
CheckLevel(); |
| 897 |
|
// |
| 898 |
}; |
}; |
| 899 |
|
|
| 900 |
void PAMevcontrol::SetFilter() { |
void PAMevcontrol::SetFilter() { |
| 1077 |
} |
} |
| 1078 |
|
|
| 1079 |
void PAMevcontrol::forcel0() { |
void PAMevcontrol::forcel0() { |
| 1080 |
if ( cvar->fl0 ) { |
cvar->fl0 = !cvar->fl0; |
| 1081 |
cvar->fl0 = false; |
cvar->alrforc = false; |
| 1082 |
} else { |
cvar->i--; |
| 1083 |
cvar->fl0 = true; |
cvar->nevents = 0; |
| 1084 |
}; |
cvar->firstevno = 0; |
| 1085 |
cvar->alrforc = false; |
cvar->lastevno = 0; |
| 1086 |
cvar->i--; |
cvar->refresh = true; |
|
cvar->nevents = 0; |
|
|
cvar->firstevno = 0; |
|
|
cvar->lastevno = 0; |
|
|
cvar->refresh = true; |
|
| 1087 |
} |
} |
| 1088 |
|
|
| 1089 |
void PAMevcontrol::clearselfi(){ |
void PAMevcontrol::clearselfi(){ |