Line data Source code
1 : #ifndef ALIESDFRIEND_H
2 : #define ALIESDFRIEND_H
3 :
4 : //-------------------------------------------------------------------------
5 : // Class AliESDfriend
6 : // This class contains ESD additions
7 : // Origin: Iouri Belikov, CERN, Jouri.Belikov@cern.ch
8 : //-------------------------------------------------------------------------
9 :
10 : #include <TObject.h>
11 : #include <TClonesArray.h>
12 :
13 : #include "AliESDfriendTrack.h"
14 : #include "AliVfriendEvent.h"
15 :
16 : #include "AliESDVZEROfriend.h"
17 :
18 : class AliESDTZEROfriend;
19 : class AliESDADfriend;
20 :
21 : //_____________________________________________________________________________
22 : class AliESDfriend : public AliVfriendEvent {
23 : public:
24 : AliESDfriend();
25 : AliESDfriend(const AliESDfriend &);
26 : AliESDfriend& operator=(const AliESDfriend& esd);
27 : virtual ~AliESDfriend();
28 :
29 : // This function will set the ownership
30 : // needed to read old ESDfriends
31 : void SetOwner(){
32 0 : fTracks.SetOwner();
33 0 : Int_t n=fTracks.GetEntriesFast();
34 0 : for(;n--;){
35 0 : AliESDfriendTrack *t=(AliESDfriendTrack *)fTracks.UncheckedAt(n);
36 0 : if(t)t->SetOwner();
37 : }
38 0 : }
39 :
40 16 : Int_t GetNumberOfTracks() const {return fTracks.GetEntriesFast();}
41 : AliESDfriendTrack *GetTrack(Int_t i) const {
42 0 : return (AliESDfriendTrack *)fTracks.At(i);
43 : }
44 0 : Int_t GetEntriesInTracks() const {return fTracks.GetEntries();}
45 :
46 : AliESDfriendTrack* AddTrack(const AliESDfriendTrack *t, Bool_t shallow=kFALSE) {
47 142 : return new(fTracks[fTracks.GetEntriesFast()]) AliESDfriendTrack(*t,shallow);
48 0 : }
49 :
50 : AliESDfriendTrack* AddTrackAt(const AliESDfriendTrack *t, Int_t i, Bool_t shallow=kFALSE) {
51 0 : return new(fTracks[i]) AliESDfriendTrack(*t,shallow);
52 0 : }
53 :
54 : void SetVZEROfriend(const AliESDVZEROfriend * obj);
55 8 : AliESDVZEROfriend *GetVZEROfriend(){ return fESDVZEROfriend; }
56 0 : const AliESDVZEROfriend *GetVZEROfriendConst() const { return fESDVZEROfriend; }
57 0 : AliVVZEROfriend *GetVVZEROfriend(){ return fESDVZEROfriend; }
58 : Int_t GetESDVZEROfriend( AliESDVZEROfriend &v ) const {
59 0 : if( fESDVZEROfriend ){ v=*fESDVZEROfriend; return 0; }
60 0 : return -1;
61 0 : }
62 :
63 : void SetTZEROfriend(AliESDTZEROfriend * obj);
64 0 : AliESDTZEROfriend *GetTZEROfriend(){ return fESDTZEROfriend; }
65 : void SetADfriend(AliESDADfriend * obj);
66 0 : AliESDADfriend *GetADfriend(){ return fESDADfriend; }
67 :
68 : void Ls() const {
69 0 : return fTracks.ls();
70 : }
71 : void Reset();
72 : void ResetSoft();
73 : // bit manipulation for filtering
74 2 : void SetSkipBit(Bool_t skip){SetBit(23,skip);}
75 0 : Bool_t TestSkipBit() const { return TestBit(23); }
76 :
77 : //TPC cluster occupancy
78 0 : Int_t GetNclustersTPC(UInt_t sector) const {return (sector<72)?fNclustersTPC[sector]:0;}
79 0 : Int_t GetNclustersTPCused(UInt_t sector) const {return (sector<72)?fNclustersTPCused[sector]:0;}
80 2304 : void SetNclustersTPC(UInt_t sector, Int_t occupancy) {if (sector<72) fNclustersTPC[sector]=occupancy;}
81 2304 : void SetNclustersTPCused(UInt_t sector, Int_t occupancy) {if (sector<72) fNclustersTPCused[sector]=occupancy;}
82 : //
83 16 : Bool_t GetESDIndicesStored() const {return fESDIndicesStored;}
84 8 : void SetESDIndicesStored(Bool_t v) {fESDIndicesStored = v;}
85 :
86 : protected:
87 : void DeleteTracksSafe();
88 :
89 : protected:
90 : Bool_t fESDIndicesStored; // Flag new format of sparse friends
91 : TClonesArray fTracks; // ESD friend tracks
92 : AliESDVZEROfriend *fESDVZEROfriend; // VZERO object containing complete raw data
93 : AliESDTZEROfriend *fESDTZEROfriend; // TZERO calibration object
94 : AliESDADfriend *fESDADfriend; // AD object containing complete raw data
95 :
96 : Int_t fNclustersTPC[72]; //cluster occupancy per sector per sector
97 : Int_t fNclustersTPCused[72]; //number of clusters used in tracking per sector
98 :
99 472 : ClassDef(AliESDfriend,6) // ESD friend
100 : };
101 :
102 : #endif
103 :
104 :
|