]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - HLT/PHOS/AliHLTPHOSDigitMakerComponent.cxx
- PHOS clusterizer component now inherits from CALO clusterizer component
[u/mrichter/AliRoot.git] / HLT / PHOS / AliHLTPHOSDigitMakerComponent.cxx
index 34a94113076109fb965112824b7d6acf1f0109d1..0712ab062182f443ac674ade2fbf151b509adec9 100644 (file)
  **************************************************************************/
 
 #include "AliHLTPHOSDigitMakerComponent.h"
-#include "AliHLTPHOSDigitMaker.h"
-#include "TTree.h"
-#include "AliHLTPHOSProcessor.h"
-#include "AliHLTPHOSRcuCellEnergyDataStruct.h"
-#include "AliHLTPHOSDigitDataStruct.h"
+#include "AliHLTCaloDigitMaker.h"
+#include "AliHLTCaloDigitDataStruct.h"
+#include "AliHLTPHOSMapper.h"
 #include "AliHLTPHOSChannelDataHeaderStruct.h"
 #include "AliHLTPHOSChannelDataStruct.h"
-#include "TClonesArray.h"
 #include "TFile.h"
 #include <sys/stat.h>
 #include <sys/types.h>
 
 
 /** 
- * @file   AliHLTPHOSDigitMakerComponent.cxx
+ * @file   AliHLTCaloDigitMakerComponent.cxx
  * @author Oystein Djuvsland
  * @date   
  * @brief  A digit maker component for PHOS HLT
 // visit http://web.ift.uib.no/~kjeks/doc/alice-hlt
 
 
-const AliHLTComponentDataType AliHLTPHOSDigitMakerComponent::fgkInputDataTypes[]={kAliHLTVoidDataType,{0,"",""}};
-
 AliHLTPHOSDigitMakerComponent gAliHLTPHOSDigitMakerComponent;
 
 AliHLTPHOSDigitMakerComponent::AliHLTPHOSDigitMakerComponent() :
   AliHLTPHOSProcessor(),
   fDigitMakerPtr(0),
   fDigitContainerPtr(0)
-  //  fEvtCnt(0)
 {
   //see header file for documentation
 }
@@ -88,12 +82,6 @@ AliHLTPHOSDigitMakerComponent::GetInputDataTypes(vector<AliHLTComponentDataType>
   //see header file for documentation
   list.clear();
   list.push_back(AliHLTPHOSDefinitions::fgkChannelDataType);
-
-//   const AliHLTComponentDataType* pType=fgkInputDataTypes;
-//   while (pType->fID!=0) {
-//     list.push_back(*pType); 
-//     pType++;
-//   }
 }
 
 AliHLTComponentDataType 
@@ -109,7 +97,7 @@ AliHLTPHOSDigitMakerComponent::GetOutputDataSize(unsigned long& constBase, doubl
 {
   //see header file for documentation
   constBase = 0;
-  inputMultiplier = (float)sizeof(AliHLTPHOSDigitDataStruct)/sizeof(AliHLTPHOSChannelDataStruct) + 1;
+  inputMultiplier = (float)sizeof(AliHLTCaloDigitDataStruct)/sizeof(AliHLTPHOSChannelDataStruct) + 1;
 }
 
 int 
@@ -129,9 +117,11 @@ AliHLTPHOSDigitMakerComponent::DoEvent(const AliHLTComponentEventData& evtData,
   unsigned long ndx; 
 
   UInt_t specification = 0;
-  AliHLTPHOSChannelDataHeaderStruct* tmpChannelData = 0;
+  AliHLTCaloChannelDataHeaderStruct* tmpChannelData = 0;
   
-  fDigitMakerPtr->SetDigitDataPtr(reinterpret_cast<AliHLTPHOSDigitDataStruct*>(outputPtr));
+  //  fDigitMakerPtr->SetDigitHeaderPtr(reinterpret_cast<AliHLTCaloDigitHeaderStruct*>(outputPtr));
+
+  fDigitMakerPtr->SetDigitDataPtr(reinterpret_cast<AliHLTCaloDigitDataStruct*>(outputPtr));
 
   for( ndx = 0; ndx < evtData.fBlockCnt; ndx++ )
     {
@@ -144,9 +134,9 @@ AliHLTPHOSDigitMakerComponent::DoEvent(const AliHLTComponentEventData& evtData,
        }
 
       specification |= iter->fSpecification;
-      tmpChannelData = reinterpret_cast<AliHLTPHOSChannelDataHeaderStruct*>(iter->fPtr);
+      tmpChannelData = reinterpret_cast<AliHLTCaloChannelDataHeaderStruct*>(iter->fPtr);
     
-      ret = fDigitMakerPtr->MakeDigits(tmpChannelData, size-(digitCount*sizeof(AliHLTPHOSDigitDataStruct)));
+      ret = fDigitMakerPtr->MakeDigits(tmpChannelData, size-(digitCount*sizeof(AliHLTCaloDigitDataStruct)));
       if(ret == -1) 
        {
          HLTError("Trying to write over buffer size");
@@ -155,11 +145,10 @@ AliHLTPHOSDigitMakerComponent::DoEvent(const AliHLTComponentEventData& evtData,
       digitCount += ret; 
     }
   
-  mysize += digitCount*sizeof(AliHLTPHOSDigitDataStruct);
+  mysize += digitCount*sizeof(AliHLTCaloDigitDataStruct);
 
   HLTDebug("# of digits: %d, used memory size: %d, available size: %d", digitCount, mysize, size);
 
-
   if(mysize > 0) 
     {
       AliHLTComponentBlockData bd;
@@ -170,6 +159,7 @@ AliHLTPHOSDigitMakerComponent::DoEvent(const AliHLTComponentEventData& evtData,
       bd.fSpecification = specification;
       outputBlocks.push_back(bd);
     }
+
   fDigitMakerPtr->Reset();
 
   size = mysize; 
@@ -183,7 +173,10 @@ AliHLTPHOSDigitMakerComponent::DoInit(int argc, const char** argv )
 {
   //see header file for documentation
 
-  fDigitMakerPtr = new AliHLTPHOSDigitMaker();
+  fDigitMakerPtr = new AliHLTCaloDigitMaker("PHOS");
+
+  AliHLTCaloMapper *mapper = new AliHLTPHOSMapper();
+  fDigitMakerPtr->SetMapper(mapper);
   
   for(int i = 0; i < argc; i++)
     {
@@ -195,10 +188,6 @@ AliHLTPHOSDigitMakerComponent::DoInit(int argc, const char** argv )
        {
          fDigitMakerPtr->SetGlobalHighGainFactor(atof(argv[i+1]));
        }
-      if(!strcmp("-reverseorder", argv[i]))
-       {
-         fDigitMakerPtr->SetOrdered(false);
-       }
     }
  
   //fDigitMakerPtr->SetDigitThreshold(2);