]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - MUON/AliMUONPainterRegistry.cxx
- update track cuts
[u/mrichter/AliRoot.git] / MUON / AliMUONPainterRegistry.cxx
index 1802420db2d41b9d88cd139ac4b5e892b6439033..aee1fd6b781593c0ed99b36bf4d0f97094a3c1b6 100644 (file)
 
 #include "AliMUONPainterRegistry.h"
 
+#include "AliMpManuIterator.h"
+#include "AliMUON2DMap.h"
+#include "AliMUONCalibParamND.h"
 #include "AliMUONPainterMatrix.h"
-#include "AliMUONVTrackerData.h"
-#include "AliMUONVTrackerDataMaker.h"
 #include "AliLog.h"
 #include <TGMenu.h>
 #include <TGWindow.h>
@@ -35,6 +36,8 @@
 ///
 ///\author Laurent Aphecetche, Subatech
 
+using std::cout;
+using std::endl;
 ///\cond CLASSIMP
 ClassImp(AliMUONPainterRegistry)
 ///\endcond
@@ -44,16 +47,12 @@ AliMUONPainterRegistry* AliMUONPainterRegistry::fgInstance(0x0);
 //_____________________________________________________________________________
 AliMUONPainterRegistry::AliMUONPainterRegistry() : TObject(), TQObject(),
 fPainterMatrices(new TObjArray),
-fDataMakers(new TObjArray),
 fHistoryMenu(0x0),
 fMenuBar(0x0),
-fHistoryCounter(0),
-fZombies(new TObjArray)
+fHistoryCounter(0)
 {
   /// ctor
   fPainterMatrices->SetOwner(kTRUE);
-  fDataMakers->SetOwner(kTRUE);
-  fZombies->SetOwner(kTRUE);
 }
 
 //_____________________________________________________________________________
@@ -61,93 +60,6 @@ AliMUONPainterRegistry::~AliMUONPainterRegistry()
 {
   /// dtor
   delete fPainterMatrices;
-  delete fDataMakers;
-}
-
-//_____________________________________________________________________________
-AliMUONVTrackerDataMaker* 
-AliMUONPainterRegistry::DataMaker(Int_t i) const
-{
-  /// Get one data source
-  if ( i >= 0 && i <= fDataMakers->GetLast() )
-  {
-    return static_cast<AliMUONVTrackerDataMaker*>(fDataMakers->At(i));
-  }
-  else
-  {
-    AliError(Form("Index out of bounds : %d / %d",i,fDataMakers->GetLast()+1));
-    return 0x0;
-  }
-}
-
-//_____________________________________________________________________________
-AliMUONVTrackerData* 
-AliMUONPainterRegistry::DataSource(Int_t i) const
-{
-  /// Get one data source
-  
-  AliMUONVTrackerDataMaker* maker = DataMaker(i);
-  if ( maker ) return maker->Data();
-  return 0x0;
-}
-
-//_____________________________________________________________________________
-void 
-AliMUONPainterRegistry::DataMakerWasRegistered(AliMUONVTrackerDataMaker* data)
-{
-  /// A new reader source was registered
-  Long_t param[] = { (Long_t)data };
-  
-  Emit("DataMakerWasRegistered(AliMUONVTrackerDataMaker*)",param);
-}
-
-//_____________________________________________________________________________
-void
-AliMUONPainterRegistry::DataMakerWasUnregistered(AliMUONVTrackerDataMaker* data)
-{
-  /// A data reader was unregistered
-  Long_t param[] = { (Long_t)data };
-  
-  Emit("DataMakerWasUnregistered(AliMUONVTrackerDataMaker*)",param);
-  
-}
-
-//_____________________________________________________________________________
-void 
-AliMUONPainterRegistry::DataSourceWasRegistered(AliMUONVTrackerData* data)
-{
-  /// A new data source was registered
-  Long_t param[] = { (Long_t)data };
-  
-  Emit("DataSourceWasRegistered(AliMUONVTrackerData*)",param);
-}
-
-//_____________________________________________________________________________
-void
-AliMUONPainterRegistry::DataSourceWasUnregistered(AliMUONVTrackerData* data)
-{
-  /// A data source was unregistered
-  Long_t param[] = { (Long_t)data };
-  
-  Emit("DataSourceWasUnregistered(AliMUONVTrackerData*)",param);
-  
-}
-
-//_____________________________________________________________________________
-AliMUONVTrackerData*
-AliMUONPainterRegistry::DataSource(const char* name) const
-{
-  /// Find a data source by name
-  for ( Int_t i = 0; i < NumberOfDataMakers(); ++i )
-  {
-    AliMUONVTrackerData* data = DataMaker(i)->Data();
-    if ( data ) 
-    {
-      TString dname(data->GetName());
-      if ( dname == name ) return data;
-    }
-  }
-  return 0x0;
 }
 
 //_____________________________________________________________________________
@@ -208,7 +120,7 @@ AliMUONPainterRegistry::PainterMatrix(Int_t i) const
 
 //_____________________________________________________________________________
 void 
-AliMUONPainterRegistry::PainterMatrixWantToShow(AliMUONPainterMatrix* group)
+AliMUONPainterRegistry::PainterMatrixWantToShow(const AliMUONPainterMatrix* group)
 {
   /// A given paintermatrix want to appear on screen
   Long_t param[] = { (Long_t)group };
@@ -233,7 +145,7 @@ AliMUONPainterRegistry::AddToHistory(AliMUONPainterMatrix* group)
                           "AliMUONPainterRegistry",this,
                           "HistoryMenuActivated(Int_t)");
     
-    AliDebug(1,Form("HistoryMenu create at %x",fHistoryMenu));
+    AliDebug(1,Form("HistoryMenu create at %p",fHistoryMenu));
   }
   
   if ( fHistoryMenu ) 
@@ -262,7 +174,7 @@ AliMUONPainterRegistry::AddToHistory(AliMUONPainterMatrix* group)
 
 //_____________________________________________________________________________
 void 
-AliMUONPainterRegistry::PainterMatrixWasRegistered(AliMUONPainterMatrix* group)
+AliMUONPainterRegistry::PainterMatrixWasRegistered(const AliMUONPainterMatrix* group)
 {
   /// A new painter matrix was registered
   Long_t param[] = { (Long_t)group };
@@ -272,7 +184,7 @@ AliMUONPainterRegistry::PainterMatrixWasRegistered(AliMUONPainterMatrix* group)
 
 //_____________________________________________________________________________
 void 
-AliMUONPainterRegistry::PainterMatrixWasUnregistered(AliMUONPainterMatrix* group)
+AliMUONPainterRegistry::PainterMatrixWasUnregistered(const AliMUONPainterMatrix* group)
 {
   /// A painter matrix was unregistered
   Long_t param[] = { (Long_t)group };
@@ -288,32 +200,8 @@ AliMUONPainterRegistry::Print(Option_t* opt) const
   TString sopt(opt);
   sopt.ToUpper();
   
-  cout << "Number of data readers = " << NumberOfDataMakers() << endl;
   cout << "Number of painter matrices = " << NumberOfPainterMatrices() << endl;
   
-  if ( sopt.Contains("FULL") || sopt.Contains("READER") )
-  {
-    TIter next(fDataMakers);
-    AliMUONVTrackerDataMaker* reader;
-    
-    while ( ( reader = static_cast<AliMUONVTrackerDataMaker*>(next()) ) )
-    {
-      reader->Print();
-    }
-  }
-  
-  if ( sopt.Contains("FULL") || sopt.Contains("DATA") )
-  {
-    TIter next(fDataMakers);
-    AliMUONVTrackerDataMaker* reader;
-    
-    while ( ( reader = static_cast<AliMUONVTrackerDataMaker*>(next()) ) )
-    {
-      AliMUONVTrackerData* data = reader->Data();
-      if ( data ) data->Print();
-    }
-  }
-
   if ( sopt.Contains("FULL") || sopt.Contains("MATRIX") )
   {
     TIter next(fPainterMatrices);
@@ -339,24 +227,6 @@ AliMUONPainterRegistry::Register(AliMUONPainterMatrix* group)
   return fPainterMatrices->IndexOf(group);
 }
 
-//_____________________________________________________________________________
-void
-AliMUONPainterRegistry::Register(AliMUONVTrackerDataMaker* reader)
-{
-  /// reader is adopted, i.e. the registry becomes the owner of it.
-  fDataMakers->AddLast(reader);
-  DataMakerWasRegistered(reader);
-  if ( reader->Data() ) DataSourceWasRegistered(reader->Data());
-}
-
-//_____________________________________________________________________________
-Int_t 
-AliMUONPainterRegistry::NumberOfDataMakers() const
-{
-  /// The number of data readers we handle
-  return fDataMakers->GetLast()+1;
-}
-
 //_____________________________________________________________________________
 Int_t 
 AliMUONPainterRegistry::NumberOfPainterMatrices() const
@@ -365,48 +235,6 @@ AliMUONPainterRegistry::NumberOfPainterMatrices() const
   return fPainterMatrices->GetLast()+1;
 }
 
-//_____________________________________________________________________________
-void 
-AliMUONPainterRegistry::DeleteZombies()
-{
-  /// Delete zombies
-  fZombies->Delete();
-}
-
-//_____________________________________________________________________________
-Bool_t 
-AliMUONPainterRegistry::Unregister(AliMUONVTrackerDataMaker* reader)
-{
-  /// Unregister some reader
-  
-  if (!reader) return kFALSE;
-  
-  if ( reader->Data() ) 
-  {
-    DataSourceWasUnregistered(reader->Data());
-    reader->Data()->Destroyed(); // we pretend it's deleted now, even
-    // if it will be only later on when zombie are killed, so that
-    // for instance painters depending on it will no longer try to access it
-  }
-
-  DataMakerWasUnregistered(reader);
-  
-  TObject* o = fDataMakers->Remove(reader);
-  
-  fZombies->Add(o); // for later deletion
-  
-//  if ( o ) 
-//  {
-//    delete o;
-//  }
-//  else
-//  {
-//    AliError(Form("Could not unregister data named %s title %s",reader->GetName(),
-//                  reader->GetTitle()));
-//  }
-  return ( o != 0x0 );
-}
-
 //_____________________________________________________________________________
 Bool_t 
 AliMUONPainterRegistry::Unregister(AliMUONPainterMatrix* group)