From 49f4392152117cc52724a92467be458627f82a70 Mon Sep 17 00:00:00 2001 From: ivana Date: Fri, 9 Mar 2007 17:16:42 +0000 Subject: [PATCH] Adding Generate method to build a store with identical values (Laurent) --- MUON/AliMUON2DMap.cxx | 29 +++++++++++++++++++++++++++++ MUON/AliMUON2DMap.h | 5 +++++ 2 files changed, 34 insertions(+) diff --git a/MUON/AliMUON2DMap.cxx b/MUON/AliMUON2DMap.cxx index e695b058946..b541f1d8173 100644 --- a/MUON/AliMUON2DMap.cxx +++ b/MUON/AliMUON2DMap.cxx @@ -25,6 +25,7 @@ #include "AliMpManuList.h" #include "AliMpDEManager.h" #include "AliMUONConstants.h" +#include /// \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(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) diff --git a/MUON/AliMUON2DMap.h b/MUON/AliMUON2DMap.h index d847a4ad533..6dda9ee1561 100644 --- a/MUON/AliMUON2DMap.h +++ b/MUON/AliMUON2DMap.h @@ -36,6 +36,11 @@ public: AliMUON2DMap(const AliMUON2DMap& other); AliMUON2DMap& operator = (const AliMUON2DMap& other); + /// 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. + static AliMUONV2DStore* Generate(const TObject& object); + private: void CopyTo(AliMUON2DMap& destination) const; -- 2.43.0