]>
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, |
adc4b00f | 20 | Int_t* labelsL2, Int_t ns, Float_t *ts, Float_t *ps, 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); |
1f9831ab | 52 | |
d4216ce1 | 53 | Bool_t FreeClustersTracklet(Int_t i, Int_t mode) const {return (mode>=0&&mode<2&&i>=0&&i<fNtracks) ? !fUsedClusT[mode].TestBitNumber(i):kFALSE;} |
54 | 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 | 55 | |
eda42f29 | 56 | |
968e8539 | 57 | // methods to access single cluster information |
58 | Int_t GetNumberOfSingleClusters() const {return fNsingle;} | |
4f499767 | 59 | Double_t GetThetaSingle(Int_t i) const { |
60 | if(i>=0 && i<fNsingle) return fThsingle[i]; | |
61 | Error("GetThetaSingle","Invalid cluster number %d",i); return -9999.; | |
62 | } | |
63 | ||
64 | Double_t GetPhiSingle(Int_t i) const { | |
65 | if(i>=0 && i<fNsingle) return fPhisingle[i]; | |
66 | Error("GetPhisingle","Invalid cluster number %d",i); return -9999.; | |
67 | } | |
32e449be | 68 | |
ab37e14c | 69 | Short_t GetNumberOfFiredChips(Int_t layer) const { return fFiredChips[layer]; } |
70 | void SetFiredChips(Int_t layer, Short_t firedChips) { fFiredChips[layer] = firedChips; } | |
466ffa28 | 71 | |
d325d83f | 72 | UInt_t GetNumberOfITSClusters(Int_t layer) const { return layer<6 ? fITSClusters[layer] : 0; } |
73 | UInt_t GetNumberOfITSClusters(Int_t layMin, Int_t layMax) const ; | |
74 | void SetITSClusters(Int_t layer, UInt_t clusters) { fITSClusters[layer] = clusters; } | |
75 | ||
ee87788b | 76 | void SetFastOrFiredChips(UInt_t chipKey){fFastOrFiredChips.SetBitNumber(chipKey);} |
adc4b00f | 77 | const TBits & GetFastOrFiredChips() const {return fFastOrFiredChips;} |
ee87788b | 78 | Bool_t TestFastOrFiredChips(UInt_t chipKey) const {return fFastOrFiredChips.TestBitNumber(chipKey);} |
ff44c37c | 79 | |
ab37e14c | 80 | void SetFiredChipMap(TBits & firedChips){fClusterFiredChips = firedChips;} |
81 | void SetFiredChipMap(UInt_t chipKey){fClusterFiredChips.SetBitNumber(chipKey);} | |
82 | const TBits & GetFiredChipMap() const {return fClusterFiredChips;} | |
83 | Bool_t TestFiredChipMap(UInt_t chipKey) const {return fClusterFiredChips.TestBitNumber(chipKey);} | |
adc4b00f | 84 | |
1f9831ab | 85 | |
86 | ||
87 | // array getters | |
88 | Double_t* GetTheta() const {return (Double_t*)fTh;} | |
89 | Double_t* GetPhi() const {return (Double_t*)fPhi;} | |
90 | Double_t* GetDeltTheta() const {return (Double_t*)fDeltTh;} | |
91 | Double_t* GetDeltPhi() const {return (Double_t*)fDeltPhi;} | |
92 | Double_t* GetThetaSingle() const {return (Double_t*)fThsingle;} | |
93 | Double_t* GetPhiSingle() const {return (Double_t*)fPhisingle;} | |
94 | Int_t* GetLabels() const {return (Int_t*)fLabels;} | |
95 | Int_t* GetLabels2() const {return (Int_t*)fLabelsL2;} | |
96 | ||
97 | void SetTrackletData(Int_t id, const Float_t* tlet, UInt_t bits); | |
98 | void SetSingleClusterData(Int_t id, const Float_t* scl,UInt_t bits); | |
99 | void CompactBits(); | |
100 | ||
101 | virtual void Print(Option_t *opt="") const; | |
102 | ||
32e449be | 103 | protected: |
104 | void Duplicate(const AliMultiplicity &m); // used by copy ctr. | |
32e449be | 105 | |
cd888a89 | 106 | Int_t fNtracks; // Number of tracklets |
107 | Int_t fNsingle; // Number of clusters on SPD layer 1, not associated | |
cd888a89 | 108 | // with a tracklet on SPD layer 2 |
0939e22a | 109 | Int_t *fLabels; //[fNtracks] array with labels of cluster in L1 used for tracklet |
110 | Int_t *fLabelsL2; //[fNtracks] array with labels of cluster in L2 used for tracklet | |
cd888a89 | 111 | Double32_t *fTh; //[fNtracks] array with theta values |
112 | Double32_t *fPhi; //[fNtracks] array with phi values | |
fa9ed8e9 | 113 | Double32_t *fDeltTh; //[fNtracks] array with delta theta values |
cd888a89 | 114 | Double32_t *fDeltPhi; //[fNtracks] array with delta phi values |
115 | Double32_t *fThsingle; //[fNsingle] array with theta values of L1 clusters | |
1f9831ab | 116 | Double32_t *fPhisingle; //[fNsingle] array with phi values of L1 clusters |
ab37e14c | 117 | Short_t fFiredChips[2]; // Number of fired chips in the two SPD layers |
d325d83f | 118 | UInt_t fITSClusters[6]; // Number of ITS cluster per layer |
ff44c37c | 119 | TBits fFastOrFiredChips; // Map of FastOr fired chips |
1f9831ab | 120 | TBits fClusterFiredChips; // Map of fired chips (= at least one cluster) |
121 | 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) | |
122 | TBits fUsedClusS[2]; // flag that the single clusters is used by TPC/ITS+ITS_SA (0) or ITS_SA_PURE tracks | |
ff44c37c | 123 | |
1f9831ab | 124 | ClassDef(AliMultiplicity,13); |
32e449be | 125 | }; |
126 | ||
eda42f29 | 127 | inline Int_t AliMultiplicity::GetLabel(Int_t i, Int_t layer) const |
128 | { | |
129 | if(i>=0 && i<fNtracks) { | |
130 | if (layer == 0) { | |
131 | return fLabels[i]; | |
132 | } else if (layer == 1) { | |
133 | if (fLabelsL2) { | |
134 | return fLabelsL2[i]; | |
135 | } else { | |
136 | Warning("GetLabel", "No information for layer 2 available !"); | |
137 | return -9999; | |
138 | } | |
139 | } else { | |
140 | Error("GetLabel","Invalid layer number %d",layer); return -9999; | |
141 | } | |
142 | } else { | |
143 | Error("GetLabel","Invalid track number %d",i); return -9999; | |
144 | } | |
4f499767 | 145 | return -9999; |
eda42f29 | 146 | } |
32e449be | 147 | #endif |