Bug fix: AliHLTOUTRawReader
[u/mrichter/AliRoot.git] / HLT / rec / AliHLTOUTRawReader.cxx
CommitLineData
176d8684 1// $Id$
2
c5123824 3//**************************************************************************
8bc2b457 4//* This file is property of and copyright by the *
c5123824 5//* ALICE Experiment at CERN, All rights reserved. *
6//* *
7//* Primary Authors: Matthias Richter <Matthias.Richter@ift.uib.no> *
c5123824 8//* *
9//* Permission to use, copy, modify and distribute this software and its *
10//* documentation strictly for non-commercial purposes is hereby granted *
11//* without fee, provided that the above copyright notice appears in all *
12//* copies and that both the copyright notice and this permission notice *
13//* appear in the supporting documentation. The authors make no claims *
14//* about the suitability of this software for any purpose. It is *
15//* provided "as is" without express or implied warranty. *
16//**************************************************************************
176d8684 17
8bc2b457 18/// @file AliHLTOUTRawReader.cxx
19/// @author Matthias Richter
20/// @date
21/// @brief HLTOUT data wrapper for AliRawReader.
22///
176d8684 23
24#include "AliHLTOUTRawReader.h"
176d8684 25#include "AliRawReader.h"
176d8684 26
27/** ROOT macro for the implementation of ROOT specific class methods */
28ClassImp(AliHLTOUTRawReader)
29
c1292031 30AliHLTOUTRawReader::AliHLTOUTRawReader()
31 :
32 AliHLTOUTHomerCollection(),
33 fpRawreader(NULL)
34{
8bc2b457 35 // constructor
36 //
37 // HLTOUT data wrapper for AliRawReader
38 //
c1292031 39 // see header file for class documentation
c1292031 40}
41
c5123824 42AliHLTOUTRawReader::AliHLTOUTRawReader(AliRawReader* pRawreader, int event, AliHLTEsdManager* pEsdManager)
176d8684 43 :
c5123824 44 AliHLTOUTHomerCollection(event, pEsdManager),
45 fpRawreader(pRawreader)
176d8684 46{
47 // see header file for class documentation
48 // or
49 // refer to README to build package
50 // or
51 // visit http://web.ift.uib.no/~kjeks/doc/alice-hlt
52}
53
176d8684 54AliHLTOUTRawReader::~AliHLTOUTRawReader()
55{
8bc2b457 56 // destructor
176d8684 57}
58
c5123824 59Bool_t AliHLTOUTRawReader::ReadNextData(UChar_t*& data)
176d8684 60{
8bc2b457 61 // overloaded from AliHLTOUTHomerCollection: switch to next DDL
c5123824 62 if (!fpRawreader) return kFALSE;
63 return fpRawreader->ReadNextData(data);
176d8684 64}
65
c5123824 66int AliHLTOUTRawReader::Reset()
176d8684 67{
8bc2b457 68 // overloaded from AliHLTOUTHomerCollection: reset DDL position
c5123824 69 if (fpRawreader) return fpRawreader->Reset();
70 return 0;
176d8684 71}
44dc7683 72
c5123824 73int AliHLTOUTRawReader::GetDataSize()
44dc7683 74{
8bc2b457 75 // overloaded from AliHLTOUTHomerCollection: get size of current DDL
c5123824 76 if (fpRawreader) return fpRawreader->GetDataSize();
77 return 0;
78}
44dc7683 79
16e6f752 80AliHLTCDHWrapper AliHLTOUTRawReader::GetDataHeader()
c5123824 81{
8bc2b457 82 // overloaded from AliHLTOUTHomerCollection: get data header of current DDL
c89f0daf 83 if (fpRawreader) {
84 if(fpRawreader->GetDataHeader())
85 return fpRawreader->GetDataHeader();
86 if(fpRawreader->GetDataHeaderV3())
87 return fpRawreader->GetDataHeaderV3();
88 }
c5123824 89 return NULL;
90}
44dc7683 91
c5123824 92void AliHLTOUTRawReader::SelectEquipment(int equipmentType, int minEquipmentId, int maxEquipmentId)
93{
8bc2b457 94 // overloaded from AliHLTOUTHomerCollection: select equipment range
c5123824 95 if (fpRawreader) fpRawreader->SelectEquipment(equipmentType, minEquipmentId, maxEquipmentId);
96}
44dc7683 97
c5123824 98int AliHLTOUTRawReader::GetEquipmentId()
99{
8bc2b457 100 // overloaded from AliHLTOUTHomerCollection: get id of current DDL
c5123824 101 if (fpRawreader) return fpRawreader->GetEquipmentId();
102 return -1;
44dc7683 103}