3 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * See cxx source for full Copyright notice */
7 //__________________________________________
8 // The particle list class CorrelList_t: implements a single-linked list
10 // list node defined by class CorrelListNode_t and
11 // list iterator defined by class CorrelListIter_t
12 //-- Author: Paul Constantin
14 #include "CorrelParticle.h"
15 #include "CorrelTrack.h"
16 #include "CorrelRecoParent.h"
19 class CorrelListIter_t;
21 class CorrelListNode_t {
24 CorrelListNode_t(CorrelParticle_t* p, CorrelListNode_t* n);
25 CorrelListNode_t(const CorrelListNode_t& rhs);
27 const CorrelListNode_t& operator=(const CorrelListNode_t& rhs);
28 CorrelParticle_t* GetData() const {return fPart;}
29 CorrelListNode_t* GetNext() const {return fNext;}
32 CorrelParticle_t* fPart; // pointer to contained particle
33 CorrelListNode_t* fNext; // pointer to next node
36 class CorrelListIter_t {
39 CorrelListIter_t(CorrelListNode_t* theNode);
40 CorrelListIter_t(const CorrelListIter_t& rhs);
42 const CorrelListIter_t& operator=(const CorrelListIter_t& rhs);
44 Bool_t HasEnded() const {return (fCurr==NULL);}
46 void Move() {Check(); fCurr=fCurr->GetNext();}
47 CorrelListNode_t* Node() const {Check(); return fCurr;}
48 CorrelParticle_t* Data() const {Check(); return fCurr->GetData();}
51 CorrelListNode_t* fCurr; // iterator "current node"
54 class CorrelList_t : public TObject {
57 virtual ~CorrelList_t() {Reset();}
59 const CorrelList_t& operator=(const CorrelList_t& rhs); // makes shallow copy
60 CorrelList_t* DeepCopy(); // use this method to get a deep copy
62 void Push(CorrelParticle_t* p);
63 UInt_t Size() const {return fSize;}
64 UInt_t EvtID() const {return fEvtID;}
65 PartType_t PartID() const {return fPartID;}
66 PoolType_t PoolID() const {return fPoolID;}
67 Bool_t Filled() const {return fFilled;}
68 void SetFilled(Bool_t f) {fFilled=f;}
69 void Label(PartType_t p, PoolType_t l, UInt_t e) {fPartID=p; fPoolID=l; fEvtID=e;}
70 CorrelListIter_t Head() const {return CorrelListIter_t(fHead);}
71 void ShowHead() const;
75 UInt_t fSize; // list size
76 UInt_t fEvtID; // event ID
77 Bool_t fFilled; // is filled
78 PartType_t fPartID; // particle ID
79 PoolType_t fPoolID; // pool type
80 CorrelListNode_t* fHead; // list head
82 CorrelList_t(const CorrelList_t& rhs); // forbid copy constructor
84 ClassDef(CorrelList_t, 1); //CorrelList_t