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