1 /**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
7 * Permission to use, copy, modify and distribute this software and its *
8 * documentation strictly for non-commercial purposes is hereby granted *
9 * without fee, provided that the above copyright notice appears in all *
10 * copies and that both the copyright notice and this permission notice *
11 * appear in the supporting documentation. The authors make no claims *
12 * about the suitability of this software for any purpose. It is *
13 * provided "as is" without express or implied warranty. *
14 **************************************************************************/
18 #include "AliMUONHitStoreV1.h"
20 //-----------------------------------------------------------------------------
21 /// \class AliMUONHitStoreV1
23 /// Implementation of AliMUONVHitStore
25 /// \author Laurent Aphecetche, Subatech
26 //-----------------------------------------------------------------------------
28 #include <TClonesArray.h>
30 #include "AliMUONTreeManager.h"
31 #include "AliMUONHit.h"
34 ClassImp(AliMUONHitStoreV1)
37 //_____________________________________________________________________________
38 AliMUONHitStoreV1::AliMUONHitStoreV1() : AliMUONVHitStore(),
39 fHits(new TClonesArray("AliMUONHit",10))
42 fHits->SetOwner(kTRUE);
45 //_____________________________________________________________________________
46 AliMUONHitStoreV1::~AliMUONHitStoreV1()
52 //_____________________________________________________________________________
54 AliMUONHitStoreV1::Add(const AliMUONHit& hit)
57 new((*fHits)[fHits->GetLast()+1]) AliMUONHit(hit);
60 //_____________________________________________________________________________
62 AliMUONHitStoreV1::Collection()
67 //_____________________________________________________________________________
69 AliMUONHitStoreV1::Connect(TTree& tree, Bool_t /*alone*/) const
71 /// Connect this to tree.
72 AliMUONTreeManager tman;
75 if ( tree.GetBranch("MUONHits") )
77 ok = tman.SetAddress(tree,"MUONHits",HitsPtr());
81 ok = tman.MakeBranch(tree,ClassName(),"TClonesArray","MUONHits",
87 //_____________________________________________________________________________
89 AliMUONHitStoreV1::CreateIterator() const
91 /// create an iterator on hits
92 return fHits->MakeIterator();
95 //____________________________________________________________________________
97 AliMUONHitStoreV1::GetSize() const
99 return fHits->GetLast()+1;
102 //____________________________________________________________________________
104 AliMUONHitStoreV1::Clear(Option_t*)
106 /// reset the internal array