]>
Commit | Line | Data |
---|---|---|
32e449be | 1 | #ifndef ALIMULTIPLICITY_H |
2 | #define ALIMULTIPLICITY_H | |
3 | ||
4 | #include<TObject.h> | |
ff44c37c | 5 | #include <TBits.h> |
44ca59b0 | 6 | #include<TMath.h> |
32e449be | 7 | |
8 | //////////////////////////////////////////////////////// | |
9 | //// Class containing multiplicity information // | |
10 | //// to stored in the ESD // | |
11 | //////////////////////////////////////////////////////// | |
12 | ||
13 | class AliMultiplicity : public TObject { | |
14 | ||
15 | public: | |
16 | ||
17 | AliMultiplicity(); // default constructor | |
18 | // standard constructor | |
fa9ed8e9 | 19 | AliMultiplicity(Int_t ntr,Float_t *th, Float_t *ph, Float_t *dth, Float_t *dph, Int_t *labels, |
d7c5c1e4 | 20 | Int_t* labelsL2, Int_t ns, Float_t *ts, Float_t *ps, Int_t *labelss, Short_t nfcL1, Short_t nfcL2, const TBits & fFastOrFiredChips); |
1f9831ab | 21 | AliMultiplicity(Int_t ntr, Int_t ns, Short_t nfcL1, Short_t nfcL2, const TBits & fFastOr); |
32e449be | 22 | AliMultiplicity(const AliMultiplicity& m); |
23 | AliMultiplicity& operator=(const AliMultiplicity& m); | |
732a24fe | 24 | virtual void Copy(TObject &obj) const; |
1f9831ab | 25 | virtual void Clear(Option_t* opt=""); |
32e449be | 26 | virtual ~AliMultiplicity(); |
968e8539 | 27 | // methods to access tracklet information |
32e449be | 28 | Int_t GetNumberOfTracklets() const {return fNtracks;} |
4f499767 | 29 | Double_t GetTheta(Int_t i) const { |
30 | if(i>=0 && i<fNtracks) return fTh[i]; | |
31 | Error("GetTheta","Invalid track number %d",i); return -9999.; | |
32 | } | |
33 | Double_t GetEta(Int_t i) const { | |
34 | if(i>=0 && i<fNtracks) return -TMath::Log(TMath::Tan(fTh[i]/2.)); | |
35 | Error("GetEta","Invalid track number %d",i); return -9999.; | |
36 | } | |
37 | Double_t GetPhi(Int_t i) const { | |
38 | if(i>=0 && i<fNtracks) return fPhi[i]; | |
39 | Error("GetPhi","Invalid track number %d",i); return -9999.; | |
40 | } | |
41 | Double_t GetDeltaTheta(Int_t i) const { | |
42 | if(fDeltTh && i>=0 && i<fNtracks) return fDeltTh[i]; | |
43 | Error("GetDeltaTheta","DeltaTheta not available in data or Invalid track number %d(max %d)",i, fNtracks); return -9999.; | |
44 | } | |
45 | Double_t GetDeltaPhi(Int_t i) const { | |
46 | if(i>=0 && i<fNtracks) return fDeltPhi[i]; | |
47 | Error("GetDeltaPhi","Invalid track number %d",i); return -9999.; | |
48 | } | |
eda42f29 | 49 | |
50 | Int_t GetLabel(Int_t i, Int_t layer) const; | |
56258350 | 51 | void SetLabel(Int_t i, Int_t layer, Int_t label); |
d7c5c1e4 | 52 | Int_t GetLabelSingle(Int_t i) const; |
53 | void SetLabelSingle(Int_t i, Int_t label); | |
54 | ||
1f9831ab | 55 | |
d4216ce1 | 56 | Bool_t FreeClustersTracklet(Int_t i, Int_t mode) const {return (mode>=0&&mode<2&&i>=0&&i<fNtracks) ? !fUsedClusT[mode].TestBitNumber(i):kFALSE;} |
57 | Bool_t FreeSingleCluster(Int_t i, Int_t mode) const {return (mode>=0&&mode<2&&i>=0&&i<fNsingle) ? !fUsedClusS[mode].TestBitNumber(i):kFALSE;} | |
1f9831ab | 58 | |
eda42f29 | 59 | |
968e8539 | 60 | // methods to access single cluster information |
61 | Int_t GetNumberOfSingleClusters() const {return fNsingle;} | |
4f499767 | 62 | Double_t GetThetaSingle(Int_t i) const { |
63 | if(i>=0 && i<fNsingle) return fThsingle[i]; | |
64 | Error("GetThetaSingle","Invalid cluster number %d",i); return -9999.; | |
65 | } | |
66 | ||
67 | Double_t GetPhiSingle(Int_t i) const { | |
68 | if(i>=0 && i<fNsingle) return fPhisingle[i]; | |
69 | Error("GetPhisingle","Invalid cluster number %d",i); return -9999.; | |
70 | } | |
32e449be | 71 | |
ab37e14c | 72 | Short_t GetNumberOfFiredChips(Int_t layer) const { return fFiredChips[layer]; } |
73 | void SetFiredChips(Int_t layer, Short_t firedChips) { fFiredChips[layer] = firedChips; } | |
466ffa28 | 74 | |
d325d83f | 75 | UInt_t GetNumberOfITSClusters(Int_t layer) const { return layer<6 ? fITSClusters[layer] : 0; } |
76 | UInt_t GetNumberOfITSClusters(Int_t layMin, Int_t layMax) const ; | |
77 | void SetITSClusters(Int_t layer, UInt_t clusters) { fITSClusters[layer] = clusters; } | |
78 | ||
ee87788b | 79 | void SetFastOrFiredChips(UInt_t chipKey){fFastOrFiredChips.SetBitNumber(chipKey);} |
adc4b00f | 80 | const TBits & GetFastOrFiredChips() const {return fFastOrFiredChips;} |
ee87788b | 81 | Bool_t TestFastOrFiredChips(UInt_t chipKey) const {return fFastOrFiredChips.TestBitNumber(chipKey);} |
ff44c37c | 82 | |
ab37e14c | 83 | void SetFiredChipMap(TBits & firedChips){fClusterFiredChips = firedChips;} |
84 | void SetFiredChipMap(UInt_t chipKey){fClusterFiredChips.SetBitNumber(chipKey);} | |
85 | const TBits & GetFiredChipMap() const {return fClusterFiredChips;} | |
86 | Bool_t TestFiredChipMap(UInt_t chipKey) const {return fClusterFiredChips.TestBitNumber(chipKey);} | |
adc4b00f | 87 | |
1f9831ab | 88 | |
89 | ||
90 | // array getters | |
91 | Double_t* GetTheta() const {return (Double_t*)fTh;} | |
92 | Double_t* GetPhi() const {return (Double_t*)fPhi;} | |
93 | Double_t* GetDeltTheta() const {return (Double_t*)fDeltTh;} | |
94 | Double_t* GetDeltPhi() const {return (Double_t*)fDeltPhi;} | |
95 | Double_t* GetThetaSingle() const {return (Double_t*)fThsingle;} | |
96 | Double_t* GetPhiSingle() const {return (Double_t*)fPhisingle;} | |
d7c5c1e4 | 97 | Int_t* GetLabels() const {return (Int_t*)fLabels;} |
1f9831ab | 98 | Int_t* GetLabels2() const {return (Int_t*)fLabelsL2;} |
d7c5c1e4 | 99 | Int_t* GetLabelsSingle() const {return (Int_t*)fLabelssingle;} |
1f9831ab | 100 | |
101 | void SetTrackletData(Int_t id, const Float_t* tlet, UInt_t bits); | |
102 | void SetSingleClusterData(Int_t id, const Float_t* scl,UInt_t bits); | |
103 | void CompactBits(); | |
104 | ||
105 | virtual void Print(Option_t *opt="") const; | |
106 | ||
32e449be | 107 | protected: |
108 | void Duplicate(const AliMultiplicity &m); // used by copy ctr. | |
32e449be | 109 | |
cd888a89 | 110 | Int_t fNtracks; // Number of tracklets |
111 | Int_t fNsingle; // Number of clusters on SPD layer 1, not associated | |
cd888a89 | 112 | // with a tracklet on SPD layer 2 |
0939e22a | 113 | Int_t *fLabels; //[fNtracks] array with labels of cluster in L1 used for tracklet |
114 | Int_t *fLabelsL2; //[fNtracks] array with labels of cluster in L2 used for tracklet | |
cd888a89 | 115 | Double32_t *fTh; //[fNtracks] array with theta values |
116 | Double32_t *fPhi; //[fNtracks] array with phi values | |
fa9ed8e9 | 117 | Double32_t *fDeltTh; //[fNtracks] array with delta theta values |
cd888a89 | 118 | Double32_t *fDeltPhi; //[fNtracks] array with delta phi values |
119 | Double32_t *fThsingle; //[fNsingle] array with theta values of L1 clusters | |
1f9831ab | 120 | Double32_t *fPhisingle; //[fNsingle] array with phi values of L1 clusters |
d7c5c1e4 | 121 | Int_t *fLabelssingle; //[fNsingle] array with labels of clusters in L1 not used for tracklets |
ab37e14c | 122 | Short_t fFiredChips[2]; // Number of fired chips in the two SPD layers |
d7c5c1e4 | 123 | UInt_t fITSClusters[6]; // Number of ITS cluster per layer |
ff44c37c | 124 | TBits fFastOrFiredChips; // Map of FastOr fired chips |
1f9831ab | 125 | TBits fClusterFiredChips; // Map of fired chips (= at least one cluster) |
126 | TBits fUsedClusT[2]; // flag that at least one of tracklets clusters is used by TPC/ITS+ITS_SA (0) or ITS_SA_PURE tracks (1) | |
127 | TBits fUsedClusS[2]; // flag that the single clusters is used by TPC/ITS+ITS_SA (0) or ITS_SA_PURE tracks | |
ff44c37c | 128 | |
d7c5c1e4 | 129 | ClassDef(AliMultiplicity,14); |
32e449be | 130 | }; |
131 | ||
eda42f29 | 132 | inline Int_t AliMultiplicity::GetLabel(Int_t i, Int_t layer) const |
133 | { | |
134 | if(i>=0 && i<fNtracks) { | |
135 | if (layer == 0) { | |
136 | return fLabels[i]; | |
137 | } else if (layer == 1) { | |
138 | if (fLabelsL2) { | |
139 | return fLabelsL2[i]; | |
140 | } else { | |
141 | Warning("GetLabel", "No information for layer 2 available !"); | |
142 | return -9999; | |
143 | } | |
144 | } else { | |
145 | Error("GetLabel","Invalid layer number %d",layer); return -9999; | |
146 | } | |
147 | } else { | |
148 | Error("GetLabel","Invalid track number %d",i); return -9999; | |
149 | } | |
4f499767 | 150 | return -9999; |
eda42f29 | 151 | } |
d7c5c1e4 | 152 | |
153 | inline Int_t AliMultiplicity::GetLabelSingle(Int_t i) const | |
154 | { | |
155 | if(i>=0 && i<fNsingle) { | |
156 | return fLabelssingle[i]; | |
157 | } else { | |
158 | Error("GetLabelSingle","Invalid cluster number %d",i); return -9999; | |
159 | } | |
160 | return -9999; | |
161 | } | |
162 | ||
163 | ||
164 | ||
165 | ||
32e449be | 166 | #endif |