]> git.uio.no Git - u/mrichter/AliRoot.git/blame - STEER/AliMultiplicity.h
Corrected Clear method
[u/mrichter/AliRoot.git] / STEER / AliMultiplicity.h
CommitLineData
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
13class 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,
ff44c37c 20 Int_t* labelsL2, Int_t ns, Float_t *ts, Float_t *ps, Short_t nfcL1, Short_t nfcL2, TBits fFastOrFiredChips);
32e449be 21 AliMultiplicity(const AliMultiplicity& m);
22 AliMultiplicity& operator=(const AliMultiplicity& m);
732a24fe 23 virtual void Copy(TObject &obj) const;
32e449be 24 virtual ~AliMultiplicity();
968e8539 25// methods to access tracklet information
32e449be 26 Int_t GetNumberOfTracklets() const {return fNtracks;}
cd888a89 27 Double_t GetTheta(Int_t i) const { if(i>=0 && i<fNtracks) {return fTh[i];}
32e449be 28 else {Error("GetTheta","Invalid track number %d",i); return -9999.;}}
44ca59b0 29 Double_t GetEta(Int_t i) const { if(i>=0 && i<fNtracks) {return -TMath::Log(TMath::Tan(fTh[i]/2.));}
fa9ed8e9 30 else {Error("GetEta","Invalid track number %d",i); return -9999.;}}
cd888a89 31 Double_t GetPhi(Int_t i) const { if(i>=0 && i<fNtracks) {return fPhi[i];}
968e8539 32 else {Error("GetPhi","Invalid track number %d",i); return -9999.;}}
0e51d097 33 Double_t GetDeltaTheta(Int_t i) const {if(fDeltTh && i>=0 && i<fNtracks) {return fDeltTh[i];}
34 else {Error("GetDeltaTheta","DeltaTheta not available in data or Invalid track number %d(max %d)",i, fNtracks); return -9999.;}}
cd888a89 35 Double_t GetDeltaPhi(Int_t i) const {if(i>=0 && i<fNtracks) {return fDeltPhi[i];}
32e449be 36 else {Error("GetDeltaPhi","Invalid track number %d",i); return -9999.;}}
eda42f29 37
38 Int_t GetLabel(Int_t i, Int_t layer) const;
56258350 39 void SetLabel(Int_t i, Int_t layer, Int_t label);
eda42f29 40
968e8539 41// methods to access single cluster information
42 Int_t GetNumberOfSingleClusters() const {return fNsingle;}
cd888a89 43 Double_t GetThetaSingle(Int_t i) const { if(i>=0 && i<fNsingle) {return fThsingle[i];}
968e8539 44 else {Error("GetThetaSingle","Invalid cluster number %d",i); return -9999.;}}
cd888a89 45 Double_t GetPhiSingle(Int_t i) const { if(i>=0 && i<fNsingle) {return fPhisingle[i];}
968e8539 46 else {Error("GetPhisingle","Invalid cluster number %d",i); return -9999.;}}
32e449be 47
008149e2 48 Short_t GetNumberOfFiredChips(Int_t layer) const { return fFiredChips[layer]; }
466ffa28 49 void SetFiredChips(Int_t layer, Short_t firedChips) { fFiredChips[layer] = firedChips; }
50
d325d83f 51 UInt_t GetNumberOfITSClusters(Int_t layer) const { return layer<6 ? fITSClusters[layer] : 0; }
52 UInt_t GetNumberOfITSClusters(Int_t layMin, Int_t layMax) const ;
53 void SetITSClusters(Int_t layer, UInt_t clusters) { fITSClusters[layer] = clusters; }
54
ee87788b 55 void SetFastOrFiredChips(UInt_t chipKey){fFastOrFiredChips.SetBitNumber(chipKey);}
ff44c37c 56 TBits GetFastOrFiredChips() const {return fFastOrFiredChips;}
ee87788b 57 Bool_t TestFastOrFiredChips(UInt_t chipKey) const {return fFastOrFiredChips.TestBitNumber(chipKey);}
ff44c37c 58
32e449be 59 protected:
60 void Duplicate(const AliMultiplicity &m); // used by copy ctr.
32e449be 61
cd888a89 62 Int_t fNtracks; // Number of tracklets
63 Int_t fNsingle; // Number of clusters on SPD layer 1, not associated
cd888a89 64 // with a tracklet on SPD layer 2
0939e22a 65 Int_t *fLabels; //[fNtracks] array with labels of cluster in L1 used for tracklet
66 Int_t *fLabelsL2; //[fNtracks] array with labels of cluster in L2 used for tracklet
cd888a89 67 Double32_t *fTh; //[fNtracks] array with theta values
68 Double32_t *fPhi; //[fNtracks] array with phi values
fa9ed8e9 69 Double32_t *fDeltTh; //[fNtracks] array with delta theta values
cd888a89 70 Double32_t *fDeltPhi; //[fNtracks] array with delta phi values
71 Double32_t *fThsingle; //[fNsingle] array with theta values of L1 clusters
72 Double32_t *fPhisingle; //[fNsingle] array with phi values of L2 clusters
9b373e9a 73 Short_t fFiredChips[2]; // Number of fired chips in the two SPD layers
d325d83f 74 UInt_t fITSClusters[6]; // Number of ITS cluster per layer
ff44c37c 75 TBits fFastOrFiredChips; // Map of FastOr fired chips
76
d325d83f 77 ClassDef(AliMultiplicity,10);
32e449be 78};
79
eda42f29 80inline Int_t AliMultiplicity::GetLabel(Int_t i, Int_t layer) const
81{
82 if(i>=0 && i<fNtracks) {
83 if (layer == 0) {
84 return fLabels[i];
85 } else if (layer == 1) {
86 if (fLabelsL2) {
87 return fLabelsL2[i];
88 } else {
89 Warning("GetLabel", "No information for layer 2 available !");
90 return -9999;
91 }
92 } else {
93 Error("GetLabel","Invalid layer number %d",layer); return -9999;
94 }
95 } else {
96 Error("GetLabel","Invalid track number %d",i); return -9999;
97 }
98}
32e449be 99#endif