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)); |
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() { |
601 |
cout<<"PSW "<<psw<<endl; |
cout<<"PSW "<<psw<<endl; |
602 |
cout<<"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"<<endl; |
cout<<"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"<<endl; |
603 |
TSQLServer *dbc = TSQLServer::Connect(host.Data(),user.Data(),psw.Data()); |
TSQLServer *dbc = TSQLServer::Connect(host.Data(),user.Data(),psw.Data()); |
604 |
|
// |
605 |
|
TSQLResult *pResult; |
606 |
|
TSQLRow *Row; |
607 |
|
// |
608 |
if( dbc && dbc->IsConnected() ){ |
if( dbc && dbc->IsConnected() ){ |
609 |
// |
// |
610 |
// Starting from level2 |
// Retrieve the file |
611 |
// |
// |
612 |
if ( clev->file == 2 ){ |
if ( clev->file == 2 ){ |
613 |
|
// |
614 |
|
// Starting from level2 |
615 |
|
// |
616 |
GL_ROOT glroot = GL_ROOT(); |
GL_ROOT glroot = GL_ROOT(); |
617 |
if( !glroot.Query_GL_ROOT(cvar->idroot,dbc) ){ |
if( !glroot.Query_GL_ROOT(cvar->idroot,dbc) ){ |
618 |
// |
// |
631 |
cvar->thefilter=""; |
cvar->thefilter=""; |
632 |
cvar->selex = true; |
cvar->selex = true; |
633 |
}; |
}; |
634 |
cvar->i = -(cvar->EVF + cvar->i -1); |
cvar->i = cvar->EVF + cvar->i ; |
635 |
//cvar->refresh = true; |
//cvar->refresh = true; |
636 |
// cvar->file = 0; |
// cvar->file = 0; |
637 |
// |
// |
638 |
} else { |
} else { |
639 |
stringstream warning; |
stringstream warning; |
640 |
warning.str(""); |
warning.str(""); |
641 |
warning << " Problems getting Level0 file "; |
warning << " Problems getting Level0 file "; |
642 |
DIALOG(2,warning.str().c_str()); |
DIALOG(2,warning.str().c_str()); |
643 |
}; |
}; |
644 |
} else { |
} else { |
645 |
// |
// |
646 |
// starting from L0 |
// starting from L0 |
647 |
// |
// |
648 |
stringstream warning; |
stringstream query; |
649 |
warning.str(""); |
query.str(""); |
650 |
warning << " Not yet implemented "; |
query << " SELECT ID FROM GL_ROOT WHERE NAME='"<< gSystem->BaseName(cvar->thefilename.Data()) <<"' order by INSERT_TIME desc limit 1;"; |
651 |
DIALOG(2,warning.str().c_str()); |
// printf(" query is %s \n",query.str().c_str()); |
652 |
|
pResult = dbc->Query(query.str().c_str()); |
653 |
|
Row = pResult->Next(); |
654 |
|
UInt_t idrl0 = 0; |
655 |
|
if ( Row ){ |
656 |
|
idrl0 = (UInt_t)atoll(Row->GetField(0)); |
657 |
|
}; |
658 |
|
// |
659 |
|
query.str(""); |
660 |
|
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 <<";"; |
661 |
|
// printf(" query is %s \n",query.str().c_str()); |
662 |
|
pResult = dbc->Query(query.str().c_str()); |
663 |
|
Row = pResult->Next(); |
664 |
|
UInt_t idrl2 = 0; |
665 |
|
UInt_t idrlun = 0; |
666 |
|
UInt_t evfrom = 0; |
667 |
|
if ( Row ){ |
668 |
|
idrlun = (UInt_t)atoll(Row->GetField(0)); |
669 |
|
idrl2 = (UInt_t)atoll(Row->GetField(1)); |
670 |
|
evfrom = (UInt_t)atoll(Row->GetField(2)); |
671 |
|
}; |
672 |
|
// |
673 |
|
query.str(""); |
674 |
|
query << " SELECT ID,NEVENTS FROM GL_RUN WHERE ID_ROOT_L2="<< idrl2 <<" order by RUNHEADER_TIME asc;"; |
675 |
|
// printf(" query is %s \n",query.str().c_str()); |
676 |
|
pResult = dbc->Query(query.str().c_str()); |
677 |
|
Row = pResult->Next(); |
678 |
|
UInt_t coren = 0; |
679 |
|
while ( Row ){ |
680 |
|
if ( (UInt_t)atoll(Row->GetField(0)) == idrlun ) break; |
681 |
|
coren += (UInt_t)atoll(Row->GetField(1)); |
682 |
|
Row = pResult->Next(); |
683 |
|
}; |
684 |
|
coren += cvar->i - evfrom; |
685 |
|
// |
686 |
|
GL_ROOT glroot = GL_ROOT(); |
687 |
|
if( !glroot.Query_GL_ROOT(idrl2,dbc) ){ |
688 |
|
// |
689 |
|
cvar->i = coren; |
690 |
|
// |
691 |
|
cvar->thefilename= glroot.PATH + glroot.NAME; |
692 |
|
cvar->nevents = 0; |
693 |
|
cvar->firstevno = 0; |
694 |
|
cvar->lastevno = 0; |
695 |
|
if ( cvar->fl0 ) { |
696 |
|
cvar->fl0 = false; |
697 |
|
ffl0->SetState(kButtonUp); |
698 |
|
}; |
699 |
|
cvar->restart = true; |
700 |
|
cvar->waitforever = false; |
701 |
|
// |
702 |
|
if ( cvar->thefilter != "" ){ |
703 |
|
cvar->thefilter=""; |
704 |
|
cvar->selex = true; |
705 |
|
}; |
706 |
|
// |
707 |
|
} else { |
708 |
|
stringstream warning; |
709 |
|
warning.str(""); |
710 |
|
warning << " Problems getting Level2 file "; |
711 |
|
DIALOG(2,warning.str().c_str()); |
712 |
|
}; |
713 |
|
// stringstream warning; |
714 |
|
// warning.str(""); |
715 |
|
// warning << " Not yet implemented "; |
716 |
|
// DIALOG(2,warning.str().c_str()); |
717 |
}; |
}; |
718 |
// |
// |
719 |
} else { |
} else { |
741 |
ffl0->SetState(kButtonDown); |
ffl0->SetState(kButtonDown); |
742 |
}; |
}; |
743 |
}; |
}; |
744 |
|
if ( clev->file == 2 ){ |
745 |
|
fgetl0->SetText("Get L0 file"); |
746 |
|
} else { |
747 |
|
fgetl0->SetText("Get L2 file"); |
748 |
|
}; |
749 |
} |
} |
750 |
|
|
751 |
void PAMevcontrol::SetSearching() { |
void PAMevcontrol::SetSearching() { |
1011 |
} |
} |
1012 |
|
|
1013 |
void PAMevcontrol::forcel0() { |
void PAMevcontrol::forcel0() { |
1014 |
if ( cvar->fl0 ) { |
cvar->fl0 = !cvar->fl0; |
1015 |
cvar->fl0 = false; |
cvar->alrforc = false; |
1016 |
} else { |
cvar->i--; |
1017 |
cvar->fl0 = true; |
cvar->nevents = 0; |
1018 |
}; |
cvar->firstevno = 0; |
1019 |
cvar->alrforc = false; |
cvar->lastevno = 0; |
1020 |
cvar->i--; |
cvar->refresh = true; |
|
cvar->nevents = 0; |
|
|
cvar->firstevno = 0; |
|
|
cvar->lastevno = 0; |
|
|
cvar->refresh = true; |
|
1021 |
} |
} |
1022 |
|
|
1023 |
void PAMevcontrol::clearselfi(){ |
void PAMevcontrol::clearselfi(){ |