1 /**************************************************************************
2 * Copyright(c) 2006, ALICE Experiment at CERN, All rights reserved. *
4 * Author: Per Thomas Hille for the ALICE HLT Project. *
5 * Contributors are mentioned in the code where appropriate. *
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 **************************************************************************/
16 //#include "AliHLTPHOSModuleMergerComponent.h"
18 #include "AliHLTPHOSModuleMergerComponent.h"
22 #include "AliRawReaderMemory.h"
23 #include "AliCaloRawStream.h"
27 //#include "AliHLTTPCDefinitions.h"
29 const AliHLTComponentDataType AliHLTPHOSModuleMergerComponent::inputDataTypes[]={kAliHLTVoidDataType,{0,"",""}}; //'zero' terminated array
30 const AliHLTComponentDataType AliHLTPHOSModuleMergerComponent::outputDataType=kAliHLTVoidDataType;
33 // AliHLTPHOSModuleMergerComponent g AliHLTPHOSModuleMergerComponent;
34 //ClassImp( AliHLTPHOSModuleMergerComponent)
35 AliHLTPHOSModuleMergerComponent:: AliHLTPHOSModuleMergerComponent():AliHLTProcessor(), fEventCount(0), fEquippmentId(0)
40 AliHLTPHOSModuleMergerComponent::~ AliHLTPHOSModuleMergerComponent()
45 AliHLTPHOSModuleMergerComponent:: AliHLTPHOSModuleMergerComponent(const AliHLTPHOSModuleMergerComponent & ) : AliHLTProcessor(), fEventCount(0), fEquippmentId(0)
52 AliHLTPHOSModuleMergerComponent::Deinit()
58 AliHLTPHOSModuleMergerComponent::DoDeinit()
60 Logging(kHLTLogInfo, "HLT", "PHOS", ",AliHLTPHOSModuleMerger DoDeinit");
66 AliHLTPHOSModuleMergerComponent::GetComponentID()
68 return "ModuleMerger";
72 AliHLTPHOSModuleMergerComponent::GetInputDataTypes( vector<AliHLTComponentDataType>& list)
74 const AliHLTComponentDataType* pType=inputDataTypes;
75 while (pType->fID!=0) {
76 list.push_back(*pType);
81 AliHLTComponentDataType
82 AliHLTPHOSModuleMergerComponent::GetOutputDataType()
84 return outputDataType;
88 AliHLTPHOSModuleMergerComponent::GetOutputDataSize(unsigned long& constBase, double& inputMultiplier )
92 inputMultiplier = 0.1;
96 int AliHLTPHOSModuleMergerComponent::DoEvent( const AliHLTComponentEventData& evtData, const AliHLTComponentBlockData* blocks,
97 AliHLTComponentTriggerData& trigData, AliHLTUInt8_t* outputPtr,
98 AliHLTUInt32_t& size, vector<AliHLTComponentBlockData>& outputBlocks )
109 AliHLTPHOSModuleMergerComponent::DoInit( int argc, const char** argv )
111 cout << "DOINIT argc =" << argc << endl;
112 cout << "DOINIT argv[0] =" << argv[0] << endl;
113 cout << "DOINIT argv[1] =" << argv[1] << endl;
114 cout << "DOINIT argv[2] =" << argv[2] << endl;
115 cout << "DOINIT argv[3] =" << argv[3] << endl;
116 cout << "DOINIT argv[4] =" << argv[4] << endl;
117 cout << "DOINIT argv[5] =" << argv[5] << endl;
118 cout << "DOINIT argv[6] =" << argv[6] << endl;
120 int equippmentId = atoi(argv[6]);
121 cout << "The equipment ID was set to " <<equippmentId << endl;
125 cout << " AliHLTPHOSModuleMergerComponent::DoInit Creating new AliRawReaderMemory()" << endl;
128 cout <<" AliHLTPHOSModuleMergerComponent::DoIni DONE!" << endl;
129 if (argc==0 && argv==NULL) {
130 // this is currently just to get rid of the warning "unused parameter"
136 AliHLTPHOSModuleMergerComponent::DumpData()
138 for(int mod = 0; mod <5; mod ++)
140 printf("\n *********** MODULE %d ************\n", mod);
141 for(int row = 0; row < 64; row ++)
143 for(int col = 0; col < 56; col ++)
145 if( fMaxValues[mod][row][col][0] != 0)
147 cout << fMaxValues[mod][row][col][0] << "\t";
156 AliHLTPHOSModuleMergerComponent::Reset()
158 for(int mod = 0; mod <5; mod ++)
160 for(int row = 0; row < 64; row ++)
162 for(int col = 0; col < 56; col ++)
164 for(int gain = 0; gain <2; gain ++ )
166 fMaxValues[mod][row][col][gain] = 0;
172 for(int i = 0 ; i< 1008; i++)
174 fTmpChannelData[i] = 0;
179 AliHLTPHOSModuleMergerComponent::ResetDataPtr()
181 for(int i = 0 ; i< 1008; i++)
183 fTmpChannelData[i] = 0;
189 AliHLTPHOSModuleMergerComponent::SetEquippmentId(int id)
195 AliHLTPHOSModuleMergerComponent::GetEquippmentId()
197 return fEquippmentId;