New functionalityto calculate derived dEdx: GetWeightedMean, GetSignalTot, GetSignalMax
authormivanov <marian.ivanov@cern.ch>
Mon, 16 Dec 2013 14:56:52 +0000 (15:56 +0100)
committermivanov <marian.ivanov@cern.ch>
Mon, 16 Dec 2013 14:56:52 +0000 (15:56 +0100)
AliTPCdEdxInfo.h AliTPCdEdxInfo.cxx

STEER/STEERBase/AliTPCdEdxInfo.cxx
STEER/STEERBase/AliTPCdEdxInfo.h

index 35c606c..779e5a6 100644 (file)
@@ -195,3 +195,21 @@ void  AliTPCdEdxInfo::SetTPCSignalsQmax(Double_t signal[4]){
     fTPCsignalRegionQmax[i]=signal[i];
   }
 }
+
+
+Double_t AliTPCdEdxInfo::GetWeightedMean(Int_t qType, Int_t wType, Double_t w0, Double_t w1, Double_t w2){
+  //
+  // Get weighted mean of the dEdx information
+  //
+  Double_t *info = (qType==0)? fTPCsignalRegion :  fTPCsignalRegionQmax;
+  Char_t *ninfo = (wType==0)? fTPCsignalNRegion:  fTPCsignalNRowRegion;
+  Double_t weight[3]={w0,w1,w2};
+  Double_t sum=0;
+  Double_t sumw=0;
+  for (Int_t i=0; i<3; i++){
+    sum+= info[i]*Double_t(ninfo[i])*weight[i];
+    sumw+= ninfo[i]*weight[i];
+  }
+  Double_t result = (sumw>0) ? sum/sumw:0;
+  return result;
+}
index dd6298d..f992d12 100644 (file)
@@ -9,6 +9,7 @@ public:
   AliTPCdEdxInfo();
   AliTPCdEdxInfo(const AliTPCdEdxInfo& source);
   AliTPCdEdxInfo& operator=(const AliTPCdEdxInfo& source);
+  Double_t GetWeightedMean(Int_t qType, Int_t wType, Double_t w0, Double_t w1, Double_t w2); 
   //
   // qTot info
   void     GetTPCSignalRegionInfo(Double_t signal[4], Char_t ncl[3], Char_t nrows[3]) const;
@@ -25,7 +26,8 @@ public:
   void     SetTPCSignalRegionInfoQmax(Double_t signal[4], Char_t ncl[3], Char_t nrows[3]);
   void     SetTPCSignalsQmax(Double_t signal[4]);
   
-  
+  Double_t GetSignalTot(Int_t index){ return fTPCsignalRegion[index];}
+  Double_t GetSignalMax(Int_t index){ return fTPCsignalRegionQmax[index];}
   //
   Double_t GetTPCsignalShortPad()      const {return fTPCsignalRegion[0];}
   Double_t GetTPCsignalMediumPad()     const {return fTPCsignalRegion[1];}