LCOV - code coverage report
Current view: top level - TRD/TRDbase - AliTRDUshortInfo.cxx (source / functions) Hit Total Coverage
Test: coverage.info Lines: 1 49 2.0 %
Date: 2016-06-14 17:26:59 Functions: 1 13 7.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             : /* $Id: AliTRDUshortInfo.cxx 27946 2008-08-13 15:26:24Z cblume $ */
      17             : 
      18             : ///////////////////////////////////////////////////////////////////////////////
      19             : //                                                                           //
      20             : //  Calibration base class for a single ROC                                  //
      21             : //  Contains one UShort_t value per pad                                      //
      22             : //  However, values are set and get as float, there are stored internally as //
      23             : //  (UShort_t) value * 10000                                                 //
      24             : //                                                                           //
      25             : ///////////////////////////////////////////////////////////////////////////////
      26             : 
      27             : #include "AliTRDUshortInfo.h"
      28             : 
      29          48 : ClassImp(AliTRDUshortInfo)
      30             : 
      31             : //_____________________________________________________________________________
      32             : AliTRDUshortInfo::AliTRDUshortInfo()
      33           0 :   :TObject()
      34           0 :   ,fSize(0)
      35           0 :   ,fData(0)
      36           0 : {
      37             :   //
      38             :   // Default constructor
      39             :   //
      40             : 
      41           0 : }
      42             : 
      43             : //_____________________________________________________________________________
      44             : AliTRDUshortInfo::AliTRDUshortInfo(Int_t n)
      45           0 :   :TObject()
      46           0 :   ,fSize(n)
      47           0 :   ,fData(0)
      48           0 : {
      49             :   //
      50             :   // Constructor that initializes a given size
      51             :   //
      52             :   
      53           0 :   fData = new UShort_t[fSize];
      54           0 :   for(Int_t k = 0; k < fSize; k++){
      55           0 :     fData[k] = 0;
      56             :   }
      57             : 
      58           0 : }
      59             : 
      60             : //_____________________________________________________________________________
      61             : AliTRDUshortInfo::AliTRDUshortInfo(const AliTRDUshortInfo &c)
      62           0 :   :TObject(c)
      63           0 :   ,fSize(c.fSize)
      64           0 :   ,fData(0)
      65           0 : {
      66             :   //
      67             :   // AliTRDUshortInfo copy constructor
      68             :   //
      69             : 
      70             :   Int_t iBin = 0;
      71             : 
      72           0 :   fData = new UShort_t[fSize];
      73           0 :   for (iBin = 0; iBin < fSize; iBin++) {
      74           0 :     fData[iBin] = ((AliTRDUshortInfo &) c).fData[iBin];
      75             :   }
      76             : 
      77           0 : }
      78             : 
      79             : //_____________________________________________________________________________
      80             : AliTRDUshortInfo::~AliTRDUshortInfo()
      81           0 : {
      82             :   //
      83             :   // AliTRDUshortInfo destructor
      84             :   //
      85             : 
      86           0 :   if (fData) {
      87           0 :     delete [] fData;
      88           0 :     fData = 0;
      89           0 :   }
      90             : 
      91           0 : }
      92             : 
      93             : //_____________________________________________________________________________
      94             : AliTRDUshortInfo &AliTRDUshortInfo::operator=(const AliTRDUshortInfo &c)
      95             : {
      96             :   //
      97             :   // Assignment operator
      98             :   //
      99             : 
     100           0 :   if (this == &c) {
     101           0 :     return *this;
     102             :   }
     103             : 
     104           0 :   fSize = c.fSize;
     105             : 
     106           0 :   if (fData) {
     107           0 :     delete [] fData;
     108             :   }
     109           0 :   fData = new UShort_t[fSize];
     110           0 :   for (Int_t iBin = 0; iBin < fSize; iBin++) {
     111           0 :     fData[iBin] = c.fData[iBin];
     112             :   }
     113             : 
     114           0 :   return *this;
     115             : 
     116           0 : }
     117             : 
     118             : //_____________________________________________________________________________
     119             : void AliTRDUshortInfo::Copy(TObject &c) const
     120             : {
     121             :   //
     122             :   // Copy function
     123             :   //
     124             :   
     125             :   Int_t iBin = 0;
     126             : 
     127           0 :   ((AliTRDUshortInfo &) c).fSize = fSize;
     128             : 
     129           0 :   if (((AliTRDUshortInfo &) c).fData) delete [] ((AliTRDUshortInfo &) c).fData;
     130           0 :   ((AliTRDUshortInfo &) c).fData = new UShort_t[fSize];
     131           0 :   for (iBin = 0; iBin < fSize; iBin++) {
     132           0 :     ((AliTRDUshortInfo &) c).fData[iBin] = fData[iBin];
     133             :   }
     134             :   
     135           0 :   TObject::Copy(c);
     136             : 
     137           0 : }
     138             : 
     139             : //_____________________________________________________________________________
     140             : void AliTRDUshortInfo::SetSize(Int_t n)
     141             : {
     142             :   //
     143             :   // Set the size
     144             :   //
     145             : 
     146           0 :   if(fData) delete [] fData;
     147           0 :   fData = new UShort_t[n];
     148             : 
     149           0 :   fSize = n;
     150             :   
     151           0 : }

Generated by: LCOV version 1.11