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 /// \class AliMUONHitStoreV1
22 /// Implementation of AliMUONVHitStore
24 /// \author Laurent Aphecetche, Subatech
27 #include <TClonesArray.h>
29 #include "AliMUONTreeManager.h"
30 #include "AliMUONHit.h"
33 ClassImp(AliMUONHitStoreV1)
36 //_____________________________________________________________________________
37 AliMUONHitStoreV1::AliMUONHitStoreV1() : AliMUONVHitStore(),
38 fHits(new TClonesArray("AliMUONHit",10))
41 fHits->SetOwner(kTRUE);
44 //_____________________________________________________________________________
45 AliMUONHitStoreV1::~AliMUONHitStoreV1()
51 //_____________________________________________________________________________
53 AliMUONHitStoreV1::Add(const AliMUONHit& hit)
56 new((*fHits)[fHits->GetLast()+1]) AliMUONHit(hit);
59 //_____________________________________________________________________________
61 AliMUONHitStoreV1::Collection()
66 //_____________________________________________________________________________
68 AliMUONHitStoreV1::Connect(TTree& tree, Bool_t /*alone*/) const
70 /// Connect this to tree.
71 AliMUONTreeManager tman;
74 if ( tree.GetBranch("MUONHits") )
76 ok = tman.SetAddress(tree,"MUONHits",HitsPtr());
80 ok = tman.MakeBranch(tree,ClassName(),"TClonesArray","MUONHits",
86 //_____________________________________________________________________________
88 AliMUONHitStoreV1::CreateIterator() const
90 /// create an iterator on hits
91 return fHits->MakeIterator();
94 //____________________________________________________________________________
96 AliMUONHitStoreV1::GetSize() const
98 return fHits->GetLast()+1;
101 //____________________________________________________________________________
103 AliMUONHitStoreV1::Clear(Option_t*)
105 /// reset the internal array