]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - TPC/AliTPCParamSR.cxx
Some of the coding violations corrected
[u/mrichter/AliRoot.git] / TPC / AliTPCParamSR.cxx
index f3c35f87d329096bf35ad7c61c93405020aab577..2b6ef4072c25789f0c4a1781caa8aaaecfc472ab 100644 (file)
@@ -46,19 +46,48 @@ 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);
   SetDefault();
   Update();
 }
+AliTPCParamSR::AliTPCParamSR(const AliTPCParamSR &param)
+              :AliTPCParam(),
+              fInnerPRF(0),
+              fOuter1PRF(0),
+              fOuter2PRF(0),
+              fTimeRF(0),
+              fFacSigmaPadRow(0),
+              fFacSigmaPad(0),
+              fFacSigmaTime(0)
+{
+  //
+  //  copy constructor - dummy
+  //
+  fFacSigmaPadRow = param.fFacSigmaPadRow;
+}
+AliTPCParamSR & AliTPCParamSR::operator =(const AliTPCParamSR & param)
+{
+  //
+  // assignment operator - dummy
+  //
+  fZLength=param.fZLength;
+  return (*this);
+}
 
 AliTPCParamSR::~AliTPCParamSR()
 {
@@ -111,11 +140,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 +186,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 +238,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 +252,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 +448,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 +521,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();