LCOV - code coverage report
Current view: top level - FMD/FMDbase - AliFMDUShortMap.h (source / functions) Hit Total Coverage
Test: coverage.info Lines: 4 15 26.7 %
Date: 2016-06-14 17:26:59 Functions: 6 21 28.6 %

          Line data    Source code
       1             : #ifndef ALIFMDUSHORTMAP_H
       2             : #define ALIFMDUSHORTMAP_H
       3             : /* Copyright(c) 1998-2000, ALICE Experiment at CERN, All rights
       4             :  * reserved. 
       5             :  *
       6             :  * See cxx source for full Copyright notice                               
       7             :  */
       8             : /** @file    AliFMDUShortMap.h
       9             :     @author  Christian Holm Christensen <cholm@nbi.dk>
      10             :     @date    Mon Mar 27 12:48:18 2006
      11             :     @brief   Per strip of unisgned shorts (16 bit) data 
      12             : */
      13             : // Map of an integer per strip
      14             : // This class stores one short unsigned integer (16 bits) per strip in
      15             : // the FMD detectors. 
      16             : #ifndef ALIFMDMAP_H
      17             : # include "AliFMDMap.h"
      18             : #endif 
      19             : //____________________________________________________________________
      20             : /** @class AliFMDUShortMap 
      21             :     @brief Map of an integer per strip
      22             :     @ingroup FMD_base
      23             :  */
      24             : class AliFMDUShortMap : public AliFMDMap
      25             : {
      26             : public:
      27             :   /** Copy constructor 
      28             :       @param other Object to copy from.  */
      29             :   AliFMDUShortMap(const AliFMDUShortMap& other);
      30             :   /** Constructor */
      31             :   AliFMDUShortMap();
      32             :   /** Constructor 
      33             :       @param maxDet  Number of detectors (3)
      34             :       @param maxRing Number of rings (2)
      35             :       @param maxSec  Number of sectors (40)
      36             :       @param maxStr  Number of strips (20) */
      37             :   AliFMDUShortMap(UShort_t maxDet,
      38             :                   UShort_t maxRing= kMaxRings, 
      39             :                   UShort_t maxSec = kMaxSectors, 
      40             :                   UShort_t maxStr = kMaxStrips);
      41             :   /** Destructor */
      42          24 :   virtual ~AliFMDUShortMap() { delete [] fData; }
      43             :   /** Assignment operator 
      44             :       @param other Object to assign from 
      45             :       @return reference to this object.  */
      46             :   AliFMDUShortMap& operator=(const AliFMDUShortMap& other);
      47             :   /** Reset to value 
      48             :       @param val Value to reset from */
      49             :   virtual void Reset(const UShort_t& val=UShort_t());
      50             :   /** Access operator 
      51             :       @param detector Detector 
      52             :       @param ring     Ring 
      53             :       @param sector   Sector  
      54             :       @param strip    Strip
      55             :       @return  reference value stored for the strip */
      56             :   virtual UShort_t& operator()(UShort_t detector, 
      57             :                                Char_t   ring, 
      58             :                                UShort_t sector, 
      59             :                                UShort_t strip);
      60             :   /** Access operator 
      61             :       @param detector Detector 
      62             :       @param ring     Ring 
      63             :       @param sector   Sector  
      64             :       @param strip    Strip
      65             :       @return  value stored for the strip */
      66             :   virtual const UShort_t& operator()(UShort_t detector, 
      67             :                                      Char_t   ring, 
      68             :                                      UShort_t sector, 
      69             :                                      UShort_t strip) const;
      70             :   /** 
      71             :    * Get the raw data pointer. 
      72             :    * 
      73             :    * @return Pointer to the data 
      74             :    */
      75           0 :   UShort_t* Data() const { return fData; }
      76             :   /** 
      77             :    * The total number of entries in the data array 
      78             :    * 
      79             :    * @return Total number of entries in the data array 
      80             :    */
      81           0 :   Int_t     Total() const { return fTotal; }
      82      409618 :   void*     Ptr() const { return reinterpret_cast<void*>(fData); }
      83      409600 :   Int_t     MaxIndex()            const { return fTotal; }
      84             :  protected:
      85           0 :   UShort_t  AtAsUShort(Int_t idx) const { return fData[idx]; }
      86           0 :   UShort_t& AtAsUShort(Int_t idx)       { return fData[idx]; }
      87           0 :   Int_t     AtAsInt(Int_t idx)    const { return fData[idx]; }
      88           0 :   Float_t   AtAsFloat(Int_t idx)  const { return fData[idx]; }
      89           0 :   Bool_t    AtAsBool(Int_t idx)   const { return fData[idx]!=0?kTRUE:kFALSE; }
      90           0 :   Int_t&    AtAsInt(Int_t idx)          { return AliFMDMap::AtAsInt(idx);    }
      91           0 :   Float_t&  AtAsFloat(Int_t idx)        { return AliFMDMap::AtAsFloat(idx);  }
      92           0 :   Bool_t&   AtAsBool(Int_t idx)         { return AliFMDMap::AtAsBool(idx); }
      93           0 :   Bool_t    IsUShort()            const { return kTRUE; }  
      94             :   Int_t     fTotal; // Total number of entries 
      95             :   UShort_t* fData;  // [fTotal] The data 
      96          60 :   ClassDef(AliFMDUShortMap, 3) // Cache of edep,hit information per strip
      97             : };
      98             : 
      99             : #endif 
     100             : //____________________________________________________________________
     101             : //
     102             : // Local Variables:
     103             : //   mode: C++
     104             : // End:
     105             : //
     106             : // EOF
     107             : //
     108             : 
     109             : 

Generated by: LCOV version 1.11