]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - MUON/AliMUONMchViewApplication.cxx
- Bug fix: in the creation/reading of the trigger DCS values, the HV and currents...
[u/mrichter/AliRoot.git] / MUON / AliMUONMchViewApplication.cxx
index 38b7067d9395edd8577a20250bd13c3e7d3df650..5832a31f19dd9d6d865bbd410f2f358e50f17a9b 100644 (file)
@@ -20,6 +20,7 @@
 #include "AliCDBManager.h"
 #include "AliCodeTimer.h"
 #include "AliLog.h"
+#include "AliMUONPainterDataRegistry.h"
 #include "AliMUONPainterDataSourceFrame.h"
 #include "AliMUONPainterEnv.h"
 #include "AliMUONPainterHelper.h"
@@ -70,22 +71,22 @@ const char* AliMUONMchViewApplication::fgkFileTypes[] = {
 //______________________________________________________________________________
 AliMUONMchViewApplication::AliMUONMchViewApplication(const char* name,
                                                      int* argc, char** argv,
-                                                     Float_t wfraction,
-                                                     Float_t hfraction
+                                                     UInt_t w, UInt_t h,
+                                                     UInt_t ox, UInt_t oy
 : TRint(name,argc,argv),
   fMainFrame(0x0),
   fPainterMasterFrame(0x0)
 {
 
   /// ctor
-  /// wfraction,hfraction are the fractions of display width and height
-  /// we want to draw on
-  
-  UInt_t dw = gClient->GetDisplayWidth(); 
-  UInt_t dh = gClient->GetDisplayHeight(); 
-                   
-  UInt_t w = (UInt_t)(wfraction*dw);
-  UInt_t h = (UInt_t)(hfraction*dh);
+  /// (w,h) is the size in pixel (if 0,0 it will be computed as 70%,90% of display size)
+  /// (ox,oy) is the offset from the top-left of the display
+
+  if (!w | !h)
+  {
+    w = (UInt_t)(gClient->GetDisplayWidth()*0.7);
+    h = (UInt_t)(gClient->GetDisplayHeight()*0.9); 
+  }
 
   fMainFrame = new TGMainFrame(gClient->GetRoot(),w,h);
   
@@ -123,13 +124,9 @@ AliMUONMchViewApplication::AliMUONMchViewApplication(const char* name,
   fMainFrame->MapWindow();
   
   fMainFrame->Connect("CloseWindow()","AliMUONMchViewApplication",this,"Terminate()");
-  
-  UInt_t x = dw/2 - w/2;
-  UInt_t y = 0;
-  
-  fMainFrame->MoveResize(x, y, w, h); 
-  fMainFrame->SetWMPosition(x, y);
-  
+
+  fMainFrame->MoveResize(ox,oy, w, h); 
+  fMainFrame->SetWMPosition(ox, oy);
   fMainFrame->SetWMSizeHints(w,h,w,h,0,0);
   
   cout << "***************************************************" << endl;
@@ -277,7 +274,18 @@ AliMUONMchViewApplication::Open(const char* filename)
   
   TFile* f = TFile::Open(filename);
   
-  TList* keys = f->GetListOfKeys();
+       ReadDir(*f);
+       
+       delete f;
+}
+
+//______________________________________________________________________________
+void
+AliMUONMchViewApplication::ReadDir(TDirectory& dir)
+{
+  /// Read the given directory and import VTrackerData objects found
+  
+  TList* keys = dir.GetListOfKeys();
   TIter next(keys);
   
   TKey* k;
@@ -286,12 +294,19 @@ AliMUONMchViewApplication::Open(const char* filename)
   {
     TObject* object = k->ReadObj();
 
+               if ( object->InheritsFrom("TDirectory") )
+               {
+                       TDirectory* d = static_cast<TDirectory*>(object);
+                       ReadDir(*d);
+                       continue;
+               }
+               
     if ( object->InheritsFrom("AliMUONVTrackerDataMaker") )
     {
       AliMUONVTrackerDataMaker* maker = dynamic_cast<AliMUONVTrackerDataMaker*>(object);
       if ( maker ) 
       {
-        AliMUONPainterRegistry::Instance()->Register(maker);
+        AliMUONPainterDataRegistry::Instance()->Register(maker);
       }
     }
     
@@ -304,15 +319,13 @@ AliMUONMchViewApplication::Open(const char* filename)
       if ( data ) 
       {
         AliMUONVTrackerDataMaker* maker = new AliMUONTrackerDataWrapper(data);
-        AliMUONPainterRegistry::Instance()->Register(maker);
+        AliMUONPainterDataRegistry::Instance()->Register(maker);
       }
     }
   }
   
-  delete f;
 } 
 
-
 //______________________________________________________________________________
 void
 AliMUONMchViewApplication::PrintAs()
@@ -339,6 +352,39 @@ AliMUONMchViewApplication::ReleaseNotes()
   TGTransientFrame* t = new TGTransientFrame(gClient->GetRoot(),gClient->GetRoot(),width,height);
   
   TGTextView* rn = new TGTextView(t);
+
+  rn->AddLine("0.97");
+  rn->AddLine("");
+  rn->AddLine("Adding calibration option with Emelec (aka injection) gain");
+  rn->AddLine("");
+  
+  rn->AddLine("0.96a");
+  rn->AddLine("");
+  rn->AddLine("Internal reorganization of the contour computations, that lead to improved performance. ");
+  rn->AddLine("Improved enough to be able to remove completely the usage of the padstore.root file with precomputed contours.");
+  rn->AddLine("");
+  
+  rn->AddLine("0.96");
+  rn->AddLine("");
+  rn->AddLine("New features");
+  rn->AddLine("");
+  rn->AddLine("- Can now read raw data from memory (using the mem://@gdc: syntax)");
+  rn->AddLine("- Raw data decoder now automatically skips buspatches with parity errors");
+  rn->AddLine("");
+  
+  rn->AddLine("0.95");
+  rn->AddLine("");
+  rn->AddLine("New features");
+  rn->AddLine("");
+  rn->AddLine("- Can now read and display HV values from OCDB");
+  rn->AddLine("- New program option --geometry to force geometry of the window");
+  rn->AddLine("- Added possibility, in painters' context menu, to include or exclude part of the detector");
+  rn->AddLine("  (which will be used later on to communicate with LC2 which parts should be read out or not)");
+  rn->AddLine("");
+  rn->AddLine("Improvement");
+  rn->AddLine("");
+  rn->AddLine("- When displaying Gains, the quality information is now decoded");
+  rn->AddLine("");
   
   rn->AddLine("0.94");
   rn->AddLine("");
@@ -412,7 +458,7 @@ AliMUONMchViewApplication::Save(const char* filename)
 {
   /// Save VTrackerDataMaker objects into file of given name
   
-  AliMUONPainterRegistry* reg = AliMUONPainterRegistry::Instance();
+  AliMUONPainterDataRegistry* reg = AliMUONPainterDataRegistry::Instance();
 
   TFile f(filename,"RECREATE");