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 //-----------------------------------------------------------------------------
19 /// \class AliMUONTriggerTrackStoreV1
21 /// Implementation of AliMUONVTriggerTrackStore which should be
22 /// backward compatible, i.e. able to read TreeT produced before
23 /// the introduction of the AliMUONVStore concept
25 /// \author Laurent Aphecetche, Subatech
26 //-----------------------------------------------------------------------------
28 #include "AliMUONTriggerTrackStoreV1.h"
30 #include <TClonesArray.h>
31 #include "AliMUONTreeManager.h"
32 #include "AliMUONTriggerTrack.h"
36 ClassImp(AliMUONTriggerTrackStoreV1)
39 //_____________________________________________________________________________
40 AliMUONTriggerTrackStoreV1::AliMUONTriggerTrackStoreV1() : AliMUONVTriggerTrackStore(),
41 fTracks(new TClonesArray("AliMUONTriggerTrack",10))
44 fTracks->SetOwner(kTRUE);
47 //_____________________________________________________________________________
48 AliMUONTriggerTrackStoreV1::~AliMUONTriggerTrackStoreV1()
54 //_____________________________________________________________________________
56 AliMUONTriggerTrackStoreV1::Add(const AliMUONTriggerTrack& track)
58 /// Add a new trigger track
59 new((*fTracks)[fTracks->GetLast()+1]) AliMUONTriggerTrack(track);
62 //_____________________________________________________________________________
64 AliMUONTriggerTrackStoreV1::Connect(TTree& tree, Bool_t alone) const
66 /// Connect this to the tree
67 AliMUONTreeManager tman;
70 if ( tree.GetBranch("MUONTriggerTrack") )
72 if ( alone ) tman.UpdateBranchStatuses(tree,"MUONTriggerTrack");
73 ok = tman.SetAddress(tree,"MUONTriggerTrack",TracksPtr());
77 ok = tman.MakeBranch(tree,ClassName(),"TClonesArray","MUONTriggerTrack",
84 //_____________________________________________________________________________
86 AliMUONTriggerTrackStoreV1::GetSize() const
88 /// Return the number of trigger tracks we hold
89 return fTracks->GetLast()+1;
92 //_____________________________________________________________________________
94 AliMUONTriggerTrackStoreV1::CreateIterator() const
96 /// Return an iterator to loop over trigger tracks
97 return fTracks->MakeIterator();
100 //_____________________________________________________________________________
102 AliMUONTriggerTrackStoreV1::Clear(Option_t*)