]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - HLT/VZERO/AliHLTVZERORecoComponent.cxx
Corrected assignment operator
[u/mrichter/AliRoot.git] / HLT / VZERO / AliHLTVZERORecoComponent.cxx
index 1d1387a12959ed27ed73e0480b9ff0e851af6bfe..eacd83ab612e54025c2a790932efe1abcf6504b0 100644 (file)
@@ -28,11 +28,13 @@ using namespace std;
 #include "TTree.h"
 #include "TMap.h"
 #include "TObjString.h"
+#include "TDatime.h"
 
 #include "AliLog.h"
 #include "AliRunInfo.h"
 #include "AliGRPObject.h"
 #include "AliRawReaderMemory.h"
+#include "AliGeomManager.h"
 
 #include "AliVZERORecoParam.h"
 #include "AliVZEROReconstructor.h"
@@ -53,8 +55,7 @@ ClassImp(AliHLTVZERORecoComponent)
 // #################################################################################
 AliHLTVZERORecoComponent::AliHLTVZERORecoComponent() :
   AliHLTProcessor(),
-  fRunInfo(NULL),
-  fDigitsTree(NULL),
+  fRunInfo(NULL),  
   fVZERORecoParam(NULL),
   fVZEROReconstructor(NULL),
   fRawReader(NULL) {
@@ -154,6 +155,11 @@ Int_t AliHLTVZERORecoComponent::DoInit( Int_t argc, const Char_t** argv ) {
 
   Int_t iResult=0;
 
+  // -- Load GeomManager
+  if(AliGeomManager::GetGeometry()==NULL){
+    AliGeomManager::LoadGeometry();
+  }
+  
   // -- Read configuration object : HLT/ConfigVZERO/VZEROReconstruction
   TString cdbPath="HLT/ConfigVZERO/";
   cdbPath+=GetComponentID();
@@ -206,12 +212,6 @@ Int_t AliHLTVZERORecoComponent::DoInit( Int_t argc, const Char_t** argv ) {
       break;
     }
 
-    fDigitsTree = new TTree("D", "Digits Tree");
-    if (!fDigitsTree) {
-      iResult=-ENOMEM;
-      break;
-    }
-
     fVZERORecoParam = new AliVZERORecoParam;
     if (!fVZERORecoParam) {
       iResult=-ENOMEM;
@@ -234,10 +234,6 @@ Int_t AliHLTVZERORecoComponent::DoInit( Int_t argc, const Char_t** argv ) {
       delete fRawReader;
     fRawReader = NULL;
 
-    if (!fDigitsTree)
-      delete fDigitsTree;
-    fDigitsTree = NULL;
-
     if (fVZERORecoParam)
       delete fVZERORecoParam;
     fVZERORecoParam = NULL;
@@ -287,10 +283,6 @@ Int_t AliHLTVZERORecoComponent::DoDeinit() {
     delete fRawReader;
   fRawReader = NULL;
   
-  if (!fDigitsTree)
-    delete fDigitsTree;
-  fDigitsTree = NULL;
-    
   if (fVZERORecoParam)
     delete fVZERORecoParam;
   fVZERORecoParam = NULL;
@@ -320,8 +312,8 @@ Int_t AliHLTVZERORecoComponent::DoEvent(const AliHLTComponentEventData& /*evtDat
   // -- Get VZERO raw dat a input block and set up the rawreader
   const AliHLTComponentBlockData* pBlock = GetFirstInputBlock(kAliHLTDataTypeDDLRaw|kAliHLTDataOriginVZERO);
   if (!pBlock) {
-    HLTError("No VZERO input block !!!");
-    return -1;
+    HLTInfo("No VZERO input block !!!");
+    return 0;
   }
   
   // -- Add input block to raw reader
@@ -331,24 +323,38 @@ Int_t AliHLTVZERORecoComponent::DoEvent(const AliHLTComponentEventData& /*evtDat
     iResult = -1;
   }
   
+  TTree *digitsTree = new TTree("D", "Digits Tree");
+  if (!digitsTree) {
+    iResult=-ENOMEM;
+  }
+
   if (iResult >= 0) {
 
     // -- Set VZERO EquipmentID
     fRawReader->SetEquipmentID(3584);
   
     // -- 1. step VZERO reconstruction
-    fVZEROReconstructor->ConvertDigits(fRawReader, fDigitsTree);
+    fVZEROReconstructor->ConvertDigits(fRawReader, digitsTree);
 
     // -- 2. step VZERO reconstruction -- fill AliESDVZERO object
-    fVZEROReconstructor->FillESD(fDigitsTree, NULL, NULL);
+    fVZEROReconstructor->FillESD(digitsTree, NULL, NULL);
+
+    AliESDVZERO *esdVZERO = fVZEROReconstructor->GetESDVZERO();
+    
+    // Send info every 10 s
+    const TDatime time;    
+    static UInt_t lastTime=0;
+    if (time.Get()-lastTime>10) {
+      lastTime=time.Get();
+      HLTInfo("VZERO Multiplicity A %f - C %f", esdVZERO->GetMTotV0A(), esdVZERO->GetMTotV0A() );
+    }
 
     // -- Send AliESDVZERO
-    PushBack(static_cast<TObject*>(fVZEROReconstructor->GetESDVZERO()),
-            kAliHLTDataTypeESDContent|kAliHLTDataOriginVZERO,0);
+    PushBack(esdVZERO, kAliHLTDataTypeESDContent|kAliHLTDataOriginVZERO,0);
   }
   
   // -- Clean up
-  fDigitsTree->Reset();
+  delete digitsTree;
   fRawReader->ClearBuffers();   
 
   return iResult;