]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - TPC/AliTPCParamSR.cxx
Electron identification cut changed to 3.5 sigma
[u/mrichter/AliRoot.git] / TPC / AliTPCParamSR.cxx
index f3c35f87d329096bf35ad7c61c93405020aab577..a112df279b8ed4dc89adfa6c44feed713b1622fd 100644 (file)
@@ -46,13 +46,19 @@ static const Float_t kFacSigmaTime=3.;
 
 
 AliTPCParamSR::AliTPCParamSR()
+              :AliTPCParam(),
+              fInnerPRF(0),
+              fOuter1PRF(0),
+              fOuter2PRF(0),
+              fTimeRF(0),
+              fFacSigmaPadRow(0),
+              fFacSigmaPad(0),
+              fFacSigmaTime(0)
 {   
   //
   //constructor set the default parameters
-  fInnerPRF=0;
-  fOuter1PRF=0;
-  fOuter2PRF=0;
-  fTimeRF = 0;
+  //
+
   fFacSigmaPadRow = Float_t(kFacSigmaPadRow);
   fFacSigmaPad = Float_t(kFacSigmaPad);
   fFacSigmaTime = Float_t(kFacSigmaTime);
@@ -111,11 +117,11 @@ Int_t  AliTPCParamSR::CalcResponse(Float_t* xyz, Int_t * index, Int_t row)
 
   Int_t fpadrow = TMath::Max(TMath::Nint(index[2]+xyz[0]-sfpadrow),0);  //"first" padrow
   Int_t fpad    = TMath::Nint(xyz[1]-sfpad);     //first pad
-  Int_t ftime   = TMath::Max(TMath::Nint(xyz[2]+xyz[3]+GetZOffset()/GetZWidth()-sftime-GetNTBinsL1()),0);  // first time
+  Int_t ftime   = TMath::Max(TMath::Nint(xyz[2]+xyz[3]+GetZOffset()/GetZWidth()-sftime),0);  // first time
   Int_t lpadrow = TMath::Min(TMath::Nint(index[2]+xyz[0]+sfpadrow),fpadrow+19);  //"last" padrow
   lpadrow       = TMath::Min(GetNRow(index[1])-1,lpadrow);
   Int_t lpad    = TMath::Min(TMath::Nint(xyz[1]+sfpad),fpad+19);     //last pad
-  Int_t ltime   = TMath::Min(TMath::Nint(xyz[2]+xyz[3]+GetZOffset()/GetZWidth()+sftime-GetNTBinsL1()),ftime+19);    // last time
+  Int_t ltime   = TMath::Min(TMath::Nint(xyz[2]+xyz[3]+GetZOffset()/GetZWidth()+sftime),ftime+19);    // last time
   ltime         = TMath::Min(ltime,GetMaxTBin()-1); 
   // 
   Int_t npads = GetNPads(index[1],row);
@@ -157,7 +163,7 @@ Int_t  AliTPCParamSR::CalcResponse(Float_t* xyz, Int_t * index, Int_t row)
   //calculate time response function
   Int_t time;
   for (time = ftime;time<=ltime;time++) 
-    timeres[time-ftime]= fTimeRF->GetRF((-xyz[2]-xyz[3]+Float_t(time))*fZWidth+GetNTBinsL1());     
+    timeres[time-ftime]= fTimeRF->GetRF((-xyz[2]-xyz[3]+Float_t(time))*fZWidth);     
   //write over threshold values to stack
   for (padrow = fpadrow;padrow<=lpadrow;padrow++)
     for (pad = fpad;pad<=lpad;pad++)
@@ -209,7 +215,7 @@ void AliTPCParamSR::CRXYZtoXYZ(Float_t *xyz,
 {  
   //transform relative coordinates to absolute
   Bool_t rel = ( (option&2)!=0);
-  Int_t index[2]={sector,padrow};
+  Int_t index[3]={sector,padrow,0};
   if (rel==kTRUE)      Transform4to3(xyz,index);//if the position is relative to pad row  
   Transform2to1(xyz,index);
 }
@@ -223,7 +229,7 @@ void AliTPCParamSR::XYZtoCRXYZ(Float_t *xyz,
   //if option=2  X           relative to pad row calculate sector
   //if option=3  X           relative            use input sector
   //!!!!!!!!! WE start to calculate rows from row = 0
-  Int_t index[2];
+  Int_t index[3];
   Bool_t rel = ( (option&2)!=0);  
 
   //option 0 and 2  means that we don't have information about sector
@@ -419,7 +425,7 @@ void AliTPCParamSR::Streamer(TBuffer &R__b)
       AliTPCParam::Streamer(R__b);    
    }
 }
-Int_t  AliTPCParamSR::CalcResponseFast(Float_t* xyz, Int_t * index, Int_t row)
+Int_t  AliTPCParamSR::CalcResponseFast(Float_t* xyz, Int_t * index, Int_t row, Float_t phase)
 {
   //
   //calculate bin response as function of the input position -x 
@@ -492,11 +498,11 @@ Int_t  AliTPCParamSR::CalcResponseFast(Float_t* xyz, Int_t * index, Int_t row)
   Int_t npads = GetNPads(index[1],index[3]-1);
   Int_t cpadrow = index[2]; // electrons are here
   Int_t cpad    = TMath::Nint(xyz[1]);
-  Int_t ctime   = TMath::Nint(xyz[2]+zoffset2+xyz[3]-GetNTBinsL1());
+  Int_t ctime   = TMath::Nint(xyz[2]+zoffset2+xyz[3]);
   //calulate deviation
   Float_t dpadrow = xyz[0];
   Float_t dpad    = xyz[1]-cpad;
-  Float_t dtime   = xyz[2]+zoffset2+xyz[3]-ctime-GetNTBinsL1();
+  Float_t dtime   = xyz[2]+zoffset2+xyz[3]-ctime+phase*0.25;
   Int_t cindex =0;
   Int_t cindex3 =0;
   Int_t maxt =GetMaxTBin();
@@ -538,7 +544,9 @@ Int_t  AliTPCParamSR::CalcResponseFast(Float_t* xyz, Int_t * index, Int_t row)
     if ( (apadrow<0) || (apadrow>=2*kpadrn)) 
       continue;
     // pad angular correction
-    Float_t angle = kTanMax*2.*(cpad+0.5)/Float_t(npads);
+    Float_t angle = 0.;
+    if (npads != 0)
+      angle = kTanMax*2.*(cpad+0.5)/Float_t(npads);
     Float_t dpadangle =0;
     if (index[1]<fNInnerSector){
       dpadangle = angle*dpadrow*fInnerPadPitchLength/fInnerPadPitchWidth;