LCOV - code coverage report
Current view: top level - MUON/MUONraw - AliMUONRegHeader.cxx (source / functions) Hit Total Coverage
Test: coverage.info Lines: 18 72 25.0 %
Date: 2016-06-14 17:26:59 Functions: 6 13 46.2 %

          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 <TClonesArray.h>
      19             : 
      20             : #include "AliMUONRegHeader.h"
      21             : #include "AliMUONLocalStruct.h"
      22             : 
      23             : //-----------------------------------------------------------------------------
      24             : /// \class AliMUONRegHeader
      25             : /// Regional structure for trigger raw data.
      26             : /// Each Reg structure contains 16 (at most) local card structure.
      27             : /// The structure includes the information of the Reg. boards and
      28             : /// regional inputs
      29             : /// 
      30             : /// \author Christian Finck
      31             : //-----------------------------------------------------------------------------
      32             : 
      33             : /// \cond CLASSIMP
      34          18 : ClassImp(AliMUONRegHeader)
      35             : /// \endcond
      36             :  
      37             :  const Int_t  AliMUONRegHeader::fgkHeaderLength = 5;
      38             :  const Int_t  AliMUONRegHeader::fgkScalerLength = 10;
      39             :  const UInt_t AliMUONRegHeader::fgkEndOfReg     = 0xBEEFFACE;
      40             :  const UInt_t AliMUONRegHeader::fgkErrorWord    = 0xCAFEDEAD;
      41             : 
      42             : //___________________________________________
      43             : AliMUONRegHeader::AliMUONRegHeader(TRootIOCtor* /*dummy*/)
      44           0 : :  TObject(),
      45           0 : fDarcWord(0),
      46           0 : fWord(0),
      47           0 : fMask(0),
      48           0 : fL0(0),
      49           0 : fClk(0),
      50           0 : fHold(0),
      51           0 : fLocalArray(0x0)
      52           0 : {
      53             :   /// ctor
      54           0 :   fInput[0] = fInput[1] = 0;
      55             :   
      56           0 :   for (Int_t i = 0; i < 8; i++)
      57           0 :     fScaler[i] = 0;  
      58           0 : }
      59             : 
      60             : //___________________________________________
      61             : AliMUONRegHeader::AliMUONRegHeader()
      62           1 :   :  TObject(),
      63           1 :      fDarcWord(0),
      64           1 :      fWord(0),
      65           1 :      fMask(0),
      66           1 :      fL0(0),
      67           1 :      fClk(0),
      68           1 :      fHold(0),
      69           3 :      fLocalArray(new TClonesArray("AliMUONLocalStruct",16))
      70           5 : {
      71             :   /// ctor
      72             :  
      73           1 :   fInput[0] = fInput[1] = 0;
      74             : 
      75          18 :   for (Int_t i = 0; i < 8; i++)
      76           8 :     fScaler[i] = 0;
      77             : 
      78           2 : }
      79             : 
      80             : //___________________________________________
      81             : AliMUONRegHeader::~AliMUONRegHeader()
      82           6 : {
      83             :   /// dtor
      84             :  
      85           1 :   fLocalArray->Delete();
      86           2 :   delete fLocalArray;
      87           3 : }
      88             : 
      89             : //___________________________________________
      90             : AliMUONRegHeader::AliMUONRegHeader(const AliMUONRegHeader& event)
      91           0 :   :  TObject(event),
      92           0 :      fDarcWord(event.fDarcWord),
      93           0 :      fWord(event.fWord),
      94           0 :      fMask(event.fMask),
      95           0 :      fL0(event.fL0),
      96           0 :      fClk(event.fClk),
      97           0 :      fHold(event.fHold),
      98           0 :      fLocalArray(new TClonesArray("AliMUONLocalStruct", 16))
      99           0 : {
     100             :   ///
     101             :   /// copy ctor
     102             :   ///
     103             : 
     104           0 :   fInput[0] = event.fInput[0];
     105           0 :   fInput[1] = event.fInput[1];
     106             : 
     107           0 :   for (Int_t i = 0; i < 8; i++)
     108           0 :     fScaler[i] = event.fScaler[i];
     109             : 
     110           0 :   for (Int_t index = 0; index < (event.fLocalArray)->GetEntriesFast(); index++) {
     111           0 :     {new ((*fLocalArray)[fLocalArray->GetEntriesFast()]) 
     112           0 :         AliMUONLocalStruct(*(AliMUONLocalStruct*)(event.fLocalArray)->At(index));}
     113             :   }
     114           0 : }
     115             : 
     116             : //___________________________________________
     117             : AliMUONRegHeader& AliMUONRegHeader::operator=(const AliMUONRegHeader& event)
     118             : {
     119             :   /// 
     120             :   /// assignment operator
     121             :   ///
     122             : 
     123           0 :   if (this == &event) return *this;
     124             : 
     125           0 :   fDarcWord = event.fDarcWord;
     126           0 :   fWord     = event.fWord;
     127           0 :   fClk      = event.fClk;
     128           0 :   fHold     = event.fHold;
     129           0 :   fL0       = event.fL0;
     130           0 :   fMask     = event.fMask;
     131             : 
     132           0 :   fInput[0] = event.fInput[0];
     133           0 :   fInput[1] = event.fInput[1];
     134             : 
     135           0 :   for (Int_t i = 0; i < 8; i++)
     136           0 :     fScaler[i] = event.fScaler[i];
     137             : 
     138           0 :   fLocalArray = new TClonesArray("AliMUONLocalStruct", 16);
     139           0 :   for (Int_t index = 0; index < (event.fLocalArray)->GetEntriesFast(); index++) {
     140           0 :     {new ((*fLocalArray)[fLocalArray->GetEntriesFast()]) 
     141           0 :         AliMUONLocalStruct(*(AliMUONLocalStruct*)(event.fLocalArray)->At(index));}
     142             :   }
     143             : 
     144           0 :   return *this;
     145           0 : }
     146             : 
     147             : //___________________________________________
     148             : void AliMUONRegHeader::SetScalersNumbers()
     149             : {
     150             :   /// set numbers for scaler events for Regional header
     151             :   /// since this is provided by the experiment
     152             :   /// put dummy numbers to check the monitoring
     153             :   
     154           0 :   fClk  = 10000;
     155           0 :   fHold = 100; 
     156             :   
     157           0 :   for (Int_t i = 0; i < 8; i++)
     158           0 :     fScaler[i] = i;  
     159           0 : }
     160             : 
     161             : //___________________________________________
     162             : void AliMUONRegHeader::Clear(Option_t* )
     163             : {
     164             :   /// Clear TClones arrays
     165             :   /// instead of deleting
     166             :   ///
     167           0 :   fLocalArray->Clear("C");
     168             :  
     169           0 : }

Generated by: LCOV version 1.11