AliRoot Core  3abf5b4 (3abf5b4)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
AliMUONTriggerTrackStoreV1.cxx
Go to the documentation of this file.
1 /**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
3 * *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
6 * *
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 **************************************************************************/
15 
16 // $Id$
17 
18 //-----------------------------------------------------------------------------
26 //-----------------------------------------------------------------------------
27 
29 
30 #include <TClonesArray.h>
31 #include "AliMUONTreeManager.h"
32 #include "AliMUONTriggerTrack.h"
33 #include <TTree.h>
34 
38 
39 //_____________________________________________________________________________
41 fTracks(0x0)
42 {
44 }
45 
46 //_____________________________________________________________________________
48  fTracks(new TClonesArray("AliMUONTriggerTrack",10))
49 {
51  fTracks->SetOwner(kTRUE);
52 }
53 
54 //_____________________________________________________________________________
56 {
58  delete fTracks;
59 }
60 
61 //_____________________________________________________________________________
62 void
64 {
66  new((*fTracks)[fTracks->GetLast()+1]) AliMUONTriggerTrack(track);
67 }
68 
69 //_____________________________________________________________________________
70 Bool_t
71 AliMUONTriggerTrackStoreV1::Connect(TTree& tree, Bool_t alone) const
72 {
74  AliMUONTreeManager tman;
75  Bool_t ok;
76 
77  if ( tree.GetBranch("MUONTriggerTrack") )
78  {
79  if ( alone ) tman.UpdateBranchStatuses(tree,"MUONTriggerTrack");
80  ok = tman.SetAddress(tree,"MUONTriggerTrack",TracksPtr());
81  }
82  else
83  {
84  ok = tman.MakeBranch(tree,ClassName(),"TClonesArray","MUONTriggerTrack",
85  TracksPtr());
86  }
87 
88  return kTRUE;
89 }
90 
91 //_____________________________________________________________________________
92 Int_t
94 {
96  return fTracks->GetLast()+1;
97 }
98 
99 //_____________________________________________________________________________
100 TIterator*
102 {
104  return fTracks->MakeIterator();
105 }
106 
107 //_____________________________________________________________________________
108 void
110 {
112  fTracks->Clear("C");
113 }
Bool_t SetAddress(TTree &tree, const char *branchName, void *address) const
virtual Int_t GetSize() const
The number of objects stored.
virtual TIterator * CreateIterator() const
Iterator to loop over tracks.
Implementation of AliMUONVTriggerTrackStore.
TClonesArray * fTracks
internal array
AliTPCfastTrack * track
Reconstructed trigger track in ALICE dimuon spectrometer.
virtual Bool_t Connect(TTree &tree, Bool_t alone=kTRUE) const
Connect us to a TTree (only valid if CanConnect()==kTRUE)
TTree * tree
Helper class to ease TTree (MUON) branches manipulations.
ClassImp(TPCGenInfo)
Definition: AliTPCCmpNG.C:254
virtual void Clear(Option_t *opt="")
Clear ourselves (i.e. Reset)
TClonesArray ** TracksPtr() const
Return the address of the tracks array.
Base class of a trigger track store.
void UpdateBranchStatuses(TTree &tree, const char *pattern) const
virtual void Add(const AliMUONTriggerTrack &track)
Add a trigger track.
Bool_t MakeBranch(TTree &tree, const char *storeClassName, const char *branchClassName, const char *branchName, void *address, Int_t bufferSize=4000, Int_t splitLevel=99) const