Make the raw OCDB more obvious in the data source tab
authorlaphecet <laphecet@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 25 Oct 2011 08:57:12 +0000 (08:57 +0000)
committerlaphecet <laphecet@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 25 Oct 2011 08:57:12 +0000 (08:57 +0000)
MUON/AliMUONMchViewApplication.cxx
MUON/AliMUONMchViewApplication.h
MUON/AliMUONPainterDataSourceFrame.cxx
MUON/AliMUONPainterDataSourceFrame.h
MUON/AliMUONPainterMatrixFrame.cxx

index 1471eba..b5ffc60 100644 (file)
@@ -135,9 +135,10 @@ AliMUONMchViewApplication::AliMUONMchViewApplication(const char* name,
   
   fMainFrame->Connect("CloseWindow()","AliMUONMchViewApplication",this,"Terminate()");
 
-  fMainFrame->MoveResize(ox,oy, w, h); 
+//  fMainFrame->MoveResize(ox,oy, w, h); 
   fMainFrame->SetWMPosition(ox, oy);
-  fMainFrame->SetWMSizeHints(w,h,w,h,0,0);
+//  fMainFrame->SetWMSizeHints(w,h,w,h,0,0);
+//  fMainFrame->SetWMSizeHints(w,h,w,h,10,10);
   
   cout << "***************************************************" << endl;
   cout << "   Welcome to mchview" << endl;
@@ -466,6 +467,11 @@ AliMUONMchViewApplication::ReleaseNotes()
   
   TGTextView* rn = new TGTextView(t);
 
+  rn->AddLine("1.10");
+  rn->AddLine("");
+  rn->AddLine("Make the raw OCDB more obvious in the data source tab");
+  rn->AddLine("");
+  
   rn->AddLine("1.08");
   rn->AddLine("");
   rn->AddLine("Changed the default OCDB to 2011 version");
index f854260..695bdbd 100644 (file)
@@ -32,7 +32,7 @@ public:
   void HandleMenu(Int_t i);
 
   /// Return the version number of the mchview application
-  static const char* Version() { return "1.08"; }
+  static const char* Version() { return "1.10"; }
   
   /// Return the SVN revision  and version number of the mchview application
   static const char* FullVersion() { return Form("mchview Version %s ($Id$)",Version()); }
index c51fddb..930f66e 100644 (file)
@@ -19,6 +19,8 @@
 #include "AliMUONPainterDataSourceFrame.h"
 
 #include "AliLog.h"
+#include "AliCDBEntry.h"
+#include "AliCDBManager.h"
 #include "AliMUONChamberPainter.h"
 #include "AliMUONMchViewApplication.h"
 #include "AliMUONPainterDataRegistry.h"
@@ -68,6 +70,7 @@ AliMUONPainterDataSourceFrame::AliMUONPainterDataSourceFrame(const TGWindow* p,
   fRawSelector2(new TGCompositeFrame(fRawSelector,w,h,kVerticalFrame)),
   fRawSelector21(new TGCompositeFrame(fRawSelector2,w,h,kHorizontalFrame)),
   fRawSelector22(new TGCompositeFrame(fRawSelector2,w,h,kHorizontalFrame)),
+  fRawSelector24(new TGCompositeFrame(fRawSelector2,w,h,kHorizontalFrame)),
   fRawSelector23(new TGCompositeFrame(fRawSelector2,w,h,kHorizontalFrame)),
   fCalibrateNoGain(new TGCheckButton(fRawSelector22,"Ped sub")),
   fCalibrateGainConstantCapa(new TGCheckButton(fRawSelector22,"Ped sub+gain (capa cste)")),
@@ -79,7 +82,7 @@ AliMUONPainterDataSourceFrame::AliMUONPainterDataSourceFrame(const TGWindow* p,
   fEventRangeButton(new TGCheckButton(fRawSelector23,"Event range")),
   fEventMin(new TGNumberEntry(fRawSelector23,-1,10)),
   fEventMax(new TGNumberEntry(fRawSelector23,-1,10)),
-  fRawOCDBPath(new TGTextEntry(fRawSelector22,"")),
+  fRawOCDBPath(new TGTextEntry(fRawSelector24,"alien://folder=/alice/data/2011/OCDB")),
   fOCDBSelector(new TGGroupFrame(this,"OCDB Path",kHorizontalFrame)),
   fDataReaders(new TGGroupFrame(this,"Data sources")),
   fFilePath(new TGTextEntry(fRawSelector21,"")),
@@ -138,6 +141,7 @@ AliMUONPainterDataSourceFrame::AliMUONPainterDataSourceFrame(const TGWindow* p,
                                         
     fRawSelector2->AddFrame(fRawSelector21, new TGLayoutHints(kLHintsExpandX,5,5,5,5));
     fRawSelector2->AddFrame(fRawSelector22, new TGLayoutHints(kLHintsExpandX,5,5,5,5));
+    fRawSelector2->AddFrame(fRawSelector24, new TGLayoutHints(kLHintsTop,5,5,5,5));
     fRawSelector2->AddFrame(fRawSelector23, new TGLayoutHints(kLHintsExpandX,5,5,5,5));
 
     fRawSelector21->AddFrame(openButton,new TGLayoutHints(kLHintsTop,5,5,5,5));
@@ -147,7 +151,8 @@ AliMUONPainterDataSourceFrame::AliMUONPainterDataSourceFrame(const TGWindow* p,
     fRawSelector22->AddFrame(fCalibrateGainConstantCapa, new TGLayoutHints(kLHintsTop,5,5,5,5));
     fRawSelector22->AddFrame(fCalibrateGain, new TGLayoutHints(kLHintsTop,5,5,5,5));
     fRawSelector22->AddFrame(fCalibrateEmelecGain, new TGLayoutHints(kLHintsTop,5,5,5,5));
-    fRawSelector22->AddFrame(fRawOCDBPath, new TGLayoutHints(kLHintsExpandX | kLHintsTop,5,5,5,5));
+  
+    fRawSelector24->AddFrame(fRawOCDBPath, new TGLayoutHints(kLHintsExpandX | kLHintsTop,5,5,5,5));
     fRawOCDBPath->SetEnabled(kFALSE);
     
     fRawSelector23->AddFrame(fHistogramButton,new TGLayoutHints(kLHintsTop,5,5,5,5));    
@@ -705,14 +710,20 @@ AliMUONPainterDataSourceFrame::CreateRawDataSource(const TString& uri)
   }
   
   /// Basic test to see if the file is correct
+  /// and to get run numbre
+  Int_t runNumber(-1);
   Bool_t ok = rawReader->NextEvent();
   if (!ok)
   {
-    AliError(Form("File %s does not seem to be a raw data file",filename.Data()));
+    AliError(Form("File %s does not seem to be a raw data file",filename.Data()));    
     fFilePath->SetText("");
     return kFALSE;
   }
-  
+  else
+  {
+    runNumber = rawReader->GetRunNumber();    
+  }
+
   rawReader->RewindEvents();
   
   AliMUONVTrackerDataMaker* reader(0x0);
@@ -722,9 +733,28 @@ AliMUONPainterDataSourceFrame::CreateRawDataSource(const TString& uri)
 
   if ( ocdbPath.Length() > 0 ) 
   {
-    AliMUONRecoParam* recoParam = AliMUONRecoParam::GetCosmicParam();
+        
+    AliMUONRecoParam* recoParam(0x0);
     
-    // FIXME: where to get the reco params from in reality ?
+    AliCDBEntry* e = AliCDBManager::Instance()->Get("MUON/Calib/RecoParam",runNumber);
+    if (e)
+    {
+      TObject* o = e->GetObject();
+      if ( o->IsA() == TObjArray::Class() )
+      {
+        TObjArray* a = static_cast<TObjArray*>(o);
+        TIter next(a);
+        AliMUONRecoParam* p;
+        while ( ( p = static_cast<AliMUONRecoParam*>(next()) ))
+        {
+          if ( p->IsDefault()) recoParam = p;
+        }
+      }
+      else
+      {
+        recoParam = static_cast<AliMUONRecoParam*>(o);
+      }
+    }
     
     reader = new AliMUONTrackerDataMaker(recoParam,
                                          rawReader,
index 02c56ff..24091ad 100644 (file)
@@ -97,6 +97,7 @@ private:
   TGCompositeFrame* fRawSelector2; ///< idem
   TGCompositeFrame* fRawSelector21; ///< idem
   TGCompositeFrame* fRawSelector22; ///< idem
+  TGCompositeFrame* fRawSelector24; ///< idem
   TGCompositeFrame* fRawSelector23; ///< idem
   TGCheckButton* fCalibrateNoGain; ///< to trig calibration of raw data (only 0 suppression)
   TGCheckButton* fCalibrateGainConstantCapa; ///< to trig calibration of raw data (0-supp and gain w/ constant capacitance)
index 597f1e3..69757a1 100644 (file)
@@ -88,8 +88,8 @@ AliMUONPainterMatrixFrame::AliMUONPainterMatrixFrame(const TGWindow* window,
     
     fInterface = new TGHorizontalFrame(this,fCanvasWidth);
     
-    fMainFrame->AddFrame(fView, new TGLayoutHints(kLHintsLeft));
-    fMainFrame->AddFrame(fColorSlider,new TGLayoutHints(kLHintsTop|kLHintsRight|kLHintsExpandX|kLHintsCenterY,kBorderSize/2));
+    fMainFrame->AddFrame(fView, new TGLayoutHints(kLHintsExpandX));
+    fMainFrame->AddFrame(fColorSlider,new TGLayoutHints(kLHintsTop|kLHintsRight|kLHintsCenterY,kBorderSize/2));
 
     AliMUONPainterInterfaceHelper::SetBackgroundColor("MatrixFrame.ColorSlider",*fColorSlider);