]> git.uio.no Git - u/mrichter/AliRoot.git/blob - STEER/AliMultiplicity.h
added a protection
[u/mrichter/AliRoot.git] / STEER / AliMultiplicity.h
1 #ifndef ALIMULTIPLICITY_H
2 #define ALIMULTIPLICITY_H
3
4 #include<TObject.h>
5 #include<TMath.h>
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
18   AliMultiplicity(Int_t ntr,Float_t *t, Float_t *ph, Float_t *df, Int_t *labels,
19                   Int_t ns, Float_t *ts, Float_t *ps);
20   AliMultiplicity(const AliMultiplicity& m);
21   AliMultiplicity& operator=(const AliMultiplicity& m);
22   virtual ~AliMultiplicity();
23 // methods to access tracklet information
24   Int_t GetNumberOfTracklets() const {return fNtracks;}
25   Double_t GetTheta(Int_t i) const { if(i>=0 && i<fNtracks) {return fTh[i];}
26   else {Error("GetTheta","Invalid track number %d",i); return -9999.;}}
27   Double_t GetEta(Int_t i) const { if(i>=0 && i<fNtracks) {return -TMath::Log(TMath::Tan(fTh[i]/2.));}
28   else {Error("GetTheta","Invalid track number %d",i); return -9999.;}}
29   Double_t GetPhi(Int_t i) const { if(i>=0 && i<fNtracks) {return fPhi[i];}
30   else {Error("GetPhi","Invalid track number %d",i); return -9999.;}}
31   Double_t GetDeltaPhi(Int_t i) const {if(i>=0 && i<fNtracks) {return fDeltPhi[i];}
32   else {Error("GetDeltaPhi","Invalid track number %d",i); return -9999.;}}
33   Int_t GetLabel(Int_t i) const {if(i>=0 && i<fNtracks) {return fLabels[i];}
34   else {Error("GetLabel","Invalid track number %d",i); return -9999;}}
35 // methods to access single cluster information
36   Int_t GetNumberOfSingleClusters() const {return fNsingle;}
37   Double_t GetThetaSingle(Int_t i) const { if(i>=0 && i<fNsingle) {return fThsingle[i];}
38   else {Error("GetThetaSingle","Invalid cluster number %d",i); return -9999.;}}
39   Double_t GetPhiSingle(Int_t i) const { if(i>=0 && i<fNsingle) {return fPhisingle[i];}
40   else {Error("GetPhisingle","Invalid cluster number %d",i); return -9999.;}}
41
42   Short_t GetFiredChips(Int_t layer) { return fFiredChips[layer]; }
43   void SetFiredChips(Int_t layer, Short_t firedChips) { fFiredChips[layer] = firedChips; }
44
45   protected:
46   void Duplicate(const AliMultiplicity &m);  // used by copy ctr.
47
48   Int_t fNtracks;            // Number of tracklets
49   Int_t fNsingle;            // Number of clusters on SPD layer 1, not associated
50   Int_t *fLabels;            //[fNtracks] array with labels of tracklets
51                              // with a tracklet on SPD layer 2
52   Double32_t *fTh;           //[fNtracks] array with theta values
53   Double32_t *fPhi;          //[fNtracks] array with phi values
54   Double32_t *fDeltPhi;      //[fNtracks] array with delta phi values
55   Double32_t *fThsingle;     //[fNsingle] array with theta values of L1 clusters
56   Double32_t *fPhisingle;    //[fNsingle] array with phi values of L2 clusters
57   Short_t fFiredChips[2]; // number of fired chips in the two SPD layers
58
59   ClassDef(AliMultiplicity,6);
60 };
61
62 #endif