HLT mode retrieved from the OCDB and used to set SDD raw data format in simulation...
[u/mrichter/AliRoot.git] / ITS / AliITSClusterFinderV2SDD.cxx
index 1f57718..2974037 100644 (file)
 #include "AliITSDetTypeRec.h"
 #include "AliRawReader.h"
 #include "AliITSRawStreamSDD.h"
+#include "AliITSRawStreamSDDCompressed.h"
 #include "AliITSCalibrationSDD.h"
+#include "AliITSresponseSDD.h"
 #include "AliITSDetTypeRec.h"
+#include "AliITSReconstructor.h"
 #include "AliITSsegmentationSDD.h"
 #include "AliITSdigitSDD.h"
 #include "AliITSgeomTGeo.h"
+
 ClassImp(AliITSClusterFinderV2SDD)
 
 AliITSClusterFinderV2SDD::AliITSClusterFinderV2SDD(AliITSDetTypeRec* dettyp):AliITSClusterFinderV2(dettyp)
@@ -61,41 +65,48 @@ void AliITSClusterFinderV2SDD::FindClustersSDD(TClonesArray *digits) {
   Int_t nzBins = nAnodes+2;
   Int_t nTimeBins = GetSeg()->Npx();
   Int_t nxBins = nTimeBins+2;
-  const Int_t kMaxBin=nzBins*(nxBins+2);
+  const Int_t kMaxBin=nzBins*nxBins;
 
   AliBin *bins[2];
   bins[0]=new AliBin[kMaxBin];
   bins[1]=new AliBin[kMaxBin];
   AliITSCalibrationSDD* cal = (AliITSCalibrationSDD*)GetResp(fModule);
-  AliITSresponseSDD* res  = (AliITSresponseSDD*)cal->GetResponse();
-  const char *option=res->ZeroSuppOption();
+  if(cal==0){
+    AliError(Form("Calibration object not present for SDD module %d\n",fModule));
+    return;
+  }
+
   AliITSdigitSDD *d=0;
   Int_t i, ndigits=digits->GetEntriesFast();
   for (i=0; i<ndigits; i++) {
      d=(AliITSdigitSDD*)digits->UncheckedAt(i);
-     Int_t y=d->GetCoord2()+1;   //y
-     Int_t z=d->GetCoord1()+1;   //z
-     Float_t gain=cal->GetChannelGain(d->GetCoord1());
-     Float_t charge=d->GetSignal();
-
-     if(!((strstr(option,"1D")) || (strstr(option,"2D")))){
-       Float_t baseline = cal->GetBaseline(d->GetCoord1());
-       if(charge>baseline) charge-=baseline;
-       else charge=0;
-     }
-
-     if(gain>0) charge/=gain;
-     if(charge<cal->GetThresholdAnode(d->GetCoord1())) continue;
-     Int_t q=(Int_t)(charge+0.5);
-     if (z <= nAnodes){
-       bins[0][y*nzBins+z].SetQ(q);
-       bins[0][y*nzBins+z].SetMask(1);
-       bins[0][y*nzBins+z].SetIndex(i);
-     } else {
-       z-=nAnodes;
-       bins[1][y*nzBins+z].SetQ(q);
-       bins[1][y*nzBins+z].SetMask(1);
-       bins[1][y*nzBins+z].SetIndex(i);
+     Int_t ian=d->GetCoord1();
+     Int_t itb=d->GetCoord2();
+     Int_t iSide=0;
+     if (ian >= nAnodes) iSide=1;    
+     Float_t gain=cal->GetChannelGain(ian);
+     Float_t charge=d->GetSignal(); // returns expanded signal 
+                                    // (10 bit, low threshold already added)
+     Float_t baseline = cal->GetBaseline(ian);
+     if(charge>baseline) charge-=baseline;
+     else charge=0;
+
+     if(gain>0.){ // Bad channels have gain=0.
+       charge/=gain;
+       if(charge<cal->GetThresholdAnode(ian)) continue;
+       Int_t q=(Int_t)(charge+0.5);
+       Int_t y=itb+1;   
+       Int_t z=ian+1;   
+       if (z <= nAnodes){
+        bins[0][y*nzBins+z].SetQ(q);
+        bins[0][y*nzBins+z].SetMask(1);
+        bins[0][y*nzBins+z].SetIndex(i);
+       } else {
+        z-=nAnodes;
+        bins[1][y*nzBins+z].SetQ(q);
+        bins[1][y*nzBins+z].SetMask(1);
+        bins[1][y*nzBins+z].SetIndex(i);
+       }
      }
   }
   
@@ -113,12 +124,25 @@ FindClustersSDD(AliBin* bins[2], Int_t nMaxBin, Int_t nzBins,
   // Actual SDD cluster finder
   //------------------------------------------------------------
 
+  static AliITSRecoParam *repa = NULL;
+  if(!repa){
+    repa = (AliITSRecoParam*) AliITSReconstructor::GetRecoParam();
+    if(!repa){
+      repa = AliITSRecoParam::GetHighFluxParam();
+      AliWarning("Using default AliITSRecoParam class");
+    }
+  }
   const TGeoHMatrix *mT2L=AliITSgeomTGeo::GetTracking2LocalMatrix(fModule);
   AliITSCalibrationSDD* cal = (AliITSCalibrationSDD*)GetResp(fModule);
+  if(cal==0){
+    AliError(Form("Calibration object not present for SDD module %d\n",fModule));
+    return;
+  }
   Int_t ncl=0; 
   TClonesArray &cl=*clusters;
   for (Int_t s=0; s<2; s++)
     for (Int_t i=0; i<nMaxBin; i++) {
+      NoiseSuppress(i,s,nzBins,bins[s],cal);
       if (bins[s][i].IsUsed()) continue;
       Int_t idx[32]; UInt_t msk[32]; Int_t npeaks=0;
       FindPeaks(i, nzBins, bins[s], idx, msk, npeaks);
@@ -130,131 +154,156 @@ FindClustersSDD(AliBin* bins[2], Int_t nMaxBin, Int_t nzBins,
       for (k=0; k<npeaks-1; k++){//mark adjacent peaks
         if (idx[k] < 0) continue; //this peak is already removed
         for (l=k+1; l<npeaks; l++) {
-           if (idx[l] < 0) continue; //this peak is already removed
-           Int_t ki=idx[k]/nzBins, kj=idx[k] - ki*nzBins;
-           Int_t li=idx[l]/nzBins, lj=idx[l] - li*nzBins;
-           Int_t di=TMath::Abs(ki - li);
-           Int_t dj=TMath::Abs(kj - lj);
-           if (di>1 || dj>1) continue;
-           if (bins[s][idx[k]].GetQ() > bins[s][idx[l]].GetQ()) {
-              msk[l]=msk[k];
-              idx[l]*=-1;
-           } else {
-              msk[k]=msk[l];
-              idx[k]*=-1;
-              break;
-           } 
+         if (idx[l] < 0) continue; //this peak is already removed
+         Int_t ki=idx[k]/nzBins, kj=idx[k] - ki*nzBins;
+         Int_t li=idx[l]/nzBins, lj=idx[l] - li*nzBins;
+         Int_t di=TMath::Abs(ki - li);
+         Int_t dj=TMath::Abs(kj - lj);
+         if (di>1 || dj>1) continue;
+         if (bins[s][idx[k]].GetQ() > bins[s][idx[l]].GetQ()) {
+           msk[l]=msk[k];
+           idx[l]*=-1;
+         } else {
+           msk[k]=msk[l];
+           idx[k]*=-1;
+           break;
+         } 
         }
       }
 
       for (k=0; k<npeaks; k++) {
+       if(repa->GetUseUnfoldingInClusterFinderSDD()==kFALSE) msk[k]=msk[0];
         MarkPeak(TMath::Abs(idx[k]), nzBins, bins[s], msk[k]);
       }
         
       for (k=0; k<npeaks; k++) {
-         if (idx[k] < 0) continue; //removed peak
-         AliITSRecPoint c;
-         MakeCluster(idx[k], nzBins, bins[s], msk[k], c);
-        //mi change
-        Int_t milab[10];
-        for (Int_t ilab=0;ilab<10;ilab++){
-          milab[ilab]=-2;
-        }
-        Int_t maxi=0,mini=0,maxj=0,minj=0;
-        //AliBin *bmax=&bins[s][idx[k]];
-        //Float_t max = TMath::Max(TMath::Abs(bmax->GetQ())/5.,3.);
-    
-        for (Int_t di=-2; di<=2;di++){
-          for (Int_t dj=-3;dj<=3;dj++){
-            Int_t index = idx[k]+di+dj*nzBins;
-            if (index<0) continue;
-            if (index>=nMaxBin) continue;
-            AliBin *b=&bins[s][index];
-            Int_t nAnode=index%nzBins-1;
-            Int_t adcSignal=b->GetQ();
-            if(adcSignal>cal->GetThresholdAnode(nAnode)){
-              if (di>maxi) maxi=di;
-              if (di<mini) mini=di;
-              if (dj>maxj) maxj=dj;
-              if (dj<minj) minj=dj;
-            }
-            //
-            if(digits) {
-              if (TMath::Abs(di)<2&&TMath::Abs(dj)<2){
-                AliITSdigitSDD* d=(AliITSdigitSDD*)digits->UncheckedAt(b->GetIndex());
-                for (Int_t itrack=0;itrack<10;itrack++){
-                  Int_t track = (d->GetTracks())[itrack];
-                  if (track>=0) {
-                    AddLabel(milab, track); 
-                  }
-                }
-              }
-            }
-          }
-        }
-
-
-         Float_t y=c.GetY(),z=c.GetZ(), q=c.GetQ();
-         y/=q; z/=q;
-
-
-        const Double_t kMicronTocm = 1.0e-4; 
-        Float_t timeBinCenter = y-0.5;
-        Float_t zAnode=z-0.5;
-        Float_t zdet = (zAnode*GetSeg()->Dpz(0)-GetSeg()->Dz()/2.)*kMicronTocm;
-        Float_t driftTime =  timeBinCenter*GetSeg()->Dpx(0) - cal->GetTimeOffset();
-        Float_t xdet = cal->GetDriftPath(driftTime,zAnode);
-        xdet=(xdet-GetSeg()->Dx())*kMicronTocm;
-        if (s) xdet=-xdet;
-        
-        
-        CorrectPosition(zdet,xdet);
-
-        Double_t loc[3]={xdet,0.,zdet},trk[3]={0.,0.,0.};
-        mT2L->MasterToLocal(loc,trk);
-        y=trk[1];
-        z=trk[2]; 
-
-         q/=cal->GetADC2keV();  //to have MPV 1 MIP = 86.4 KeV
-         Float_t hit[5] = {y, z, 0.0030*0.0030, 0.0020*0.0020, q};
-         Int_t  info[3] = {maxj-minj+1, maxi-mini+1, fNlayer[fModule]};
-        if (digits) {    
-          //      AliBin *b=&bins[s][idx[k]];
-          //      AliITSdigitSDD* d=(AliITSdigitSDD*)digits->UncheckedAt(b->GetIndex());
-          {
-            //Int_t lab[3];
-            //lab[0]=(d->GetTracks())[0];
-            //lab[1]=(d->GetTracks())[1];
-            //lab[2]=(d->GetTracks())[2];
-            //CheckLabels(lab);
-            CheckLabels2(milab); 
-          }
-        }
-         milab[3]=fNdet[fModule];
-
-         AliITSRecPoint cc(milab,hit,info);
-        cc.SetType(npeaks);
-
-        if(clusters) new (cl[ncl]) AliITSRecPoint(cc); 
-        else {
-          fDetTypeRec->AddRecPoint(cc);
-        }
-        ncl++;
+       if (idx[k] < 0) continue; //removed peak
+       AliITSRecPoint c;
+       MakeCluster(idx[k], nzBins, bins[s], msk[k], c);
+       //mi change
+       Int_t milab[10];
+       for (Int_t ilab=0;ilab<10;ilab++){
+         milab[ilab]=-2;
+       }
+       Int_t maxi=0,mini=0,maxj=0,minj=0;
+       //AliBin *bmax=&bins[s][idx[k]];
+       //Float_t max = TMath::Max(TMath::Abs(bmax->GetQ())/5.,3.);
+       
+       for (Int_t di=-2; di<=2;di++){
+         for (Int_t dj=-3;dj<=3;dj++){
+           Int_t index = idx[k]+di+dj*nzBins;
+           if (index<0) continue;
+           if (index>=nMaxBin) continue;
+           AliBin *b=&bins[s][index];
+           Int_t nAnode=index%nzBins-1;
+           Int_t adcSignal=b->GetQ();
+           if(adcSignal>cal->GetThresholdAnode(nAnode)){
+             if (di>maxi) maxi=di;
+             if (di<mini) mini=di;
+             if (dj>maxj) maxj=dj;
+             if (dj<minj) minj=dj;
+           }
+           //
+           if(digits) {
+             if (TMath::Abs(di)<2&&TMath::Abs(dj)<2){
+               AliITSdigitSDD* d=(AliITSdigitSDD*)digits->UncheckedAt(b->GetIndex());
+               for (Int_t itrack=0;itrack<10;itrack++){
+                 Int_t track = (d->GetTracks())[itrack];
+                 if (track>=0) {
+                   AddLabel(milab, track); 
+                 }
+               }
+             }
+           }
+         }
+       }
+
+
+       AliITSresponseSDD* rsdd = fDetTypeRec->GetResponseSDD();
+       Float_t y=c.GetY(),z=c.GetZ(), q=c.GetQ();
+       y/=q; z/=q;
+       Float_t zAnode=z-0.5;  // to have anode in range 0.-255. and centered on the mid of the pitch
+       Float_t timebin=y-0.5;  // to have time bin in range 0.-255. amd centered on the mid of the bin
+       if(s==1) zAnode += GetSeg()->NpzHalf();  // right side has anodes from 256. to 511.
+       Float_t zdet = GetSeg()->GetLocalZFromAnode(zAnode);
+       Float_t driftTime = GetSeg()->GetDriftTimeFromTb(timebin) - rsdd->GetTimeOffset();
+       Float_t driftPathMicron = cal->GetDriftPath(driftTime,zAnode);
+       const Double_t kMicronTocm = 1.0e-4; 
+       Float_t xdet=(driftPathMicron-GetSeg()->Dx())*kMicronTocm; // xdet is negative
+       if (s==0) xdet=-xdet; // left side has positive local x
+       
+       Float_t corrx=0, corrz=0;
+       cal->GetCorrections(zdet,xdet,corrz,corrx,GetSeg());
+       zdet+=corrz;
+       xdet+=corrx;
+
+       Double_t loc[3]={xdet,0.,zdet},trk[3]={0.,0.,0.};
+       mT2L->MasterToLocal(loc,trk);
+       y=trk[1];
+       z=trk[2]; 
+
+       q/=rsdd->GetADC2keV();  //to have MPV 1 MIP = 86.4 KeV
+       Float_t hit[5] = {y, z, 0.0030*0.0030, 0.0020*0.0020, q};
+       Int_t  info[3] = {maxj-minj+1, maxi-mini+1, fNlayer[fModule]};
+       if (digits) {     
+         //       AliBin *b=&bins[s][idx[k]];
+         //       AliITSdigitSDD* d=(AliITSdigitSDD*)digits->UncheckedAt(b->GetIndex());
+         {
+           //Int_t lab[3];
+           //lab[0]=(d->GetTracks())[0];
+           //lab[1]=(d->GetTracks())[1];
+           //lab[2]=(d->GetTracks())[2];
+           //CheckLabels(lab);
+           CheckLabels2(milab); 
+         }
+       }
+       milab[3]=fNdet[fModule];
+
+       AliITSRecPoint cc(milab,hit,info);
+       cc.SetType(npeaks);
+       if(clusters) new (cl[ncl]) AliITSRecPoint(cc); 
+       else {
+         fDetTypeRec->AddRecPoint(cc);
+       }
+       ncl++;
       }
     }
   
 }
-
-
-
+//______________________________________________________________________
 void AliITSClusterFinderV2SDD::RawdataToClusters(AliRawReader* rawReader,TClonesArray** clusters){
     //------------------------------------------------------------
   // This function creates ITS clusters from raw data
   //------------------------------------------------------------
   rawReader->Reset();
-  AliITSRawStreamSDD inputSDD(rawReader);
-  FindClustersSDD(&inputSDD,clusters);
+  AliITSRawStream* inputSDD;
+  if(fDetTypeRec->IsHLTmodeC()==kTRUE){
+    inputSDD=new AliITSRawStreamSDDCompressed(rawReader);
+  }else{
+    inputSDD=new AliITSRawStreamSDD(rawReader);
+  }
 
+  AliITSDDLModuleMapSDD *ddlmap=(AliITSDDLModuleMapSDD*)fDetTypeRec->GetDDLModuleMapSDD();
+  inputSDD->SetDDLModuleMap(ddlmap);
+  for(Int_t iddl=0; iddl<AliITSDDLModuleMapSDD::GetNDDLs(); iddl++){
+    for(Int_t icar=0; icar<AliITSDDLModuleMapSDD::GetNModPerDDL();icar++){
+      Int_t iMod=ddlmap->GetModuleNumber(iddl,icar);
+      if(iMod==-1) continue;
+      AliITSCalibrationSDD* cal = (AliITSCalibrationSDD*)GetResp(iMod);
+      if(cal==0){
+       AliError(Form("Calibration object not present for SDD module %d\n",iMod));
+       continue;
+      }
+      Bool_t isZeroSupp=cal->GetZeroSupp();
+      if(isZeroSupp){ 
+       for(Int_t iSid=0; iSid<2; iSid++) inputSDD->SetZeroSuppLowThreshold(iMod-240,iSid,cal->GetZSLowThreshold(iSid));
+      }else{
+       for(Int_t iSid=0; iSid<2; iSid++) inputSDD->SetZeroSuppLowThreshold(iMod-240,iSid,0);
+      }
+    }
+  }
+  FindClustersSDD(inputSDD,clusters);
+  delete inputSDD;
 }
 
 void AliITSClusterFinderV2SDD::FindClustersSDD(AliITSRawStream* input, 
@@ -268,7 +317,7 @@ void AliITSClusterFinderV2SDD::FindClustersSDD(AliITSRawStream* input,
   Int_t nzBins = nAnodes+2;
   Int_t nTimeBins = GetSeg()->Npx();
   Int_t nxBins = nTimeBins+2;
-  const Int_t kMaxBin=nzBins*(nxBins+2);
+  const Int_t kMaxBin=nzBins*nxBins;
   AliBin *bins[2];
   AliBin *ddlbins[kHybridsPerDDL]; // 12 modules (=24 hybrids) of 1 DDL read "in parallel"
   for(Int_t iHyb=0;iHyb<kHybridsPerDDL;iHyb++) ddlbins[iHyb]=new AliBin[kMaxBin];
@@ -307,29 +356,30 @@ void AliITSClusterFinderV2SDD::FindClustersSDD(AliITSRawStream* input,
        continue;
       }
       AliITSCalibrationSDD* cal = (AliITSCalibrationSDD*)GetResp(iModule);    
-      AliITSresponseSDD* res  = (AliITSresponseSDD*)cal->GetResponse();
-      const char *option=res->ZeroSuppOption();
+      if(cal==0){
+       AliError(Form("Calibration object not present for SDD module %d\n",iModule));
+       continue;
+      }
       Float_t charge=input->GetSignal();
       Int_t chan=input->GetCoord1()+nAnodes*iSide;
       Float_t gain=cal->GetChannelGain(chan);
-      if(!((strstr(option,"1D")) || (strstr(option,"2D")))){
-       Float_t baseline = cal->GetBaseline(chan);
-       if(charge>baseline) charge-=baseline;
-       else charge=0;
-      }
-      if(gain>0) charge/=gain;
-      if(charge>=cal->GetThresholdAnode(chan)) {
-       Int_t q=(Int_t)(charge+0.5);
-       Int_t iz = input->GetCoord1();
-       Int_t itb = input->GetCoord2();
-       Int_t index = (itb+1) * nzBins + (iz+1);
-       if(index<kMaxBin){
-         ddlbins[iHybrid][index].SetQ(q);
-         ddlbins[iHybrid][index].SetMask(1);
-         ddlbins[iHybrid][index].SetIndex(index);
-
-       }else{
-         AliWarning(Form("Invalid SDD cell: Anode=%d   TimeBin=%d",iz,itb));     
+      Float_t baseline = cal->GetBaseline(chan);
+      if(charge>baseline) charge-=baseline;
+      else charge=0;
+      if(gain>0.){ // Bad channels have gain=0
+       charge/=gain;
+       if(charge>=cal->GetThresholdAnode(chan)) {
+         Int_t q=(Int_t)(charge+0.5);
+         Int_t iz = input->GetCoord1();
+         Int_t itb = input->GetCoord2();
+         Int_t index = (itb+1) * nzBins + (iz+1);
+         if(index<kMaxBin){
+           ddlbins[iHybrid][index].SetQ(q);
+           ddlbins[iHybrid][index].SetMask(1);
+           ddlbins[iHybrid][index].SetIndex(index);
+         }else{
+           AliWarning(Form("Invalid SDD cell: Anode=%d   TimeBin=%d",iz,itb));   
+         }
        }
       }
     }
@@ -338,31 +388,54 @@ void AliITSClusterFinderV2SDD::FindClustersSDD(AliITSRawStream* input,
   Info("FindClustersSDD", "found clusters in ITS SDD: %d", nClustersSDD);
 }
 
+//______________________________________________________________________
+void AliITSClusterFinderV2SDD::NoiseSuppress(Int_t k, Int_t sid,Int_t nzBins, AliBin* bins, AliITSCalibrationSDD* cal) const {
+  // applies zero suppression using the measured noise of each anode
+  // threshold values from ALICE-INT-1999-28 V10
+  Float_t xfactL=2.2; 
+  Float_t xfactH=4.0;
+  //
+
+  Int_t iAn=(k%nzBins)-1;
+  if(iAn<0 || iAn>255) return;
+  if(sid==1) iAn+=256;
+  Int_t nLow=0, nHigh=0;
+  Float_t noise=cal->GetNoiseAfterElectronics(iAn);
+  Float_t noisem1=noise;
+  if(iAn>1) noisem1=cal->GetNoiseAfterElectronics(iAn-1);
+  Float_t noisep1=noise;
+  if(iAn<511) noisep1=cal->GetNoiseAfterElectronics(iAn+1);
+  Float_t tL=noise*xfactL;
+  Float_t tH=noise*xfactH;
+  Float_t tLp1=noisep1*xfactL;
+  Float_t tHp1=noisep1*xfactH;
+  Float_t tLm1=noisem1*xfactL;
+  Float_t tHm1=noisem1*xfactH;
+  Float_t cC=bins[k].GetQ();
+  if(cC<=tL){
+    bins[k].SetQ(0);
+    bins[k].SetMask(0xFFFFFFFE);
+    return;
+  }
+  nLow++; // cC is greater than tL
+  if(cC>tH) nHigh++;
+  Int_t sS=bins[k-1].GetQ();
+  if(sS>tLm1) nLow++;
+  if(sS>tHm1) nHigh++;
+  Int_t nN=bins[k+1].GetQ();
+  if(nN>tLp1) nLow++;
+  if(nN>tHp1) nHigh++;
+  Int_t eE=bins[k-nzBins].GetQ();
+  if(eE>tL) nLow++;
+  if(eE>tH) nHigh++;
+  Int_t wW=bins[k+nzBins].GetQ();
+  if(wW>tL) nLow++;
+  if(wW>tH) nHigh++;
+  if(nLow<3 || nHigh<1){
+    bins[k].SetQ(0);
+    bins[k].SetMask(0xFFFFFFFE);
+  }
+}
 
-//_________________________________________________________________________
-void AliITSClusterFinderV2SDD::CorrectPosition(Float_t &z, Float_t&y){
-
-  //correction of coordinates using the maps stored in the DB
-
-  AliITSCalibrationSDD* cal = (AliITSCalibrationSDD*)GetResp(fModule);
-  static const Int_t knbint = cal->GetMapTimeNBin();
-  static const Int_t knbina = cal->Chips()*cal->Channels();
-  const Double_t kMicronTocm = 1.0e-4; 
-  Float_t stepa = (GetSeg()->Dpz(0))*kMicronTocm; //anode pitch in cm
-  Float_t stept = (GetSeg()->Dx()/cal->GetMapTimeNBin()/2.)/10.;
-  
-  Int_t bint = TMath::Abs((Int_t)(y/stept));
-  if(y>=0) bint+=(Int_t)(knbint/2.);
-  if(bint>knbint) AliError("Wrong bin number!");
-
-  Int_t bina = TMath::Abs((Int_t)(z/stepa));
-  if(z>=0) bina+=(Int_t)(knbina/2.);
-  if(bina>knbina) AliError("Wrong bin number!");
-
-  Float_t devz = cal->GetMapACell(bina,bint)*kMicronTocm;
-  Float_t devx = cal->GetMapTCell(bina,bint)*kMicronTocm;
-  z+=devz;
-  y+=devx;
 
 
-}