LCOV - code coverage report
Current view: top level - MUON/MUONraw - AliMUONBlockHeader.cxx (source / functions) Hit Total Coverage
Test: coverage.info Lines: 17 74 23.0 %
Date: 2016-06-14 17:26:59 Functions: 6 14 42.9 %

          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$ */
      17             :  
      18             : #include "AliMUONBlockHeader.h"
      19             : #include "AliMUONDspHeader.h"
      20             : 
      21             : #include <Riostream.h>
      22             : 
      23             : //-----------------------------------------------------------------------------
      24             : /// \class AliMUONBlockHeader
      25             : /// Block structure for tracker raw data
      26             : /// each DDL contains two blocks,
      27             : /// each block contains at most 5 dsp structure.
      28             : /// Beside the total length and length of the below data
      29             : /// the header of the block contains the front end DSP id, trigger words and paddind word
      30             : ///
      31             : /// \author Christian Finck
      32             : //-----------------------------------------------------------------------------
      33             : 
      34             : using std::cout;
      35             : using std::endl;
      36             : /// \cond CLASSIMP
      37          18 : ClassImp(AliMUONBlockHeader)
      38             : /// \endcond
      39             : 
      40             : const Int_t  AliMUONBlockHeader::fgkHeaderLength   = 8;
      41             : const UInt_t AliMUONBlockHeader::fgkDefaultDataKey = 0xFC0000FC;
      42             : const UInt_t AliMUONBlockHeader::fgkDdlDataKey     = 0xD000000D;
      43             : 
      44             : //___________________________________________
      45             : AliMUONBlockHeader::AliMUONBlockHeader(TRootIOCtor* /*dummy*/)
      46           0 : :  TObject(),
      47           0 : fDataKey(0),
      48           0 : fTotalLength(0),
      49           0 : fLength(0),
      50           0 : fDspId(0),
      51           0 : fL0Trigger(0),
      52           0 : fMiniEventId(0),
      53           0 : fEventId1(0),
      54           0 : fEventId2(0),
      55           0 : fDspHeaderArray(0x0)
      56           0 : {
      57             :   ///
      58             :   /// ctor
      59             :   ///
      60             :   
      61           0 : }
      62             : 
      63             : //___________________________________________
      64             : AliMUONBlockHeader::AliMUONBlockHeader()
      65           1 :   :  TObject(),
      66           1 :      fDataKey(0),
      67           1 :      fTotalLength(0),
      68           1 :      fLength(0),
      69           1 :      fDspId(0),
      70           1 :      fL0Trigger(0),
      71           1 :      fMiniEventId(0),
      72           1 :      fEventId1(0),
      73           1 :      fEventId2(0),
      74           3 :      fDspHeaderArray(new TClonesArray("AliMUONDspHeader", 5))
      75             : 
      76           5 : {
      77             :   ///
      78             :   /// ctor
      79             :   ///
      80             : 
      81           2 : }
      82             : 
      83             : //___________________________________________
      84             : AliMUONBlockHeader::~AliMUONBlockHeader()
      85           6 : {
      86             :   /// 
      87             :   /// dtor
      88             :   ///
      89           1 :   fDspHeaderArray->Delete();
      90           2 :   delete fDspHeaderArray;
      91           3 : }
      92             : 
      93             : //___________________________________________
      94             : AliMUONBlockHeader::AliMUONBlockHeader(const AliMUONBlockHeader& event)
      95           0 :   :  TObject(event),
      96           0 :      fDataKey(event.fDataKey),
      97           0 :      fTotalLength(event.fTotalLength),
      98           0 :      fLength(event.fLength),
      99           0 :      fDspId(event.fDspId),
     100           0 :      fL0Trigger(event.fL0Trigger),
     101           0 :      fMiniEventId(event.fMiniEventId),
     102           0 :      fEventId1(event.fEventId1),
     103           0 :      fEventId2(event.fEventId2),
     104           0 :      fDspHeaderArray(new TClonesArray("AliMUONDspHeader", 5))
     105           0 : {
     106             :   ///
     107             :   /// copy ctor
     108             :   ///
     109             : 
     110           0 :   for (Int_t index = 0; index < (event.fDspHeaderArray)->GetEntriesFast(); index++) {
     111           0 :     {new ((*fDspHeaderArray)[fDspHeaderArray->GetEntriesFast()]) 
     112           0 :         AliMUONDspHeader(*(AliMUONDspHeader*)(event.fDspHeaderArray)->At(index));}
     113             :   }
     114             :   //  fDspHeaderArray->SetOwner();
     115           0 : }
     116             : 
     117             : //___________________________________________
     118             : AliMUONBlockHeader&
     119             : AliMUONBlockHeader::operator=(const AliMUONBlockHeader &event)
     120             : {
     121             :   /// 
     122             :   /// assignment operator
     123             :   ///
     124           0 :   if (this == &event) return *this;
     125             : 
     126           0 :   fDataKey     = event.fDataKey;
     127           0 :   fTotalLength = event.fTotalLength;
     128           0 :   fLength      = event.fLength;
     129           0 :   fDspId       = event.fDspId;
     130             :  
     131           0 :   fL0Trigger   = event.fL0Trigger;
     132           0 :   fMiniEventId = event.fMiniEventId;
     133           0 :   fEventId1    = event.fEventId1;
     134           0 :   fEventId2    = event.fEventId2;
     135             : 
     136           0 :   fDspHeaderArray = new TClonesArray("AliMUONDspHeader", 5);
     137           0 :   for (Int_t index = 0; index < (event.fDspHeaderArray)->GetEntriesFast(); index++) {
     138           0 :     new ((*fDspHeaderArray)[fDspHeaderArray->GetEntriesFast()]) 
     139           0 :         AliMUONDspHeader(*(AliMUONDspHeader*)(event.fDspHeaderArray)->At(index));
     140             :   }
     141             : 
     142           0 :   return *this;
     143             : 
     144           0 : }
     145             : //___________________________________________
     146             : void AliMUONBlockHeader::AddDspHeader(const AliMUONDspHeader& dspHeader)
     147             : { 
     148             :   /// 
     149             :   /// adding the dsp structure
     150             :   /// into the TClonesArray
     151             :   ///
     152           0 :   TClonesArray &dspArray = *fDspHeaderArray;
     153           0 :   new(dspArray[dspArray.GetEntriesFast()]) AliMUONDspHeader(dspHeader);
     154             : 
     155           0 : }
     156             : //___________________________________________
     157             : void AliMUONBlockHeader::Clear(Option_t* )
     158             : {
     159             :   /// Clear TClones arrays
     160             :   /// instead of deleting
     161             :   ///
     162           0 :   fDspHeaderArray->Clear("C");
     163             :  
     164           0 : }
     165             : 
     166             : //___________________________________________
     167             : void AliMUONBlockHeader::Print(Option_t* /*opt*/) const
     168             : {
     169             :   /// print out
     170             : 
     171           0 :   cout << "CRT info"        << endl;
     172           0 :   cout << "DataKey: "       << fDataKey << endl;
     173           0 :   cout << "TotalLength: "   << fTotalLength << endl;
     174           0 :   cout << "Length: "        << fLength << endl;
     175           0 :   cout << "DspId: "         << fDspId << endl;
     176             :  
     177           0 :   cout << "L0Trigger: "     << fL0Trigger << endl;
     178           0 :   cout << "MiniEventId: "   << fMiniEventId<< endl; 
     179           0 :   cout << "EventId1: "      << fEventId1 << endl;
     180           0 :   cout << "EventId2: "      << fEventId2 << endl;;
     181             : 
     182           0 : }

Generated by: LCOV version 1.11