]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - TPC/AliTPCCalibViewerGUI.cxx
Merge branch 'master' into TPCdev
[u/mrichter/AliRoot.git] / TPC / AliTPCCalibViewerGUI.cxx
index fa0b7e95228595b7ba74990082c04f4992a4e3ef..4cf271ab228aeafb2fee65bdb3fcd5800be176fe 100644 (file)
@@ -214,7 +214,7 @@ AliTPCCalibViewerGUI::AliTPCCalibViewerGUI(const TGWindow *p, UInt_t w, UInt_t h
 }
 
 
-void AliTPCCalibViewerGUI::DrawGUI(const TGWindow *p, UInt_t w, UInt_t h) {
+void AliTPCCalibViewerGUI::DrawGUI(const TGWindow */*p*/, UInt_t w, UInt_t h) {
    // 
    // draw the GUI
    // 
@@ -223,7 +223,6 @@ void AliTPCCalibViewerGUI::DrawGUI(const TGWindow *p, UInt_t w, UInt_t h) {
    // ======================================================================
    
    SetCleanup(kDeepCleanup);
-   p = p; // to avoid compiler warnings
 
    // *****************************************************************************
    // ************************* content of this MainFrame *************************
@@ -320,6 +319,7 @@ void AliTPCCalibViewerGUI::DrawGUI(const TGWindow *p, UInt_t w, UInt_t h) {
             fContAddDrawOpt->AddFrame(fComboAddDrawOpt, new TGLayoutHints(kLHintsNormal | kLHintsExpandX, 0, 0, 0, 0));
             fComboAddDrawOpt->Connect("ReturnPressed()", "AliTPCCalibViewerGUI", this, "HandleButtonsGeneral(=14)");
             fComboAddDrawOpt->Connect("Selected(Int_t)", "AliTPCCalibViewerGUI", this, "DoNewSelection()");
+            fComboAddDrawOpt->GetTextEntry()->SetText("",kFALSE);
                   
          // automatic redraw check button
          fChkAuto = new TGCheckButton(fContDrawOpt, "Auto redraw");
@@ -573,7 +573,7 @@ void AliTPCCalibViewerGUI::DrawGUI(const TGWindow *p, UInt_t w, UInt_t h) {
          fContCustom->AddFrame(fComboCustom, new TGLayoutHints(kLHintsNormal | kLHintsExpandX, 0, 0, 0, 0));
          fComboCustom->Connect("ReturnPressed()", "AliTPCCalibViewerGUI", this, "HandleButtonsGeneral(=42)");
          fComboCustom->Connect("Selected(Int_t)", "AliTPCCalibViewerGUI", this, "DoNewSelection()");
-      
+         fComboCustom->GetTextEntry()->SetText("",kFALSE);
    
       // additional cuts container
       fContAddCuts = new TGCompositeFrame(fContTopBottom, 200, 200, kHorizontalFrame | kFitWidth | kFitHeight);
@@ -590,6 +590,7 @@ void AliTPCCalibViewerGUI::DrawGUI(const TGWindow *p, UInt_t w, UInt_t h) {
          fContAddCuts->AddFrame(fComboAddCuts, new TGLayoutHints(kLHintsNormal | kLHintsExpandX, 0, 0, 0, 0));
          fComboAddCuts->Connect("ReturnPressed()", "AliTPCCalibViewerGUI", this, "HandleButtonsCuts(=31)");
          fComboAddCuts->Connect("Selected(Int_t)", "AliTPCCalibViewerGUI", this, "DoNewSelection()");
+         fComboAddCuts->GetTextEntry()->SetText("",kFALSE);
          
    // ==========================================================================
    // ************************* content of fContCenter *************************
@@ -798,6 +799,7 @@ void AliTPCCalibViewerGUI::DrawGUI(const TGWindow *p, UInt_t w, UInt_t h) {
             fComboAddSaveOpt->EnableTextInput(kTRUE);
             fComboAddSaveOpt->Connect("ReturnPressed()", "AliTPCCalibViewerGUI", this, "SavePicture()");
             // fComboAddSaveOpt->Connect("Selected(Int_t)", "AliTPCCalibViewerGUI", this, "SavePicture()");
+            fComboAddSaveOpt->GetTextEntry()->SetText("",kFALSE);
      
       // calPad export container
       fContExport = new TGGroupFrame(fTabRight1, "Export AliTPCCalPad", kVerticalFrame | kFitWidth | kFitHeight);
@@ -816,6 +818,7 @@ void AliTPCCalibViewerGUI::DrawGUI(const TGWindow *p, UInt_t w, UInt_t h) {
          fComboExportName->EnableTextInput(kTRUE);
          fComboExportName->Connect("ReturnPressed()", "AliTPCCalibViewerGUI", this, "DoExport()");
          fComboExportName->Connect("Selected(Int_t)", "AliTPCCalibViewerGUI", this, "DoExport()");
+         fComboExportName->GetTextEntry()->SetText("",kFALSE);
   
          // export button
          fBtnExport = new TGTextButton(fContExport, "&Export to CINT");
@@ -873,6 +876,7 @@ void AliTPCCalibViewerGUI::DrawGUI(const TGWindow *p, UInt_t w, UInt_t h) {
             fContAddFit->AddFrame(fComboCustomFit, new TGLayoutHints(kLHintsNormal | kLHintsExpandX, 0, 0, 0, 0));
             fComboCustomFit->Connect("ReturnPressed()", "AliTPCCalibViewerGUI", this, "DoFit()");
             fComboCustomFit->Connect("Selected(Int_t)", "AliTPCCalibViewerGUI", this, "DoFit()");
+            fComboCustomFit->GetTextEntry()->SetText("",kFALSE);
          
          // fit button
          fBtnFit = new TGTextButton(fContAddFit, "&Fit");
@@ -1777,7 +1781,6 @@ void AliTPCCalibViewerGUI::DoFit() {
    TMatrixD covMatrix(0,0);
    TString cutStr("");
    TString formulaStr("");
-   TString *returnStr = new TString("");
 
    // specify data to plot:
    TString drawStr(GetDrawString()->Data());
@@ -1815,12 +1818,14 @@ void AliTPCCalibViewerGUI::DoFit() {
    // ********** call AliTPCCalibViewer's fit-function
   ReplacePlaceHolders(drawStr);
   ReplacePlaceHolders(cutStr);
-  returnStr = fViewer->Fit(drawStr.Data(), formulaStr.Data(), cutStr.Data(), chi2, fitParam, covMatrix);
+  TString *returnStr = fViewer->Fit(drawStr.Data(), formulaStr.Data(), cutStr.Data(), chi2, fitParam, covMatrix);
    
    std::cout << std::endl;
    std::cout << "Your fit formula reads as follows:" << std::endl;
    std::cout << returnStr->Data() << std::endl;
    std::cout << "chi2 = " << chi2 << std::endl;
+
+  delete returnStr;
 }
 
 
@@ -1841,7 +1846,7 @@ void AliTPCCalibViewerGUI::DoExport() {
    // create calPad according to drawCommand and cuts
    AliTPCCalPad *calPad = fViewer->GetCalPad(desiredData.Data(), (char*)cutsStr.Data(), (char*)calPadName);
    // finally export calPad to Cint:
-   gROOT->ProcessLine(Form("AliTPCCalPad* %s = (AliTPCCalPad*)0x%lx;", calPadName, calPad));
+   gROOT->ProcessLine(Form("AliTPCCalPad* %s = (AliTPCCalPad*)0x%lx;", calPadName, (ULong_t)calPad));
    fPreprocessor->AddComponent(calPad);
    Info("ExportCalPad", "Current 2D view has been exported to an AliTPCCalPad* with name '%s'", calPadName);
 }
@@ -1858,6 +1863,7 @@ void AliTPCCalibViewerGUI::DoExportNorm() {
    }
    
    Error("DoExportNorm", "Not yet implemented.");
+/*  
    return;
    
    // specify data to plot:
@@ -1872,8 +1878,9 @@ void AliTPCCalibViewerGUI::DoExportNorm() {
    // create calPad according to drawCommand and cuts
    AliTPCCalPad *calPad = fViewer->GetCalPad(desiredData.Data(), (char*)cutsStr.Data(), (char*)fComboExportName->GetTextEntry()->GetText());
    // finally export calPad to Cint:
-   gROOT->ProcessLine(Form("AliTPCCalPad* %s = (AliTPCCalPad*)0x%lx;", calPadName, calPad));
+   gROOT->ProcessLine(Form("AliTPCCalPad* %s = (AliTPCCalPad*)0x%lx;", calPadName, (ULong_t) calPad));
    Info("ExportCalPad", "Current 2D view has been exported to an AliTPCCalPad* with name '%s'", calPadName);
+  */
 }
 
 
@@ -1888,7 +1895,7 @@ void AliTPCCalibViewerGUI::GetMinMax() {
       ptr = listOfPrimitives->At(i);
       if ( ptr->InheritsFrom("TH1") ) break;
    }
-   if ( ptr != 0 && !ptr->InheritsFrom("TH1") ) return;      // if the loop did not find a TH1
+   if ( !ptr || !ptr->InheritsFrom("TH1") ) return;      // if the loop did not find a TH1
    TH1 *hist = (TH1*)ptr;
 
 //    Double_t histMax = hist->GetMaximum();
@@ -2195,7 +2202,7 @@ void AliTPCCalibViewerGUI::DoDumpToFile() {
    new TGFileDialog(gClient->GetRoot(), gClient->GetRoot(), kFDSave, &fi);
    if (fi.fFilename && strlen(fi.fFilename)) {
       fPreprocessor->DumpToFile(fi.fFilename);
-      Info("DumpToFile", Form("New CalibTree has been writen to file '%s'", fi.fFilename));
+      Info("DumpToFile","New CalibTree has been writen to file '%s'", fi.fFilename);
    }
 }