+// return CookdEdxNorm(low,up,0,i1,i2,1,0,2);
+
+
+// Float_t amp[200];
+// Float_t angular[200];
+// Float_t weight[200];
+// Int_t index[200];
+// //Int_t nc = 0;
+// Float_t meanlog = 100.;
+
+// Float_t mean[4] = {0,0,0,0};
+// Float_t sigma[4] = {1000,1000,1000,1000};
+// Int_t nc[4] = {0,0,0,0};
+// Float_t norm[4] = {1000,1000,1000,1000};
+// //
+// //
+// fNShared =0;
+
+// Float_t gainGG = 1;
+// if (AliTPCcalibDB::Instance()->GetParameters()){
+// gainGG= AliTPCcalibDB::Instance()->GetParameters()->GetGasGain()/20000.; //relative gas gain
+// }
+
+
+// for (Int_t of =0; of<4; of++){
+// for (Int_t i=of+i1;i<i2;i+=4)
+// {
+// Int_t clindex = fIndex[i];
+// if (clindex<0||clindex&0x8000) continue;
+
+// //AliTPCTrackPoint * point = (AliTPCTrackPoint *) arr.At(i);
+// AliTPCTrackerPoint * point = GetTrackPoint(i);
+// //AliTPCTrackerPoint * pointm = GetTrackPoint(i-1);
+// //AliTPCTrackerPoint * pointp = 0;
+// //if (i<159) pointp = GetTrackPoint(i+1);
+
+// if (point==0) continue;
+// AliTPCclusterMI * cl = fClusterPointer[i];
+// if (cl==0) continue;
+// if (onlyused && (!cl->IsUsed(10))) continue;
+// if (cl->IsUsed(11)) {
+// fNShared++;
+// continue;
+// }
+// Int_t type = cl->GetType();
+// //if (point->fIsShared){
+// // fNShared++;
+// // continue;
+// //}
+// //if (pointm)
+// // if (pointm->fIsShared) continue;
+// //if (pointp)
+// // if (pointp->fIsShared) continue;
+
+// if (type<0) continue;
+// //if (type>10) continue;
+// //if (point->GetErrY()==0) continue;
+// //if (point->GetErrZ()==0) continue;
+
+// //Float_t ddy = (point->GetY()-cl->GetY())/point->GetErrY();
+// //Float_t ddz = (point->GetZ()-cl->GetZ())/point->GetErrZ();
+// //if ((ddy*ddy+ddz*ddz)>10) continue;
+
+
+// // if (point->GetCPoint().GetMax()<5) continue;
+// if (cl->GetMax()<5) continue;
+// Float_t angley = point->GetAngleY();
+// Float_t anglez = point->GetAngleZ();
+
+// Float_t rsigmay2 = point->GetSigmaY();
+// Float_t rsigmaz2 = point->GetSigmaZ();
+// /*
+// Float_t ns = 1.;
+// if (pointm){
+// rsigmay += pointm->GetTPoint().GetSigmaY();
+// rsigmaz += pointm->GetTPoint().GetSigmaZ();
+// ns+=1.;
+// }
+// if (pointp){
+// rsigmay += pointp->GetTPoint().GetSigmaY();
+// rsigmaz += pointp->GetTPoint().GetSigmaZ();
+// ns+=1.;
+// }
+// rsigmay/=ns;
+// rsigmaz/=ns;
+// */
+
+// Float_t rsigma = TMath::Sqrt(rsigmay2*rsigmaz2);
+
+// Float_t ampc = 0; // normalization to the number of electrons
+// if (i>64){
+// // ampc = 1.*point->GetCPoint().GetMax();
+// ampc = 1.*cl->GetMax();
+// //ampc = 1.*point->GetCPoint().GetQ();
+// // AliTPCClusterPoint & p = point->GetCPoint();
+// // Float_t dy = TMath::Abs(Int_t( TMath::Abs(p.GetY()/0.6)) - TMath::Abs(p.GetY()/0.6)+0.5);
+// // Float_t iz = (250.0-TMath::Abs(p.GetZ())+0.11)/0.566;
+// //Float_t dz =
+// // TMath::Abs( Int_t(iz) - iz + 0.5);
+// //ampc *= 1.15*(1-0.3*dy);
+// //ampc *= 1.15*(1-0.3*dz);
+// // Float_t zfactor = (AliTPCReconstructor::GetCtgRange()-0.0004*TMath::Abs(point->GetCPoint().GetZ()));
+// //ampc *=zfactor;
+// }
+// else{
+// //ampc = 1.0*point->GetCPoint().GetMax();
+// ampc = 1.0*cl->GetMax();
+// //ampc = 1.0*point->GetCPoint().GetQ();
+// //AliTPCClusterPoint & p = point->GetCPoint();
+// // Float_t dy = TMath::Abs(Int_t( TMath::Abs(p.GetY()/0.4)) - TMath::Abs(p.GetY()/0.4)+0.5);
+// //Float_t iz = (250.0-TMath::Abs(p.GetZ())+0.11)/0.566;
+// //Float_t dz =
+// // TMath::Abs( Int_t(iz) - iz + 0.5);
+
+// //ampc *= 1.15*(1-0.3*dy);
+// //ampc *= 1.15*(1-0.3*dz);
+// // Float_t zfactor = (1.02-0.000*TMath::Abs(point->GetCPoint().GetZ()));
+// //ampc *=zfactor;
+
+// }
+// ampc *= 2.0; // put mean value to channel 50
+// //ampc *= 0.58; // put mean value to channel 50
+// Float_t w = 1.;
+// // if (type>0) w = 1./(type/2.-0.5);
+// // Float_t z = TMath::Abs(cl->GetZ());
+// if (i<64) {
+// ampc /= 0.6;
+// //ampc /= (1+0.0008*z);
+// } else
+// if (i>128){
+// ampc /=1.5;
+// //ampc /= (1+0.0008*z);
+// }else{
+// //ampc /= (1+0.0008*z);
+// }