ROOT logo
#ifndef ALIMUONCLUSTERSTOREV2_H
#define ALIMUONCLUSTERSTOREV2_H

/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
* See cxx source for full Copyright notice                               */

// $Id$

/// \ingroup rec
/// \class AliMUONClusterStoreV2
/// \brief Implementation of VClusterStore
/// 
// Author Philippe Pillot, Subatech

#ifndef ALIMUONVCLUSTERSTORE_H
#  include "AliMUONVClusterStore.h"
#endif

#include "AliMUONVCluster.h"
#include <TClonesArray.h>

class AliMUONClusterStoreV2 : public AliMUONVClusterStore
{
  friend class AliMUONClusterStoreV2Iterator;
  
public:
  AliMUONClusterStoreV2();
  AliMUONClusterStoreV2(TRootIOCtor* dummy);
  AliMUONClusterStoreV2(const AliMUONClusterStoreV2& store);
  AliMUONClusterStoreV2& operator=(const AliMUONClusterStoreV2& store);  
  virtual ~AliMUONClusterStoreV2();
  
  virtual void Clear(Option_t* opt="");
  
  /// Whether the Connect(TTree&) method is implemented
  virtual Bool_t CanConnect() const { return kTRUE; }
  virtual Bool_t Connect(TTree& tree, Bool_t alone=kTRUE) const;
  
  /// Create an empty copy of this
  virtual AliMUONClusterStoreV2* Create() const { return new AliMUONClusterStoreV2; }
  
  virtual AliMUONVCluster* CreateCluster(Int_t chamberId, Int_t detElemId, Int_t clusterIndex) const;
  
  using AliMUONVClusterStore::Add;
  
  virtual AliMUONVCluster* Add(const AliMUONVCluster& Cluster);
  virtual AliMUONVCluster* Add(Int_t chamberId, Int_t detElemId, Int_t clusterIndex);

  virtual AliMUONVCluster* Remove(AliMUONVCluster& cluster);

  using AliMUONVClusterStore::GetSize;
  
  /// Return the number of clusters we hold
  virtual Int_t GetSize() const {return fClusters->GetLast()+1;}
  
  using AliMUONVStore::FindObject;
  
  AliMUONVCluster* FindObject(const TObject* object) const;
  AliMUONVCluster* FindObject(UInt_t uniqueID) const;
  
  virtual TIterator* CreateIterator() const;
  virtual TIterator* CreateChamberIterator(Int_t firstChamberId, Int_t lastChamberId) const;
  
private:
  void ReMap();
  void UpdateMap(AliMUONVCluster& cluster);
  
private:
  TClonesArray* fClusters; ///< collection of clusters
  TClonesArray* fMap;      //!< index map for fast cluster retrieval
  Bool_t        fMapped;   //!< whether our internal indices are uptodate
  
  ClassDef(AliMUONClusterStoreV2,1) // Implementation of VClusterStore
};

#endif
 AliMUONClusterStoreV2.h:1
 AliMUONClusterStoreV2.h:2
 AliMUONClusterStoreV2.h:3
 AliMUONClusterStoreV2.h:4
 AliMUONClusterStoreV2.h:5
 AliMUONClusterStoreV2.h:6
 AliMUONClusterStoreV2.h:7
 AliMUONClusterStoreV2.h:8
 AliMUONClusterStoreV2.h:9
 AliMUONClusterStoreV2.h:10
 AliMUONClusterStoreV2.h:11
 AliMUONClusterStoreV2.h:12
 AliMUONClusterStoreV2.h:13
 AliMUONClusterStoreV2.h:14
 AliMUONClusterStoreV2.h:15
 AliMUONClusterStoreV2.h:16
 AliMUONClusterStoreV2.h:17
 AliMUONClusterStoreV2.h:18
 AliMUONClusterStoreV2.h:19
 AliMUONClusterStoreV2.h:20
 AliMUONClusterStoreV2.h:21
 AliMUONClusterStoreV2.h:22
 AliMUONClusterStoreV2.h:23
 AliMUONClusterStoreV2.h:24
 AliMUONClusterStoreV2.h:25
 AliMUONClusterStoreV2.h:26
 AliMUONClusterStoreV2.h:27
 AliMUONClusterStoreV2.h:28
 AliMUONClusterStoreV2.h:29
 AliMUONClusterStoreV2.h:30
 AliMUONClusterStoreV2.h:31
 AliMUONClusterStoreV2.h:32
 AliMUONClusterStoreV2.h:33
 AliMUONClusterStoreV2.h:34
 AliMUONClusterStoreV2.h:35
 AliMUONClusterStoreV2.h:36
 AliMUONClusterStoreV2.h:37
 AliMUONClusterStoreV2.h:38
 AliMUONClusterStoreV2.h:39
 AliMUONClusterStoreV2.h:40
 AliMUONClusterStoreV2.h:41
 AliMUONClusterStoreV2.h:42
 AliMUONClusterStoreV2.h:43
 AliMUONClusterStoreV2.h:44
 AliMUONClusterStoreV2.h:45
 AliMUONClusterStoreV2.h:46
 AliMUONClusterStoreV2.h:47
 AliMUONClusterStoreV2.h:48
 AliMUONClusterStoreV2.h:49
 AliMUONClusterStoreV2.h:50
 AliMUONClusterStoreV2.h:51
 AliMUONClusterStoreV2.h:52
 AliMUONClusterStoreV2.h:53
 AliMUONClusterStoreV2.h:54
 AliMUONClusterStoreV2.h:55
 AliMUONClusterStoreV2.h:56
 AliMUONClusterStoreV2.h:57
 AliMUONClusterStoreV2.h:58
 AliMUONClusterStoreV2.h:59
 AliMUONClusterStoreV2.h:60
 AliMUONClusterStoreV2.h:61
 AliMUONClusterStoreV2.h:62
 AliMUONClusterStoreV2.h:63
 AliMUONClusterStoreV2.h:64
 AliMUONClusterStoreV2.h:65
 AliMUONClusterStoreV2.h:66
 AliMUONClusterStoreV2.h:67
 AliMUONClusterStoreV2.h:68
 AliMUONClusterStoreV2.h:69
 AliMUONClusterStoreV2.h:70
 AliMUONClusterStoreV2.h:71
 AliMUONClusterStoreV2.h:72
 AliMUONClusterStoreV2.h:73
 AliMUONClusterStoreV2.h:74
 AliMUONClusterStoreV2.h:75
 AliMUONClusterStoreV2.h:76