LCOV - code coverage report
Current view: top level - HLT/BASE/util - AliHLTAgentUtil.cxx (source / functions) Hit Total Coverage
Test: coverage.info Lines: 34 74 45.9 %
Date: 2016-06-14 17:26:59 Functions: 7 16 43.8 %

          Line data    Source code
       1             : // $Id$
       2             : 
       3             : /**************************************************************************
       4             :  * This file is property of and copyright by the ALICE HLT Project        * 
       5             :  * ALICE Experiment at CERN, All rights reserved.                         *
       6             :  *                                                                        *
       7             :  * Primary Authors: Matthias Richter <Matthias.Richter@ift.uib.no>        *
       8             :  *                  for The ALICE HLT Project.                            *
       9             :  *                                                                        *
      10             :  * Permission to use, copy, modify and distribute this software and its   *
      11             :  * documentation strictly for non-commercial purposes is hereby granted   *
      12             :  * without fee, provided that the above copyright notice appears in all   *
      13             :  * copies and that both the copyright notice and this permission notice   *
      14             :  * appear in the supporting documentation. The authors make no claims     *
      15             :  * about the suitability of this software for any purpose. It is          *
      16             :  * provided "as is" without express or implied warranty.                  *
      17             :  **************************************************************************/
      18             : 
      19             : /** @file   AliHLTAgentUtil.cxx
      20             :     @author Matthias Richter
      21             :     @date   
      22             :     @brief  Agent of the libAliHLTUtil library
      23             : */
      24             : 
      25             : #include <cassert>
      26             : #include "AliHLTAgentUtil.h"
      27             : #include "AliHLTOUTHandlerChain.h"
      28             : 
      29             : // header files of library components
      30             : #include "AliHLTDataGenerator.h"
      31             : #include "AliHLTRawReaderPublisherComponent.h"
      32             : #include "AliHLTLoaderPublisherComponent.h"
      33             : #include "AliHLTRootFileStreamerComponent.h"
      34             : #include "AliHLTRootFileWriterComponent.h"
      35             : #include "AliHLTRootFilePublisherComponent.h"
      36             : #include "AliHLTRootSchemaEvolutionComponent.h"
      37             : #include "AliHLTRecoParamComponent.h"
      38             : //#include "AliHLTMCGeneratorComponent.h"
      39             : #include "AliHLTESDMCEventPublisherComponent.h"
      40             : #include "AliHLTFileWriter.h"
      41             : #include "AliHLTFXSFileWriter.h"
      42             : #include "AliHLTFXSWriterComponent.h"
      43             : #include "AliHLTFilePublisher.h"
      44             : #include "AliHLTBlockFilterComponent.h"
      45             : #include "AliHLTMonitoringRelay.h"
      46             : #include "AliHLTEsdCollectorComponent.h"
      47             : #include "AliHLTReadoutListDumpComponent.h"
      48             : #include "AliHLTOUTPublisherComponent.h"
      49             : #include "AliHLTCompStatCollector.h"
      50             : #include "AliHLTCorruptorComponent.h"
      51             : #include "AliHLTObjectCompressionComponent.h"
      52             : 
      53             : /** global instance for agent registration */
      54           8 : AliHLTAgentUtil gAliHLTAgentUtil;
      55             : 
      56             : /** ROOT macro for the implementation of ROOT specific class methods */
      57           8 : ClassImp(AliHLTAgentUtil)
      58             : 
      59             : AliHLTAgentUtil::AliHLTAgentUtil()
      60           4 :   : AliHLTModuleAgent("Util")
      61           4 :   , fCompStatDataHandler(NULL)
      62           4 :   , fStreamerInfoDataHandler(NULL)
      63          20 : {
      64             :   // see header file for class documentation
      65             :   // or
      66             :   // refer to README to build package
      67             :   // or
      68             :   // visit http://web.ift.uib.no/~kjeks/doc/alice-hlt
      69           8 : }
      70             : 
      71           0 : AliHLTAgentUtil::~AliHLTAgentUtil()
      72           8 : {
      73             :   // see header file for class documentation
      74          12 : }
      75             : 
      76             : int AliHLTAgentUtil::CreateConfigurations(AliHLTConfigurationHandler* handler,
      77             :                                           AliRawReader* /*rawReader*/,
      78             :                                           AliRunLoader* /*runloader*/) const
      79             : {
      80             :   // see header file for class documentation
      81           0 :   if (!handler) return 0;
      82             : 
      83             :   /////////////////////////////////////////////////////////////////////////////////////
      84             :   //
      85             :   // a kChain HLTOUT configuration for processing of {'COMPSTAT':'PRIV'} data blocks
      86             :   // produces a TTree object of the component statistics and writes it to disc
      87             : 
      88             :   // publisher component
      89           0 :   handler->CreateConfiguration("UTIL-hltout-compstat-publisher", "AliHLTOUTPublisher"   , NULL, "-disable-component-stat");
      90             : 
      91             :   // collector configuration
      92           0 :   handler->CreateConfiguration("UTIL-compstat-converter", "StatisticsCollector", "UTIL-hltout-compstat-publisher", "-disable-component-stat");
      93             : 
      94             :   // writer configuration
      95           0 :   handler->CreateConfiguration("UTIL-compstat-writer", "ROOTFileWriter", "UTIL-compstat-converter", "-datafile HLT.statistics.root -concatenate-events -overwrite");
      96             : 
      97           0 :   return 0;
      98           0 : }
      99             : 
     100             : const char* AliHLTAgentUtil::GetReconstructionChains(AliRawReader* /*rawReader*/,
     101             :                                                      AliRunLoader* /*runloader*/) const
     102             : {
     103             :   // see header file for class documentation
     104           0 :   return NULL;
     105             : }
     106             : 
     107             : const char* AliHLTAgentUtil::GetRequiredComponentLibraries() const
     108             : {
     109             :   // see header file for class documentation
     110           0 :   return NULL;
     111             : }
     112             : 
     113             : int AliHLTAgentUtil::RegisterComponents(AliHLTComponentHandler* pHandler) const
     114             : {
     115             :   // see header file for class documentation
     116           6 :   assert(pHandler);
     117           3 :   if (!pHandler) return -EINVAL;
     118           6 :   pHandler->AddComponent(new AliHLTDataGenerator);
     119           6 :   pHandler->AddComponent(new AliHLTRawReaderPublisherComponent);
     120           6 :   pHandler->AddComponent(new AliHLTLoaderPublisherComponent);
     121           6 :   pHandler->AddComponent(new AliHLTRootFileStreamerComponent);
     122           6 :   pHandler->AddComponent(new AliHLTRootFileWriterComponent);
     123           6 :   pHandler->AddComponent(new AliHLTRootFilePublisherComponent);
     124           6 :   pHandler->AddComponent(new AliHLTRootSchemaEvolutionComponent);
     125           6 :   pHandler->AddComponent(new AliHLTRecoParamComponent);
     126             :   //  pHandler->AddComponent(new AliHLTMCGeneratorComponent);
     127           6 :   pHandler->AddComponent(new AliHLTESDMCEventPublisherComponent);
     128           6 :   pHandler->AddComponent(new AliHLTFileWriter);
     129           6 :   pHandler->AddComponent(new AliHLTFXSFileWriter);
     130           6 :   pHandler->AddComponent(new AliHLTFXSWriterComponent);
     131           6 :   pHandler->AddComponent(new AliHLTFilePublisher);
     132           6 :   pHandler->AddComponent(new AliHLTBlockFilterComponent);
     133           6 :   pHandler->AddComponent(new AliHLTMonitoringRelay);
     134           6 :   pHandler->AddComponent(new AliHLTEsdCollectorComponent);
     135           6 :   pHandler->AddComponent(new AliHLTReadoutListDumpComponent);
     136           6 :   pHandler->AddComponent(new AliHLTOUTPublisherComponent);
     137           6 :   pHandler->AddComponent(new AliHLTCompStatCollector);
     138           6 :   pHandler->AddComponent(new AliHLTCorruptorComponent);
     139           6 :   pHandler->AddComponent(new AliHLTObjectCompressionComponent);
     140           3 :   return 0;
     141           3 : }
     142             : 
     143             : int AliHLTAgentUtil::GetHandlerDescription(AliHLTComponentDataType dt,
     144             :                                            AliHLTUInt32_t /*spec*/,
     145             :                                            AliHLTOUTHandlerDesc& desc) const
     146             : {
     147             :   // see header file for class documentation
     148             : 
     149             :   // handler for the component statistics data blocks {'COMPSTAT':'PRIV'}
     150           0 :   if (dt==kAliHLTDataTypeComponentStatistics ||
     151           0 :       dt==kAliHLTDataTypeComponentTable) {
     152           0 :       desc=AliHLTOUTHandlerDesc(kChain, dt, GetModuleId());
     153           0 :       return 1;
     154             :   }
     155             : 
     156             :   // handler for the component statistics data blocks {'ROOTSTRI':'HLT '}
     157           0 :   if (dt==kAliHLTDataTypeStreamerInfo) {
     158           0 :       desc=AliHLTOUTHandlerDesc(kProprietary, dt, GetModuleId());
     159           0 :       return 1;
     160             :   }
     161           0 :   return 0;
     162           0 : }
     163             : 
     164             : AliHLTOUTHandler* AliHLTAgentUtil::GetOutputHandler(AliHLTComponentDataType dt,
     165             :                                                    AliHLTUInt32_t /*spec*/)
     166             : {
     167             :   // see header file for class documentation
     168             : 
     169             :   // handler for the component statistics data blocks {'COMPSTAT':'PRIV'}
     170           0 :   if (dt==kAliHLTDataTypeComponentStatistics ||
     171           0 :       dt==kAliHLTDataTypeComponentTable) {
     172           0 :     if (fCompStatDataHandler==NULL)
     173           0 :       fCompStatDataHandler=new AliHLTOUTHandlerChain("chains=UTIL-compstat-writer");
     174           0 :     return fCompStatDataHandler;
     175             :   }
     176             : 
     177             :   // handler for the component statistics data blocks {'ROOTSTRI':'HLT '}
     178           0 :   if (dt==kAliHLTDataTypeStreamerInfo) {
     179           0 :     if (fStreamerInfoDataHandler==NULL)
     180           0 :       fStreamerInfoDataHandler=new AliHLTStreamerInfoHandler;
     181           0 :     return fStreamerInfoDataHandler;
     182             :   }
     183             : 
     184           0 :   return NULL;
     185           0 : }
     186             : 
     187             : int AliHLTAgentUtil::DeleteOutputHandler(AliHLTOUTHandler* pInstance)
     188             : {
     189             :   // see header file for class documentation
     190           0 :   if (pInstance==NULL) return -EINVAL;
     191             : 
     192           0 :   if (pInstance==fCompStatDataHandler) {
     193           0 :     delete fCompStatDataHandler;
     194           0 :     fCompStatDataHandler=NULL;
     195           0 :   }
     196             : 
     197           0 :   if (pInstance==fStreamerInfoDataHandler) {
     198           0 :     delete fStreamerInfoDataHandler;
     199           0 :     fStreamerInfoDataHandler=NULL;
     200           0 :   }
     201           0 :   return 0;
     202           0 : }

Generated by: LCOV version 1.11