]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Merge from EVE-dev to HEAD.
authormtadel <mtadel@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 18 May 2006 18:38:11 +0000 (18:38 +0000)
committermtadel <mtadel@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 18 May 2006 18:38:11 +0000 (18:38 +0000)
EVE/Alieve/ChangeLog
EVE/Alieve/TPCData.cxx
EVE/Alieve/TPCData.h
EVE/Alieve/TPCSector2D.cxx
EVE/Alieve/TPCSector2D.h
EVE/Alieve/TPCSector2DEditor.cxx
EVE/Alieve/TPCSector2DEditor.h
EVE/Alieve/TPCSector2DGL.cxx
EVE/ChangeLog
EVE/macros/alieve_loadlibs.C

index c0472816bdbf0a2b33aa39cdbb369d678e927e1d..2d08138e87eca794f37312a8c1622e9a47e3de25 100644 (file)
@@ -1,3 +1,24 @@
+2006-05-18  Matevz Tadel  <matevz.tadel@cern.ch>
+
+       EVE-dev branch
+
+       * TPCData.cxx:
+       * TPCData.h:
+       Added member fLoadPedestal to support subtraction of common
+       pedestal during data loading.
+
+       * TPCSector2D.cxx:
+       * TPCSector2D.h:
+       * TPCSector2DEditor.cxx:
+       * TPCSector2DEditor.h:
+       * TPCSector2DGL.cxx:
+       Added option fAverage to divide the integrated time-bin contents
+       by window width; fShowMax now works within the given time
+       window. Added flags to control rendering of inner/outer1/outer2
+       segments. Widgets have been extended to display numeric values for
+       threshold, max-value and min/max time (there were only sliders and
+       print-out before).
+
 2006-05-18  Matevz Tadel  <matevz.tadel@cern.ch>
 
        EVE-dev branch
index 59edde9bb3a977f0a2efb85a901ddc2b3579e895..77ad4b79e57777482751941a7cb3af7eacca7b66 100644 (file)
@@ -28,7 +28,7 @@ ClassImp(TPCData)
 
 TPCData::TPCData() :
   fSectors(36), fSectorBlockSize(65536),
-  fLoadThreshold(0)
+  fLoadThreshold(0), fLoadPedestal(0)
 {
   TPCSectorData::InitStatics();
 }
@@ -107,7 +107,7 @@ void TPCData::LoadDigits(TTree* tree, Bool_t spawnSectors)
        inFill = kTRUE;
       }
       if(signal > fLoadThreshold)
-       secData->RegisterData(time, signal);
+       secData->RegisterData(time, signal - fLoadPedestal);
 
     } while (digit.Next());
     if(inFill) {
@@ -159,7 +159,7 @@ void TPCData::LoadRaw(AliTPCRawStream& input, Bool_t spawnSectors)
     }
 
     if(input.GetSignal() > fLoadThreshold)
-      secData->RegisterData(input.GetTime(), input.GetSignal());
+      secData->RegisterData(input.GetTime(), input.GetSignal() - fLoadPedestal);
   }
 
   if(inFill) {
@@ -220,7 +220,7 @@ void TPCData::LoadRaw(AliTPCRawStreamOld& input, Bool_t spawnSectors, Bool_t war
     }
 
     if(input.GetSignal() > fLoadThreshold)
-      secData->RegisterData(input.GetTime(), input.GetSignal());
+      secData->RegisterData(input.GetTime(), input.GetSignal() - fLoadPedestal);
   }
 
   if(inFill) {
index fff389a55577ffd9ab2087c0f80f640af9966fe7..dafaf6245478ec8d1d77c94ac254a495fb9ac063 100644 (file)
@@ -23,6 +23,7 @@ protected:
   std::vector<TPCSectorData*>  fSectors;
   Int_t                        fSectorBlockSize;
   Short_t                      fLoadThreshold;
+  Short_t                      fLoadPedestal;
 
 public:
   TPCData();
@@ -39,6 +40,9 @@ public:
   Short_t GetLoadThreshold()     const { return fLoadThreshold; }
   void    SetLoadThreshold(Short_t lt) { fLoadThreshold = lt; }
 
+  Short_t GetLoadPedestal()     const { return fLoadPedestal; }
+  void    SetLoadPedestal(Short_t lp) { fLoadPedestal = lp; }
+
   void LoadDigits(TTree* tree, Bool_t spawnSectors=kTRUE);
   void LoadRaw(AliTPCRawStream&    input, Bool_t spawnSectors=kTRUE);
   void LoadRaw(AliTPCRawStreamOld& input, Bool_t spawnSectors=kTRUE, Bool_t warn=kFALSE);
index d99610db2e3040c54f2ff73a29bbdacc452f1f1c..c8dceb2e40819e3b2c14123d091a1b1b4b03de1d 100644 (file)
@@ -1,3 +1,5 @@
+// $Header$
+
 #include "TPCSector2D.h"
 
 #include <Alieve/TPCData.h>
@@ -18,16 +20,21 @@ void TPCSector2D::Init()
   fTPCData   = 0;
 
   fSectorID  = 0;
-  fShowMax   = true;
+  fShowMax   = kTRUE;
+  fAverage   = kFALSE;
   fMinTime   = 0;
-  fMaxTime   = 1;
-  fthreshold  = 5;
+  fMaxTime   = 450;
+  fThreshold = 5;
   fMaxVal    = 80;
 
-  fRnrFrame   = true;
-  fUseTexture = true;
+  fRnrInn    = kTRUE;
+  fRnrOut1   = kTRUE;
+  fRnrOut2   = kTRUE;
+
+  fRnrFrame   = kTRUE;
+  fUseTexture = kTRUE;
 
-  fTrans      = false;
+  fTrans      = kFALSE;
 }
 
 TPCSector2D::~TPCSector2D()
index d1d68e8f76ba9f0e7b5fbf3742804aa47d9c345c..a1e83967dc3aff4dea468acbdb284c4976706cda 100644 (file)
@@ -1,3 +1,5 @@
+// $Header$
+
 #ifndef ALIEVE_TPCSector2D_H
 #define ALIEVE_TPCSector2D_H
 
@@ -34,11 +36,16 @@ protected:
   // These change data representation:
   Int_t       fSectorID; 
   Bool_t      fShowMax;
+  Bool_t      fAverage;
   Int_t       fMinTime;     
   Int_t       fMaxTime;
-  Short_t     fthreshold;
+  Short_t     fThreshold;
   Int_t       fMaxVal;
 
+  Bool_t      fRnrInn;
+  Bool_t      fRnrOut1;
+  Bool_t      fRnrOut2;
+
   Bool_t      fRnrFrame;
   Bool_t      fUseTexture;
   Color_t     fFrameCol;
@@ -57,10 +64,15 @@ public:
   void SetDataSource(TPCData* data);
   virtual void SetSectorID(Int_t id);
 
+  void SetRnrInn(Bool_t r)  { fRnrInn = r; ++fRTS; }
+  void SetRnrOut1(Bool_t r) { fRnrOut1 = r; ++fRTS; }
+  void SetRnrOut2(Bool_t r) { fRnrOut2 = r; ++fRTS; }
+
   void SetShowMax(Bool_t sm)  { fShowMax  = sm; ++fRTS; }
+  void SetAverage(Bool_t avg) { fAverage  = avg; ++fRTS; }
   void SetMinTime(Int_t mt)   { fMinTime  = mt; ++fRTS; }
   void SetMaxTime(Int_t mt)   { fMaxTime  = mt; ++fRTS; }
-  void Setthreshold(Short_t t) { fthreshold =  t; ++fRTS; }
+  void SetThreshold(Short_t t) { fThreshold =  t; ++fRTS; }
   void SetMaxVal(Int_t mv)    { fMaxVal   = mv; ++fRTS; }
 
   virtual void ComputeBBox();
index d0b69ba2e884f721bafc59917816df21306f743c..0aace9afbc249398f604c968b754512c235057fb 100644 (file)
@@ -22,9 +22,9 @@ using namespace Alieve;
 
 ClassImp(TPCSector2DEditor)
 
-TPCSector2DEditor::TPCSector2DEditor(const TGWindow *p, Int_t id, Int_t width, Int_t height,
-                                  UInt_t options, Pixel_t back) :
-  TGedFrame(p, id, width, height, options | kVerticalFrame, back)
+  TPCSector2DEditor::TPCSector2DEditor(const TGWindow *p, Int_t id, Int_t width, Int_t height,
+                                      UInt_t options, Pixel_t back) :
+    TGedFrame(p, id, width, height, options | kVerticalFrame, back)
 {
   fM = 0;
   MakeTitle("TPCSector2D");
@@ -49,28 +49,45 @@ TPCSector2DEditor::TPCSector2DEditor(const TGWindow *p, Int_t id, Int_t width, I
     f->AddFrame(l, new TGLayoutHints(kLHintsLeft | kLHintsCenterY, 3, 2, 1, 1));
 
     fSectorID = new TGNumberEntry(f, 0., 6, -1, 
-                                  TGNumberFormat::kNESInteger, TGNumberFormat::kNEANonNegative,
-                                  TGNumberFormat::kNELLimitMinMax, 0, 35);
+                                 TGNumberFormat::kNESInteger, TGNumberFormat::kNEANonNegative,
+                                 TGNumberFormat::kNELLimitMinMax, 0, 35);
 
     fSectorID->GetNumberEntry()->SetToolTipText("0-17 +z plate 18-35 -z plate");
     f->AddFrame(fSectorID, new TGLayoutHints(kLHintsLeft, 1, 1, 1, 1));
     fSectorID->Associate(this);
     fSectorID->Connect("ValueSet(Long_t)",
-                       "Alieve::TPCSector2DEditor", this, "DoSectorID()");                 
+                      "Alieve::TPCSector2DEditor", this, "DoSectorID()");
 
-    AddFrame(f, new TGLayoutHints(kLHintsTop, 1, 1, 1, 1));  
+    AddFrame(f, new TGLayoutHints(kLHintsTop, 1, 1, 1, 1));
+  }
+  {
+    TGHorizontalFrame* f = new TGHorizontalFrame(this);
+
+    fRnrInn = new TGCheckButton(f, "Inner");
+    f->AddFrame(fRnrInn, new TGLayoutHints(kLHintsTop, 3, 1, 1, 0));
+    fRnrInn->Connect("Toggled(Bool_t)","Alieve::TPCSector2DEditor", this, "DoRnrInn()");
+
+    fRnrOut1 = new TGCheckButton(f, "Outer 1");
+    f->AddFrame(fRnrOut1, new TGLayoutHints(kLHintsTop, 3, 1, 1, 0));
+    fRnrOut1->Connect("Toggled(Bool_t)","Alieve::TPCSector2DEditor", this, "DoRnrOut1()");
+
+    fRnrOut2 = new TGCheckButton(f, "Outer 2");
+    f->AddFrame(fRnrOut2, new TGLayoutHints(kLHintsTop, 3, 1, 1, 0));
+    fRnrOut2->Connect("Toggled(Bool_t)","Alieve::TPCSector2DEditor", this, "DoRnrOut2()");
+
+    AddFrame(f, new TGLayoutHints(kLHintsTop, 1, 1, 1, 1));
   }
   {
     TGHorizontalFrame* f = new TGHorizontalFrame(this);
-    fThresholdLabel = new TGLabel(f, "threshold [XXX]:");
+    fThresholdLabel = new TGLabel(f, "Threshold [XXX]:");
     f->AddFrame(fThresholdLabel, new TGLayoutHints(kLHintsLeft | kLHintsCenterY, 3, 2, 1, 1));
 
-    fthreshold = new TGHSlider(f, 150);
-    fthreshold->SetRange(0,149);
-    fthreshold->Associate(this);
-    f->AddFrame(fthreshold, new TGLayoutHints(kLHintsLeft, 0, 5));
-    fthreshold->Connect("PositionChanged(Int_t)",
-                      "Alieve::TPCSector2DEditor", this, "Dothreshold()");
+    fThreshold = new TGHSlider(f, 150);
+    fThreshold->SetRange(0,149);
+    fThreshold->Associate(this);
+    f->AddFrame(fThreshold, new TGLayoutHints(kLHintsLeft, 0, 5));
+    fThreshold->Connect("PositionChanged(Int_t)",
+                       "Alieve::TPCSector2DEditor", this, "DoThreshold()");
     AddFrame(f, new TGLayoutHints(kLHintsTop, 1, 1, 1, 1));
   }
   {
@@ -85,22 +102,49 @@ TPCSector2DEditor::TPCSector2DEditor(const TGWindow *p, Int_t id, Int_t width, I
                     "Alieve::TPCSector2DEditor", this, "DoMaxVal()");
     AddFrame(f, new TGLayoutHints(kLHintsTop, 1, 1, 1, 1));
   }
-  fShowMax = new TGCheckButton(this, "ShowMax");
-  AddFrame(fShowMax, new TGLayoutHints(kLHintsTop, 3, 1, 1, 0));
-  fShowMax->Connect("Toggled(Bool_t)","Alieve::TPCSector2DEditor", this, "DoShowMax()");
-
   {
     TGHorizontalFrame* f = new TGHorizontalFrame(this);
+    fShowMax = new TGCheckButton(f, "ShowMax");
+    f->AddFrame(fShowMax, new TGLayoutHints(kLHintsLeft, 3, 16, 1, 0));
+    fShowMax->Connect("Toggled(Bool_t)","Alieve::TPCSector2DEditor", this, "DoShowMax()");
+    fAverage = new TGCheckButton(f, "Average");
+    f->AddFrame(fAverage, new TGLayoutHints(kLHintsLeft, 3, 1, 1, 0));
+    fAverage->Connect("Toggled(Bool_t)","Alieve::TPCSector2DEditor", this, "DoAverage()");
+    AddFrame(f, new TGLayoutHints(kLHintsTop, 1, 1, 1, 1));
+  }
+
+  {
+    TGVerticalFrame* vf = new TGVerticalFrame(this);
+    
+    TGHorizontalFrame* f = new TGHorizontalFrame(vf);
+
     TGLabel *l = new TGLabel(f, "Time Range:");
     f->AddFrame(l, new TGLayoutHints(kLHintsLeft | kLHintsCenterY, 1, 2, 1, 1));
 
-    fTime = new TGDoubleHSlider(f);
-    fTime->SetRange(0, 500);
-    fTime->Resize(160, 20);
-    f->AddFrame(fTime);//, new TGLayoutHints(kLHintsLeft, 0, 5));
+    fMinTime = new TGNumberEntry(f, 0., 6, -1, TGNumberFormat::kNESInteger, TGNumberFormat::kNEANonNegative,
+                                TGNumberFormat::kNELLimitMinMax, 0, 1023);
+    fMinTime->GetNumberEntry()->SetToolTipText("MinTime");
+    f->AddFrame(fMinTime, new TGLayoutHints(kLHintsLeft, 1, 1, 1, 1));
+    fMinTime->Associate(this);
+    fMinTime->Connect("ValueSet(Long_t)", "Alieve::TPCSector2DEditor", this, "DoMinTime()");
+
+    fMaxTime = new TGNumberEntry(f, 0., 6, -1, TGNumberFormat::kNESInteger, TGNumberFormat::kNEANonNegative,
+                                TGNumberFormat::kNELLimitMinMax, 0, 1023);
+    fMaxTime->GetNumberEntry()->SetToolTipText("MaxTime");
+    f->AddFrame(fMaxTime, new TGLayoutHints(kLHintsLeft, 1, 1, 1, 1));
+    fMaxTime->Associate(this);
+    fMaxTime->Connect("ValueSet(Long_t)", "Alieve::TPCSector2DEditor", this, "DoMaxTime()");
+
+    vf->AddFrame(f, new TGLayoutHints(kLHintsTop, 1, 1, 1, 1));
+
+    fTime = new TGDoubleHSlider(vf);
+    fTime->SetRange(0, 1023);
+    fTime->Resize(250, 20);
+    vf->AddFrame(fTime);//, new TGLayoutHints(kLHintsLeft, 0, 5));
     fTime->Connect("PositionChanged()", "Alieve::TPCSector2DEditor",
                   this, "DoTime()");
-    AddFrame(f, new TGLayoutHints(kLHintsTop, 1, 1, 1, 1));
+
+    AddFrame(vf, new TGLayoutHints(kLHintsTop, 1, 1, 1, 1));
   }
   // What is this crap?
   TClass *cl = TPCSector2DEditor::Class();
@@ -132,14 +176,20 @@ void TPCSector2DEditor::SetModel(TVirtualPad* pad, TObject* obj, Int_t )
 
   fUseTexture->SetState(fM->fUseTexture ? kButtonDown : kButtonUp);
   fSectorID->SetNumber(fM->fSectorID);
-  fThresholdLabel->SetText(Form("threshold [%3d]:", fM->fthreshold));
-  fthreshold->SetPosition(fM->fthreshold);
+  fRnrInn->SetState(fM->fRnrInn   ? kButtonDown : kButtonUp);
+  fRnrOut1->SetState(fM->fRnrOut1 ? kButtonDown : kButtonUp);
+  fRnrOut2->SetState(fM->fRnrOut2 ? kButtonDown : kButtonUp);
+  fThresholdLabel->SetText(Form("Threshold [%3d]:", fM->fThreshold));
+  fThreshold->SetPosition(fM->fThreshold);
 
   fMaxValLabel->SetText(Form("MaxValue [%3d]:", fM->fMaxVal));
   fMaxVal->SetPosition(fM->fMaxVal);
+  fMinTime->SetNumber(fM->fMinTime);
+  fMaxTime->SetNumber(fM->fMaxTime);
   fTime->SetPosition(fM->fMinTime, fM->fMaxTime);
 
   fShowMax->SetState(fM->fShowMax ? kButtonDown : kButtonUp);
+  SetupAverage();
 
   SetActive();
 }
@@ -158,10 +208,29 @@ void TPCSector2DEditor::DoSectorID()
   Update();
 }
 
-void TPCSector2DEditor::Dothreshold()
+void TPCSector2DEditor::DoRnrInn()
+{
+  fM->SetRnrInn(fRnrInn->IsOn());
+  Update();
+}
+
+void TPCSector2DEditor::DoRnrOut1()
+{
+  fM->SetRnrOut1(fRnrOut1->IsOn());
+  Update();
+}
+
+void TPCSector2DEditor::DoRnrOut2()
+{
+  fM->SetRnrOut2(fRnrOut2->IsOn());
+  Update();
+}
+
+
+void TPCSector2DEditor::DoThreshold()
 {
-  fM->Setthreshold((Short_t) fthreshold->GetPosition());
-  fThresholdLabel->SetText(Form("threshold [%3d]:", fM->fthreshold));
+  fM->SetThreshold((Short_t) fThreshold->GetPosition());
+  fThresholdLabel->SetText(Form("Threshold [%3d]:", fM->fThreshold));
   Update();
 }
 
@@ -175,14 +244,57 @@ void TPCSector2DEditor::DoMaxVal()
 void TPCSector2DEditor::DoShowMax()
 {
   fM->SetShowMax(fShowMax->IsOn());
+  SetupAverage();
+  Update();
+}
+
+void TPCSector2DEditor::DoAverage()
+{
+  fM->SetAverage(fAverage->IsOn());
+  Update();
+}
+
+void TPCSector2DEditor::SetupAverage()
+{
+  if(fM->fShowMax) {
+    fAverage->SetEnabled(kFALSE);
+  } else {
+    fAverage->SetEnabled(kTRUE);
+    fAverage->SetState(fM->fAverage ? kButtonDown : kButtonUp);
+  }
+}
+
+void TPCSector2DEditor::DoMinTime()
+{
+  Int_t minTime = (Int_t) fMinTime->GetNumber();
+  if(minTime > fM->fMaxTime) {
+    minTime = fM->fMaxTime;
+    fMinTime->SetNumber(minTime);
+  }
+  fM->SetMinTime(minTime);
+  fTime->SetPosition(minTime, fM->fMaxTime);
+  Update();
+}
+
+void TPCSector2DEditor::DoMaxTime()
+{
+  Int_t maxTime = (Int_t) fMaxTime->GetNumber();
+  if(maxTime < fM->fMinTime) {
+    maxTime = fM->fMinTime;
+    fMaxTime->SetNumber(maxTime);
+  }
+  fM->SetMaxTime(maxTime);
+  fTime->SetPosition(fM->fMinTime, maxTime);
   Update();
 }
 
 void TPCSector2DEditor::DoTime()
 { 
-  Double_t min = fTime->GetMinPosition(), max = fTime->GetMaxPosition();
-  printf("hslidor min=%f max=%f\n", min, max);
-  fM->SetMinTime((Int_t) min);
-  fM->SetMaxTime((Int_t) max);
+  Int_t min = (Int_t) TMath::Nint(fTime->GetMinPosition());
+  Int_t max = (Int_t) TMath::Nint(fTime->GetMaxPosition());
+  fM->SetMinTime(min);
+  fM->SetMaxTime(max);
+  fMinTime->SetNumber(min);
+  fMaxTime->SetNumber(max);
   Update();
 }
index dfca7a25a79809a70d318472439cbc6941773efe..eae4633aa668dc2d42b97e118330528a6a167f3a 100644 (file)
@@ -24,13 +24,20 @@ protected:
 
   TGNumberEntry*   fSectorID;
 
+  TGCheckButton*   fRnrInn;
+  TGCheckButton*   fRnrOut1;
+  TGCheckButton*   fRnrOut2;
+
   TGLabel*         fThresholdLabel;
   TGLabel*         fMaxValLabel;
-  TGHSlider*       fthreshold;
+  TGHSlider*       fThreshold;
   TGHSlider*       fMaxVal;
 
   TGCheckButton*   fShowMax;
+  TGCheckButton*   fAverage;
 
+  TGNumberEntry*   fMinTime;
+  TGNumberEntry*   fMaxTime;
   TGDoubleHSlider* fTime;
 
 public:
@@ -45,9 +52,17 @@ public:
 
   void DoSectorID();
 
-  void Dothreshold();
+  void DoRnrInn();
+  void DoRnrOut1();
+  void DoRnrOut2();
+
+  void DoThreshold();
   void DoMaxVal();
   void DoShowMax();
+  void DoAverage();
+  void SetupAverage();
+  void DoMinTime();
+  void DoMaxTime();
   void DoTime();
  
   ClassDef(TPCSector2DEditor, 0); // Editor for TPCSector2D
index edf8a9de448f182ea2ad66dadff7d849ed3786d1..f5bce4d0c9288add840177599322319ee645c4a6 100644 (file)
@@ -63,7 +63,7 @@ void TPCSector2DGL::SetCol(Float_t z, UChar_t* pixel) const
 
   Int_t ci = gStyle->GetColorPalette
     (TMath::Min(n_col - 1,
-                Int_t((n_col*(z - fSector->fthreshold))/(fSector->fMaxVal - fSector->fthreshold))));
+                Int_t((n_col*(z - fSector->fThreshold))/(fSector->fMaxVal - fSector->fThreshold))));
 
   TColor* c = gROOT->GetColor(ci);
 
@@ -114,9 +114,6 @@ void TPCSector2DGL::DirectDraw(const TGLDrawFlags& /*flags*/) const
       glEnable(GL_BLEND);
       glDepthMask(GL_FALSE);
       glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
-      glShadeModel(GL_FLAT);
-
-      glBindTexture  (GL_TEXTURE_2D, fTexture);
 
       glPolygonOffset(2,2);
       glEnable(GL_POLYGON_OFFSET_FILL);
@@ -125,27 +122,33 @@ void TPCSector2DGL::DirectDraw(const TGLDrawFlags& /*flags*/) const
       glBindTexture(GL_TEXTURE_2D, fTexture);
       glEnable(GL_TEXTURE_2D);
 
-      DisplayTexture(iSeg.GetPadWidth(),  iSeg.GetPadHeight(),  iSeg.GetRLow(),
+      if(fSector->fRnrInn)
+       DisplayTexture(iSeg.GetPadWidth(),  iSeg.GetPadHeight(),  iSeg.GetRLow(),
+                      iSeg.GetNMaxPads(),  iSeg.GetNRows(),
+                      0,                   0);
+      if(fSector->fRnrOut1)
+       DisplayTexture(o1Seg.GetPadWidth(), o1Seg.GetPadHeight(), o1Seg.GetRLow(),
+                      o1Seg.GetNMaxPads(), o1Seg.GetNRows(),
+                      iSeg.GetNMaxPads(),  0);
+      if(fSector->fRnrOut2)
+       DisplayTexture(o2Seg.GetPadWidth(), o2Seg.GetPadHeight(), o2Seg.GetRLow(),
+                      o2Seg.GetNMaxPads(), o2Seg.GetNRows(),
+                      0,                   o1Seg.GetNRows());
+
+      glDisable(GL_TEXTURE_2D);
+    } else {
+      if(fSector->fRnrInn)
+       DisplayQuads(iSeg.GetPadWidth(),  iSeg.GetPadHeight(),  iSeg.GetRLow(),
                     iSeg.GetNMaxPads(),  iSeg.GetNRows(),
                     0,                   0);
-      DisplayTexture(o1Seg.GetPadWidth(), o1Seg.GetPadHeight(), o1Seg.GetRLow(),
+      if(fSector->fRnrOut1)
+       DisplayQuads(o1Seg.GetPadWidth(), o1Seg.GetPadHeight(), o1Seg.GetRLow(),
                     o1Seg.GetNMaxPads(), o1Seg.GetNRows(),
-                    iSeg.GetNMaxPads(),  0);
-      DisplayTexture(o2Seg.GetPadWidth(), o2Seg.GetPadHeight(), o2Seg.GetRLow(),
+                    iSeg.GetNMaxPads(),    0);
+      if(fSector->fRnrOut2)
+       DisplayQuads(o2Seg.GetPadWidth(), o2Seg.GetPadHeight(), o2Seg.GetRLow(),
                     o2Seg.GetNMaxPads(), o2Seg.GetNRows(),
                     0,                   o1Seg.GetNRows());
-
-      glDisable(GL_TEXTURE_2D);
-    } else {
-      DisplayQuads(iSeg.GetPadWidth(),  iSeg.GetPadHeight(),  iSeg.GetRLow(),
-                  iSeg.GetNMaxPads(),  iSeg.GetNRows(),
-                  0,                   0);
-      DisplayQuads(o1Seg.GetPadWidth(), o1Seg.GetPadHeight(), o1Seg.GetRLow(),
-                  o1Seg.GetNMaxPads(), o1Seg.GetNRows(),
-                  iSeg.GetNMaxPads(),    0);
-      DisplayQuads(o2Seg.GetPadWidth(), o2Seg.GetPadHeight(), o2Seg.GetRLow(),
-                  o2Seg.GetNMaxPads(), o2Seg.GetNRows(),
-                  0,                   o1Seg.GetNRows());
     }
   }
 
@@ -163,39 +166,42 @@ void TPCSector2DGL::DirectDraw(const TGLDrawFlags& /*flags*/) const
 void TPCSector2DGL::LoadPadrow(TPCSectorData::RowIterator& iter,
                               Int_t row, Int_t col_off) const
 {
-  Int_t    pad_var;
+  Int_t    padVal;
   Int_t    time, val;   
 
-  Int_t    min_time = fSector->fMinTime;
-  Int_t    max_time = fSector->fMaxTime;
-  Bool_t   half_border_time = ((fSector->fMaxTime - fSector->fMinTime) % 2 == 0);
+  Int_t    minTime = fSector->fMinTime;
+  Int_t    maxTime = fSector->fMaxTime;
+  Bool_t   halfBorderTime = ((maxTime - minTime) % 2 == 0);
 
   UChar_t* img_pos = GetRowCol(row, col_off);
   while (iter.NextPad()) {
-    pad_var = 0; 
+    padVal = 0; 
 
     while (iter.Next()) {
       time = iter.Time();
       val  = iter.Signal();
 
+      if(time < minTime || time > maxTime)
+       continue;
+
       if(fSector->fShowMax) {
-        if(val > pad_var) {
-          pad_var = val;
+        if(val > padVal) {
+          padVal = val;
         }
       } else {
-        // Integrate int max_val.
-        if(time >= min_time && time <= max_time) {
-          if(half_border_time && (time == min_time || time == max_time))
-            pad_var += val/2;
-          else
-            pad_var += val;
-        }
+       if(halfBorderTime && (time == minTime || time == maxTime))
+         padVal += val/2;
+       else
+         padVal += val;
       }
     }
 
-    pad_var = TMath::Min(pad_var, fSector->fMaxVal);
-    if(pad_var > fSector->fthreshold)
-      SetCol(pad_var, img_pos);
+    if(fSector->fShowMax == kFALSE && fSector->fAverage) {
+      padVal = (Int_t)((Float_t)padVal / (maxTime - minTime));
+    }
+    padVal = TMath::Min(padVal, fSector->fMaxVal);
+    if(padVal > fSector->fThreshold)
+      SetCol(padVal, img_pos);
     img_pos += 4;
   }
 }
@@ -211,11 +217,19 @@ void TPCSector2DGL::CreateTexture() const
   memset(fImage, 0, fgkTextureByteSize);
 
   Int_t rowOff[3], colOff[3];
-  rowOff[0] = 0; rowOff[1] = rowOff[2] = -TPCSectorData::GetSeg(1).GetFirstRow();
-  colOff[0] = colOff[2] = 0; colOff[1] =  TPCSectorData::GetSeg(0).GetNMaxPads();
+  Bool_t isOn[3];
+  rowOff[0] = 0;
+  rowOff[1] = rowOff[2] = -TPCSectorData::GetSeg(1).GetFirstRow();
+  colOff[0] = colOff[2] = 0;
+  colOff[1] =  TPCSectorData::GetSeg(0).GetNMaxPads();
+  isOn[0] = fSector->fRnrInn;
+  isOn[1] = fSector->fRnrOut1;
+  isOn[2] = fSector->fRnrOut2;
 
   // Loop over 3 main segments
   for (Int_t sId = 0; sId <= 2; ++sId) {
+    if(isOn[sId] == kFALSE)
+      continue;
     const TPCSectorData::SegmentInfo& sInfo = TPCSectorData::GetSeg(sId);
     for (Int_t row=sInfo.GetFirstRow(); row<=sInfo.GetLastRow(); ++row) {
       TPCSectorData::RowIterator i = fSectorData->MakeRowIterator(row);
@@ -333,18 +347,23 @@ void TPCSector2DGL::DisplayFrame() const
              (UChar_t)(255*c->GetGreen()),
              (UChar_t)(255*c->GetBlue()));
 
-  glBegin(GL_LINE_LOOP);
-  TraceStepsUp  (TPCSectorData::GetInnSeg());
-  TraceStepsDown(TPCSectorData::GetInnSeg());
-  glEnd();
-
-  glBegin(GL_LINE_LOOP);
-  TraceStepsUp  (TPCSectorData::GetOut1Seg());
-  TraceStepsDown(TPCSectorData::GetOut1Seg());
-  glEnd();
-
-  glBegin(GL_LINE_STRIP);
-  TraceStepsUp  (TPCSectorData::GetOut2Seg());
-  TraceStepsDown(TPCSectorData::GetOut2Seg());
-  glEnd();
+  glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
+  if(fSector->fRnrInn) {
+    glBegin(GL_POLYGON);
+    TraceStepsUp  (TPCSectorData::GetInnSeg());
+    TraceStepsDown(TPCSectorData::GetInnSeg());
+    glEnd();
+  }
+  if(fSector->fRnrOut1) {
+    glBegin(GL_POLYGON);
+    TraceStepsUp  (TPCSectorData::GetOut1Seg());
+    TraceStepsDown(TPCSectorData::GetOut1Seg());
+    glEnd();
+  }
+  if(fSector->fRnrOut2) {
+    glBegin(GL_POLYGON);
+    TraceStepsUp  (TPCSectorData::GetOut2Seg());
+    TraceStepsDown(TPCSectorData::GetOut2Seg());
+    glEnd();
+  }
 }
index 726795a02b144961ec92d3b002e889c560f1be72..e00361b7fde046b4ef489e68f4d282ff0a1d3b19 100644 (file)
@@ -1,7 +1,8 @@
 2006-05-18  Matevz Tadel  <matevz.tadel@cern.ch>
 
-       Merged EVE-dev to HEAD.
-       Tagged the EVE-dev branch with EVE-head-merge.
+       Merged EVE-dev to HEAD. Tagged EVE-dev (EVE-dev-after-merge) and
+       EVE's HEAD (EVE-head-after-merge).
+       Merging was actually done twice.
 
 2006-05-18  Matevz Tadel  <matevz.tadel@cern.ch>
 
index 8b25b7e9dca3ec34e680b63025dd690ef291c6cb..bb58526fb24272b75b878681a1b9370a5003182f 100644 (file)
@@ -13,7 +13,7 @@ void alieve_loadlibs ()
   // Waiting for a better solution
   //  gSystem->Load("libg2c_sh");
   // And the following works for gcc-4.
-  //  gSystem->Load("/usr/lib/libg2c");
+  // gSystem->Load("/usr/lib/libg2c");
   gSystem->Load("libmicrocern");
   gSystem->Load("libpdf");
   gSystem->Load("libpythia6");