1 /**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * Authors: Jochen Thaeder <thaeder@kip.uni-heidelberg.de> *
5 * for The ALICE Off-line Project. *
7 * Permission to use, copy, modify and distribute this software and its *
8 * documentation strictly for non-commercial purposes is hereby granted *
9 * without fee, provided that the above copyright notice appears in all *
10 * copies and that both the copyright notice and this permission notice *
11 * appear in the supporting documentation. The authors make no claims *
12 * about the suitability of this software for any purpose. It is *
13 * provided "as is" without express or implied warranty. *
14 **************************************************************************/
16 /** @file AliHLTGUI.cxx
17 @author Jochen Thaeder
19 @brief Qt class for ALICE HLT online Display
28 #include "AliHLTGUI.h"
29 #include "AliHLTTPCDisplayMain.h"
30 #include "AliHLTLogging.h"
31 #include "AliHLTTPCDigitReaderRaw.h"
33 #include <TQtWidget.h>
36 #include <qcheckbox.h>
38 #include <qbuttongroup.h>
39 #include <qgroupbox.h>
40 #include <qpushbutton.h>
41 #include <qlineedit.h>
42 #include <qlistview.h>
44 #include <qtabwidget.h>
56 // -- standard constructor
57 //____________________________________________________________________________________________________
58 AliHLTGUI::AliHLTGUI()
65 residualsWidget(NULL),
72 padrow_padWidget(NULL),
77 // -- not a valid copy constructor, defined according to effective C++ style
78 //____________________________________________________________________________________________________
79 AliHLTGUI::AliHLTGUI(const AliHLTGUI& srcGUI)
81 fDisplay(srcGUI.fDisplay),
82 fHostnames(srcGUI.fHostnames),
83 fPorts(srcGUI.fPorts),
84 padrowWidget(srcGUI.padrowWidget),
85 padWidget(srcGUI.padWidget),
86 residualsWidget(srcGUI.residualsWidget),
87 chargeWidget(srcGUI.chargeWidget),
88 threeDWidget(srcGUI.threeDWidget),
89 frontWidget(srcGUI.frontWidget),
90 hits_sWidget(srcGUI.hits_sWidget),
91 q_trackWidget(srcGUI.q_trackWidget),
92 q_sWidget(srcGUI.q_sWidget),
93 padrow_padWidget(srcGUI.padrow_padWidget),
94 fEventLoop(srcGUI.fEventLoop)
96 HLTFatal("copy constructor not implemented");
99 // -- not a valid assignment op, but defined according to effective C++ style
100 //____________________________________________________________________________________________________
101 AliHLTGUI& AliHLTGUI::operator=(const AliHLTGUI&) {
102 HLTFatal("assignment operator not implemented");
107 //____________________________________________________________________________________________________
108 AliHLTGUI::AliHLTGUI( Int_t argc, Char_t **argv )
115 residualsWidget(NULL),
122 padrow_padWidget(NULL),
125 cout << "Creating display" << endl;
127 const Float_t fVersion = 1.5; // CONST XXX INLINE
130 padrowWidget = tQtWidgetPadRow;
131 residualsWidget = tQtWidgetResiduals;
132 threeDWidget = tQtWidget3D;
133 padWidget = tQtWidgetPad;
134 chargeWidget = tQtWidgetCharge;
135 frontWidget = tQtWidgetFront;
136 hits_sWidget = tQtWidgetHits_s;
137 q_trackWidget = tQtWidgetq_track;
138 q_sWidget = tQtWidgetQ_s;
139 padrow_padWidget = tQtWidgetPadRow_Pad;
141 AliHLTTPCDisplayMain* display = new AliHLTTPCDisplayMain((void*) this, &AliHLTGUI::callback_setGUIPad);
143 HLTFatal( "ERROR no Display!" );
147 fDisplay = (void*)display;
152 display->RegisterCanvas( charge, chargeWidget->GetCanvas() );
153 display->RegisterCanvas( padrow, padrowWidget->GetCanvas() );
154 display->RegisterCanvas( threeD, threeDWidget->GetCanvas() );
155 display->RegisterCanvas( pad, padWidget->GetCanvas() );
156 display->RegisterCanvas( residuals, residualWidget->GetCanvas() );
157 display->RegisterCanvas( front, frontWidget->GetCanvas() );
158 display->RegisterCanvas( hits_s, hits_sWidget->GetCanvas() );
159 display->RegisterCanvas( q_track, q_trackWidget->GetCanvas() );
160 display->RegisterCanvas( q_s, q_sWidget->GetCanvas() );
161 display->RegisterCanvas( padrow_pad, padrow_padWidget->GetCanvas() );
164 // Set Canvas // TODO : REDO with enum
165 display->SetCanvasCharge(chargeWidget->GetCanvas());
166 display->SetCanvasPadRow(padrowWidget->GetCanvas());
167 display->SetCanvas3D(threeDWidget->GetCanvas());
168 display->SetCanvasPad(padWidget->GetCanvas());
169 display->SetCanvasResiduals(residualsWidget->GetCanvas());
170 display->SetCanvasFront(frontWidget->GetCanvas());
171 display->SetCanvasHits_S(hits_sWidget->GetCanvas());
172 display->SetCanvasQ_Track(q_trackWidget->GetCanvas());
173 display->SetCanvasQ_S(q_sWidget->GetCanvas());
174 #if ALIHLTTPCDISPLAY_VERSION >= 2
175 display->SetCanvasPadRow_Pad(padrow_padWidget->GetCanvas());
181 // -- Timer for Event-Loop
182 // -----------------------
183 fEventLoop = new QTimer( this );
185 HLTFatal( "ERROR no QTimer" );
189 connect( fEventLoop, SIGNAL(timeout()),this, SLOT(nextEvent()) );
191 // -- read commandline arguments and set values in AliHLTTPCDiplayMain
192 // -------------------------------------------------------------------
194 Char_t* cpErr; // error string
195 Int_t errocc = 0; // check if error occured
196 Bool_t connectToSource = kFALSE; // check if connect to source on startup
199 while ( ii < argc ) {
201 // -- raw reader mode
202 if ( !strcmp( argv[ii], "-rawreadermode" ) ) {
203 if ( argc <= ii+1 ) {
204 HLTError( "Raw Reader Mode not specified" );
209 // Int_t readerMode = AliHLTTPCDigitReaderRaw::DecodeMode( argv[ii+1] );
210 // Int_t readerMode = AliHLTTPCDigitReaderRaw::DecodeMode( 1 );
211 Int_t readerMode = 0;
213 HLTError ("Cannot convert rawreadermode specifier '%s'", argv[ii+1]);
218 // display->SetRawReaderMode( readerMode );
224 // -- zero suppression threshold
225 if ( !strcmp( argv[ii], "-adc-threshold" ) ) {
226 if ( argc <= ii+1 ) {
227 HLTError( "adc-threshold not specified" );
232 Int_t sigThresh = strtoul( argv[ii+1], &cpErr ,0 );
234 HLTError("Cannot convert adc-threshold specifier '%s'.", argv[ii+1]);
239 // display->SetZeroSuppressionThreshold(sigThresh);
245 // -- pad occupancy limit
246 if ( !strcmp( argv[ii], "-occupancy-limit" ) ) {
247 if ( argc <= ii+1 ) {
248 HLTError( "occupancy-limit not specified" );
253 Float_t occuLimit = strtof( argv[ii+1], &cpErr );
255 HLTError("Cannot convert occupancy-limit specifier '%s'.", argv[ii+1]);
260 // display->SetOccupancyLimit(occuLimit);
267 if ( !strcmp( argv[ii], "-b-field" ) ) {
268 if ( argc <= ii+1 ) {
269 HLTError( "b-field not specified" );
274 Float_t bfield = strtof( argv[ii+1], &cpErr );
276 HLTError("Cannot convert b-field specifier '%s'.", argv[ii+1]);
281 // display->SetBField( bfield )
288 if ( !strcmp( argv[ii], "-n-time-bins" ) ) {
289 if ( argc <= ii+1 ) {
290 HLTError( "n-time-bins not specified" );
295 Int_t nTimeBins = strtoul( argv[ii+1], &cpErr ,0);
296 // check if already a number, if not check if "tpc" or "sim"
298 if ( !strcmp( argv[ii+1], "sim" ) )
300 else if ( !strcmp( argv[ii+1], "tpc") )
303 HLTError("Cannot convert n-time-bins specifier '%s'.", argv[ii+1]);
309 // display->SetNTimeBins( nTimeBins );
316 if ( !strcmp( argv[ii], "-tcp-source" ) ) {
317 if ( argc <= ii+1 ) {
318 HLTError( "-tcp-source not specified" );
323 Int_t sourceCount = 1;
326 // break if more argc is exceeded
327 if ( argc <= ii+sourceCount ) break;
329 // check is next is new option and source count != 1 ( because at least 1 host:port is needed)
330 if ( strstr( argv[ii + sourceCount], "-" ) ) {
331 if ( sourceCount == 1 ){
332 HLTError( "-tcp-source not specified" );
338 // break if argument is no host:port
339 if ( !strstr( argv[ii + sourceCount], ":" ) ) break;
341 Char_t *host = strtok( argv[ii + sourceCount], ":" );
342 Char_t *port = strtok( NULL, ":" );
345 HLTError("Cannot convert tcp-source specifier '%s'.", argv[ii+1]);
351 fHostnames.push_back( host );
352 fPorts.push_back( port );
355 QListViewItem * item1 = new QListViewItem( hostListView, host, port );
356 hostListView->insertItem(item1);
361 if ( errocc != 0 ) break;
368 if ( !strcmp( argv[ii], "--connect" ) ) {
370 connectToSource = kTRUE;
377 if ( !strcmp( argv[ii], "--help" ) ) {
378 cout << "Usage: AliHLTGUI [OPTON VALUE] ..." << endl;
379 cout << " OPTIONs:\n --------" << endl;
380 cout << " -rawreadermode <mode> Sets the mode for AliHLTDigitReaderRaw, can bei either digit or string." << endl;
381 cout << " -n-time-bins <mode> Sets number of TimeBins for the TPC, can bei either a digit, 'sim' or 'tpc'." << endl;
382 cout << " -adc-threshold <mode> Sets the ADC Threshold for the Zero-Suppression of raw data, should be ADC counts." << endl;
383 cout << " -occupancy-limit <mode> Sets the Occupancy limits for pads, wherby <mode> is [0,1]." << endl;
384 cout << " -b-field <mode> Sets the B-field." << endl;
385 cout << " -tcp-source <host:port> ... Sets Host and Ports to a TCP port of a TCPDumpSubscriber. Multiple Connections can be given." << endl;
386 cout << " -connect Connects already to given TCP-Sources." << endl;
387 cout << " --help Shows the Help Menu." << endl;
388 cout << " --version Prints version of AliHLTGUI" << endl;
394 if ( !strcmp( argv[ii], "--version" ) ) {
395 cout << "Version of AliHLTGUI: " << fVersion << endl;
401 HLTError( "Unknown Option", "Unknown option '%s'", argv[ii] );
404 } // end while ( ii < argc ) {
408 // if error occured: Print usage and exit
410 cout << "Usage: AliHLTGUI [OPTON VALUE] ..." << endl;
411 cout << " OPTIONs:\n --------" << endl;
412 cout << " -rawreadermode <mode> Sets the mode for AliHLTDigitReaderRaw, can bei either digit or string." << endl;
413 cout << " -n-time-bins <mode> Sets number of TimeBins for the TPC, can bei either a digit, 'sim' or 'tpc'." << endl;
414 cout << " -adc-threshold <mode> Sets the ADC Threshold for the Zero-Suppression of raw data, should be ADC counts." << endl;
415 cout << " -occupancy-limit <mode> Sets the Occupancy limits for pads, wherby <mode> is [0,1]." << endl;
416 cout << " -b-field <mode> Sets the B-field." << endl;
417 cout << " -tcp-source <host:port> ... Sets Host and Ports to a TCP port of a TCPDumpSubscriber. Multiple Connections can be given." << endl;
418 cout << " -connect Connects already to given TCP-Sources." << endl;
419 cout << " --help Shows the Help Menu." << endl;
420 cout << " --version Prints version of AliHLTGUI" << endl;
425 if ( connectToSource ) connectDisplay();
429 //____________________________________________________________________________________________________
430 AliHLTGUI::~AliHLTGUI() {
437 AliHLTTPCDisplayMain* display = (AliHLTTPCDisplayMain*) fDisplay;
444 //____________________________________________________________________________________________________
445 void AliHLTGUI::connectDisplay() {
446 // -- connect to Display class / TCPDumpSubscriber
448 AliHLTTPCDisplayMain* display = (AliHLTTPCDisplayMain*)fDisplay;
452 enableDisplay( display->GetConnectionStatus() );
454 // if connected => diconnect
455 if ( display->GetConnectionStatus() ) {
456 cout << "Disonnecting..." << endl;
457 display->SetConnectionStatus(kFALSE);
459 connectPushButton->setText("Connect");
460 connectTextLabel->setText("DISCONNECTED");
461 connectTextLabel->setPaletteForegroundColor(red);
462 HostListTextLabel->setEnabled(TRUE);
463 hostListView->setEnabled(TRUE);
464 removePushButton->setEnabled(TRUE);
465 addGroupBox->setEnabled(TRUE);
467 eventGroupBox->setEnabled(FALSE);
470 #if ALIHLTTPCDISPLAY_VERSION >= 2
471 display->Disconnect();
473 HLTWarning("disconnect not available for AliHLTTPCDisplay version < 2");
480 cout << "Connecting..." << endl;
483 // -- Set geometry file in AliHLTTPCDisplayMain
484 // --------------------------------------------
485 Char_t * geometryPath = getenv("ALIHLT_TOPDIR");
486 Char_t * geometryFile = "alice.geom";
493 strcat(geoPath,geometryPath);
494 strcat(geoPath,"/TPCLib/OnlineDisplay");
496 else strcat(geoPath,".");
499 strcat(geoPath,geometryFile);
501 // -- Set Hostnames in AliHLTTPCDisplayMain
502 // ----------------------------------------
503 Int_t cnt = fHostnames.size();
506 HLTError( "Error establishing connection: No Hostnames specified" );
507 connectTextLabel->setText("ERROR");
508 connectTextLabel->setPaletteForegroundColor(red);
512 unsigned short* ports = new unsigned short[cnt];
513 const char** hostnames = new const char*[cnt];
515 for ( Int_t i = 0; i < cnt; i++ ) {
516 const char * temp = fHostnames[i].latin1();
518 ports[i] = (unsigned short) atoi(fPorts[i]);
521 Int_t connect = display->Connect( cnt, (const char**) hostnames, ports, geoPath);
526 // check return value
528 connectTextLabel->setText("CONNECTED");
529 connectTextLabel->setPaletteForegroundColor(green);
531 else if (connect == -1){
532 connectTextLabel->setText("NO CHAIN");
533 connectTextLabel->setPaletteForegroundColor(red);
536 else if (connect == -2){
537 connectTextLabel->setText("TIMEOUT");
538 connectTextLabel->setPaletteForegroundColor(red);
542 connectTextLabel->setText("GENERAL ERROR");
543 connectTextLabel->setPaletteForegroundColor(red);
550 // if raw data present
551 if ( display->ExistsRawData() ) {
552 rawZeroGroupBox->setEnabled(TRUE);
553 rawSliceGroupBox->setEnabled(TRUE);
554 padrowGroupBox->setEnabled(TRUE);
555 frontDataButtonGroup->setEnabled(TRUE);
556 frontDisplayButtonGroup->setEnabled(TRUE);
557 padrowCheckBox->setEnabled(TRUE);
558 threeDRawButtonGroup->setEnabled(TRUE);
561 rawZeroGroupBox->setEnabled(FALSE);
562 rawSliceGroupBox->setEnabled(FALSE);
563 padrowGroupBox->setEnabled(FALSE);
564 frontDataButtonGroup->setEnabled(FALSE);
565 frontDisplayButtonGroup->setEnabled(FALSE);
566 padrowCheckBox->setEnabled(FALSE);
567 threeDRawButtonGroup->setEnabled(FALSE);
571 // if cluster data present
572 if ( display->ExistsClusterData() ) {
573 clusterCheckBox->setEnabled(TRUE);
574 clusterPropButtonGroup->setEnabled(TRUE);
577 clusterCheckBox->setEnabled(FALSE);
578 clusterPropButtonGroup->setEnabled(FALSE);
581 // if track data present
582 if ( display->ExistsTrackData() ) {
583 tracksCheckBox->setEnabled(TRUE);
584 trackPropGroupBox->setEnabled(TRUE);
585 selectTrackGroupBox->setEnabled(TRUE);
586 trackParamGroupBox->setEnabled(TRUE);
589 tracksCheckBox->setEnabled(FALSE);
590 trackPropGroupBox->setEnabled(FALSE);
591 selectTrackGroupBox->setEnabled(FALSE);
592 trackParamGroupBox->setEnabled(FALSE);
597 enableDisplay( display->GetConnectionStatus() );
600 connectPushButton->setText("Disconnect");
601 connectTextLabel->setText("READ DATA");
602 connectTextLabel->setPaletteForegroundColor(green);
603 HostListTextLabel->setEnabled(FALSE);
604 hostListView->setEnabled(FALSE);
605 removePushButton->setEnabled(FALSE);
606 addGroupBox->setEnabled(FALSE);
609 eventGroupBox->setEnabled(TRUE);
610 nextEventPushButton->setEnabled(TRUE);
611 redisplayPushButton->setEnabled(TRUE);
612 saveGroupBox->setEnabled(TRUE);
613 sectorButtonGroup->setEnabled(TRUE);
614 threeDGroupBox->setEnabled(TRUE);
618 display->ReadData(kFALSE);
619 display->DisplayEvent();
621 Char_t eventID[256] = "";
622 #if ALIHLTTPCDISPLAY_VERSION >= 2
623 sprintf(eventID,"%Lu",display->GetEventID());
625 sprintf(eventID,"%Lu",0);
626 eventIDTextLabel->setText(eventID);
631 //____________________________________________________________________________________________________
632 void AliHLTGUI::nextEvent(){
633 // -- Display next event
634 AliHLTTPCDisplayMain* display = (AliHLTTPCDisplayMain*)fDisplay;
636 #if ALIHLTTPCDISPLAY_VERSION >= 2
637 ret = display->ReadData();
642 connectTextLabel->setText("NO CHAIN");
643 setPaletteForegroundColor(red);
645 // Stop of Event Loop
646 if (!fEventLoop->isActive()){
648 eventLoopPushButton->setText("Start Loop");
653 else if (ret == -2) {
654 connectTextLabel->setText("TIME OUT");
655 connectTextLabel->setPaletteForegroundColor(red);
657 // Stop of Event Loop
658 if (!fEventLoop->isActive()){
660 eventLoopPushButton->setText("Start Loop");
665 else if (ret == -3) {
666 connectTextLabel->setText("GENERAL ERROR");
667 connectTextLabel->setPaletteForegroundColor(red);
669 // Stop of Event Loop
670 if (!fEventLoop->isActive()){
672 eventLoopPushButton->setText("Start Loop");
678 connectTextLabel->setText("READ DATA");
679 connectTextLabel->setPaletteForegroundColor(green);
682 display->DisplayEvent();
684 Char_t eventID[256] = "";
685 #if ALIHLTTPCDISPLAY_VERSION >= 2
686 sprintf(eventID,"%Lu",display->GetEventID());
688 sprintf(eventID,"%Lu",0);
689 eventIDTextLabel->setText(eventID);
694 //____________________________________________________________________________________________________
695 void AliHLTGUI::eventLoop(){
696 // -- Start / Stop of Event Loop
697 if (!fEventLoop->isActive()){
698 fEventLoop->start(1000 * atoi( eventLoopSpinBox->text() ) );
699 eventLoopPushButton->setText("Stop Loop");
703 eventLoopPushButton->setText("Start Loop");
708 //____________________________________________________________________________________________________
709 void AliHLTGUI::enableDisplay(Bool_t connected){
710 AliHLTTPCDisplayMain* display = (AliHLTTPCDisplayMain*) fDisplay;
712 Bool_t inverseconnected = ~connected; // TODO check!!
714 // if already connected => disconnect
715 // else disconnect => connect
717 HostListTextLabel->setEnabled( connected );
718 hostListView->setEnabled( connected );
719 removePushButton->setEnabled( connected );
720 addGroupBox->setEnabled( connected );
721 eventGroupBox->setEnabled( inverseconnected );
724 cout << "Disonnecting..." << endl;
725 display->SetConnectionStatus( inverseconnected );
727 connectPushButton->setText("Connect");
728 connectTextLabel->setText("DISCONNECTED");
729 connectTextLabel->setPaletteForegroundColor(red);
731 #if ALIHLTTPCDISPLAY_VERSION >= 2
732 display->Disconnect();
734 HLTWarning("disconnect not available for AliHLTTPCDisplay version < 2");
740 else { // connected = false
742 connectPushButton->setText("Disconnect");
743 connectTextLabel->setText("READ DATA");
744 connectTextLabel->setPaletteForegroundColor(green);
747 nextEventPushButton->setEnabled( inverseconnected );
748 redisplayPushButton->setEnabled( inverseconnected );
749 saveGroupBox->setEnabled( inverseconnected );
750 sectorButtonGroup->setEnabled( inverseconnected );
751 threeDGroupBox->setEnabled( inverseconnected );
756 //____________________________________________________________________________________________________
757 void AliHLTGUI::enableDataObjects(){
758 AliHLTTPCDisplayMain* display = (AliHLTTPCDisplayMain*) fDisplay;
760 Bool_t existsRawData = display->ExistsRawData();
761 Bool_t existsClusterData = display->ExistsClusterData();
762 Bool_t existsTrackData = display->ExistsTrackData();
765 rawZeroGroupBox->setEnabled(existsRawData);
766 rawSliceGroupBox->setEnabled(existsRawData);
767 padrowGroupBox->setEnabled(existsRawData);
768 frontDataButtonGroup->setEnabled(existsRawData);
769 frontDisplayButtonGroup->setEnabled(existsRawData);
770 padrowCheckBox->setEnabled(existsRawData);
771 threeDRawButtonGroup->setEnabled(existsRawData);
774 clusterCheckBox->setEnabled(existsClusterData);
775 clusterPropButtonGroup->setEnabled(existsClusterData);
778 tracksCheckBox->setEnabled(existsTrackData);
779 trackPropGroupBox->setEnabled(existsTrackData);
780 selectTrackGroupBox->setEnabled(existsTrackData);
781 trackParamGroupBox->setEnabled(existsTrackData);
784 //____________________________________________________________________________________________________
785 void AliHLTGUI::updateEventLoop(){
786 if (fEventLoop->isActive())
787 fEventLoop->changeInterval(1000 * atoi( eventLoopSpinBox->text() ) );
790 //____________________________________________________________________________________________________
791 void AliHLTGUI::redisplay(Bool_t newRawSlice){
792 // -- ReDisplay current event
793 AliHLTTPCDisplayMain* display = (AliHLTTPCDisplayMain*)fDisplay;
794 #if ALIHLTTPCDISPLAY_VERSION >= 2
795 display->DisplayEvent(newRawSlice);
797 HLTError("function not available for AliHLTTPCDisplay version < 2");
803 //____________________________________________________________________________________________________
804 void AliHLTGUI::saveHistograms(){
805 // -- save all Histograms
806 AliHLTTPCDisplayMain* display = (AliHLTTPCDisplayMain*)fDisplay;
807 display->SaveHistograms();
810 //____________________________________________________________________________________________________
811 void AliHLTGUI::addHost(){
812 // -- add host to hostlist
814 fHostnames.push_back( hostnameLineEdit->text() );
815 fPorts.push_back( portSpinBox->text() );
818 QListViewItem * item1 = new QListViewItem(hostListView, hostnameLineEdit->text(), portSpinBox->text() );
819 hostListView->insertItem(item1);
822 //____________________________________________________________________________________________________
823 void AliHLTGUI::removeHost(){
824 // -- remove host from hostlist
825 if (hostListView->selectedItem()) {
826 for ( unsigned i = 0; i < fHostnames.size(); i++ ) {
827 if ( fHostnames[i] == hostListView->selectedItem()->text(0) && fPorts[i] == hostListView->selectedItem()->text(1)){
828 fHostnames.erase( fHostnames.begin()+i );
829 fPorts.erase( fPorts.begin()+i );
832 delete hostListView->selectedItem(); // #########
833 // hostListView->removeItem(hostListView->selectedItem());
837 //----------------------------------------------------------------------------------------------------
838 // SETTER - minor functions
839 //____________________________________________________________________________________________________
840 void AliHLTGUI::setSector(){
841 // -- set sectors to display
842 AliHLTTPCDisplayMain* display = (AliHLTTPCDisplayMain*)fDisplay;
844 Int_t selectSectorID = sectorButtonGroup->selectedId();
847 if (selectSectorID == 0) {
848 display->SetSlices();
849 display->SetTheta(90.);
852 else if (selectSectorID == 4) {
853 display->SetSlices( atoi( oneSpinBox->text() ) );
854 display->SetTheta(0.);
856 // Set RANGE of Sectors
857 else if (selectSectorID == 1) {
858 display->SetSlices( atoi( rangeMinSpinBox->text() ) ,atoi( rangeMaxSpinBox->text() ) );
859 display->SetTheta(90.);
861 // Set PAIR of Sectors
862 else if (selectSectorID == 3) {
863 display->SetSlicesPair(atoi( pairSpinBox->text() ) );
864 display->SetTheta(90.);
866 // Set PAIR RANGE of Sectors
867 else if (selectSectorID == 2) {
868 display->SetSlicesPair(atoi( pairRangeMinSpinBox->text() ) ,atoi( pairRangeMaxSpinBox->text() ) );
869 display->SetTheta(90.);
875 //____________________________________________________________________________________________________
876 void AliHLTGUI::setCluster(){
877 // -- set used/unuse/all cluster
878 AliHLTTPCDisplayMain* display = (AliHLTTPCDisplayMain*)fDisplay;
880 // ALL Cluster = 0 | USED Cluster = 1 | UNUSED Cluster = 2
881 display->SetSelectCluster( clusterPropButtonGroup->selectedId() );
886 //____________________________________________________________________________________________________
887 void AliHLTGUI::setTrack(){
888 // -- set track properties
889 AliHLTTPCDisplayMain* display = (AliHLTTPCDisplayMain*)fDisplay;
891 display->SetCutHits(atoi (cutHitsSpinBox->text() ) );
892 display->SetCutPt( (Float_t) atof (cutPtLineEdit->text() ) );
893 display->SetCutPsi( (Float_t) atof (cutPsiLineEdit->text() ) );
894 display->SetCutLambda( (Float_t) atof (cutLambdaLineEdit->text() ) );
895 display->SetCutS( (Float_t) atof (cutSLineEdit->text() ) );
896 display->SetIncidentPadrow( (Int_t) atoi (cutPadrowLineEdit->text() ) );
900 //____________________________________________________________________________________________________
901 void AliHLTGUI::setInvert(){
902 // -- set invert 3D display
903 AliHLTTPCDisplayMain* display = (AliHLTTPCDisplayMain*)fDisplay;
905 display->SetInvert();
909 //____________________________________________________________________________________________________
910 void AliHLTGUI::setKeepView(){
911 // -- keep angle view
912 AliHLTTPCDisplayMain* display = (AliHLTTPCDisplayMain*)fDisplay;
914 if (keepViewCheckBox->isChecked() ) display->SetKeepView(kTRUE);
915 else display->SetKeepView(kFALSE);
919 void AliHLTGUI::setZeroSuppression(){
920 // -- set Zero Suppresion
921 AliHLTTPCDisplayMain* display = (AliHLTTPCDisplayMain*)fDisplay;
923 #if ALIHLTTPCDISPLAY_VERSION >= 2
924 if (rawZeroCheckBox->isChecked() ) display->SetZeroSuppression(kTRUE);
925 else display->SetZeroSuppression(kFALSE);
927 HLTError("function not available for AliHLTTPCDisplay version < 2");
934 //____________________________________________________________________________________________________
935 void AliHLTGUI::setRawSlice(){
936 // -- set slice for padrow / pad / timebin
937 AliHLTTPCDisplayMain* display = (AliHLTTPCDisplayMain*)fDisplay;
939 display->SetSlicePadRow( atoi (rawSectorSpinBox->text() ) );
941 redisplay(kTRUE/*newRawSlice*/);
944 //____________________________________________________________________________________________________
945 void AliHLTGUI::setPadRow(){
947 AliHLTTPCDisplayMain* display = (AliHLTTPCDisplayMain*)fDisplay;
949 display->SetPadRow(atoi (padrowSpinBox->text() ) );
951 padSpinBox->setMaxValue(display->GetNPads());
952 padSlider->setMaxValue(display->GetNPads());
957 //____________________________________________________________________________________________________
958 void AliHLTGUI::setPad(){
959 // -- set pad, or pad histograms
960 AliHLTTPCDisplayMain* display = (AliHLTTPCDisplayMain*)fDisplay;
962 display->SetPad(atoi (padSpinBox->text() ) );
967 //____________________________________________________________________________________________________
968 void AliHLTGUI::setTimeBin(){
970 AliHLTTPCDisplayMain* display = (AliHLTTPCDisplayMain*)fDisplay;
972 Int_t selectTimebinID = frontDisplayButtonGroup->selectedId();
974 #if ALIHLTTPCDISPLAY_VERSION >= 2
976 if ( selectTimebinID == 3) display->SetTimeBinMinMax(0,display->GetNTimeBins()-1 );
979 else if ( selectTimebinID == 2) display->SetTimeBinMinMax( atoi( oneTimeBinSpinBox->text() ), atoi( oneTimeBinSpinBox->text() ) );
981 // Set RANGE of TimeBins
982 else if ( selectTimebinID == 1) {
983 Int_t min = atoi( minTimeBinSpinBox->text() );
984 Int_t max = atoi( maxTimeBinSpinBox->text() );
988 maxTimeBinSpinBox->setValue(max);
991 display->SetTimeBinMinMax( min , max );
995 HLTError("function not available for AliHLTTPCDisplay version < 2");
1001 //____________________________________________________________________________________________________
1002 void AliHLTGUI::selectTimeBinData(){
1003 // -- select max,sum,average of Data
1004 AliHLTTPCDisplayMain* display = (AliHLTTPCDisplayMain*)fDisplay;
1006 Int_t selectFrontDataID = frontDataButtonGroup->selectedId();
1008 #if ALIHLTTPCDISPLAY_VERSION >= 2
1009 // Set use sum in data
1010 if (selectFrontDataID == 0) display->SetFrontDataSwitch(0);
1012 // Set use average in data
1013 else if (selectFrontDataID == 1) display->SetFrontDataSwitch(1);
1015 // Set use maximum in data
1016 else if (selectFrontDataID == 2) display->SetFrontDataSwitch(2);
1018 HLTError("function not available for AliHLTTPCDisplay version < 2");
1024 //____________________________________________________________________________________________________
1025 void AliHLTGUI::setSplitPadRow(){
1026 // -- set split PadRow Canvas
1027 AliHLTTPCDisplayMain* display = (AliHLTTPCDisplayMain*)fDisplay;
1029 if (padrowSplitCheckBox->isChecked() ) display->SetSplitPadRow(kTRUE);
1030 else display->SetSplitPadRow(kFALSE);
1034 //____________________________________________________________________________________________________
1035 void AliHLTGUI::setSplitFront(){
1036 // -- set split Front Canvas
1037 AliHLTTPCDisplayMain* display = (AliHLTTPCDisplayMain*)fDisplay;
1039 #if ALIHLTTPCDISPLAY_VERSION >= 2
1040 if (frontSplitCheckBox->isChecked() ) display->SetSplitFront(kTRUE);
1041 else display->SetSplitFront(kFALSE);
1043 HLTError("function not available for AliHLTTPCDisplay version < 2");
1050 //____________________________________________________________________________________________________
1051 void AliHLTGUI::setAllTimeBins(){
1052 // -- set show all Timebins in front view
1053 AliHLTTPCDisplayMain* display = (AliHLTTPCDisplayMain*)fDisplay;
1055 if (allTimebinCheckBox->isChecked() ) display->SetAllTimebins(kTRUE);
1056 else display->SetAllTimebins(kFALSE);
1062 //____________________________________________________________________________________________________
1063 void AliHLTGUI::setGUIPad(Int_t pad){
1064 // -- set GUI pad value
1065 padSpinBox->setValue(pad);
1068 //____________________________________________________________________________________________________
1069 void AliHLTGUI::set3D(){
1070 // -- set 3D Display
1071 AliHLTTPCDisplayMain* display = (AliHLTTPCDisplayMain*)fDisplay;
1073 if (padrowCheckBox->isChecked()) setPadRow();
1075 display->SetSwitches(tracksCheckBox->isChecked(), clusterCheckBox->isChecked(), padrowCheckBox->isChecked(), geometryCheckBox->isChecked() );
1079 //____________________________________________________________________________________________________
1080 void AliHLTGUI::set3DRaw(){
1081 // -- set 3D Display Raw Properties
1082 AliHLTTPCDisplayMain* display = (AliHLTTPCDisplayMain*)fDisplay;
1084 Int_t selectRawID = threeDRawButtonGroup->selectedId();
1086 #if ALIHLTTPCDISPLAY_VERSION >= 2
1088 if (selectRawID == 0) display->Set3DRawSwitch(0);
1091 else if (selectRawID == 1) display->Set3DRawSwitch(1);
1093 HLTError("function not available for AliHLTTPCDisplay version < 2");
1100 //____________________________________________________________________________________________________
1101 void AliHLTGUI::setSelectTrack(){
1102 // -- turn on /off of single track
1103 AliHLTTPCDisplayMain* display = (AliHLTTPCDisplayMain*)fDisplay;
1105 display->SetSelectTrackSwitch( selectTrackCheckBox->isChecked() );
1107 if (! selectTrackCheckBox->isChecked() ) {
1108 display->SetSelectTrack(0);
1111 else selectTrackSector();
1114 //____________________________________________________________________________________________________
1115 void AliHLTGUI::selectTrackSector(){
1116 // -- select slice for single track
1117 AliHLTTPCDisplayMain* display = (AliHLTTPCDisplayMain*)fDisplay;
1119 Int_t slice = atoi( selectTrackSectorSpinBox->text());
1121 if (display->GetTracksPerSlice(slice) == 0) selectTrackSpinBox->setMaxValue( 0 );
1122 else selectTrackSpinBox->setMaxValue( display->GetTracksPerSlice(slice) - 1 );
1124 selectTrackSpinBox->setValue(0);
1126 display->SetSelectTrackSlice(slice);
1131 //____________________________________________________________________________________________________
1132 void AliHLTGUI::selectTrack(){
1133 // -- select single track in slice
1134 AliHLTTPCDisplayMain* display = (AliHLTTPCDisplayMain*)fDisplay;
1136 display->SetSelectTrack( atoi( selectTrackSpinBox->text() ) );
1141 //____________________________________________________________________________________________________
1142 void AliHLTGUI::displayTrackParam(){
1143 // -- display Track Parameters
1144 AliHLTTPCDisplayMain* display = (AliHLTTPCDisplayMain*)fDisplay;
1146 Char_t nHits[256] = "";
1147 Char_t charge[256] = "";
1148 Char_t kappa[256] = "";
1149 Char_t radius[256] = "";
1150 Char_t slice[256] = "";
1151 Char_t phi0[256] = "";
1152 Char_t psi[256] = "";
1153 Char_t lambda[256]= "";
1154 Char_t pt[256] = "";
1155 Char_t id[256] = "";
1157 if ( display->GetSelectTrackSwitch()
1158 && display->ExistsTrackData()
1159 && display->GetDisplaySlice( atoi(selectTrackSectorSpinBox->text()) )
1160 && display->GetTracksPerSlice( atoi(selectTrackSectorSpinBox->text()) ) > 0 ){
1161 sprintf(kappa,"%f",display->fTrackParam.kappa);
1162 sprintf(nHits,"%d",display->fTrackParam.nHits);
1163 sprintf(charge,"%d",display->fTrackParam.charge);
1164 sprintf(radius,"%f",display->fTrackParam.radius);
1165 sprintf(slice,"%d",display->fTrackParam.slice);
1166 sprintf(phi0,"%f",display->fTrackParam.phi0);
1167 sprintf(psi,"%f",display->fTrackParam.psi);
1168 sprintf(lambda,"%f",display->fTrackParam.lambda);
1169 sprintf(pt,"%f",display->fTrackParam.pt);
1170 sprintf(id,"%d",display->fTrackParam.id);
1173 sprintf(kappa,"%f",0.);
1174 sprintf(nHits,"%d",1);
1175 sprintf(charge,"%d",0);
1176 sprintf(radius,"%f",0.);
1177 sprintf(slice,"%d",0);
1178 sprintf(phi0,"%f",0.);
1179 sprintf(psi,"%f",0.);
1180 sprintf(lambda,"%f",0.);
1181 sprintf(pt,"%f",0.);
1185 trackParamSliceTextLabel->setText(slice);
1186 trackParamIDTextLabel->setText(id);
1187 trackParamKappaTextLabel->setText(kappa);
1188 trackParamPtTextLabel->setText(pt);
1189 trackParamNHitsTextLabel->setText(nHits);
1190 trackParamChargeTextLabel->setText(charge);
1191 trackParamRadiusTextLabel->setText(radius);
1192 trackParamPhi0TextLabel->setText(phi0);
1193 trackParamPsiTextLabel->setText(psi);
1194 trackParamLambdaTextLabel->setText(lambda);