]> git.uio.no Git - u/mrichter/AliRoot.git/blame - HLT/PHOS/AliHLTPHOSFileWriterComponent.cxx
Getting rid of trivial warnings.
[u/mrichter/AliRoot.git] / HLT / PHOS / AliHLTPHOSFileWriterComponent.cxx
CommitLineData
acd526ae 1/**************************************************************************
2 * Copyright(c) 2006, ALICE Experiment at CERN, All rights reserved. *
3 * *
4 * Author: Per Thomas Hille for the ALICE HLT 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
d504c864 16#include "AliHLTPHOSDefinitions.h"
acd526ae 17#include "AliHLTPHOSFileWriterComponent.h"
f4d27262 18#include <iostream>
f4d27262 19#include <TObjString.h>
f4d27262 20#include "AliRawReaderMemory.h"
21#include "AliCaloRawStream.h"
22#include <cstdlib>
45c8f2b2 23#include "AliRawReaderMemory.h"
24#include "AliCaloRawStream.h"
f4d27262 25#include "AliHLTPHOSRcuCellEnergyDataStruct.h"
26#include "AliHLTPHOSDataHeaderStruct.h"
27#include "AliHLTDataTypes.h"
d504c864 28#include "AliHLTPHOSDDLPackedFileWriter.h"
29#include "AliHLTPHOSCellEnergiesFileWriter.h"
f4d27262 30
31
d504c864 32const AliHLTComponentDataType AliHLTPHOSFileWriterComponent::fgkInputDataTypes[]={kAliHLTVoidDataType,{0,"",""}}; //'zero' terminated array
acd526ae 33
34
35AliHLTPHOSFileWriterComponent gAliHLTPHOSFileWriterComponent;
36
d504c864 37//____________________________________________________________________________________
05be0766 38AliHLTPHOSFileWriterComponent::AliHLTPHOSFileWriterComponent(): AliHLTFileWriter(), fCellEnergiesFileWriterPtr(0) \
ab38011b 39 , fDDLPackedFileWriterPtr(0), fDirectory(""),fFilename(""), fEvtCnt(0)
acd526ae 40{
d504c864 41 /*
42 *Default constructor
43 */
1804b020 44 for(unsigned int i=0; i<N_DATATYPES; i++)
f4d27262 45 {
46 fDataTypesToFile[i] = kAliHLTVoidDataType;
47 }
48
49 fCellEnergiesFileWriterPtr = new AliHLTPHOSCellEnergiesFileWriter();
50 fDDLPackedFileWriterPtr = new AliHLTPHOSDDLPackedFileWriter();
acd526ae 51
f4d27262 52}
acd526ae 53
d504c864 54//____________________________________________________________________________________
acd526ae 55AliHLTPHOSFileWriterComponent::~AliHLTPHOSFileWriterComponent()
56{
ab38011b 57 //comment
f4d27262 58 delete fCellEnergiesFileWriterPtr;
59 delete fDDLPackedFileWriterPtr;
60}
61
62
d504c864 63//____________________________________________________________________________________
05be0766 64AliHLTPHOSFileWriterComponent::AliHLTPHOSFileWriterComponent(const AliHLTPHOSFileWriterComponent & ): AliHLTFileWriter(), fCellEnergiesFileWriterPtr(0), \
ab38011b 65 fDDLPackedFileWriterPtr(0), fDirectory(""),fFilename(""), fEvtCnt(0)
f4d27262 66{
ab38011b 67 //comment
f4d27262 68}
acd526ae 69
d504c864 70
71//____________________________________________________________________________________
f4d27262 72int
73AliHLTPHOSFileWriterComponent::AddDataType(string dataType)
74{
ab38011b 75 //comment
f4d27262 76 int ret = -1;
77 int tmpCnt = 0;
1804b020 78 for(unsigned int i=0; i< N_DATATYPES; i++)
f4d27262 79 {
80 if( fDataTypesToFile[i] != kAliHLTVoidDataType)
81 {
82 tmpCnt ++;
83 }
84 }
85
86 string cmpString("gkCellEnergyDataType");
87
88 if(dataType.compare("gkCellEnergyDataType") == 0)
89 {
d504c864 90 fDataTypesToFile[tmpCnt] = AliHLTPHOSDefinitions::fgkCellEnergyDataType;
f4d27262 91 cout <<"regsitring dataType for filewriting: fDataTypesToFile[" << tmpCnt <<"]"<<endl;
92 }
93 else if(dataType.compare("gkDDLPackedRawDataType") == 0)
94 {
d504c864 95 fDataTypesToFile[tmpCnt] = AliHLTPHOSDefinitions::fgkDDLPackedRawDataType;
f4d27262 96 }
97
98 cout << "dataType.compare(cmpString) = " <<dataType.compare(cmpString)<<endl;
99 return ret;
100}
101
d504c864 102//____________________________________________________________________________________
f4d27262 103int
104AliHLTPHOSFileWriterComponent::Deinit()
105{
ab38011b 106 //comment
f4d27262 107 return 0;
108}
109
d504c864 110//____________________________________________________________________________________
f4d27262 111int
112AliHLTPHOSFileWriterComponent::DoDeinit()
113{
ab38011b 114 //comment
f4d27262 115 Logging(kHLTLogInfo, "HLT", "PHOS", ",AliHLTPHOSFileWriterComponen DoDeinit");
116 return 0;
acd526ae 117}
118
d504c864 119
120//____________________________________________________________________________________
acd526ae 121const char*
122AliHLTPHOSFileWriterComponent::GetComponentID()
123{
ab38011b 124 //comment
acd526ae 125 return "PhosFileWriter";
126}
127
d504c864 128
129//____________________________________________________________________________________
f4d27262 130AliHLTComponent*
131AliHLTPHOSFileWriterComponent::Spawn()
ab38011b 132{
133 //comment
acd526ae 134 return new AliHLTPHOSFileWriterComponent;
135}
136
f4d27262 137
d504c864 138//____________________________________________________________________________________
f4d27262 139void
140AliHLTPHOSFileWriterComponent::GetInputDataTypes( vector<AliHLTComponentDataType>& list)
141{
ab38011b 142 //comment
d504c864 143 const AliHLTComponentDataType* pType=fgkInputDataTypes;
f4d27262 144 while (pType->fID!=0) {
145 list.push_back(*pType);
146 pType++;
147 }
148}
149
d504c864 150//____________________________________________________________________________________
f4d27262 151AliHLTComponentDataType
152AliHLTPHOSFileWriterComponent::GetOutputDataType()
153{
ab38011b 154 //comment
d504c864 155 return AliHLTPHOSDefinitions::fgkCellEnergyDataType;
f4d27262 156}
157
d504c864 158//____________________________________________________________________________________
f4d27262 159void
160AliHLTPHOSFileWriterComponent::GetOutputDataSize(unsigned long& constBase, double& inputMultiplier )
161
162{
45c8f2b2 163 // see header file for documentation
f4d27262 164 constBase = 30;
165 inputMultiplier = 0.1;
166}
167
d504c864 168//____________________________________________________________________________________
f4d27262 169Bool_t
170AliHLTPHOSFileWriterComponent::IsRegisteredDataType(const AliHLTComponentDataType& dataType)
171{
45c8f2b2 172 // see header file for documentation
f4d27262 173 Bool_t tmp = kFALSE;
1804b020 174 for(unsigned int i =0; i<N_DATATYPES; i++)
f4d27262 175 {
176 if((fDataTypesToFile[i] == dataType) && (dataType != kAliHLTVoidDataType))
177 {
178 tmp = kTRUE;
179 }
180 }
181
182 return tmp;
183}