Modified files to use constants declared in the
[u/mrichter/AliRoot.git] / HLT / PHOS / AliHLTPHOSModuleMergerComponent.cxx
index d388bc48d6097d6c863a1146f033f799a480badf..8db4e3830627fe7cb23da9d10eede897ddc94c95 100644 (file)
  * provided "as is" without express or implied warranty.                  *
  **************************************************************************/
 
+
+
 #include "AliHLTPHOSModuleMergerComponent.h"
-#include <iostream>
-#include "stdio.h"
 #include "AliRawReaderMemory.h"
 #include "AliCaloRawStream.h"
-#include <cstdlib>
+#include <cstdio>
 #include "AliHLTPHOSRcuCellEnergyDataStruct.h"
 
 
-const AliHLTComponentDataType  AliHLTPHOSModuleMergerComponent::inputDataTypes[]={kAliHLTVoidDataType,{0,"",""}}; //'zero' terminated array
-const AliHLTComponentDataType  AliHLTPHOSModuleMergerComponent::outputDataType=kAliHLTVoidDataType;
-
+const AliHLTComponentDataType  AliHLTPHOSModuleMergerComponent::fgkInputDataTypes[]={kAliHLTVoidDataType,{0,"",""}}; //'zero' terminated array
+const AliHLTComponentDataType  AliHLTPHOSModuleMergerComponent::fgkOutputDataType=kAliHLTVoidDataType;
 
 AliHLTPHOSModuleMergerComponent gAliHLTPHOSModuleMergerComponent;
-AliHLTPHOSModuleMergerComponent:: AliHLTPHOSModuleMergerComponent():AliHLTProcessor(),  fEventCount(0),  fEquippmentID(0)
+
+//_____________________________________________________________________________________________________
+AliHLTPHOSModuleMergerComponent:: AliHLTPHOSModuleMergerComponent():AliHLTPHOSProcessor(),  fPhosEventCount(0),  fEquippmentID(0)
 {
 
 } 
 
 
+//_____________________________________________________________________________________________________
 AliHLTPHOSModuleMergerComponent::~ AliHLTPHOSModuleMergerComponent()
 {
 
 }
 
 
-AliHLTPHOSModuleMergerComponent::AliHLTPHOSModuleMergerComponent(const  AliHLTPHOSModuleMergerComponent & ) : AliHLTProcessor(),  fEventCount(0),  fEquippmentID(0)
+//_____________________________________________________________________________________________________
+AliHLTPHOSModuleMergerComponent::AliHLTPHOSModuleMergerComponent(const  AliHLTPHOSModuleMergerComponent & ) : AliHLTPHOSProcessor(),  fPhosEventCount(0),  fEquippmentID(0)
 {
 
 }
 
 
+//_____________________________________________________________________________________________________
 int 
 AliHLTPHOSModuleMergerComponent::Deinit()
 {
@@ -52,6 +56,7 @@ AliHLTPHOSModuleMergerComponent::Deinit()
 }
 
 
+//_____________________________________________________________________________________________________
 int 
 AliHLTPHOSModuleMergerComponent::DoDeinit()
 {
@@ -61,6 +66,7 @@ AliHLTPHOSModuleMergerComponent::DoDeinit()
 }
 
 
+//_____________________________________________________________________________________________________
 const char* 
 AliHLTPHOSModuleMergerComponent::GetComponentID()
 {
@@ -68,10 +74,11 @@ AliHLTPHOSModuleMergerComponent::GetComponentID()
 }
 
 
+//_____________________________________________________________________________________________________
 void
- AliHLTPHOSModuleMergerComponent::GetInputDataTypes( vector<AliHLTComponentDataType>& list)
+AliHLTPHOSModuleMergerComponent::GetInputDataTypes( vector<AliHLTComponentDataType>& list)
 {
-  const AliHLTComponentDataType* pType=inputDataTypes;
+  const AliHLTComponentDataType* pType=fgkInputDataTypes;
   while (pType->fID!=0) 
     {
       list.push_back(*pType);
@@ -80,16 +87,19 @@ void
 }
 
 
+//_____________________________________________________________________________________________________
 AliHLTComponentDataType 
 AliHLTPHOSModuleMergerComponent::GetOutputDataType()
 {
-  return AliHLTPHOSDefinitions::gkCellEnergyDataType;
+  return AliHLTPHOSDefinitions::fgkCellEnergyDataType;
 }
 
 
+//_____________________________________________________________________________________________________
 void
 AliHLTPHOSModuleMergerComponent::GetOutputDataSize(unsigned long& constBase, double& inputMultiplier )
 {
+  ///
   constBase = 30;
   inputMultiplier = 1;
 }
@@ -99,6 +109,7 @@ int  AliHLTPHOSModuleMergerComponent::DoEvent( const AliHLTComponentEventData& e
                                              AliHLTComponentTriggerData& trigData, AliHLTUInt8_t* outputPtr, 
                                              AliHLTUInt32_t& size, vector<AliHLTComponentBlockData>& outputBlocks )
 {
+  //Merging of data from 4 RCUS to one module
   
   unsigned long ndx;
   const AliHLTComponentBlockData* iter = NULL;   
@@ -123,27 +134,27 @@ int  AliHLTPHOSModuleMergerComponent::DoEvent( const AliHLTComponentEventData& e
          if(cellDataPtr->fValidData[i].fGain == HIGH_GAIN)
            {
              fMaxValues[tmpModuleID][ cellDataPtr->fValidData[i].fZ +  N_ZROWS_RCU*tmpRcuZ][ cellDataPtr->fValidData[i].fX + N_XCOLUMNS_RCU*tmpRcuX][HIGH_GAIN] =  cellDataPtr->fValidData[i].fEnergy;
-             //   fMaxValues[0][0][0][0] = 0;
            }
          else if(cellDataPtr->fValidData[i].fGain == LOW_GAIN)
            {
-                  fMaxValues[tmpModuleID][ cellDataPtr->fValidData[i].fZ +  N_ROWS_RCU*tmpRcuZ][ cellDataPtr->fValidData[i].fX +N_COLUMNS_RCU*tmpRcuX][LOW_GAIN] =  cellDataPtr->fValidData[i].fEnergy;
-             //    fMaxValues[0][0][0][0]=0;
+             fMaxValues[tmpModuleID][ cellDataPtr->fValidData[i].fZ +  N_ROWS_RCU*tmpRcuZ][ cellDataPtr->fValidData[i].fX +N_COLUMNS_RCU*tmpRcuX][LOW_GAIN] =  cellDataPtr->fValidData[i].fEnergy;
            }
        }
       
     }
 
   DumpData(1);
-  fEventCount++; 
+  fPhosEventCount++; 
   return 0;
   
 }//end DoEvent
 
 
+//_____________________________________________________________________________________________________
 int
 AliHLTPHOSModuleMergerComponent::DoInit( int argc, const char** argv )
 {
+  //See base classs for documenation
   Reset();
 
   if (argc==0 && argv==NULL) {
@@ -153,10 +164,10 @@ AliHLTPHOSModuleMergerComponent::DoInit( int argc, const char** argv )
 }
 
 
+//_____________________________________________________________________________________________________
 void
 AliHLTPHOSModuleMergerComponent::DumpData(int gain)
 {
-
   if(gain < 0 || gain >  N_GAINS)
     {
       cout <<"AliHLTPHOSModuleMergerComponent::DumpDat: Error, gain must be between " << 0 << "and" << N_GAINS << endl;
@@ -188,6 +199,7 @@ AliHLTPHOSModuleMergerComponent::DumpData(int gain)
 
 
 
+//_____________________________________________________________________________________________________
 void
 AliHLTPHOSModuleMergerComponent::Reset()
 {
@@ -212,6 +224,8 @@ AliHLTPHOSModuleMergerComponent::Reset()
     }
 } // end Reset
 
+
+//_____________________________________________________________________________________________________
 void
 AliHLTPHOSModuleMergerComponent::ResetDataPtr()
 {
@@ -222,19 +236,23 @@ AliHLTPHOSModuleMergerComponent::ResetDataPtr()
 }
 
 
+//_____________________________________________________________________________________________________
 void 
 AliHLTPHOSModuleMergerComponent::SetEquippmentId(int id)
 {
   fEquippmentID = id;
 }
 
-int 
-AliHLTPHOSModuleMergerComponent::GetEquippmentId()
+
+//_____________________________________________________________________________________________________
+const int 
+AliHLTPHOSModuleMergerComponent::GetEquippmentId() const
 {
   return  fEquippmentID;
 }
 
 
+//_____________________________________________________________________________________________________
 AliHLTComponent*
 AliHLTPHOSModuleMergerComponent::Spawn()
 {