+Int_t AliTPCParamSR::CalcResponseFast(Float_t* xyz, Int_t * index, Int_t row)
+{
+ //
+ //calculate bin response as function of the input position -x
+ //return number of valid response bin
+ //
+ //we suppose that coordinate is expressed in float digits
+ // it's mean coordinate system 8
+ //xyz[0] - electron position w.r.t. pad center, normalized to pad length,
+ //xyz[1] is float pad (center pad is number 0) and xyz[2] is float time bin
+ //xyz[3] - electron time in float time bin format
+ if ( (fInnerPRF==0)||(fOuter1PRF==0)||(fOuter2PRF==0) ||(fTimeRF==0) ){
+ Error("AliTPCParamSR", "response function was not adjusted");
+ return -1;
+ }
+
+ const Int_t kpadn = 500;
+ const Float_t kfpadn = 500.;
+ const Int_t ktimen = 500;
+ const Float_t kftimen = 500.;
+ const Int_t kpadrn = 500;
+ const Float_t kfpadrn = 500.;
+
+
+
+ static Float_t prfinner[2*kpadrn][5*kpadn]; //pad divided by 50
+ static Float_t prfouter1[2*kpadrn][5*kpadn]; //prfouter division
+ static Float_t prfouter2[2*kpadrn][5*kpadn];
+ static Float_t kTanMax =0;
+
+ static Float_t rftime[5*ktimen]; //time division
+ static Int_t blabla=0;
+ static Float_t zoffset=0;
+ static Float_t zwidth=0;
+ static Float_t zoffset2=0;
+ static TH1F * hdiff=0;
+ static TH1F * hdiff1=0;
+ static TH1F * hdiff2=0;
+
+ if (blabla==0) { //calculate Response function - only at the begginning
+ kTanMax = TMath::ATan(10.*TMath::DegToRad());
+ hdiff =new TH1F("prf_diff","prf_diff",10000,-1,1);
+ hdiff1 =new TH1F("no_repsonse1","no_response1",10000,-1,1);
+ hdiff2 =new TH1F("no_response2","no_response2",10000,-1,1);
+
+ blabla=1;
+ zoffset = GetZOffset();
+ zwidth = fZWidth;
+ zoffset2 = zoffset/zwidth;
+ for (Int_t i=0;i<5*ktimen;i++){
+ rftime[i] = fTimeRF->GetRF(((i-2.5*kftimen)/kftimen)*zwidth+zoffset);
+ }
+ for (Int_t i=0;i<5*kpadn;i++){
+ for (Int_t j=0;j<2*kpadrn;j++){
+ prfinner[j][i] =
+ fInnerPRF->GetPRF((i-2.5*kfpadn)/kfpadn
+ *fInnerPadPitchWidth,(j-kfpadrn)/kfpadrn*fInnerPadPitchLength);
+ prfouter1[j][i] =
+ fOuter1PRF->GetPRF((i-2.5*kfpadn)/kfpadn
+ *fOuterPadPitchWidth,(j-kfpadrn)/kfpadrn*fOuter1PadPitchLength);
+
+ //
+ prfouter2[j][i] =
+ fOuter2PRF->GetPRF((i-2.5*kfpadn)/kfpadn
+ *fOuterPadPitchWidth,(j-kfpadrn)/kfpadrn*fOuter2PadPitchLength);
+ }
+ }
+ } // the above is calculated only once
+
+ // calculate central padrow, pad, time
+ 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());
+ //calulate deviation
+ Float_t dpadrow = xyz[0];
+ Float_t dpad = xyz[1]-cpad;
+ Float_t dtime = xyz[2]+zoffset2+xyz[3]-ctime-GetNTBinsL1();
+ Int_t cindex =0;
+ Int_t cindex3 =0;
+ Int_t maxt =GetMaxTBin();
+
+ Int_t fpadrow;
+ Int_t lpadrow;