]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - STEER/AliMultiplicity.h
New representation of the raw TRD PID signal in ESD (Alex, Yuri)
[u/mrichter/AliRoot.git] / STEER / AliMultiplicity.h
index 2d862bb6eb26fb298a38a2a6bc938bacdbc1d40c..9c5a3cc2eeca09e9392121768f49300a04e8664b 100644 (file)
@@ -2,6 +2,7 @@
 #define ALIMULTIPLICITY_H
 
 #include<TObject.h>
+#include<TMath.h>
 
 ////////////////////////////////////////////////////////
 ////   Class containing multiplicity information      //
@@ -14,38 +15,70 @@ class AliMultiplicity : public TObject {
 
   AliMultiplicity();               // default constructor
   // standard constructor
-  AliMultiplicity(Int_t ntr,Float_t *t, Float_t *ph, Float_t *df,
-                  Int_t ns, Float_t *ts, Float_t *ps); 
+  AliMultiplicity(Int_t ntr,Float_t *t, Float_t *ph, Float_t *df, Int_t *labels,
+                  Int_t* labelsL2, Int_t ns, Float_t *ts, Float_t *ps);
   AliMultiplicity(const AliMultiplicity& m);
   AliMultiplicity& operator=(const AliMultiplicity& m);
+  virtual void Copy(TObject &obj) const;
   virtual ~AliMultiplicity();
 // methods to access tracklet information
   Int_t GetNumberOfTracklets() const {return fNtracks;}
-  Float_t GetTheta(Int_t i) const { if(i>=0 && i<fNtracks) {return fTh[i];}
+  Double_t GetTheta(Int_t i) const { if(i>=0 && i<fNtracks) {return fTh[i];}
   else {Error("GetTheta","Invalid track number %d",i); return -9999.;}}
-  Float_t GetPhi(Int_t i) const { if(i>=0 && i<fNtracks) {return fPhi[i];}
+  Double_t GetEta(Int_t i) const { if(i>=0 && i<fNtracks) {return -TMath::Log(TMath::Tan(fTh[i]/2.));}
+  else {Error("GetTheta","Invalid track number %d",i); return -9999.;}}
+  Double_t GetPhi(Int_t i) const { if(i>=0 && i<fNtracks) {return fPhi[i];}
   else {Error("GetPhi","Invalid track number %d",i); return -9999.;}}
-  Float_t GetDeltaPhi(Int_t i) const {if(i>=0 && i<fNtracks) {return fDeltPhi[i];}
+  Double_t GetDeltaPhi(Int_t i) const {if(i>=0 && i<fNtracks) {return fDeltPhi[i];}
   else {Error("GetDeltaPhi","Invalid track number %d",i); return -9999.;}}
+
+  Int_t GetLabel(Int_t i, Int_t layer) const;
+  
 // methods to access single cluster information
   Int_t GetNumberOfSingleClusters() const {return fNsingle;}
-  Float_t GetThetaSingle(Int_t i) const { if(i>=0 && i<fNsingle) {return fThsingle[i];}
+  Double_t GetThetaSingle(Int_t i) const { if(i>=0 && i<fNsingle) {return fThsingle[i];}
   else {Error("GetThetaSingle","Invalid cluster number %d",i); return -9999.;}}
-  Float_t GetPhiSingle(Int_t i) const { if(i>=0 && i<fNsingle) {return fPhisingle[i];}
+  Double_t GetPhiSingle(Int_t i) const { if(i>=0 && i<fNsingle) {return fPhisingle[i];}
   else {Error("GetPhisingle","Invalid cluster number %d",i); return -9999.;}}
 
+  Short_t GetFiredChips(Int_t layer) { return fFiredChips[layer]; }
+  void SetFiredChips(Int_t layer, Short_t firedChips) { fFiredChips[layer] = firedChips; }
+
   protected:
   void Duplicate(const AliMultiplicity &m);  // used by copy ctr.
-  Int_t fNtracks;         // Number of tracklets 
-  Float_t *fTh;           //[fNtracks] array with theta values
-  Float_t *fPhi;          //[fNtracks] array with phi values
-  Float_t *fDeltPhi;      //[fNtracks] array with delta phi values
-  Int_t fNsingle;         // Number of clusters on SPD layer 1, not associated
-                          // with a tracklet on SPD layer 2
-  Float_t *fThsingle;     //[fNsingle] array with theta values of L1 clusters
-  Float_t *fPhisingle;    //[fNsingle] array with phi values of L2 clusters
-
-  ClassDef(AliMultiplicity,2);
+
+  Int_t fNtracks;            // Number of tracklets
+  Int_t fNsingle;            // Number of clusters on SPD layer 1, not associated
+                             // with a tracklet on SPD layer 2
+  Int_t *fLabels;            //[fNtracks] array with labels of cluster in L1 used for tracklet
+  Int_t *fLabelsL2;          //[fNtracks] array with labels of cluster in L2 used for tracklet
+  Double32_t *fTh;           //[fNtracks] array with theta values
+  Double32_t *fPhi;          //[fNtracks] array with phi values
+  Double32_t *fDeltPhi;      //[fNtracks] array with delta phi values
+  Double32_t *fThsingle;     //[fNsingle] array with theta values of L1 clusters
+  Double32_t *fPhisingle;    //[fNsingle] array with phi values of L2 clusters
+  Short_t fFiredChips[2]; // number of fired chips in the two SPD layers
+
+  ClassDef(AliMultiplicity,7);
 };
 
+inline Int_t AliMultiplicity::GetLabel(Int_t i, Int_t layer) const
+{
+    if(i>=0 && i<fNtracks) {
+       if (layer == 0) {
+           return fLabels[i];
+       } else if (layer == 1) {
+           if (fLabelsL2) {
+               return fLabelsL2[i];
+           } else {
+               Warning("GetLabel", "No information for layer 2 available !");
+               return -9999;
+           }
+       } else {
+           Error("GetLabel","Invalid layer number %d",layer); return -9999;
+       }
+    } else {
+       Error("GetLabel","Invalid track number %d",i); return -9999;
+    }
+}
 #endif