LCOV - code coverage report
Current view: top level - TPC/TPCbase - AliTPCclusterInfo.cxx (source / functions) Hit Total Coverage
Test: coverage.info Lines: 1 76 1.3 %
Date: 2016-06-14 17:26:59 Functions: 1 15 6.7 %

          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             : /// \class AliTPCclusterInfo
      17             : /// \brief Implementation of the TPC cluster debug information
      18             : ///
      19             : ///   Additional cluster information to monitor clustering performance
      20             : ///   and to extract a features of detector response
      21             : ///   Information attached to the default cluster
      22             : ///   ONLY in DEBUG MODE
      23             : ///
      24             : /// \author Marian Ivanov   Marian.Ivanov@cern.ch
      25             : 
      26             : #include "AliTPCclusterInfo.h"
      27             : #include "AliLog.h"
      28             : 
      29             : /// \cond CLASSIMP
      30          24 : ClassImp(AliTPCclusterInfo)
      31             : /// \endcond
      32             : 
      33             : 
      34           0 : AliTPCclusterInfo::AliTPCclusterInfo():
      35           0 :   fNPads(0),
      36           0 :   fNTimeBins(0),
      37           0 :   fNBins(0),
      38           0 :   fGraph(0)
      39           0 : {
      40             :   //
      41             :   // default constructor
      42             :   //
      43           0 :   for (Int_t i=0; i<25;i++){
      44           0 :     fMatrix[i] = i;
      45             :   }
      46           0 : }
      47             : 
      48             : AliTPCclusterInfo::AliTPCclusterInfo(const  AliTPCclusterInfo & info):
      49           0 :   TObject(info),
      50           0 :   fNPads(info.fNPads),
      51           0 :   fNTimeBins(info.fNTimeBins),
      52           0 :   fNBins(info.fNBins),
      53           0 :   fGraph(0)
      54           0 : {
      55             :   /// copy constructor
      56             : 
      57             :   // AliInfo("Copy constructor\n");
      58           0 :   for (Int_t i=0; i<25;i++){
      59           0 :     fMatrix[i] = info.fMatrix[i];
      60             :   }
      61           0 :   if (info.fGraph) {
      62           0 :     fGraph = new Float_t[fNBins];
      63           0 :     for (Int_t i=0;i<fNBins; i++){
      64           0 :       fGraph[i] = info.fGraph[i];
      65             :     }
      66           0 :   }
      67           0 : }
      68             : 
      69             : 
      70           0 : AliTPCclusterInfo::AliTPCclusterInfo(Bool_t extend):
      71           0 :   fNPads(0),
      72           0 :   fNTimeBins(0),
      73           0 :   fNBins(0),
      74           0 :   fGraph(0)
      75           0 : {
      76             :   /// allocate dummy graph - neccessary for IO part to use automatic branching
      77             : 
      78           0 :   for (Int_t i=0; i<25;i++){
      79           0 :     fMatrix[i] = i;
      80             :   }
      81           0 :   if (extend){
      82           0 :     fNBins = 1;
      83           0 :     fGraph  = new Float_t[1];
      84           0 :     fGraph[0]=-1;
      85           0 :   }
      86           0 : }
      87             : 
      88           0 : AliTPCclusterInfo::AliTPCclusterInfo(Float_t *matrix, Int_t nbins, Float_t* graph):
      89           0 :   fNPads(0),
      90           0 :   fNTimeBins(0),
      91           0 :   fNBins(0),
      92           0 :   fGraph(0)
      93           0 : {
      94             :   /// constructor of the info
      95             : 
      96           0 :   for (Int_t i=0;i<25;i++){
      97           0 :     fMatrix[i]=matrix[i];
      98             :   }
      99           0 :   fNPads=0;
     100           0 :   fNTimeBins=0;
     101             :   Int_t center = 5+5+2;
     102           0 :   for (Int_t i=-2; i<=2;i++) if (matrix[center+i]>0) fNTimeBins++;
     103           0 :   for (Int_t i=-2; i<=2;i++) if (matrix[center+i*5]>0) fNPads++;
     104           0 :   fNBins = nbins;
     105           0 :   fGraph = 0;
     106           0 :   if (fNBins>0) {
     107           0 :     fGraph = new Float_t[fNBins];
     108           0 :     for (Int_t i=0;i<fNBins; i++){
     109           0 :       fGraph[i] = graph[i];
     110             :     }
     111           0 :   }
     112           0 : }
     113             : 
     114             : AliTPCclusterInfo& AliTPCclusterInfo::operator=(const AliTPCclusterInfo& info){
     115             :   /// assignment operator
     116             : 
     117           0 :   if (this == &info) return (*this);
     118           0 :   for (Int_t i=0; i<25;i++){
     119           0 :     fMatrix[i] = info.fMatrix[i];
     120             :   }
     121           0 :   if (info.fGraph) {
     122           0 :     if (fGraph) delete []fGraph;
     123           0 :     fGraph = new Float_t[fNBins];
     124           0 :     for (Int_t i=0;i<fNBins; i++){
     125           0 :       fGraph[i] = info.fGraph[i];
     126             :     }
     127           0 :   }
     128           0 :   return *this;
     129           0 : }
     130             : 
     131             : 
     132             : UChar_t AliTPCclusterInfo::GetNPads(Float_t threshold) const {
     133             :   ///
     134             : 
     135             :   Int_t nPads=0;
     136             :   Int_t center = 5+5+2;
     137           0 :   for (Int_t i=-2; i<=2;i++) if (fMatrix[center+i*5]>threshold) nPads++;
     138           0 :   return nPads;
     139             : }
     140             : 
     141             : UChar_t AliTPCclusterInfo::GetNTimeBins(Float_t threshold) const {
     142             :   ///
     143             : 
     144             :   Int_t nTimeBins=0;
     145             :   Int_t center = 5+5+2;
     146           0 :   for (Int_t i=-2; i<=2;i++) if (fMatrix[center+i]>threshold) nTimeBins++;
     147           0 :   return nTimeBins;
     148             : }
     149             : 
     150             : 
     151             : 
     152             : 
     153           0 : AliTPCclusterInfo::~AliTPCclusterInfo(){
     154             :   /// destructor
     155             : 
     156           0 :   if (fGraph)  delete [] fGraph;
     157           0 : }
     158             : 

Generated by: LCOV version 1.11