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(TRootIOCtor* /*dummy*/) : AliMUONVHitStore(),
41 /// default ctor from file
44 //_____________________________________________________________________________
45 AliMUONHitStoreV1::AliMUONHitStoreV1() : AliMUONVHitStore(),
46 fHits(new TClonesArray("AliMUONHit",10))
49 fHits->SetOwner(kTRUE);
52 //_____________________________________________________________________________
53 AliMUONHitStoreV1::~AliMUONHitStoreV1()
59 //_____________________________________________________________________________
61 AliMUONHitStoreV1::Add(const AliMUONHit& hit)
64 new((*fHits)[fHits->GetLast()+1]) AliMUONHit(hit);
67 //_____________________________________________________________________________
69 AliMUONHitStoreV1::Collection()
74 //_____________________________________________________________________________
76 AliMUONHitStoreV1::Connect(TTree& tree, Bool_t /*alone*/) const
78 /// Connect this to tree.
79 AliMUONTreeManager tman;
82 if ( tree.GetBranch("MUONHits") )
84 ok = tman.SetAddress(tree,"MUONHits",HitsPtr());
88 ok = tman.MakeBranch(tree,ClassName(),"TClonesArray","MUONHits",
94 //_____________________________________________________________________________
96 AliMUONHitStoreV1::CreateIterator() const
98 /// create an iterator on hits
99 return fHits->MakeIterator();
102 //____________________________________________________________________________
104 AliMUONHitStoreV1::GetSize() const
106 return fHits->GetLast()+1;
109 //____________________________________________________________________________
111 AliMUONHitStoreV1::Clear(Option_t*)
113 /// reset the internal array