]>
Commit | Line | Data |
---|---|---|
32e449be | 1 | #ifndef ALIMULTIPLICITY_H |
2 | #define ALIMULTIPLICITY_H | |
3 | ||
4 | #include<TObject.h> | |
44ca59b0 | 5 | #include<TMath.h> |
32e449be | 6 | |
7 | //////////////////////////////////////////////////////// | |
8 | //// Class containing multiplicity information // | |
9 | //// to stored in the ESD // | |
10 | //////////////////////////////////////////////////////// | |
11 | ||
12 | class AliMultiplicity : public TObject { | |
13 | ||
14 | public: | |
15 | ||
16 | AliMultiplicity(); // default constructor | |
17 | // standard constructor | |
59ea252e | 18 | AliMultiplicity(Int_t ntr,Float_t *t, Float_t *ph, Float_t *df, Int_t *labels, |
0939e22a | 19 | Int_t* labelsL2, Int_t ns, Float_t *ts, Float_t *ps); |
32e449be | 20 | AliMultiplicity(const AliMultiplicity& m); |
21 | AliMultiplicity& operator=(const AliMultiplicity& m); | |
732a24fe | 22 | virtual void Copy(TObject &obj) const; |
32e449be | 23 | virtual ~AliMultiplicity(); |
968e8539 | 24 | // methods to access tracklet information |
32e449be | 25 | Int_t GetNumberOfTracklets() const {return fNtracks;} |
cd888a89 | 26 | Double_t GetTheta(Int_t i) const { if(i>=0 && i<fNtracks) {return fTh[i];} |
32e449be | 27 | else {Error("GetTheta","Invalid track number %d",i); return -9999.;}} |
44ca59b0 | 28 | Double_t GetEta(Int_t i) const { if(i>=0 && i<fNtracks) {return -TMath::Log(TMath::Tan(fTh[i]/2.));} |
29 | else {Error("GetTheta","Invalid track number %d",i); return -9999.;}} | |
cd888a89 | 30 | Double_t GetPhi(Int_t i) const { if(i>=0 && i<fNtracks) {return fPhi[i];} |
968e8539 | 31 | else {Error("GetPhi","Invalid track number %d",i); return -9999.;}} |
cd888a89 | 32 | Double_t GetDeltaPhi(Int_t i) const {if(i>=0 && i<fNtracks) {return fDeltPhi[i];} |
32e449be | 33 | else {Error("GetDeltaPhi","Invalid track number %d",i); return -9999.;}} |
eda42f29 | 34 | |
35 | Int_t GetLabel(Int_t i, Int_t layer) const; | |
36 | ||
968e8539 | 37 | // methods to access single cluster information |
38 | Int_t GetNumberOfSingleClusters() const {return fNsingle;} | |
cd888a89 | 39 | Double_t GetThetaSingle(Int_t i) const { if(i>=0 && i<fNsingle) {return fThsingle[i];} |
968e8539 | 40 | else {Error("GetThetaSingle","Invalid cluster number %d",i); return -9999.;}} |
cd888a89 | 41 | Double_t GetPhiSingle(Int_t i) const { if(i>=0 && i<fNsingle) {return fPhisingle[i];} |
968e8539 | 42 | else {Error("GetPhisingle","Invalid cluster number %d",i); return -9999.;}} |
32e449be | 43 | |
466ffa28 | 44 | Short_t GetFiredChips(Int_t layer) { return fFiredChips[layer]; } |
45 | void SetFiredChips(Int_t layer, Short_t firedChips) { fFiredChips[layer] = firedChips; } | |
46 | ||
32e449be | 47 | protected: |
48 | void Duplicate(const AliMultiplicity &m); // used by copy ctr. | |
32e449be | 49 | |
cd888a89 | 50 | Int_t fNtracks; // Number of tracklets |
51 | Int_t fNsingle; // Number of clusters on SPD layer 1, not associated | |
cd888a89 | 52 | // with a tracklet on SPD layer 2 |
0939e22a | 53 | Int_t *fLabels; //[fNtracks] array with labels of cluster in L1 used for tracklet |
54 | Int_t *fLabelsL2; //[fNtracks] array with labels of cluster in L2 used for tracklet | |
cd888a89 | 55 | Double32_t *fTh; //[fNtracks] array with theta values |
56 | Double32_t *fPhi; //[fNtracks] array with phi values | |
57 | Double32_t *fDeltPhi; //[fNtracks] array with delta phi values | |
58 | Double32_t *fThsingle; //[fNsingle] array with theta values of L1 clusters | |
59 | Double32_t *fPhisingle; //[fNsingle] array with phi values of L2 clusters | |
466ffa28 | 60 | Short_t fFiredChips[2]; // number of fired chips in the two SPD layers |
61 | ||
0939e22a | 62 | ClassDef(AliMultiplicity,7); |
32e449be | 63 | }; |
64 | ||
eda42f29 | 65 | inline Int_t AliMultiplicity::GetLabel(Int_t i, Int_t layer) const |
66 | { | |
67 | if(i>=0 && i<fNtracks) { | |
68 | if (layer == 0) { | |
69 | return fLabels[i]; | |
70 | } else if (layer == 1) { | |
71 | if (fLabelsL2) { | |
72 | return fLabelsL2[i]; | |
73 | } else { | |
74 | Warning("GetLabel", "No information for layer 2 available !"); | |
75 | return -9999; | |
76 | } | |
77 | } else { | |
78 | Error("GetLabel","Invalid layer number %d",layer); return -9999; | |
79 | } | |
80 | } else { | |
81 | Error("GetLabel","Invalid track number %d",i); return -9999; | |
82 | } | |
83 | } | |
32e449be | 84 | #endif |