]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - MUON/AliMUON2DMap.cxx
Adding Generate method to build a store with identical values (Laurent)
[u/mrichter/AliRoot.git] / MUON / AliMUON2DMap.cxx
index e695b0589462408f2dcf6c62a4431e45b2aa64bb..b541f1d81730654902ad91363ca93814c7f64afb 100644 (file)
@@ -25,6 +25,7 @@
 #include "AliMpManuList.h"
 #include "AliMpDEManager.h"
 #include "AliMUONConstants.h"
+#include <TList.h>
 
 /// \class AliMUON2DMap
 /// \brief Basic implementation of AliMUONV2DStore container using
@@ -133,6 +134,34 @@ AliMUON2DMap::Iterator() const
   return 0x0;
 }
 
+//_____________________________________________________________________________
+AliMUONV2DStore* 
+AliMUON2DMap::Generate(const TObject& object)
+{
+  /// Build a complete (i.e. all detElemId,manuId couple will be there) store
+  /// but with identical values, given by object 
+  /// The returned store will be obviously optimized for DEManu.
+
+  AliMUONV2DStore* store = new AliMUON2DMap(true);
+  
+  TList* list = AliMpManuList::ManuList();
+  
+  AliMpIntPair* pair;
+  
+  TIter next(list);
+  
+  while ( ( pair = static_cast<AliMpIntPair*>(next()) ) ) 
+  {
+    Int_t detElemId = pair->GetFirst();
+    Int_t manuId = pair->GetSecond();
+    store->Set(detElemId,manuId,object.Clone(),kFALSE);
+  }
+  
+  delete list;
+  
+  return store;
+}
+
 //_____________________________________________________________________________
 Bool_t 
 AliMUON2DMap::Set(Int_t i, Int_t j, TObject* object, Bool_t replace)