]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
suppress ESD fill when TrackSeg input is missing (handling of special events)
authorrichterm <richterm@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 6 Aug 2008 00:53:51 +0000 (00:53 +0000)
committerrichterm <richterm@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 6 Aug 2008 00:53:51 +0000 (00:53 +0000)
HLT/TPCLib/AliHLTTPCEsdWriterComponent.cxx

index 5493d7ceffd89e43f299a1bca3b6c4b877487f3b..0a4ae783834c1cfe68a389d9a9286740ead02b29 100644 (file)
@@ -172,6 +172,7 @@ int AliHLTTPCEsdWriterComponent::ProcessBlocks(TTree* pTree, AliESDEvent* pESD,
 {
   // see header file for class documentation
   int iResult=0;
+  int iAddedDataBlocks=0;
   if (pESD && blocks) {
       pESD->Reset();
     
@@ -207,6 +208,7 @@ int AliHLTTPCEsdWriterComponent::ProcessBlocks(TTree* pTree, AliESDEvent* pESD,
            HLTDebug("reading block %d (slice %d): %d tracklets", ndx, minslice, inPtr->fTrackletCnt);
            if ((iResult=tracks.FillTracksChecked(inPtr->fTracklets, inPtr->fTrackletCnt, iter->fSize, minslice, 0/*don't rotate*/))>=0) {
              if ((iResult=Tracks2ESD(&tracks, pESD))>=0) {
+               iAddedDataBlocks++;
              }
            }
          } else {
@@ -215,13 +217,14 @@ int AliHLTTPCEsdWriterComponent::ProcessBlocks(TTree* pTree, AliESDEvent* pESD,
          }
        }
       }
-      if (iResult>=0 && pTree) {
+      if (iAddedDataBlocks>0 && pTree) {
        pTree->Fill();
       }
 
   } else {
     iResult=-EINVAL;
   }
+  if (iResult>=0) iResult=iAddedDataBlocks;
   return iResult;
 }
 
@@ -439,7 +442,7 @@ int AliHLTTPCEsdWriterComponent::AliConverter::DoEvent(const AliHLTComponentEven
       pESD->WriteToTree(pTree);
     }
 
-    if ((iResult=fBase->ProcessBlocks(pTree, pESD, blocks, (int)evtData.fBlockCnt))>=0) {
+    if ((iResult=fBase->ProcessBlocks(pTree, pESD, blocks, (int)evtData.fBlockCnt))>0) {
        // TODO: set the specification correctly
       if (pTree) {
        // the esd structure is written to the user info and is