]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - TRD/qaGui/AliTRDqaGuiBlackChamber.cxx
Extended Notify() functions to read cross section and trials also from the histogram...
[u/mrichter/AliRoot.git] / TRD / qaGui / AliTRDqaGuiBlackChamber.cxx
index 5e6627607ad03a23cc118cf64ccde279f92f586c..f477a24170df2822bb7f9333b7b1ee4a0d6734a4 100644 (file)
@@ -39,6 +39,7 @@
 #include "TString.h"
 #include "TSystem.h"
 
+#include "TLine.h"
 #include "TPaveText.h"
 #include "TGLabel.h"
 #include "TGComboBox.h"
@@ -54,7 +55,8 @@ const Int_t AliTRDqaGuiBlackChamber::fgknChamber = 30;
 //////////////////////////////////////////////////////////////////////////////////
 
 AliTRDqaGuiBlackChamber::AliTRDqaGuiBlackChamber() 
-  : fSetRangePed(0),
+  : fView(0),
+    fSetRangePed(0),
     fSetRangeNoise(0),
     fIdxSM(0),
     fIdxChamber(0),
@@ -64,8 +66,9 @@ AliTRDqaGuiBlackChamber::AliTRDqaGuiBlackChamber()
     fGCanvasDown(0),
     fGSelectSM(0),
     fGSelectChamber(0),
+    fGSelectView(0),
     fGPrevSM(0),
-    fGPrevChamber(0),
+    fGPrevChamber(0), 
     fGNextSM(0),
     fGNextChamber(0)
 {
@@ -73,8 +76,9 @@ AliTRDqaGuiBlackChamber::AliTRDqaGuiBlackChamber()
 
 //////////////////////////////////////////////////////////////////////////////////
 
-AliTRDqaGuiBlackChamber::AliTRDqaGuiBlackChamber(TGWindow *parent) 
+AliTRDqaGuiBlackChamber::AliTRDqaGuiBlackChamber(TGWindow *parent)
   : TGCompositeFrame(parent, 720, 500), 
+    fView(0),
     fSetRangePed(0),
     fSetRangeNoise(0),
     fIdxSM(0),
@@ -85,6 +89,7 @@ AliTRDqaGuiBlackChamber::AliTRDqaGuiBlackChamber(TGWindow *parent)
     fGCanvasDown(0),
     fGSelectSM(0),
     fGSelectChamber(0),
+    fGSelectView(0),
     fGPrevSM(0),
     fGPrevChamber(0),
     fGNextSM(0),
@@ -94,10 +99,9 @@ AliTRDqaGuiBlackChamber::AliTRDqaGuiBlackChamber(TGWindow *parent)
   // main constructor
   // 
   
-  // steering panel 
+   // steering panel 
   
   SetLayoutManager(new TGVerticalLayout(this));
-
   fGPanel = new TGHorizontalFrame(this);
 
   // fGLabel = new TGLabel(fGPanel, "Current Chamber: ");
@@ -109,14 +113,22 @@ AliTRDqaGuiBlackChamber::AliTRDqaGuiBlackChamber(TGWindow *parent)
 
   fGSelectSM = new TGComboBox(fGPanel);
   for(int i=0; i<fgknSM; i++) fGSelectSM->AddEntry(Form("SM %d", i), i);
-  fGSelectSM->Resize(100, fGPrevSM->GetHeight());
+  fGSelectSM->Resize(100, (Int_t)(fGPrevSM->GetHeight()*1.4));
   fGSelectSM->Select(fIdxSM);
 
   fGSelectChamber = new TGComboBox(fGPanel);
   for(int i=0; i<fgknChamber; i++) fGSelectChamber->AddEntry(Form("Chamber %d", i), i);
-  fGSelectChamber->Resize(100, fGPrevSM->GetHeight());
+  fGSelectChamber->Resize(100, (Int_t)(fGPrevSM->GetHeight()*1.4));
   fGSelectChamber->Select(fIdxChamber);
 
+  // vew
+  fGSelectView = new TGComboBox(fGPanel);
+  fGSelectView->AddEntry("pedestals",0);
+  fGSelectView->AddEntry("entiries", 1);
+  fGSelectView->Resize(150, (Int_t)(fGPrevSM->GetHeight()*1.4));
+  fGSelectView->Select(0);
+
+
   //fGPlay = new TGTextButton(fGPanel, "PLAY");
 
   TGLayoutHints *hint = new TGLayoutHints(kLHintsNormal, 5, 5, 5, 5);
@@ -131,6 +143,7 @@ AliTRDqaGuiBlackChamber::AliTRDqaGuiBlackChamber(TGWindow *parent)
   fGPanel->AddFrame(fGNextChamber, hint);
   fGPanel->AddFrame(fGNextSM, hint);
 
+  fGPanel->AddFrame(fGSelectView, hint);
   //fGPanel->AddFrame(fGPlay, hint);
 
   AddFrame(fGPanel);
@@ -144,6 +157,8 @@ AliTRDqaGuiBlackChamber::AliTRDqaGuiBlackChamber(TGWindow *parent)
   fGSelectSM->Connect("Selected(Int_t)", "AliTRDqaGuiBlackChamber", this, "SelectSM(Int_t)");
   fGSelectChamber->Connect("Selected(Int_t)", "AliTRDqaGuiBlackChamber", this, "SelectChamber(Int_t)");
   
+  fGSelectView->Connect("Selected(Int_t)", "AliTRDqaGuiBlackChamber", this, "SelectView(Int_t)");
+
   //fGPlay->Connect("Clicked()", "AliTRDqaGuiBlackChamber", this, "Play()");
 
   // histograms
@@ -195,10 +210,13 @@ void AliTRDqaGuiBlackChamber::SetQAFile(const char *filename) {
   // sets a file with histograms
   //
 
-
-  const char *names[5] = {"ped", "noise", "pedDist", "noiseDist", "signal"};
-  const char *opt[5] = {"colz", "colz", "", "", ""};
-  const Int_t kLogy[5] = {0, 0, 1, 1, 0};
+  //const char *names[5] = {"ped", "noise", "pedDist", "noiseDist", "signal"};
+  const char *names[10] = {
+    "ped", "noise", "pedDist", "noiseDist", "signal",
+    "entries", "entriesRM", "entriesDist", "", ""
+  };
+  const char *opt[10] = {"colz", "colz", "", "", "", "colz", "colz", "", "", ""};
+  const Int_t kLogy[10] = {0, 0, 1, 1, 1, 0, 0, 1, 1,1};
   
   strcpy(fFileName, filename);
  
@@ -214,27 +232,68 @@ void AliTRDqaGuiBlackChamber::SetQAFile(const char *filename) {
   for(Int_t i=0; i<5; i++) {
 
     Int_t index = fIdxSM * 30 + fIdxChamber;
-    const char *nn = Form("%s_%d", names[i], index);
+    const char *nn = Form("%s_%d", names[i+5*fView], index);
     //printf("%s\n", nn);
     fHistList[i] = (TH1*)file->Get(nn); //Form("%s_$d", names[fIdxType], index));
     if (!fHistList[i]) continue;
-    
-    if ( (i == 0)  && fSetRangePed) {
+
+    if ( (fView == 1) && (i == 0)) {
+      fHistList[i]->SetMinimum(0);
+      fHistList[i]->SetMaximum(2);
+    }
+
+    if ( (fView == 0) && (i == 0)  && fSetRangePed) {
       fHistList[i]->SetMinimum(fRangePed[0]);
       fHistList[i]->SetMaximum(fRangePed[1]);
     }
     
-    if ( (i == 1) && fSetRangeNoise) {
+    if ( (fView == 0) && (i == 1) && fSetRangeNoise) {
       fHistList[i]->SetMinimum(fRangeNoise[0]);
       fHistList[i]->SetMaximum(fRangeNoise[1]);
     }
 
-
     fCanvasList[i]->GetCanvas()->cd();
-    fCanvasList[i]->GetCanvas()->SetLogy(kLogy[i]);
-    if (fHistList[i]) fHistList[i]->Draw(opt[i]);
-    fCanvasList[i]->GetCanvas()->Update();
+    fCanvasList[i]->GetCanvas()->SetLogy(kLogy[i+5*fView]);
+    if (fHistList[i]) fHistList[i]->Draw(opt[i+5*fView]);
+    //fCanvasList[i]->GetCanvas()->Update();
+  }
+  
+  // mcm lines
+  TLine *line;
+  for(Int_t i=1; i<8; i++) {
+
+    fCanvasList[0]->GetCanvas()->cd();
+    line = new TLine(0, i*18-0.5, 15, i*18-0.5);
+    line->SetLineStyle(2);
+    if (i!=4) line->SetLineStyle(3);
+    line->Draw();
+
+    fCanvasList[1]->GetCanvas()->cd();
+    line = new TLine(0, i*18-0.5, 15, i*18-0.5);
+    line->SetLineStyle(2);
+    if (i!=4) line->SetLineStyle(3);
+    line->Draw();    
   }
+  
+  for(Int_t i=1; i<4; i++) {
+    
+    fCanvasList[0]->GetCanvas()->cd();
+    line = new TLine(i*4-0.5, 0, i*4-0.5, 143);
+    line->SetLineStyle(2);
+    line->Draw();
+
+    fCanvasList[1]->GetCanvas()->cd();
+    line = new TLine(i*4-0.5, 0, i*4-0.5, 143);
+    line->SetLineStyle(2);
+    line->Draw();  
+  }
+
+  
+
+
+  
+  for(Int_t i=0; i<5; i++)
+    fCanvasList[i]->GetCanvas()->Update();
 }
 
 //////////////////////////////////////////////////////////////////////////////////
@@ -264,3 +323,14 @@ void AliTRDqaGuiBlackChamber::SetSM(Int_t idxSM) {
 }
 
 //////////////////////////////////////////////////////////////////////////////////
+
+void AliTRDqaGuiBlackChamber::SetView(Int_t idxView) {
+  //
+  // sets active view
+  //
+  
+  fView = idxView;
+  fGSelectView->Select(idxView);
+  SetQAFile(fFileName);
+}
+//////////////////////////////////////////////////////////////////////////////////