LCOV - code coverage report
Current view: top level - ITS/ITSbase - AliITSRecPoint.cxx (source / functions) Hit Total Coverage
Test: coverage.info Lines: 75 149 50.3 %
Date: 2016-06-14 17:26:59 Functions: 10 17 58.8 %

          Line data    Source code
       1             : /**************************************************************************
       2             :  * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
       3             :  *                                                                        *
       4             :  * Author: The ALICE Off-line Project.                                    *
       5             :  * Contributors are mentioned in the code where appropriate.              *
       6             :  *                                                                        *
       7             :  * Permission to use, copy, modify and distribute this software and its   *
       8             :  * documentation strictly for non-commercial purposes is hereby granted   *
       9             :  * without fee, provided that the above copyright notice appears in all   *
      10             :  * copies and that both the copyright notice and this permission notice   *
      11             :  * appear in the supporting documentation. The authors make no claims     *
      12             :  * about the suitability of this software for any purpose. It is          *
      13             :  * provided "as is" without express or implied warranty.                  *
      14             :  **************************************************************************/
      15             : 
      16             : /* $Id$ */
      17             : 
      18             : ///////////////////////////////////////////////////////////////////////////////
      19             : //  Reconstructed space point class for set:ITS   
      20             : //  Reconstructed points are expressed simultaneously in two different 
      21             : //  reference frames, both differing from the global system.
      22             : //  The first is referred to the sensor (see AliITSsegmentation for the
      23             : //  definition) and each point is represented by two coordinates: fXloc and
      24             : //  fZloc. This system in the code is referred to as "local"
      25             : //  The second is used for tracking (V2, SA and MI versions) and the X axis 
      26             : //  represents the radial coordinate (this system is, in the bending plane, 
      27             : //  a rotated system w.r.t. the global reference system). 
      28             : //  Each reaconstructed point is represented by two coordinates: fY and fZ, 
      29             : //  inherited from AliCluster. This system in the code is referred to as 
      30             : //  "trackingV2".
      31             : ///////////////////////////////////////////////////////////////////////////////
      32             : 
      33             : #include <TGeoMatrix.h>
      34             : #include "AliITSRecPoint.h"
      35             : #include "AliAlignObj.h"
      36             : #include <AliLog.h>
      37             : #include <iostream>
      38             : 
      39             : using std::ios;
      40         118 : ClassImp(AliITSRecPoint)
      41             : 
      42             : //_____________________________________________________________
      43             : AliITSRecPoint::AliITSRecPoint(): 
      44          68 : AliCluster(),
      45          68 : fXloc(0),
      46          68 : fZloc(0),
      47          68 : fdEdX(0),
      48          68 : fIndex(0),
      49          68 : fQ(0),
      50          68 : fLayer(0),
      51          68 : fNz(0),
      52          68 : fNy(0),
      53          68 : fChargeRatio(0),
      54          68 : fType(0),
      55          68 : fDeltaProb(0),
      56          68 : fDriftTime(0.),
      57          68 : fDriftSide(0)
      58         340 : {
      59             :     // default constructor
      60         136 : }
      61             : 
      62             : //________________________________________________________________________
      63             : AliITSRecPoint::AliITSRecPoint(Int_t *lab,Float_t *hit, Int_t *info, Bool_t local):
      64         666 : AliCluster(AliGeomManager::LayerToVolUID((info[2]+AliGeomManager::kSPD1),lab[3]&0x3FF),hit,0,0,lab),
      65         666 : fXloc(0),
      66         666 : fZloc(0),
      67         666 : fdEdX(0),
      68         666 : fIndex(lab[3]),
      69         666 : fQ(hit[4]),
      70         666 : fLayer(info[2]),
      71         666 : fNz(info[1]),
      72         666 : fNy(info[0]),
      73         666 : fChargeRatio(0),
      74         666 : fType(0),
      75         666 : fDeltaProb(0),
      76         666 : fDriftTime(0.),
      77         666 : fDriftSide(0)
      78        1998 : {
      79             :   //standard constructor used in AliITSClusterFinderV2
      80             : 
      81         666 :   if (!local) { // Cluster V2
      82         666 :     Double_t txyz[3] = {GetX(), GetY(), GetZ()};
      83         666 :     Double_t lxyz[3] = {0, 0, 0};
      84        1332 :     GetTracking2LocalMatrix()->LocalToMaster(txyz,lxyz);
      85         666 :     fXloc = lxyz[0]; fZloc = lxyz[2];
      86         814 :     if(fLayer==4) hit[5]=-hit[5];
      87        1476 :     if( (fLayer==4) || (fLayer==5) ) SetSigmaYZ(hit[5]); 
      88         666 :   }
      89             :   else {
      90           0 :     switch (fLayer) {
      91             :     case 0:
      92             :     case 1:
      93           0 :       fdEdX = 0;
      94           0 :       break;
      95             :     case 2:
      96             :     case 3:
      97           0 :       fdEdX=fQ*1e-6;
      98           0 :       break;
      99             :     case 4:
     100           0 :       fdEdX=fQ*2.16;
     101           0 :       SetSigmaYZ(hit[5]);
     102           0 :       break;
     103             :     case 5:
     104           0 :       fdEdX=fQ*2.16;
     105           0 :       hit[5]=-hit[5];
     106           0 :       SetSigmaYZ(hit[5]);
     107           0 :       break;
     108             :     default:
     109           0 :       AliError(Form("Wrong ITS layer %d (0 -> 5)",fLayer));
     110             :       break;
     111             :     }
     112           0 :     fXloc = hit[0];
     113           0 :     fZloc = hit[1];
     114           0 :     Double_t lxyz[3] = {fXloc, 0, fZloc};
     115           0 :     Double_t txyz[3] = {0, 0, 0};
     116           0 :     GetTracking2LocalMatrix()->MasterToLocal(lxyz,txyz);
     117             : 
     118           0 :     SetX(0.); SetY(txyz[1]); SetZ(txyz[2]);
     119             : 
     120           0 :   }
     121             : 
     122        1332 : }
     123             : 
     124             : //_______________________________________________________________________
     125             : AliITSRecPoint::AliITSRecPoint(const AliITSRecPoint& pt):
     126        1186 :   AliCluster(pt),
     127        1186 :   fXloc(pt.fXloc),
     128        1186 :   fZloc(pt.fZloc),
     129        1186 :   fdEdX(pt.fdEdX),
     130        1186 :   fIndex(pt.fIndex),
     131        1186 :   fQ(pt.fQ),
     132        1186 :   fLayer(pt.fLayer),
     133        1186 :   fNz(pt.fNz),
     134        1186 :   fNy(pt.fNy),
     135        1186 :   fChargeRatio(pt.fChargeRatio),
     136        1186 :   fType(pt.fType),
     137        1186 :   fDeltaProb(pt.fDeltaProb),
     138        1186 :   fDriftTime(pt.fDriftTime),
     139        1186 :   fDriftSide(pt.fDriftSide)
     140        5930 : {
     141             :   //Copy constructor
     142             : 
     143        2372 : }
     144             : 
     145             : //______________________________________________________________________
     146             : AliITSRecPoint& AliITSRecPoint::operator=(const AliITSRecPoint& source){
     147             :   // Assignment operator
     148             : 
     149           0 :   this->~AliITSRecPoint();
     150           0 :   new(this) AliITSRecPoint(source);
     151           0 :   return *this;
     152             : 
     153           0 : }
     154             : 
     155             : //----------------------------------------------------------------------
     156             : void AliITSRecPoint::Print(ostream *os){
     157             :     ////////////////////////////////////////////////////////////////////////
     158             :     // Standard output format for this class.
     159             :     ////////////////////////////////////////////////////////////////////////
     160             : #if defined __GNUC__
     161             : #if __GNUC__ > 2
     162             :     ios::fmtflags fmt;
     163             : #else
     164             :     Int_t fmt;
     165             : #endif
     166             : #else
     167             : #if defined __ICC || defined __ECC || defined __xlC__
     168             :     ios::fmtflags fmt;
     169             : #else
     170             :     Int_t fmt;
     171             : #endif
     172             : #endif
     173             :  
     174           0 :     fmt = os->setf(ios::fixed);  // set fixed floating point output
     175           0 :     *os << GetLabel(0) << " " << GetLabel(1) << " " << GetLabel(2) << " ";
     176           0 :     fmt = os->setf(ios::scientific); // set scientific for dEdX.
     177           0 :     *os << GetX() <<" " << GetY() << " " << GetZ() << " " ;
     178           0 :     *os << GetSigmaY2() << " " << GetSigmaZ2() << " " << GetSigmaYZ() << " ";
     179           0 :     fmt = os->setf(ios::fixed);
     180           0 :     *os << GetVolumeId() << " "<< Misalign() /*fIsMisaligned*/ << " ";
     181           0 :     fmt = os->setf(ios::scientific); // set scientific for dEdX.
     182           0 :     *os << fXloc << " " << fZloc << " " << fdEdX << " ";
     183           0 :     fmt = os->setf(ios::fixed); // every fixed
     184           0 :     *os << fIndex <<" " << fQ << " "<<fLayer <<" "<<fNz<<" "<<fNy<<" ";
     185           0 :     *os << fChargeRatio<<" " << fType << " " << fDeltaProb << " " << fDriftTime<< " " << fDriftSide;
     186           0 :     os->flags(fmt); // reset back to old formating.
     187             :     return;
     188           0 : }
     189             : 
     190             : //----------------------------------------------------------------------
     191             : Int_t AliITSRecPoint::GetNpixels() const {
     192             : //
     193             : // returns the number of pixels used for the SPD clusters
     194             : //
     195             : 
     196           0 :  if(fLayer > 1) return -1;
     197           0 :  else return fType;
     198             : 
     199           0 : }
     200             : 
     201             : //----------------------------------------------------------------------
     202             : Int_t AliITSRecPoint::GetSPDclusterType() const {
     203             : //
     204             : // returns an Int_t with encoded information on cluster size
     205             : //    type <= 16: cluster type identifier according to conventional numbering
     206             : //    type >  16: Npixels+1000*Ny+1000000*Nz
     207             : //
     208             : 
     209             :  Int_t type = -1;
     210         134 :  if(fLayer > 1) return type;
     211             :  else {
     212             : 
     213          67 :    switch (fType) {
     214          27 :      case 1 : type = 1 ;break;
     215          63 :      case 2 : if(fNy == 2) type = 2;
     216             :               else         type = 3;
     217             :               break;
     218          12 :      case 3 : if(fNy == 3)      type = 4;
     219           0 :               else if(fNz == 3) type = 6;
     220             :               else              type = 5;
     221             :               break;
     222           2 :      case 4 : if(fNz == 1)                  type = 7;
     223           0 :               else if(fNz == 2 && fNy == 2) type = 8;
     224           0 :               else if(fNy == 2 && fNz == 3) type = 11;
     225           0 :               else if(fNy == 3 && fNz == 2) type = 9;
     226             :               else                          type = 15;
     227             :               break;
     228           0 :      case 5 : if(fNy == 3 && fNz == 2)  type = 10;
     229           0 :               if(fNy == 2 && fNz == 3 ) type = 12;
     230           0 :               if(fNy == 5)              type = 16;
     231           0 :               else                      type = fType+1000*fNy+1000000*fNz;
     232             :               break; 
     233           1 :      case 6 : if(fNy ==3 && fNz == 2) type = 13;
     234           1 :               if(fNy ==2 && fNz == 3) type = 14;
     235           1 :               else                    type = fType+1000*fNy+1000000*fNz;
     236             :               break; 
     237           0 :      default: type = fType+1000*fNy+1000000*fNz;
     238           0 :               break; 
     239             :    }  
     240             : 
     241          67 :    return type;
     242             :  }
     243          67 : }
     244             : 
     245             : //----------------------------------------------------------------------
     246             : Int_t AliITSRecPoint::GetSDDclusterType() const {
     247             : // returns an Int_t with encoded information on cluster size
     248             : // Byte1 = fNz Byte0=fNy, other two bytes empty for extra information
     249             : // max. allowed cluster size = 255
     250         198 :   Int_t typ=(fNz&0xFF)<<8;
     251          99 :   typ+=fNy&0xFF;
     252         142 :   if(fDriftSide==1) typ+=1<<16;
     253          99 :   return typ;
     254             : }
     255             : //----------------------------------------------------------------------
     256             : void  AliITSRecPoint::DecodeSDDclusterType(Int_t cluType, Int_t &cluSizAn, Int_t& cluSizTb, Int_t &drSide){
     257             : // Extract cluster sizes and drift side from cluster type 
     258           0 :   cluSizTb=cluType&0xFF;
     259           0 :   cluSizAn=(cluType>>8)&0xFF;
     260           0 :   drSide=(cluType>>16);
     261           0 :   return;
     262             : }
     263             : //----------------------------------------------------------------------
     264             : Int_t AliITSRecPoint::GetSSDclusterType() const {
     265             : // returns an Int_t with encoded information on cluster size
     266             : // Byte1 = fNz Byte0=fNy, other two bytes empty for extra information
     267             : // max. allowed cluster size = 255
     268         202 :   Int_t typ=(fNz&0xFF)<<8;
     269         101 :   typ+=fNy&0xFF;
     270         101 :   return typ;
     271             : }
     272             : 
     273             : //----------------------------------------------------------------------
     274             : void AliITSRecPoint::Read(istream *is){
     275             : ////////////////////////////////////////////////////////////////////////
     276             : // Standard input format for this class.
     277             : ////////////////////////////////////////////////////////////////////////
     278           0 :     Bool_t mis;
     279           0 :     Int_t lab[4];
     280           0 :     Float_t hit[6];
     281           0 :     lab[3] = 0; // ??
     282           0 :     *is >> lab[0] >> lab[1] >> lab[2];
     283           0 :     SetLabel(lab[0],0); SetLabel(lab[1],1); SetLabel(lab[2],2);
     284           0 :     *is >> hit[0] >> hit[1] >> hit[2] >> hit[3] >> hit[4] >> hit[5];
     285           0 :     SetX(hit[0]);SetY(hit[1]);SetZ(hit[2]);SetSigmaY2(hit[3]);
     286           0 :     SetSigmaZ2(hit[4]);//fSigmaYZ=hit[5];
     287           0 :     *is >> lab[0] >> mis;
     288           0 :     SetVolumeId(lab[0]);// fIsMisalinged = mis;
     289           0 :     *is >> fXloc >> fZloc >> fdEdX;
     290           0 :     *is >> fIndex >> fQ >> fLayer >> fNz >> fNy >> fChargeRatio >> fType;
     291           0 :     *is >> fDeltaProb >> fDriftTime >> fDriftSide;
     292             : 
     293             :     return;
     294           0 : }
     295             : //----------------------------------------------------------------------
     296             : ostream &operator<<(ostream &os,AliITSRecPoint &p){
     297             : ////////////////////////////////////////////////////////////////////////
     298             : // Standard output streaming function.
     299             : ////////////////////////////////////////////////////////////////////////
     300             :  
     301           0 :     p.Print(&os);
     302           0 :     return os;
     303             : }
     304             : //----------------------------------------------------------------------
     305             : istream &operator>>(istream &is,AliITSRecPoint &r){
     306             : ////////////////////////////////////////////////////////////////////////
     307             : // Standard input streaming function.
     308             : ////////////////////////////////////////////////////////////////////////
     309             :  
     310           0 :     r.Read(&is);
     311           0 :     return is;
     312             : }
     313             : //----------------------------------------------------------------------

Generated by: LCOV version 1.11