]> git.uio.no Git - u/mrichter/AliRoot.git/blob - HLT/PHOS/AliHLTPHOSRawAnalyzerComponentv3.cxx
- removing obsolote classes
[u/mrichter/AliRoot.git] / HLT / PHOS / AliHLTPHOSRawAnalyzerComponentv3.cxx
1
2 /**************************************************************************
3  * This file is property of and copyright by the ALICE HLT Project        * 
4  * All rights reserved.                                                   *
5  *                                                                        *
6  * Primary Authors: Per Thomas Hille, Oystein Djuvsland                   *
7  *                                                                        *
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  **************************************************************************/
16
17 #include "AliHLTPHOSRawAnalyzerComponentv3.h"
18 #include "AliHLTPHOSRawAnalyzer.h"
19 #include "AliHLTCaloChannelDataHeaderStruct.h"
20 #include "AliHLTPHOSDefinitions.h"
21 #include "AliHLTPHOSUtilities.h"
22 #include "AliHLTPHOSMapper.h"
23 #include "AliLog.h"
24
25
26 AliHLTPHOSRawAnalyzerComponentv3::AliHLTPHOSRawAnalyzerComponentv3() :
27    AliHLTCaloRawAnalyzerComponentv3("PHOS")
28    ,fCurrentSpec(-1)
29 {
30    // See header file for class documentation
31    InitMapping(0x1); //using 0x1 to avoid error message
32 }
33
34 AliHLTPHOSRawAnalyzerComponentv3::~AliHLTPHOSRawAnalyzerComponentv3()
35 {
36   //comment
37 }
38
39
40 void
41 AliHLTPHOSRawAnalyzerComponentv3::GetInputDataTypes( vector<AliHLTComponentDataType>& list)
42 {
43   //comment
44   list.clear();
45   list.push_back( AliHLTPHOSDefinitions::fgkDDLPackedRawDataType);
46 }
47
48 AliHLTComponentDataType 
49 AliHLTPHOSRawAnalyzerComponentv3::GetOutputDataType()
50 {
51   //comment
52   return AliHLTPHOSDefinitions::fgkChannelDataType;
53 }
54
55 void
56 AliHLTPHOSRawAnalyzerComponentv3::GetOutputDataSize(unsigned long& constBase, double& inputMultiplier )
57 {
58   //comment
59   constBase = sizeof(AliHLTCaloChannelDataHeaderStruct);
60   inputMultiplier = 1.5;
61 }
62
63 int 
64 AliHLTPHOSRawAnalyzerComponentv3::DoEvent( const AliHLTComponentEventData& evtData, const AliHLTComponentBlockData* blocks, AliHLTComponentTriggerData& /*trigData*/, 
65                                          AliHLTUInt8_t* outputPtr, AliHLTUInt32_t& size, vector<AliHLTComponentBlockData>& outputBlocks )
66 {
67   //comment
68   Int_t blockSize          = 0;
69   UInt_t totSize           = 0;
70
71   const AliHLTComponentBlockData* iter = NULL; 
72   unsigned long ndx;
73
74   for( ndx = 0; ndx < evtData.fBlockCnt; ndx++ )
75     {
76       iter = blocks+ndx;
77       if ( iter->fDataType != AliHLTPHOSDefinitions::fgkDDLPackedRawDataType  )
78         {
79           HLTDebug("Data block is not of type fgkDDLPackedRawDataType");
80           continue; 
81         }
82       if(iter->fSpecification != fCurrentSpec)
83       {
84          fCurrentSpec = iter->fSpecification;
85          InitMapping(iter->fSpecification);
86       }
87       blockSize = DoIt(iter, outputPtr, size, totSize); // Processing the block
88
89       if(blockSize == -1) // If the processing returns -1 we are out of buffer and return an error msg.
90         {
91           return -ENOBUFS;
92         }
93
94       totSize += blockSize; //Keeping track of the used size
95       // HLTDebug("Output data size: %d - Input data size: %d", totSize, iter->fSize);
96
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);
105
106       outputPtr += blockSize; //Updating position of the output buffer
107     }
108
109   fCaloEventCount++; 
110   size = totSize; //telling the framework how much buffer space we have used.
111   
112   return 0;
113 }//end DoEvent
114
115
116 void AliHLTPHOSRawAnalyzerComponentv3::InitMapping ( const int specification )
117 {
118    // See header file for class documentation
119    fMapperPtr = new AliHLTPHOSMapper;
120    fMapperPtr->InitDDLSpecificationMapping();
121    fMapperPtr->InitAltroMapping(specification);
122
123 }
124