LCOV - code coverage report
Current view: top level - RAW/RAWDatabase - AliRawEquipment.cxx (source / functions) Hit Total Coverage
Test: coverage.info Lines: 1 40 2.5 %
Date: 2016-06-14 17:26:59 Functions: 1 10 10.0 %

          Line data    Source code
       1             : // @(#) $Id$
       2             : // Author: Fons Rademakers  26/11/99
       3             : 
       4             : /**************************************************************************
       5             :  * Copyright(c) 1998-2003, ALICE Experiment at CERN, All rights reserved. *
       6             :  *                                                                        *
       7             :  * Author: The ALICE Off-line Project.                                    *
       8             :  * Contributors are mentioned in the code where appropriate.              *
       9             :  *                                                                        *
      10             :  * Permission to use, copy, modify and distribute this software and its   *
      11             :  * documentation strictly for non-commercial purposes is hereby granted   *
      12             :  * without fee, provided that the above copyright notice appears in all   *
      13             :  * copies and that both the copyright notice and this permission notice   *
      14             :  * appear in the supporting documentation. The authors make no claims     *
      15             :  * about the suitability of this software for any purpose. It is          *
      16             :  * provided "as is" without express or implied warranty.                  *
      17             :  **************************************************************************/
      18             : 
      19             : //////////////////////////////////////////////////////////////////////////
      20             : //                                                                      //
      21             : // AliRawEvent                                                          //
      22             : //                                                                      //
      23             : // Set of classes defining the ALICE RAW event format. The AliRawEvent  //
      24             : // class defines a RAW event. It consists of an AliEventHeader object   //
      25             : // an AliEquipmentHeader object, an AliRawData object and an array of   //
      26             : // sub-events, themselves also being AliRawEvents. The number of        //
      27             : // sub-events depends on the number of DATE LDC's.                      //
      28             : // The AliRawEvent objects are written to a ROOT file using different   //
      29             : // technologies, i.e. to local disk via AliRawDB or via rfiod using     //
      30             : // AliRawRFIODB or via rootd using AliRawRootdDB or to CASTOR via       //
      31             : // rootd using AliRawCastorDB (and for performance testing there is     //
      32             : // also AliRawNullDB).                                                  //
      33             : // The AliStats class provides statics information that is added as     //
      34             : // a single keyed object to each raw file.                              //
      35             : // The AliTagDB provides an interface to a TAG database.                //
      36             : // The AliMDC class is usid by the "alimdc" stand-alone program         //
      37             : // that reads data directly from DATE.                                  //
      38             : //                                                                      //
      39             : //////////////////////////////////////////////////////////////////////////
      40             : 
      41             : #include "TBuffer.h"
      42             : 
      43             : #include <AliRawDataArray.h>
      44             : 
      45             : #include "AliRawEquipmentHeader.h"
      46             : #include "AliRawData.h"
      47             : 
      48             : #include "AliRawEquipment.h"
      49             : 
      50             : 
      51         128 : ClassImp(AliRawEquipment)
      52             : 
      53             : 
      54             : //______________________________________________________________________________
      55           0 : AliRawEquipment::AliRawEquipment():
      56           0 : fEqpHdr(NULL),
      57           0 : fRawData(NULL),
      58           0 : fRawDataRef(NULL)
      59           0 : {
      60             :    // Create ALICE equipment object.
      61             : 
      62           0 : }
      63             : 
      64             : //______________________________________________________________________________
      65             : AliRawEquipmentHeader *AliRawEquipment::GetEquipmentHeader()
      66             : {
      67             :    // Get equipment header part of AliRawEquipment.
      68             : 
      69           0 :    if (!fEqpHdr)
      70           0 :       fEqpHdr = new AliRawEquipmentHeader;
      71             : 
      72           0 :    return fEqpHdr;
      73           0 : }
      74             : 
      75             : //______________________________________________________________________________
      76             : AliRawData *AliRawEquipment::GetRawData()
      77             : {
      78             :    // Get raw data part of AliRawEquipment.
      79             : 
      80           0 :   if (!fRawData) {
      81           0 :     if (!fRawDataRef.IsValid())
      82           0 :       fRawData = new AliRawData;
      83             :     else {
      84           0 :       fRawData = (AliRawData*)fRawDataRef.GetObject();
      85             :     }
      86             :   }
      87           0 :   return fRawData;
      88           0 : }
      89             : 
      90             : //______________________________________________________________________________
      91             : AliRawEquipment::~AliRawEquipment()
      92           0 : {
      93             :    // Clean up event object. Delete also, possible, private raw data.
      94             : 
      95           0 :    delete fEqpHdr;
      96           0 :    delete fRawData;
      97           0 : }
      98             : 
      99             : //______________________________________________________________________________
     100             : void AliRawEquipment::CloneRawData(const AliRawData *rawData)
     101             : {
     102             :   // Clone the input raw data and
     103             :   // flush the TRef
     104             : 
     105           0 :   fRawDataRef = NULL;
     106           0 :   if (rawData) fRawData = (AliRawData*)rawData->Clone();
     107           0 : }
     108             : 
     109             : //______________________________________________________________________________
     110             : void AliRawEquipment::Streamer(TBuffer &R__b)
     111             : {
     112             :    // Stream an object of class AliRawEquipment.
     113             : 
     114           0 :    UInt_t R__s, R__c;
     115           0 :    if (R__b.IsReading()) {
     116           0 :       Version_t R__v = R__b.ReadVersion(&R__s, &R__c); if (R__v) { }
     117           0 :       TObject::Streamer(R__b);
     118           0 :       R__b >> fEqpHdr;
     119           0 :       R__b >> fRawData;
     120           0 :       fRawDataRef.Streamer(R__b);
     121           0 :       R__b.CheckByteCount(R__s, R__c, AliRawEquipment::IsA());
     122           0 :    } else {
     123           0 :       R__c = R__b.WriteVersion(AliRawEquipment::IsA(), kTRUE);
     124           0 :       TObject::Streamer(R__b);
     125           0 :       R__b << fEqpHdr;
     126           0 :       R__b << fRawData;
     127           0 :       fRawDataRef.Streamer(R__b);
     128           0 :       R__b.SetByteCount(R__c, kTRUE);
     129             :    }
     130           0 : }

Generated by: LCOV version 1.11