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

          Line data    Source code
       1             : // @(#) $Id$
       2             : // **************************************************************************
       3             : // This file is property of and copyright by the ALICE HLT Project          *
       4             : // ALICE Experiment at CERN, All rights reserved.                           *
       5             : //                                                                          *
       6             : // Primary Authors: Sergey Gorbunov <sergey.gorbunov@kip.uni-heidelberg.de> *
       7             : //                  Ivan Kisel <kisel@kip.uni-heidelberg.de>                *
       8             : //                  for The ALICE HLT Project.                              *
       9             : //                                                                          *
      10             : // Permission to use, copy, modify and distribute this software and its     *
      11             : // documentation strictly for non-commercial purposes is hereby granted     *
      12             : // without fee, provided that the above copyright notice appears in all     *
      13             : // copies and that both the copyright notice and this permission notice     *
      14             : // appear in the supporting documentation. The authors make no claims       *
      15             : // about the suitability of this software for any purpose. It is            *
      16             : // provided "as is" without express or implied warranty.                    *
      17             : //                                                                          *
      18             : //***************************************************************************
      19             : 
      20             : 
      21             : #include "AliHLTTPCCAParam.h"
      22             : #include "AliHLTTPCCAMath.h"
      23             : 
      24             : 
      25             : #if !defined(HLTCA_GPUCODE)
      26             : 
      27             : GPUdi() AliHLTTPCCAParam::AliHLTTPCCAParam()
      28           0 :     : fISlice( 0 ), fNRows( 63 ), fAlpha( 0.174533 ), fDAlpha( 0.349066 ),
      29           0 :     fCosAlpha( 0 ), fSinAlpha( 0 ), fAngleMin( 0 ), fAngleMax( 0 ), fRMin( 83.65 ), fRMax( 133.3 ),
      30           0 :     fZMin( 0.0529937 ), fZMax( 249.778 ), fErrX( 0 ), fErrY( 0 ), fErrZ( 0.228808 ), fPadPitch( 0.4 ), fBzkG( -5.00668 ),
      31           0 :     fConstBz( -5.00668*0.000299792458 ), fHitPickUpFactor( 1. ),
      32           0 :       fMaxTrackMatchDRow( 4 ), fNeighboursSearchArea(3.), fTrackConnectionFactor( 3.5 ), fTrackChiCut( 3.5 ), fTrackChi2Cut( 10 ), fClusterError2CorrectionY(1.), fClusterError2CorrectionZ(1.),
      33           0 :       fMinNTrackClusters( 30 ),
      34           0 :       fMaxTrackQPt(1./0.1)
      35           0 : {
      36             :   // constructor
      37           0 :   fParamS0Par[0][0][0] = 0.00047013;
      38           0 :   fParamS0Par[0][0][1] = 2.00135e-05;
      39           0 :   fParamS0Par[0][0][2] = 0.0106533;
      40           0 :   fParamS0Par[0][0][3] = 5.27104e-08;
      41           0 :   fParamS0Par[0][0][4] = 0.012829;
      42           0 :   fParamS0Par[0][0][5] = 0.000147125;
      43           0 :   fParamS0Par[0][0][6] = 4.99432;
      44           0 :   fParamS0Par[0][1][0] = 0.000883342;
      45           0 :   fParamS0Par[0][1][1] = 1.07011e-05;
      46           0 :   fParamS0Par[0][1][2] = 0.0103187;
      47           0 :   fParamS0Par[0][1][3] = 4.25141e-08;
      48           0 :   fParamS0Par[0][1][4] = 0.0224292;
      49           0 :   fParamS0Par[0][1][5] = 8.27274e-05;
      50           0 :   fParamS0Par[0][1][6] = 4.17233;
      51           0 :   fParamS0Par[0][2][0] = 0.000745399;
      52           0 :   fParamS0Par[0][2][1] = 5.62408e-06;
      53           0 :   fParamS0Par[0][2][2] = 0.0151562;
      54           0 :   fParamS0Par[0][2][3] = 5.08757e-08;
      55           0 :   fParamS0Par[0][2][4] = 0.0601004;
      56           0 :   fParamS0Par[0][2][5] = 7.97129e-05;
      57           0 :   fParamS0Par[0][2][6] = 4.84913;
      58           0 :   fParamS0Par[1][0][0] = 0.00215126;
      59           0 :   fParamS0Par[1][0][1] = 6.82233e-05;
      60           0 :   fParamS0Par[1][0][2] = 0.0221867;
      61           0 :   fParamS0Par[1][0][3] = -6.27825e-09;
      62           0 :   fParamS0Par[1][0][4] = -0.00745378;
      63           0 :   fParamS0Par[1][0][5] = 0.000172629;
      64           0 :   fParamS0Par[1][0][6] = 6.24987;
      65           0 :   fParamS0Par[1][1][0] = 0.00181667;
      66           0 :   fParamS0Par[1][1][1] = -4.17772e-06;
      67           0 :   fParamS0Par[1][1][2] = 0.0253429;
      68           0 :   fParamS0Par[1][1][3] = 1.3011e-07;
      69           0 :   fParamS0Par[1][1][4] = -0.00362827;
      70           0 :   fParamS0Par[1][1][5] = 0.00030406;
      71           0 :   fParamS0Par[1][1][6] = 17.7775;
      72           0 :   fParamS0Par[1][2][0] = 0.00158251;
      73           0 :   fParamS0Par[1][2][1] = -3.55911e-06;
      74           0 :   fParamS0Par[1][2][2] = 0.0247899;
      75           0 :   fParamS0Par[1][2][3] = 7.20604e-08;
      76           0 :   fParamS0Par[1][2][4] = 0.0179946;
      77           0 :   fParamS0Par[1][2][5] = 0.000425504;
      78           0 :   fParamS0Par[1][2][6] = 20.9294;
      79             : 
      80           0 :   for( int i=0; i<200; i++ ) fRowX[i] = 0;
      81             : 
      82           0 :   Update();
      83           0 : }
      84             : 
      85             : void AliHLTTPCCAParam::Initialize( int iSlice,
      86             :     int nRows, float rowX[],
      87             :     float alpha, float dAlpha,
      88             :     float rMin, float rMax,
      89             :     float zMin, float zMax,
      90             :     float padPitch, float zSigma,
      91             :     float bz
      92             :                                         )
      93             : {
      94             :   // initialization
      95           0 :   fISlice = iSlice;
      96           0 :   fAlpha = alpha;
      97           0 :   fDAlpha = dAlpha;
      98           0 :   fRMin = rMin;
      99           0 :   fRMax = rMax;
     100           0 :   fZMin = zMin;
     101           0 :   fZMax = zMax;
     102           0 :   fPadPitch = padPitch;
     103           0 :   fErrY = 1.; // not in use
     104           0 :   fErrZ = zSigma;
     105           0 :   fBzkG = bz;
     106           0 :   fNRows = nRows;
     107           0 :   for ( int irow = 0; irow < nRows; irow++ ) {
     108           0 :     fRowX[irow] = rowX[irow];
     109             :     //std::cout << " row " << irow << " x= " << rowX[irow] << std::endl;
     110             :   }
     111             : 
     112           0 :   Update();
     113           0 : }
     114             : 
     115             : void AliHLTTPCCAParam::Update()
     116             : {
     117             :   // update of calculated values
     118             : 
     119             :   const double kCLight = 0.000299792458;
     120           0 :   fConstBz = fBzkG * kCLight;
     121             : 
     122           0 :   fPolinomialFieldBz[0] = fConstBz * (  0.999286   );
     123           0 :   fPolinomialFieldBz[1] = fConstBz * ( -4.54386e-7 );
     124           0 :   fPolinomialFieldBz[2] = fConstBz * (  2.32950e-5 );
     125           0 :   fPolinomialFieldBz[3] = fConstBz * ( -2.99912e-7 );
     126           0 :   fPolinomialFieldBz[4] = fConstBz * ( -2.03442e-8 );
     127           0 :   fPolinomialFieldBz[5] = fConstBz * (  9.71402e-8 );
     128             : 
     129           0 :   fCosAlpha = CAMath::Cos( fAlpha );
     130           0 :   fSinAlpha = CAMath::Sin( fAlpha );
     131           0 :   fAngleMin = fAlpha - fDAlpha / 2.f;
     132           0 :   fAngleMax = fAlpha + fDAlpha / 2.f;
     133           0 :   fErrX = fPadPitch / CAMath::Sqrt( 12. );
     134           0 :   fTrackChi2Cut = fTrackChiCut * fTrackChiCut;
     135           0 : }
     136             : 
     137             : #endif
     138             : 
     139             : 
     140             : MEM_CLASS_PRE() GPUdi() void MEM_LG(AliHLTTPCCAParam)::Slice2Global( float x, float y,  float z,
     141             :     float *X, float *Y,  float *Z ) const
     142             : {
     143             :   // conversion of coorinates sector->global
     144           0 :   *X = x * fCosAlpha - y * fSinAlpha;
     145           0 :   *Y = y * fCosAlpha + x * fSinAlpha;
     146           0 :   *Z = z;
     147           0 : }
     148             : 
     149             : MEM_CLASS_PRE() GPUdi() void MEM_LG(AliHLTTPCCAParam)::Global2Slice( float X, float Y,  float Z,
     150             :     float *x, float *y,  float *z ) const
     151             : {
     152             :   // conversion of coorinates global->sector
     153           0 :   *x = X * fCosAlpha + Y * fSinAlpha;
     154           0 :   *y = Y * fCosAlpha - X * fSinAlpha;
     155           0 :   *z = Z;
     156           0 : }
     157             : 
     158             : MEM_CLASS_PRE() GPUdi() float MEM_LG(AliHLTTPCCAParam)::GetClusterError2( int yz, int type, float z, float angle ) const
     159             : {
     160             :   //* recalculate the cluster error wih respect to the track slope
     161             : 
     162           0 :   float angle2 = angle * angle;
     163           0 :   MakeType(const float*) c = fParamS0Par[yz][type];
     164           0 :   float v = c[0] + z * ( c[1] + c[3] * z ) + angle2 * ( c[2] + angle2 * c[4] + c[5] * z );
     165           0 :   return CAMath::Abs( v );
     166             : }
     167             : 
     168             : MEM_CLASS_PRE() GPUdi() void MEM_LG(AliHLTTPCCAParam)::GetClusterErrors2( int iRow, float z, float sinPhi, float cosPhi, float DzDs, float &Err2Y, float &Err2Z ) const
     169             : {
     170             :   //
     171             :   // Use calibrated cluster error from OCDB
     172             :   //
     173             : 
     174           0 :   z = CAMath::Abs( ( 250. - 0.275 ) - CAMath::Abs( z ) );
     175           0 :   int    type = ( iRow < 63 ) ? 0 : ( ( iRow > 126 ) ? 1 : 2 );
     176           0 :   float cosPhiInv = CAMath::Abs( cosPhi ) > 1.e-2 ? 1. / cosPhi : 0;
     177           0 :   float angleY = sinPhi * cosPhiInv ; // dy/dx
     178           0 :   float angleZ = DzDs * cosPhiInv ; // dz/dx
     179             : 
     180           0 :   Err2Y = GetClusterError2( 0, type, z, angleY );
     181           0 :   Err2Z = GetClusterError2( 1, type, z, angleZ );
     182           0 : }
     183             : 
     184             : MEM_CLASS_PRE() GPUdi() void MEM_LG(AliHLTTPCCAParam)::GetClusterErrors2v1( int rowType, float z, float sinPhi, float cosPhi, float DzDs, float &Err2Y, float &Err2Z ) const
     185             : {
     186             :   //
     187             :   // Use calibrated cluster error from OCDB
     188             :   //
     189             : 
     190           0 :   z = CAMath::Abs( ( 250. - 0.275 ) - CAMath::Abs( z ) );
     191           0 :   float cosPhiInv = CAMath::Abs( cosPhi ) > 1.e-2 ? 1. / cosPhi : 0;
     192           0 :   float angleY = sinPhi * cosPhiInv ; // dy/dx
     193           0 :   float angleZ = DzDs * cosPhiInv ; // dz/dx
     194             : 
     195           0 :   Err2Y = GetClusterError2( 0, rowType, z, angleY );
     196           0 :   Err2Z = GetClusterError2( 1, rowType, z, angleZ );
     197           0 : }
     198             : 
     199             : #ifndef HLTCA_GPUCODE
     200             : GPUh() void AliHLTTPCCAParam::WriteSettings( std::ostream &out ) const
     201             : {
     202             :   // write settings to the file
     203           0 :   out << fISlice << std::endl;
     204           0 :   out << fNRows << std::endl;
     205           0 :   out << fAlpha << std::endl;
     206           0 :   out << fDAlpha << std::endl;
     207           0 :   out << fCosAlpha << std::endl;
     208           0 :   out << fSinAlpha << std::endl;
     209           0 :   out << fAngleMin << std::endl;
     210           0 :   out << fAngleMax << std::endl;
     211           0 :   out << fRMin << std::endl;
     212           0 :   out << fRMax << std::endl;
     213           0 :   out << fZMin << std::endl;
     214           0 :   out << fZMax << std::endl;
     215           0 :   out << fErrX << std::endl;
     216           0 :   out << fErrY << std::endl;
     217           0 :   out << fErrZ << std::endl;
     218           0 :   out << fPadPitch << std::endl;
     219           0 :   out << fBzkG << std::endl;
     220           0 :   out << fHitPickUpFactor << std::endl;
     221           0 :   out << fMaxTrackMatchDRow << std::endl;
     222           0 :   out << fTrackConnectionFactor << std::endl;
     223           0 :   out << fTrackChiCut << std::endl;
     224           0 :   out << fTrackChi2Cut << std::endl;
     225           0 :   for ( int iRow = 0; iRow < fNRows; iRow++ ) {
     226           0 :     out << fRowX[iRow] << std::endl;
     227             :   }
     228           0 :   out << std::endl;
     229           0 :   for ( int i = 0; i < 2; i++ )
     230           0 :     for ( int j = 0; j < 3; j++ )
     231           0 :       for ( int k = 0; k < 7; k++ )
     232           0 :         out << fParamS0Par[i][j][k] << std::endl;
     233           0 :   out << std::endl;
     234           0 : }
     235             : 
     236             : GPUh() void AliHLTTPCCAParam::ReadSettings( std::istream &in )
     237             : {
     238             :   // Read settings from the file
     239             : 
     240           0 :   in >> fISlice;
     241           0 :   in >> fNRows;
     242           0 :   in >> fAlpha;
     243           0 :   in >> fDAlpha;
     244           0 :   in >> fCosAlpha;
     245           0 :   in >> fSinAlpha;
     246           0 :   in >> fAngleMin;
     247           0 :   in >> fAngleMax;
     248           0 :   in >> fRMin;
     249           0 :   in >> fRMax;
     250           0 :   in >> fZMin;
     251           0 :   in >> fZMax;
     252           0 :   in >> fErrX;
     253           0 :   in >> fErrY;
     254           0 :   in >> fErrZ;
     255           0 :   in >> fPadPitch;
     256           0 :   in >> fBzkG;
     257           0 :   in >> fHitPickUpFactor;
     258           0 :   in >> fMaxTrackMatchDRow;
     259           0 :   in >> fTrackConnectionFactor;
     260           0 :   in >> fTrackChiCut;
     261           0 :   in >> fTrackChi2Cut;
     262             : 
     263           0 :   if( fNRows<0 || fNRows > 200 ) fNRows = 0;
     264             : 
     265           0 :   for ( int iRow = 0; iRow < fNRows; iRow++ ) {
     266           0 :     in >> fRowX[iRow];
     267             :   }
     268           0 :   for ( int i = 0; i < 2; i++ )
     269           0 :     for ( int j = 0; j < 3; j++ )
     270           0 :       for ( int k = 0; k < 7; k++ )
     271           0 :         in >> fParamS0Par[i][j][k];
     272           0 : }
     273             : #endif

Generated by: LCOV version 1.11