]> git.uio.no Git - u/mrichter/AliRoot.git/blob - HLT/PHOS/AliHLTPHOSModuleMergerComponent.cxx
93fe1e051adeb9d8046946359c80c3021d2cf30c
[u/mrichter/AliRoot.git] / HLT / PHOS / AliHLTPHOSModuleMergerComponent.cxx
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
16 //#include "AliHLTPHOSModuleMergerComponent.h"
17
18 #include "AliHLTPHOSModuleMergerComponent.h"
19 #include <iostream>
20 #include "stdio.h"
21
22 #include "AliRawReaderMemory.h"
23 #include "AliCaloRawStream.h"
24 #include <cstdlib>
25 //#include "TH2.h"
26
27 //#include "AliHLTTPCDefinitions.h"
28
29 const AliHLTComponentDataType  AliHLTPHOSModuleMergerComponent::inputDataTypes[]={kAliHLTVoidDataType,{0,"",""}}; //'zero' terminated array
30 const AliHLTComponentDataType  AliHLTPHOSModuleMergerComponent::outputDataType=kAliHLTVoidDataType;
31
32
33 // AliHLTPHOSModuleMergerComponent g AliHLTPHOSModuleMergerComponent;
34 //ClassImp( AliHLTPHOSModuleMergerComponent) 
35 AliHLTPHOSModuleMergerComponent:: AliHLTPHOSModuleMergerComponent():AliHLTProcessor(),  fEventCount(0),  fEquippmentId(0)
36 {
37
38
39
40 AliHLTPHOSModuleMergerComponent::~ AliHLTPHOSModuleMergerComponent()
41 {
42
43 }
44
45 AliHLTPHOSModuleMergerComponent:: AliHLTPHOSModuleMergerComponent(const  AliHLTPHOSModuleMergerComponent & ) : AliHLTProcessor(),  fEventCount(0),  fEquippmentId(0)
46 {
47
48 }
49
50
51 int 
52 AliHLTPHOSModuleMergerComponent::Deinit()
53 {
54   return 0;
55 }
56
57 int 
58 AliHLTPHOSModuleMergerComponent::DoDeinit()
59 {
60   Logging(kHLTLogInfo, "HLT", "PHOS", ",AliHLTPHOSModuleMerger DoDeinit");
61   return 0;
62
63 }
64
65 const char* 
66  AliHLTPHOSModuleMergerComponent::GetComponentID()
67 {
68   return "ModuleMerger";
69 }
70
71 void
72  AliHLTPHOSModuleMergerComponent::GetInputDataTypes( vector<AliHLTComponentDataType>& list)
73 {
74   const AliHLTComponentDataType* pType=inputDataTypes;
75   while (pType->fID!=0) {
76     list.push_back(*pType);
77     pType++;
78   }
79 }
80
81 AliHLTComponentDataType 
82  AliHLTPHOSModuleMergerComponent::GetOutputDataType()
83 {
84   return outputDataType;
85 }
86
87 void
88  AliHLTPHOSModuleMergerComponent::GetOutputDataSize(unsigned long& constBase, double& inputMultiplier )
89
90 {
91   constBase = 30;
92   inputMultiplier = 0.1;
93 }
94
95
96 int  AliHLTPHOSModuleMergerComponent::DoEvent( const AliHLTComponentEventData& evtData, const AliHLTComponentBlockData* blocks, 
97                                               AliHLTComponentTriggerData& trigData, AliHLTUInt8_t* outputPtr, 
98                                               AliHLTUInt32_t& size, vector<AliHLTComponentBlockData>& outputBlocks )
99 {
100
101
102   fEventCount++; 
103   return 0;
104 }//end DoEvent
105
106
107
108 int
109  AliHLTPHOSModuleMergerComponent::DoInit( int argc, const char** argv )
110 {
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;
119  
120   int equippmentId = atoi(argv[6]);
121   cout << "The equipment ID was set to " <<equippmentId << endl;
122   
123
124   Reset();
125   cout << " AliHLTPHOSModuleMergerComponent::DoInit Creating new  AliRawReaderMemory()" << endl; 
126
127
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"
131   }
132   return 0;
133 }
134
135 void
136  AliHLTPHOSModuleMergerComponent::DumpData()
137 {
138   for(int mod = 0; mod <5; mod ++)
139     {
140       printf("\n ***********  MODULE %d ************\n", mod);
141       for(int row = 0; row < 64; row ++)
142         {
143           for(int col = 0; col < 56; col ++)
144             {
145               if( fMaxValues[mod][row][col][0] != 0)
146                 { 
147                   cout << fMaxValues[mod][row][col][0] << "\t";
148                 }
149             }
150         } 
151     }
152 }
153
154
155 void
156  AliHLTPHOSModuleMergerComponent::Reset()
157 {
158   for(int mod = 0; mod <5; mod ++)
159     {
160       for(int row = 0; row < 64; row ++)
161         {
162           for(int col = 0; col < 56; col ++)
163             {
164               for(int gain = 0; gain <2; gain ++ )
165                 {
166                   fMaxValues[mod][row][col][gain] = 0;
167                 }
168             }
169         }
170     }
171
172   for(int i = 0 ; i< 1008; i++)
173     {
174       fTmpChannelData[i] = 0;
175     }
176 } // end Reset
177
178 void
179  AliHLTPHOSModuleMergerComponent::ResetDataPtr()
180 {
181   for(int i = 0 ; i< 1008; i++)
182     {
183       fTmpChannelData[i] = 0;
184     }
185 }
186
187
188 void 
189  AliHLTPHOSModuleMergerComponent::SetEquippmentId(int id)
190 {
191   fEquippmentId = id;
192 }
193
194 int 
195 AliHLTPHOSModuleMergerComponent::GetEquippmentId()
196 {
197   return  fEquippmentId;
198 }