]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Modification needed for the dEdx calibration:
authormivanov <marian.ivanov@cern.ch>
Tue, 7 Jan 2014 14:14:17 +0000 (15:14 +0100)
committermivanov <marian.ivanov@cern.ch>
Tue, 7 Jan 2014 14:14:17 +0000 (15:14 +0100)
1.) Calculation of the phi at the reference riadius - AliExternalTrackParam
2.) Adding the dEdx calibration per sector - AliTPCdEdxInfo

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

index 5157d3de7e452f7d994ca1e952f23f682533098d..f61e6a6198e00fc689aa082b33c3260f1050b91a 100644 (file)
@@ -2468,3 +2468,68 @@ Bool_t AliExternalTrackParam::GetXatLabR(Double_t r,Double_t &x, Double_t bz, In
   //
   return kTRUE;
 }
+
+
+Double_t  AliExternalTrackParam::GetParameterAtRadius(Double_t r, Double_t bz, Int_t &parType) const
+{
+  //
+  // Get track parameters at the radius of interest.
+  // Given function is aimed to be used to interactivelly (tree->Draw())
+  // access track properties at different radii
+  //
+  // TO BE USED WITH SPECICAL CARE - 
+  //     it is aimed to be used for rough calculation as constant field and  
+  //     no correction for material is used
+  //  
+  // r  - radius of interest
+  // bz - magentic field 
+  // retun values dependens on parType:
+  //    parType = 0  -gx 
+  //    parType = 1  -gy 
+  //    parType = 2  -gz 
+  //
+  //    parType = 3  -pgx 
+  //    parType = 4  -pgy 
+  //    parType = 5  -pgz
+  //
+  //    parType = 6  - r
+  //    parType = 7  - global position phi
+  //    parType = 8  - global direction phi
+  //    parType = 9  - direction phi- positionphi
+  if (parType<0) {
+    parType=-1;
+     return 0;
+  }
+  Double_t xyz[3];
+  Double_t pxyz[3];  
+  Double_t localX=0;
+  Bool_t res = GetXatLabR(r,localX,bz,1);
+  if (!res) {
+    parType=-1;
+    return 0;
+  }
+  //
+  // position parameters
+  // 
+  GetXYZAt(localX,bz,xyz); 
+  if (parType<3)   {
+    return xyz[parType];
+  }
+  if (parType==6) return TMath::Sqrt(xyz[0]*xyz[0]+xyz[1]*xyz[1]);
+  if (parType==7) return TMath::ATan2(xyz[1],xyz[0]);
+  //
+  // momenta parameters
+  //
+  GetPxPyPzAt(localX,bz,pxyz); 
+  if (parType==8) return TMath::ATan2(pxyz[1],pxyz[0]);
+  if (parType==9) {
+    Double_t diff = TMath::ATan2(pxyz[1],pxyz[0])-TMath::ATan2(xyz[1],xyz[0]);
+    if (diff>TMath::Pi()) diff-=TMath::TwoPi();
+    if (diff<-TMath::Pi()) diff+=TMath::TwoPi();
+    return diff;
+  }
+  if (parType>=3&&parType<6) {
+    return pxyz[parType%3];
+  }
+  return 0;
+}
index 44721d6253123a51a3d22c01f59113ff8c4afe4c..aea85509379ca0f354e45f5c5e6c1df20ce94513 100644 (file)
@@ -218,7 +218,8 @@ class AliExternalTrackParam: public AliVTrack {
   void Print(Option_t* option = "") const;
   Double_t GetSnpAt(Double_t x,Double_t b) const;
   Bool_t GetXatLabR(Double_t r,Double_t &x, Double_t bz, Int_t dir=0) const;
-
+  //
+  Double_t GetParameterAtRadius(Double_t r, Double_t bz, Int_t &parType) const;
   //Deprecated
   Bool_t CorrectForMaterial(Double_t d, Double_t x0, Double_t mass,
         Double_t (*f)(Double_t)=AliExternalTrackParam::BetheBlochSolid);
index 779e5a6753664bd18e244ecf5effedbf3857cb3c..964a07f711ab911ec46bb0f9d628ab9eac740cde 100644 (file)
@@ -1,4 +1,6 @@
 #include "AliTPCdEdxInfo.h"
+#include "TObjArray.h"
+#include "TGraphErrors.h"
 
 //##################################################################
 //
@@ -8,7 +10,7 @@
 //
 //##################################################################
 
-
+TObjArray * AliTPCdEdxInfo::fArraySectorCalibration=0;
 
 ClassImp(AliTPCdEdxInfo)
 
@@ -213,3 +215,17 @@ Double_t AliTPCdEdxInfo::GetWeightedMean(Int_t qType, Int_t wType, Double_t w0,
   Double_t result = (sumw>0) ? sum/sumw:0;
   return result;
 }
+
+
+
+void  AliTPCdEdxInfo::RegisterSectorCalibration(TGraphErrors* gainSector, Int_t regionID, Int_t calibID){
+  //
+  // Register sector calibration
+  //
+  // create if arrray does not exist
+  if (!fArraySectorCalibration) fArraySectorCalibration= new TObjArray((calibID+1)*3*10); // boook space for calibration pointer
+  // resize if not enough booked
+  if (fArraySectorCalibration->GetSize()<(calibID+1)*3) fArraySectorCalibration->Expand((calibID+1)*3);
+  //
+  fArraySectorCalibration->AddAt(gainSector, 3*calibID+regionID);
+}
index f992d12050473cd8c0d0e23da1ba4862a2d779b8..f204bdb0021d4e6047eda377b4e6aaa39dc7f95c 100644 (file)
@@ -1,6 +1,8 @@
 #ifndef AliTPCdEdxInfo_H
 #define AliTPCdEdxInfo_H
 
+class TGraphErrors;
+class TObjArray;
 #include <TObject.h>
 
 class AliTPCdEdxInfo : public TObject 
@@ -38,14 +40,15 @@ public:
   Double_t GetTPCsignalMediumPadQmax() const {return fTPCsignalRegionQmax[1];}
   Double_t GetTPCsignalLongPadQmax()   const {return fTPCsignalRegionQmax[2];}
   Double_t GetTPCsignalOROCQmax()      const {return fTPCsignalRegionQmax[3];}
-  
-private:
+  static void     RegisterSectorCalibration(TGraphErrors* gainSector, Int_t regionID, Int_t calibID);
+private: 
 
   Double32_t  fTPCsignalRegion[4]; //[0.,0.,10] TPC dEdx signal in 4 different regions - 0 - IROC, 1- OROC medium, 2 - OROC long, 3- OROC all, (default truncation used)  - for qTot
   Double32_t  fTPCsignalRegionQmax[4]; //[0.,0.,10] TPC dEdx signal in 4 different regions - 0 - IROC, 1- OROC medium, 2 - OROC long, 3- OROC all, (default truncation used) - for qMax
   Char_t      fTPCsignalNRegion[3]; // number of clusters above threshold used in the dEdx calculation
   Char_t      fTPCsignalNRowRegion[3]; // number of crosed rows used in the dEdx calculation - signal below threshold included
-
+  //
+  static TObjArray *fArraySectorCalibration;
   
   ClassDef(AliTPCdEdxInfo,3)
 };