LCOV - code coverage report
Current view: top level - HLT/ITS/tracking - AliHLTITSLayer.cxx (source / functions) Hit Total Coverage
Test: coverage.info Lines: 0 395 0.0 %
Date: 2016-06-14 17:26:59 Functions: 0 18 0.0 %

          Line data    Source code
       1             : // **************************************************************************
       2             : // This file is property of and copyright by the ALICE HLT Project          *
       3             : // ALICE Experiment at CERN, All rights reserved.                           *
       4             : //                                                                          *
       5             : // Primary Authors: Sergey Gorbunov <sergey.gorbunov@kip.uni-heidelberg.de> *
       6             : //                  for The ALICE HLT Project.                              *
       7             : //                                                                          *
       8             : // Permission to use, copy, modify and distribute this software and its     *
       9             : // documentation strictly for non-commercial purposes is hereby granted     *
      10             : // without fee, provided that the above copyright notice appears in all     *
      11             : // copies and that both the copyright notice and this permission notice     *
      12             : // appear in the supporting documentation. The authors make no claims       *
      13             : // about the suitability of this software for any purpose. It is            *
      14             : // provided "as is" without express or implied warranty.                    *
      15             : //                                                                          *
      16             : //***************************************************************************
      17             : 
      18             : 
      19             : #include "AliHLTITSLayer.h"
      20             : #include <algorithm>
      21             : 
      22             : 
      23             : //------------------------------------------------------------------------
      24             : AliHLTITSLayer::AliHLTITSLayer():
      25           0 : fR(0),
      26           0 : fPhiOffset(0),
      27           0 : fNladders(0),
      28           0 : fZOffset(0),
      29           0 : fNdetectors(0),
      30           0 : fDetectors(0),
      31           0 : fN(0),
      32           0 : fDy5(0),
      33           0 : fDy10(0),
      34           0 : fDy20(0),
      35           0 : fClustersCs(0),
      36           0 : fClusterIndexCs(0),
      37           0 : fYcs(0),
      38           0 : fZcs(0),
      39           0 : fNcs(0),
      40           0 : fCurrentSlice(-1),
      41           0 : fZmax(0),
      42           0 : fYmin(0),
      43           0 : fYmax(0),
      44           0 : fI(0),
      45           0 : fImax(0),
      46           0 : fSkip(0),
      47           0 : fAccepted(0),
      48           0 : fRoad(0)
      49           0 : {
      50             :   //--------------------------------------------------------------------
      51             :   //default AliHLTITSLayer constructor
      52             :   //--------------------------------------------------------------------
      53           0 :   for (Int_t i=0;i<6;i++)  fN5[i] =0;  
      54           0 :   for (Int_t i=0;i<11;i++) fN10[i]=0;  
      55           0 :   for (Int_t i=0;i<21;i++) fN20[i]=0;
      56           0 :   for (Int_t i=0;i<AliITSRecoParam::kMaxClusterPerLayer;i++){
      57           0 :     fClusters[i] = 0;
      58           0 :     fClusterIndex[i] = 0;
      59           0 :     fZ[i]        = 0;
      60           0 :     fY[i] = 0;
      61             :   }
      62           0 :   fYB[0] = 0;
      63           0 :   fYB[1] = 0;
      64           0 : }
      65             : 
      66             : //------------------------------------------------------------------------
      67             : AliHLTITSLayer::
      68             : AliHLTITSLayer(Double_t r,Double_t p,Double_t z,Int_t nl,Int_t nd):
      69           0 : fR(r),
      70           0 : fPhiOffset(p),
      71           0 : fNladders(nl),
      72           0 : fZOffset(z),
      73           0 : fNdetectors(nd),
      74           0 : fDetectors(0),
      75           0 : fN(0),
      76           0 : fDy5(0),
      77           0 : fDy10(0),
      78           0 : fDy20(0),
      79           0 : fClustersCs(0),
      80           0 : fClusterIndexCs(0),
      81           0 : fYcs(0),
      82           0 : fZcs(0),
      83           0 : fNcs(0),
      84           0 : fCurrentSlice(-1),
      85           0 : fZmax(0),
      86           0 : fYmin(0),
      87           0 : fYmax(0),
      88           0 : fI(0),
      89           0 : fImax(0),
      90           0 : fSkip(0),
      91           0 : fAccepted(0),
      92           0 : fRoad(0) 
      93           0 : {
      94             :   //--------------------------------------------------------------------
      95             :   //main AliHLTITSLayer constructor
      96             :   //--------------------------------------------------------------------
      97           0 :   fDetectors=new AliHLTITSDetector[fNladders*fNdetectors];
      98           0 :   fRoad=2*fR*TMath::Sqrt(TMath::Pi()/1.);//assuming that there's only one cluster
      99             : 
     100           0 :   for (Int_t i=0;i<6;i++)  fN5[i] =0;  
     101           0 :   for (Int_t i=0;i<11;i++) fN10[i]=0;  
     102           0 :   for (Int_t i=0;i<21;i++) fN20[i]=0;
     103           0 :   for (Int_t i=0;i<AliITSRecoParam::kMaxClusterPerLayer;i++){
     104           0 :     fClusters[i] = 0;
     105           0 :     fClusterIndex[i] = 0;
     106           0 :     fZ[i]        = 0;
     107           0 :     fY[i] = 0;
     108             :   }
     109           0 :   fYB[0] = 0;
     110           0 :   fYB[1] = 0;
     111           0 : }
     112             : 
     113             : //------------------------------------------------------------------------
     114             : AliHLTITSLayer::AliHLTITSLayer(const AliHLTITSLayer& layer):
     115           0 : fR(layer.fR),
     116           0 : fPhiOffset(layer.fPhiOffset),
     117           0 : fNladders(layer.fNladders),
     118           0 : fZOffset(layer.fZOffset),
     119           0 : fNdetectors(layer.fNdetectors),
     120           0 : fDetectors(layer.fDetectors),
     121           0 : fN(layer.fN),
     122           0 : fDy5(layer.fDy5),
     123           0 : fDy10(layer.fDy10),
     124           0 : fDy20(layer.fDy20),
     125           0 : fClustersCs(layer.fClustersCs),
     126           0 : fClusterIndexCs(layer.fClusterIndexCs),
     127           0 : fYcs(layer.fYcs),
     128           0 : fZcs(layer.fZcs),
     129           0 : fNcs(layer.fNcs),
     130           0 : fCurrentSlice(layer.fCurrentSlice),
     131           0 : fZmax(layer.fZmax),
     132           0 : fYmin(layer.fYmin),
     133           0 : fYmax(layer.fYmax),
     134           0 : fI(layer.fI),
     135           0 : fImax(layer.fImax),
     136           0 : fSkip(layer.fSkip),
     137           0 : fAccepted(layer.fAccepted),
     138           0 : fRoad(layer.fRoad)
     139           0 : {
     140             :   //Copy constructor
     141           0 :   for (Int_t i=0;i<6;i++)  fN5[i] =0;  
     142           0 :   for (Int_t i=0;i<11;i++) fN10[i]=0;  
     143           0 :   for (Int_t i=0;i<21;i++) fN20[i]=0;
     144           0 :   for (Int_t i=0;i<AliITSRecoParam::kMaxClusterPerLayer;i++){
     145           0 :     fClusters[i] = 0;
     146           0 :     fClusterIndex[i] = 0;
     147           0 :     fZ[i]        = 0;
     148           0 :     fY[i] = 0;
     149             :   }
     150           0 :   fYB[0] = 0;
     151           0 :   fYB[1] = 0;
     152           0 : }
     153             : 
     154             : //------------------------------------------------------------------------
     155           0 : AliHLTITSLayer::~AliHLTITSLayer() {
     156             :   //--------------------------------------------------------------------
     157             :   // AliHLTITSLayer destructor
     158             :   //--------------------------------------------------------------------
     159           0 :   delete [] fDetectors;
     160           0 : }
     161             : //------------------------------------------------------------------------
     162             : void AliHLTITSLayer::ResetClusters() {
     163             :   //--------------------------------------------------------------------
     164             :   // This function removes loaded clusters
     165             :   //--------------------------------------------------------------------
     166             :   
     167           0 :   fN=0;
     168           0 :   fI=0;
     169           0 : }
     170             : 
     171             : 
     172             : //------------------------------------------------------------------------
     173             : void AliHLTITSLayer::ResetRoad() {
     174             :   //--------------------------------------------------------------------
     175             :   // This function calculates the road defined by the cluster density
     176             :   //--------------------------------------------------------------------
     177             :   Int_t n=0;
     178           0 :   for (Int_t i=0; i<fN; i++) {
     179           0 :      if (TMath::Abs(fClusters[i]->GetZ())<fR) n++;
     180             :   }
     181           0 :   if (n>1) fRoad=2*fR*TMath::Sqrt(TMath::Pi()/n);
     182           0 : }
     183             : //------------------------------------------------------------------------
     184             : Int_t AliHLTITSLayer::InsertCluster(AliITSRecPoint *cl) {
     185             :   //--------------------------------------------------------------------
     186             :   //This function adds a cluster to this layer
     187             :   //--------------------------------------------------------------------
     188           0 :   if (fN==AliITSRecoParam::GetMaxClusterPerLayer()) {
     189           0 :     ::Error("InsertCluster","Too many clusters !\n");
     190           0 :     return 1;
     191             :   }
     192           0 :   fCurrentSlice=-1;
     193           0 :   fClusters[fN]=cl;
     194           0 :   fN++;
     195           0 :   AliHLTITSDetector &det=GetDetector(cl->GetDetectorIndex());    
     196           0 :   if (cl->GetY()<det.GetYmin()) det.SetYmin(cl->GetY());
     197           0 :   if (cl->GetY()>det.GetYmax()) det.SetYmax(cl->GetY());
     198           0 :   if (cl->GetZ()<det.GetZmin()) det.SetZmin(cl->GetZ());
     199           0 :   if (cl->GetZ()>det.GetZmax()) det.SetZmax(cl->GetZ());
     200             :                              
     201             :   return 0;
     202           0 : }
     203             : 
     204             : 
     205             : //------------------------------------------------------------------------
     206             : void  AliHLTITSLayer::SortClusters()
     207             : {
     208             :   //
     209             :   //sort clusters
     210             :   //
     211             :  
     212           0 :   AliITSRecPoint **clusters = new AliITSRecPoint*[fN];
     213           0 :   Float_t *z                = new Float_t[fN];
     214           0 :   Int_t   * index           = new Int_t[fN];
     215             :   //
     216           0 :   for (Int_t i=0;i<fN;i++){
     217           0 :     z[i] = fClusters[i]->GetZ();
     218             :   }
     219           0 :   TMath::Sort(fN,z,index,kFALSE);
     220             :   
     221           0 :   for (Int_t i=0;i<fN;i++){
     222           0 :     clusters[i] = fClusters[index[i]];
     223             :   }
     224             :   //
     225           0 :   for (Int_t i=0;i<fN;i++){
     226           0 :     fClusters[i] = clusters[i];
     227           0 :     fZ[i]        = fClusters[i]->GetZ();
     228           0 :     AliHLTITSDetector &det=GetDetector(fClusters[i]->GetDetectorIndex());    
     229           0 :     Double_t y=fR*det.GetPhi() + fClusters[i]->GetY();
     230           0 :     if (y>2.*fR*TMath::Pi()) y -= 2.*fR*TMath::Pi();
     231           0 :     fY[i] = y;
     232             :   }
     233           0 :   delete[] index;
     234           0 :   delete[] z;
     235           0 :   delete[] clusters;
     236             :   //
     237             : 
     238           0 :   fYB[0]=10000000;
     239           0 :   fYB[1]=-10000000;
     240           0 :   for (Int_t i=0;i<fN;i++){
     241           0 :     if (fY[i]<fYB[0]) fYB[0]=fY[i];
     242           0 :     if (fY[i]>fYB[1]) fYB[1]=fY[i];
     243           0 :     fClusterIndex[i] = i;
     244             :   }
     245             :   //
     246             :   // fill slices
     247           0 :   fDy5 = (fYB[1]-fYB[0])/5.;
     248           0 :   fDy10 = (fYB[1]-fYB[0])/10.;
     249           0 :   fDy20 = (fYB[1]-fYB[0])/20.;
     250           0 :   for (Int_t i=0;i<6;i++)  fN5[i] =0;  
     251           0 :   for (Int_t i=0;i<11;i++) fN10[i]=0;  
     252           0 :   for (Int_t i=0;i<21;i++) fN20[i]=0;
     253             :   //  
     254           0 :   for (Int_t i=0;i<6;i++) {fBy5[i][0] =  fYB[0]+(i-0.75)*fDy5; fBy5[i][1] =  fYB[0]+(i+0.75)*fDy5;}
     255           0 :   for (Int_t i=0;i<11;i++) {fBy10[i][0] =  fYB[0]+(i-0.75)*fDy10; fBy10[i][1] =  fYB[0]+(i+0.75)*fDy10;} 
     256           0 :   for (Int_t i=0;i<21;i++) {fBy20[i][0] =  fYB[0]+(i-0.75)*fDy20; fBy20[i][1] =  fYB[0]+(i+0.75)*fDy20;}
     257             :   //
     258             :   //
     259           0 :   for (Int_t i=0;i<fN;i++)
     260           0 :     for (Int_t irot=-1;irot<=1;irot++){
     261           0 :       Float_t curY = fY[i]+irot*TMath::TwoPi()*fR; 
     262             :       // slice 5
     263           0 :       for (Int_t slice=0; slice<6;slice++){
     264           0 :         if (fBy5[slice][0]<curY && curY<fBy5[slice][1]&&fN5[slice]<AliITSRecoParam::GetMaxClusterPerLayer5()){
     265           0 :           fClusters5[slice][fN5[slice]] = fClusters[i];
     266           0 :           fY5[slice][fN5[slice]] = curY;
     267           0 :           fZ5[slice][fN5[slice]] = fZ[i];
     268           0 :           fClusterIndex5[slice][fN5[slice]]=i;
     269           0 :           fN5[slice]++;
     270           0 :         }
     271             :       }
     272             :       // slice 10
     273           0 :       for (Int_t slice=0; slice<11;slice++){
     274           0 :         if (fBy10[slice][0]<curY && curY<fBy10[slice][1]&&fN10[slice]<AliITSRecoParam::GetMaxClusterPerLayer10()){
     275           0 :           fClusters10[slice][fN10[slice]] = fClusters[i];
     276           0 :           fY10[slice][fN10[slice]] = curY;
     277           0 :           fZ10[slice][fN10[slice]] = fZ[i];
     278           0 :           fClusterIndex10[slice][fN10[slice]]=i;
     279           0 :           fN10[slice]++;
     280           0 :         }
     281             :       }
     282             :       // slice 20
     283           0 :       for (Int_t slice=0; slice<21;slice++){
     284           0 :         if (fBy20[slice][0]<curY && curY<fBy20[slice][1]&&fN20[slice]<AliITSRecoParam::GetMaxClusterPerLayer20()){
     285           0 :           fClusters20[slice][fN20[slice]] = fClusters[i];
     286           0 :           fY20[slice][fN20[slice]] = curY;
     287           0 :           fZ20[slice][fN20[slice]] = fZ[i];
     288           0 :           fClusterIndex20[slice][fN20[slice]]=i;
     289           0 :           fN20[slice]++;
     290           0 :         }
     291             :       }      
     292             :     }
     293             : 
     294             :   //
     295             :   // consistency check
     296             :   //
     297           0 :   for (Int_t i=0;i<fN-1;i++){
     298           0 :     if (fZ[i]>fZ[i+1]){
     299           0 :       printf("Bug\n");
     300           0 :     }
     301             :   }
     302             :   //
     303           0 :   for (Int_t slice=0;slice<21;slice++)
     304           0 :   for (Int_t i=0;i<fN20[slice]-1;i++){
     305           0 :     if (fZ20[slice][i]>fZ20[slice][i+1]){
     306           0 :       printf("Bug\n");
     307           0 :     }
     308             :   }
     309             : 
     310             : 
     311           0 : }
     312             : //------------------------------------------------------------------------
     313             : Int_t AliHLTITSLayer::FindClusterIndex(Float_t z) const {
     314             :   //--------------------------------------------------------------------
     315             :   // This function returns the index of the nearest cluster 
     316             :   //--------------------------------------------------------------------
     317             :   Int_t ncl=0;
     318             :   const Float_t *zcl;  
     319           0 :   if (fCurrentSlice<0) {
     320           0 :     ncl = fN;
     321           0 :     zcl   = fZ;
     322           0 :   }
     323             :   else{
     324           0 :     ncl   = fNcs;
     325           0 :     zcl   = fZcs;;
     326             :   }
     327             :   
     328           0 :   if (ncl==0) return 0;
     329           0 :   Int_t b=0, e=ncl-1, m=(b+e)/2;
     330           0 :   for (; b<e; m=(b+e)/2) {
     331             :     //    if (z > fClusters[m]->GetZ()) b=m+1;
     332           0 :     if (z > zcl[m]) b=m+1;
     333             :     else e=m; 
     334             :   }
     335             :   return m;
     336           0 : }
     337             : 
     338             : //------------------------------------------------------------------------
     339             : void AliHLTITSLayer::
     340             : SelectClusters(Double_t zmin,Double_t zmax,Double_t ymin, Double_t ymax) {
     341             :   //--------------------------------------------------------------------
     342             :   // This function sets the "window"
     343             :   //--------------------------------------------------------------------
     344             :  
     345           0 :   Double_t circle=2*TMath::Pi()*fR;
     346           0 :   fYmin = ymin; fYmax =ymax;
     347           0 :   Float_t ymiddle = (fYmin+fYmax)*0.5;
     348           0 :   if (ymiddle<fYB[0]) {
     349           0 :     fYmin+=circle; fYmax+=circle; ymiddle+=circle;
     350           0 :   } else if (ymiddle>fYB[1]) {
     351           0 :     fYmin-=circle; fYmax-=circle; ymiddle-=circle;
     352           0 :   }
     353             :   
     354             :   //
     355           0 :   fCurrentSlice =-1;
     356             :   // defualt take all
     357           0 :   fClustersCs = fClusters;
     358           0 :   fClusterIndexCs = fClusterIndex;
     359           0 :   fYcs  = fY;
     360           0 :   fZcs  = fZ;
     361           0 :   fNcs  = fN;
     362             :   //
     363             :   //is in 20 slice?
     364           0 :   if (fCurrentSlice<0&&TMath::Abs(fYmax-fYmin)<1.49*fDy20){
     365           0 :     Int_t slice = int(0.5+(ymiddle-fYB[0])/fDy20);
     366           0 :     if (slice<0) slice=0;
     367           0 :     if (slice>20) slice=20;
     368           0 :     Bool_t isOK = (fYmin>fBy20[slice][0]&&fYmax<fBy20[slice][1]);
     369           0 :     if (isOK) {
     370           0 :       fCurrentSlice=slice;
     371           0 :       fClustersCs = fClusters20[fCurrentSlice];
     372           0 :       fClusterIndexCs = fClusterIndex20[fCurrentSlice];
     373           0 :       fYcs  = fY20[fCurrentSlice];
     374           0 :       fZcs  = fZ20[fCurrentSlice];
     375           0 :       fNcs  = fN20[fCurrentSlice];
     376           0 :     }
     377           0 :   }  
     378             :   //
     379             :   //is in 10 slice?
     380           0 :   if (fCurrentSlice<0&&TMath::Abs(fYmax-fYmin)<1.49*fDy10){
     381           0 :     Int_t slice = int(0.5+(ymiddle-fYB[0])/fDy10);
     382           0 :     if (slice<0) slice=0;
     383           0 :     if (slice>10) slice=10;
     384           0 :     Bool_t isOK = (fYmin>fBy10[slice][0]&&fYmax<fBy10[slice][1]);
     385           0 :     if (isOK) {
     386           0 :       fCurrentSlice=slice;
     387           0 :       fClustersCs = fClusters10[fCurrentSlice];
     388           0 :       fClusterIndexCs = fClusterIndex10[fCurrentSlice];
     389           0 :       fYcs  = fY10[fCurrentSlice];
     390           0 :       fZcs  = fZ10[fCurrentSlice];
     391           0 :       fNcs  = fN10[fCurrentSlice];
     392           0 :     }
     393           0 :   }  
     394             :   //
     395             :   //is in 5 slice?
     396           0 :   if (fCurrentSlice<0&&TMath::Abs(fYmax-fYmin)<1.49*fDy5){
     397           0 :     Int_t slice = int(0.5+(ymiddle-fYB[0])/fDy5);
     398           0 :     if (slice<0) slice=0;
     399           0 :     if (slice>5) slice=5;
     400           0 :     Bool_t isOK = (fYmin>fBy5[slice][0]&&fYmax<fBy5[slice][1]);
     401           0 :     if (isOK) {
     402           0 :       fCurrentSlice=slice;
     403           0 :       fClustersCs = fClusters5[fCurrentSlice];
     404           0 :       fClusterIndexCs = fClusterIndex5[fCurrentSlice];
     405           0 :       fYcs  = fY5[fCurrentSlice];
     406           0 :       fZcs  = fZ5[fCurrentSlice];
     407           0 :       fNcs  = fN5[fCurrentSlice];
     408           0 :     }
     409           0 :   }  
     410             :   //  
     411           0 :   fI=FindClusterIndex(zmin); fZmax=zmax;
     412           0 :   fImax = TMath::Min(FindClusterIndex(zmax)+1,fNcs);
     413           0 :   fSkip = 0;
     414           0 :   fAccepted =0;
     415             : 
     416             :   return;
     417           0 : }
     418             : //------------------------------------------------------------------------
     419             : Int_t AliHLTITSLayer::
     420             : FindDetectorIndex(Double_t phi, Double_t z) const {
     421             :   //--------------------------------------------------------------------
     422             :   //This function finds the detector crossed by the track
     423             :   //--------------------------------------------------------------------
     424             :   Double_t dphi;
     425           0 :   if (fZOffset<0)            // old geometry
     426           0 :     dphi = -(phi-fPhiOffset);
     427             :   else                       // new geometry
     428             :     dphi = phi-fPhiOffset;
     429             : 
     430             : 
     431           0 :   if      (dphi <  0) dphi += 2*TMath::Pi();
     432           0 :   else if (dphi >= 2*TMath::Pi()) dphi -= 2*TMath::Pi();
     433           0 :   Int_t np=Int_t(dphi*fNladders*0.5/TMath::Pi()+0.5);
     434           0 :   if (np>=fNladders) np-=fNladders;
     435           0 :   if (np<0)          np+=fNladders;
     436             : 
     437             : 
     438           0 :   Double_t dz=fZOffset-z;
     439           0 :   Double_t nnz = dz*(fNdetectors-1)*0.5/fZOffset+0.5;
     440           0 :   Int_t nz = (nnz<0 ? -1 : (Int_t)nnz);
     441           0 :   if (nz>=fNdetectors) return -1;
     442           0 :   if (nz<0)            return -1;
     443             : 
     444             :   // ad hoc correction for 3rd ladder of SDD inner layer,
     445             :   // which is reversed (rotated by pi around local y)
     446             :   // this correction is OK only from AliITSv11Hybrid onwards
     447           0 :   if (GetR()>12. && GetR()<20.) { // SDD inner
     448           0 :     if(np==2) { // 3rd ladder
     449           0 :       nz = (fNdetectors-1) - nz;
     450           0 :     } 
     451             :   }
     452             :   //printf("ndet %d phi %f z %f  np %d nz %d\n",fNdetectors,phi,z,np,nz);
     453             : 
     454             : 
     455           0 :   return np*fNdetectors + nz;
     456           0 : }
     457             : //------------------------------------------------------------------------
     458             : const AliITSRecPoint *AliHLTITSLayer::GetNextCluster(Int_t &ci,Bool_t test)
     459             : {
     460             :   //--------------------------------------------------------------------
     461             :   // This function returns clusters within the "window" 
     462             :   //--------------------------------------------------------------------
     463             : 
     464           0 :   if (fCurrentSlice<0) {
     465           0 :     Double_t rpi2 = 2.*fR*TMath::Pi();
     466           0 :     for (Int_t i=fI; i<fImax; i++) {
     467           0 :       Double_t y = fY[i];
     468           0 :       if (fYmax<y) y -= rpi2;
     469           0 :       if (fYmin>y) y += rpi2;
     470           0 :       if (y<fYmin) continue;
     471           0 :       if (y>fYmax) continue;
     472           0 :       if (fClusters[i]->GetQ()==0&&fSkip==2) continue;
     473           0 :       ci=i;
     474           0 :       if (!test) fI=i+1;
     475           0 :       return fClusters[i];
     476             :     }
     477           0 :   } else {
     478           0 :     for (Int_t i=fI; i<fImax; i++) {
     479           0 :       if (fYcs[i]<fYmin) continue;
     480           0 :       if (fYcs[i]>fYmax) continue;
     481           0 :       if (fClustersCs[i]->GetQ()==0&&fSkip==2) continue;
     482           0 :       ci=fClusterIndexCs[i];
     483           0 :       if (!test) fI=i+1;
     484           0 :       return fClustersCs[i];
     485             :     }
     486             :   }
     487           0 :   return 0;
     488           0 : }
     489             : //------------------------------------------------------------------------
     490             : Double_t AliHLTITSLayer::GetThickness(Double_t y,Double_t z,Double_t &x0)
     491             : const {
     492             :   //--------------------------------------------------------------------
     493             :   // This function returns the layer thickness at this point (units X0)
     494             :   //--------------------------------------------------------------------
     495             :   Double_t d=0.0085;
     496           0 :   x0=AliITSRecoParam::GetX0Air();
     497           0 :   if (43<fR&&fR<45) { //SSD2
     498             :      Double_t dd=0.0034;
     499             :      d=dd;
     500           0 :      if (TMath::Abs(y-0.00)>3.40) d+=dd;
     501           0 :      if (TMath::Abs(y-1.90)<0.45) {d+=(0.013-0.0034);}
     502           0 :      if (TMath::Abs(y+1.90)<0.45) {d+=(0.013-0.0034);}
     503           0 :      for (Int_t i=0; i<12; i++) {
     504           0 :        if (TMath::Abs(z-3.9*(i+0.5))<0.15) {
     505           0 :           if (TMath::Abs(y-0.00)>3.40) d+=dd;
     506           0 :           d+=0.0034; 
     507           0 :           break;
     508             :        }
     509           0 :        if (TMath::Abs(z+3.9*(i+0.5))<0.15) {
     510           0 :           if (TMath::Abs(y-0.00)>3.40) d+=dd;
     511           0 :           d+=0.0034; 
     512           0 :           break;
     513             :        }         
     514           0 :        if (TMath::Abs(z-3.4-3.9*i)<0.50) {d+=(0.016-0.0034); break;}
     515           0 :        if (TMath::Abs(z+0.5+3.9*i)<0.50) {d+=(0.016-0.0034); break;}
     516             :      }
     517           0 :   } else 
     518           0 :   if (37<fR&&fR<41) { //SSD1
     519             :      Double_t dd=0.0034;
     520             :      d=dd;
     521           0 :      if (TMath::Abs(y-0.00)>3.40) d+=dd;
     522           0 :      if (TMath::Abs(y-1.90)<0.45) {d+=(0.013-0.0034);}
     523           0 :      if (TMath::Abs(y+1.90)<0.45) {d+=(0.013-0.0034);}
     524           0 :      for (Int_t i=0; i<11; i++) {
     525           0 :        if (TMath::Abs(z-3.9*i)<0.15) {
     526           0 :           if (TMath::Abs(y-0.00)>3.40) d+=dd;
     527           0 :           d+=dd; 
     528           0 :           break;
     529             :        }
     530           0 :        if (TMath::Abs(z+3.9*i)<0.15) {
     531           0 :           if (TMath::Abs(y-0.00)>3.40) d+=dd;
     532           0 :           d+=dd; 
     533           0 :           break;
     534             :        }         
     535           0 :        if (TMath::Abs(z-1.85-3.9*i)<0.50) {d+=(0.016-0.0034); break;}
     536           0 :        if (TMath::Abs(z+2.05+3.9*i)<0.50) {d+=(0.016-0.0034); break;}         
     537             :      }
     538           0 :   } else
     539           0 :   if (13<fR&&fR<26) { //SDD
     540             :      Double_t dd=0.0033;
     541             :      d=dd;
     542           0 :      if (TMath::Abs(y-0.00)>3.30) d+=dd;
     543             : 
     544           0 :      if (TMath::Abs(y-1.80)<0.55) {
     545           0 :         d+=0.016;
     546           0 :         for (Int_t j=0; j<20; j++) {
     547           0 :           if (TMath::Abs(z+0.7+1.47*j)<0.12) {d+=0.08; x0=9.; break;}
     548           0 :           if (TMath::Abs(z-0.7-1.47*j)<0.12) {d+=0.08; x0=9.; break;}
     549             :         } 
     550           0 :      }
     551           0 :      if (TMath::Abs(y+1.80)<0.55) {
     552           0 :         d+=0.016;
     553           0 :         for (Int_t j=0; j<20; j++) {
     554           0 :           if (TMath::Abs(z-0.7-1.47*j)<0.12) {d+=0.08; x0=9.; break;}
     555           0 :           if (TMath::Abs(z+0.7+1.47*j)<0.12) {d+=0.08; x0=9.; break;}
     556             :         } 
     557           0 :      }
     558             : 
     559           0 :      for (Int_t i=0; i<4; i++) {
     560           0 :        if (TMath::Abs(z-7.3*i)<0.60) {
     561           0 :           d+=dd;
     562           0 :           if (TMath::Abs(y-0.00)>3.30) d+=dd; 
     563           0 :           break;
     564             :        }
     565           0 :        if (TMath::Abs(z+7.3*i)<0.60) {
     566           0 :           d+=dd; 
     567           0 :           if (TMath::Abs(y-0.00)>3.30) d+=dd; 
     568           0 :           break;
     569             :        }
     570             :      }
     571           0 :   } else
     572           0 :   if (6<fR&&fR<8) {   //SPD2
     573           0 :      Double_t dd=0.0063; x0=21.5;
     574             :      d=dd;
     575           0 :      if (TMath::Abs(y-3.08)>0.5) d+=dd;
     576           0 :      if (TMath::Abs(y-3.03)<0.10) d+=0.014;
     577           0 :   } else
     578           0 :   if (3<fR&&fR<5) {   //SPD1
     579           0 :      Double_t dd=0.0063; x0=21.5;
     580             :      d=dd;
     581           0 :      if (TMath::Abs(y+0.21)>0.6) d+=dd;
     582           0 :      if (TMath::Abs(y+0.10)<0.10) d+=0.014;
     583           0 :   }
     584             : 
     585           0 :   return d;
     586             : }
     587             : 
     588             : //------------------------------------------------------------------------
     589             : Int_t AliHLTITSLayer::InRoad() const {
     590             :   //-------------------------------------------------------------------
     591             :   // This function returns number of clusters within the "window" 
     592             :   //--------------------------------------------------------------------
     593             :   Int_t ncl=0;
     594           0 :   for (Int_t i=fI; i<fN; i++) {
     595           0 :     const AliITSRecPoint *c=fClusters[i];
     596           0 :     if (c->GetZ() > fZmax) break;
     597           0 :     if (c->IsUsed()) continue;
     598           0 :     const AliHLTITSDetector &det=GetDetector(c->GetDetectorIndex());    
     599           0 :     Double_t y=fR*det.GetPhi() + c->GetY();
     600             : 
     601           0 :     if (y>2.*fR*TMath::Pi()) y -= 2*fR*TMath::Pi();
     602           0 :     if (y>1.*fR*TMath::Pi() && fYmax<y) y -= 2*fR*TMath::Pi();
     603             : 
     604           0 :     if (y<fYmin) continue;
     605           0 :     if (y>fYmax) continue;
     606           0 :     ncl++;
     607           0 :   }
     608           0 :   return ncl;
     609             : }
     610             : 

Generated by: LCOV version 1.11