]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - HLT/PHOS/AliHLTPHOSClusterAnalyserComponent.cxx
Effective C++
[u/mrichter/AliRoot.git] / HLT / PHOS / AliHLTPHOSClusterAnalyserComponent.cxx
index 613528aa9d7d318bea6a34f7353197961a6e0602..359126cc3f8f7441f3a510d38a4e6f4941d86396 100644 (file)
@@ -41,9 +41,10 @@ const AliHLTComponentDataType AliHLTPHOSClusterAnalyserComponent::fgkInputDataTy
 AliHLTPHOSClusterAnalyserComponent gAliHLTPHOSClusterAnalyserComponent;
 
 
-AliHLTPHOSClusterAnalyserComponent::AliHLTPHOSClusterAnalyserComponent(): 
-AliHLTPHOSProcessor(), 
-fClusterAnalyserPtr(0)
+AliHLTPHOSClusterAnalyserComponent::AliHLTPHOSClusterAnalyserComponent(): AliHLTPHOSProcessor(), 
+                                                                         fClusterAnalyserPtr(0),
+                                                                         fDoDeconvolution(0),
+                                                                         fDoCalculateMoments(0)
 {
   //See headerfile for documentation
 }
@@ -98,7 +99,7 @@ AliHLTPHOSClusterAnalyserComponent::GetOutputDataType()
 {
   //See headerfile for documentation
 
-  return AliHLTPHOSDefinitions::fgkAliHLTClusterDataType;
+  return AliHLTPHOSDefinitions::fgkClusterDataType;
 }
 
 void
@@ -129,9 +130,7 @@ AliHLTPHOSClusterAnalyserComponent::DoEvent(const AliHLTComponentEventData& evtD
   UInt_t tSize            = 0;
   UInt_t offset           = 0;
   UInt_t mysize           = 0;
-  Int_t nRecPoints        = 0;
-  Int_t nDigits           = 0;
-  Int_t j =0;
+  Int_t nClusters         = 0;
 
   AliHLTUInt8_t* outBPtr;
   outBPtr = outputPtr;
@@ -144,8 +143,8 @@ AliHLTPHOSClusterAnalyserComponent::DoEvent(const AliHLTComponentEventData& evtD
   fClusterAnalyserPtr->SetCaloClusterContainer((AliHLTPHOSCaloClusterContainerStruct*)outBPtr);
   for ( ndx = 0; ndx < evtData.fBlockCnt; ndx++ )
     {
-      iter = blocks+ndx;
-      if (iter->fDataType != AliHLTPHOSDefinitions::fgkAliHLTRecPointDataType)
+      iter = blocks+ndx; 
+      if (iter->fDataType != AliHLTPHOSDefinitions::fgkClusterDataType)
         {
           continue;
         }
@@ -161,15 +160,13 @@ AliHLTPHOSClusterAnalyserComponent::DoEvent(const AliHLTComponentEventData& evtD
        {
          fClusterAnalyserPtr->CalculateRecPointMoments();
        }
-      fClusterAnalyserPtr->CreateClusters();
-      
+      nClusters = fClusterAnalyserPtr->CreateClusters();
     }
 
-  mysize = 0;
+  mysize = 0; 
   offset = tSize;
-
   mysize += sizeof(AliHLTPHOSCaloClusterContainerStruct);
-  //cout << "Size of calo cluster container: " << mysize << endl;
+  
   AliHLTComponentBlockData bd;
   FillBlockData( bd );
   bd.fOffset = offset;
@@ -180,7 +177,7 @@ AliHLTPHOSClusterAnalyserComponent::DoEvent(const AliHLTComponentEventData& evtD
 
   tSize += mysize;
   outBPtr += mysize;
-
   if ( tSize > size )
     {
       Logging( kHLTLogFatal, "HLT::AliHLTPHOSClusterAnalyserComponent::DoEvent", "Too much data",
@@ -188,6 +185,15 @@ AliHLTPHOSClusterAnalyserComponent::DoEvent(const AliHLTComponentEventData& evtD
                , tSize, size );
       return EMSGSIZE;
     }
+
+  fPhosEventCount++; 
+  if(fPrintInfo == kTRUE)
+    {
+      if(fPhosEventCount%fPrintInfoFrequncy == 0)
+       {
+         cout << "Cluster analyser: # of clusters: " << nClusters << endl;
+       }  
+    }
   
   return 0;
 
@@ -196,9 +202,11 @@ AliHLTPHOSClusterAnalyserComponent::DoEvent(const AliHLTComponentEventData& evtD
 int
 AliHLTPHOSClusterAnalyserComponent::DoInit(int argc, const char** argv )
 {
+
   //See headerfile for documentation
   
   fClusterAnalyserPtr = new AliHLTPHOSClusterAnalyser();
+  ScanArguments(argc, argv);
   for (int i = 0; i < argc; i++)
     {
       if(!strcmp("-dodeconvolution", argv[i]))