2 /**************************************************************************
3 * This file is property of and copyright by the ALICE HLT Project *
4 * All rights reserved. *
6 * Primary Authors: Per Thomas Hille, Oystein Djuvsland *
8 * Permission to use, copy, modify and distribute this software and its *
9 * documentation strictly for non-commercial purposes is hereby granted *
10 * without fee, provided that the above copyright notice appears in all *
11 * copies and that both the copyright notice and this permission notice *
12 * appear in the supporting documentation. The authors make no claims *
13 * about the suitability of this software for any purpose. It is *
14 * provided "as is" without express or implied warranty. *
15 **************************************************************************/
17 #include "AliHLTPHOSRawAnalyzerComponentv3.h"
18 #include "AliHLTPHOSRawAnalyzer.h"
19 #include "AliHLTCaloChannelDataHeaderStruct.h"
20 #include "AliHLTPHOSDefinitions.h"
21 #include "AliHLTPHOSUtilities.h"
22 #include "AliHLTPHOSMapper.h"
26 AliHLTPHOSRawAnalyzerComponentv3::AliHLTPHOSRawAnalyzerComponentv3() :
27 AliHLTCaloRawAnalyzerComponentv3("PHOS")
30 // See header file for class documentation
31 InitMapping(0x1); //using 0x1 to avoid error message
34 AliHLTPHOSRawAnalyzerComponentv3::~AliHLTPHOSRawAnalyzerComponentv3()
41 AliHLTPHOSRawAnalyzerComponentv3::GetInputDataTypes( vector<AliHLTComponentDataType>& list)
45 list.push_back( AliHLTPHOSDefinitions::fgkDDLPackedRawDataType);
48 AliHLTComponentDataType
49 AliHLTPHOSRawAnalyzerComponentv3::GetOutputDataType()
52 return AliHLTPHOSDefinitions::fgkChannelDataType;
56 AliHLTPHOSRawAnalyzerComponentv3::GetOutputDataSize(unsigned long& constBase, double& inputMultiplier )
59 constBase = sizeof(AliHLTCaloChannelDataHeaderStruct);
60 inputMultiplier = 1.5;
64 AliHLTPHOSRawAnalyzerComponentv3::DoEvent( const AliHLTComponentEventData& evtData, const AliHLTComponentBlockData* blocks, AliHLTComponentTriggerData& /*trigData*/,
65 AliHLTUInt8_t* outputPtr, AliHLTUInt32_t& size, vector<AliHLTComponentBlockData>& outputBlocks )
71 const AliHLTComponentBlockData* iter = NULL;
74 for( ndx = 0; ndx < evtData.fBlockCnt; ndx++ )
77 if ( iter->fDataType != AliHLTPHOSDefinitions::fgkDDLPackedRawDataType )
79 HLTDebug("Data block is not of type fgkDDLPackedRawDataType");
82 if(iter->fSpecification != fCurrentSpec)
84 fCurrentSpec = iter->fSpecification;
85 InitMapping(iter->fSpecification);
87 blockSize = DoIt(iter, outputPtr, size, totSize); // Processing the block
89 if(blockSize == -1) // If the processing returns -1 we are out of buffer and return an error msg.
94 totSize += blockSize; //Keeping track of the used size
95 // HLTDebug("Output data size: %d - Input data size: %d", totSize, iter->fSize);
97 //Filling the block data
98 AliHLTComponentBlockData bdChannelData;
99 FillBlockData( bdChannelData );
100 bdChannelData.fOffset = 0; //FIXME
101 bdChannelData.fSize = blockSize;
102 bdChannelData.fDataType = AliHLTPHOSDefinitions::fgkChannelDataType;
103 bdChannelData.fSpecification = iter->fSpecification;
104 outputBlocks.push_back(bdChannelData);
106 outputPtr += blockSize; //Updating position of the output buffer
110 size = totSize; //telling the framework how much buffer space we have used.
116 void AliHLTPHOSRawAnalyzerComponentv3::InitMapping ( const int specification )
118 // See header file for class documentation
119 fMapperPtr = new AliHLTPHOSMapper;
120 fMapperPtr->InitDDLSpecificationMapping();
121 fMapperPtr->InitAltroMapping(specification);