LCOV - code coverage report
Current view: top level - RAW/RAWDatabase - AliRawEquipmentHeader.cxx (source / functions) Hit Total Coverage
Test: coverage.info Lines: 10 31 32.3 %
Date: 2016-06-14 17:26:59 Functions: 3 7 42.9 %

          Line data    Source code
       1             : /**************************************************************************
       2             :  * Copyright(c) 1998-2003, 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             : // Author: Fons Rademakers  26/11/99
      18             : 
      19             : //////////////////////////////////////////////////////////////////////////
      20             : //                                                                      //
      21             : // AliRawEquipmentHeader                                                //
      22             : //                                                                      //
      23             : //////////////////////////////////////////////////////////////////////////
      24             : 
      25             : #include <Bytes.h>
      26             : 
      27             : #include "AliRawEquipmentHeader.h"
      28             : #include "AliDAQ.h"
      29             : 
      30             : #include <Riostream.h>
      31             : 
      32             : using std::cout;
      33             : using std::endl;
      34         128 : ClassImp(AliRawEquipmentHeader)
      35             : 
      36             : //______________________________________________________________________________
      37        2438 : AliRawEquipmentHeader::AliRawEquipmentHeader():
      38        2438 :   fSize(0),
      39        2438 :   fEquipmentType(0),
      40        2438 :   fEquipmentID(0xffffffff),
      41        2438 :   fBasicElementSizeType(0)
      42       12190 : {
      43             :   // Default constructor
      44       19504 :   for(Int_t i = 0; i < kAttributeWords; i++)
      45        7314 :     fTypeAttribute[i] = 0;
      46        4876 : }
      47             : 
      48             : //______________________________________________________________________________
      49             : UInt_t AliRawEquipmentHeader::SwapWord(UInt_t x) const
      50             : {
      51             :    // Swap the endianess of the integer value 'x'
      52             : 
      53           0 :    return (((x & 0x000000ffU) << 24) | ((x & 0x0000ff00U) <<  8) |
      54           0 :            ((x & 0x00ff0000U) >>  8) | ((x & 0xff000000U) >> 24));
      55             : }
      56             : 
      57             : //______________________________________________________________________________
      58             : void AliRawEquipmentHeader::Swap()
      59             : {
      60             :    // Swap equipment header data. There is no way to see if the data
      61             :    // has already been swapped. This method is only called when the
      62             :    // header is read from the DATE event builder (GDC).
      63             : 
      64           0 :    fSize                 = SwapWord(fSize);
      65           0 :    fEquipmentType        = SwapWord(fEquipmentType);
      66           0 :    fEquipmentID          = SwapWord(fEquipmentID);
      67           0 :    fBasicElementSizeType = SwapWord(fBasicElementSizeType);
      68           0 :    for (int i = 0; i < kAttributeWords; i++)
      69           0 :       fTypeAttribute[i] = SwapWord(fTypeAttribute[i]);
      70           0 : }
      71             : 
      72             : //______________________________________________________________________________
      73             : void AliRawEquipmentHeader::Reset()
      74             : {
      75             :   // Reset the contents of the equipment
      76             :   // header data
      77           0 :   fSize = fEquipmentType = fBasicElementSizeType = 0;
      78           0 :   fEquipmentID = 0xffffffff;
      79             : 
      80           0 :   for(Int_t i = 0; i < kAttributeWords; i++)
      81           0 :     fTypeAttribute[i] = 0;
      82           0 : }
      83             : 
      84             : //_____________________________________________________________________________
      85             : void AliRawEquipmentHeader::Print( const Option_t* opt ) const
      86             : {
      87             :   // Dumps the equipment header
      88             :   // fields
      89             : 
      90           0 :   cout << opt << "  Equipment size: " << fSize << endl;
      91           0 :   cout << opt << "  Equipment type: " << fEquipmentType << endl;
      92           0 :   Int_t ddlIndex;
      93           0 :   cout << opt << "  Equipment ID: " << fEquipmentID << " ( " << AliDAQ::DetectorNameFromDdlID(fEquipmentID,ddlIndex) << " )" << endl;
      94           0 :   cout << opt << "  Type attribute: " << fTypeAttribute[0] << "-" << fTypeAttribute[1] << "-" << fTypeAttribute[2] << endl;
      95           0 :   cout << opt << "  Basic element size type: " << fBasicElementSizeType << endl;
      96           0 : }

Generated by: LCOV version 1.11