LCOV - code coverage report
Current view: top level - HLT/RCU - AliHLTRCUAgent.cxx (source / functions) Hit Total Coverage
Test: coverage.info Lines: 13 39 33.3 %
Date: 2016-06-14 17:26:59 Functions: 7 14 50.0 %

          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   AliHLTRCUAgent.cxx
      20             : /// @author Matthias Richter
      21             : /// @date   
      22             : /// @brief  Agent of the libAliHLTRCU library
      23             : ///
      24             : 
      25             : #include <cassert>
      26             : #include "AliHLTRCUAgent.h"
      27             : #include "AliHLTDAQ.h"
      28             : #include "AliDAQ.h"
      29             : 
      30             : // header files of library components
      31             : #include "AliHLTAltroChannelSelectorComponent.h"
      32             : #include "AliHLTAltroTimebinAverageComponent.h"
      33             : 
      34             : /** global instance for agent registration */
      35           6 : AliHLTRCUAgent gAliHLTRCUAgent;
      36             : 
      37             : /** ROOT macro for the implementation of ROOT specific class methods */
      38           6 : ClassImp(AliHLTRCUAgent)
      39             : 
      40             : AliHLTRCUAgent::AliHLTRCUAgent()
      41           3 :   : AliHLTModuleAgent("RCU")
      42          15 : {
      43             :   // see header file for class documentation
      44             :   // or
      45             :   // refer to README to build package
      46             :   // or
      47             :   // visit http://web.ift.uib.no/~kjeks/doc/alice-hlt
      48           6 : }
      49             : 
      50           0 : AliHLTRCUAgent::~AliHLTRCUAgent()
      51           6 : {
      52             :   // see header file for class documentation
      53           9 : }
      54             : 
      55             : UInt_t AliHLTRCUAgent::GetDetectorMask() const
      56             : {
      57           0 :   return AliDAQ::kTPC;
      58             : }
      59             : 
      60             : int AliHLTRCUAgent::CreateConfigurations(AliHLTConfigurationHandler* handler,
      61             :                                          AliRawReader* rawReader,
      62             :                                          AliRunLoader* /*runloader*/) const
      63             : {
      64             :   // add configurations for the RCU library
      65           0 :   if (handler) {
      66           0 :     if (rawReader) {
      67             :       // AliSimulation: use the AliRawReaderPublisher if the raw reader is available
      68             :       // Alireconstruction: indicated by runloader==NULL, run always on raw data
      69             :       int iMinSlice=0; 
      70             :       int iMaxSlice=35;
      71             :       int iMinPart=0;
      72             :       int iMaxPart=5;
      73           0 :       TString sinkChannelSelectors;
      74           0 :       for (int slice=iMinSlice; slice<=iMaxSlice; slice++) {
      75           0 :         for (int part=iMinPart; part<=iMaxPart; part++) {
      76           0 :           TString arg, publisher, selector;
      77             : 
      78             :           // publisher component
      79           0 :           int ddlno=AliHLTDAQ::DdlIDOffset(3);
      80           0 :           if (part>1) ddlno+=72+4*slice+(part-2);
      81           0 :           else ddlno+=2*slice+part;
      82             :           
      83           0 :           publisher.Form("RCU-DP_%02d_%d", slice, part);
      84           0 :           arg.Form("-minid %d -datatype 'DDL_RAW ' 'TPC '  -dataspec %s -silent", ddlno, AliHLTDAQ::HLTSpecificationFromDdlID(ddlno).c_str());
      85           0 :           handler->CreateConfiguration(publisher.Data(), "AliRawReaderPublisher", NULL , arg.Data());
      86             : 
      87             :           // selector component
      88           0 :           selector.Form("RCU-chselector_%02d_%d", slice, part);
      89           0 :           arg="-signal-threshold 1";
      90           0 :           handler->CreateConfiguration(selector.Data(), "AltroChannelSelector", publisher.Data(), arg.Data());
      91             : 
      92             : 
      93           0 :           if (sinkChannelSelectors.Length()>0) sinkChannelSelectors+=" ";
      94           0 :           sinkChannelSelectors+=selector;
      95           0 :         }
      96             :       }
      97           0 :       handler->CreateConfiguration("RCU-channelselect", "BlockFilter", sinkChannelSelectors.Data(), "");
      98           0 :     }
      99             :   }
     100           0 :   return 0;
     101           0 : }
     102             : 
     103             : const char* AliHLTRCUAgent::GetReconstructionChains(AliRawReader* /*rawReader*/,
     104             :                                                     AliRunLoader* /*runloader*/) const
     105             : {
     106             :   // see header file for class documentation
     107           0 :   return NULL;
     108             : }
     109             : 
     110             : const char* AliHLTRCUAgent::GetRequiredComponentLibraries() const
     111             : {
     112             :   // see header file for class documentation
     113           0 :   return NULL;
     114             : }
     115             : 
     116             : int AliHLTRCUAgent::RegisterComponents(AliHLTComponentHandler* pHandler) const
     117             : {
     118             :   // see header file for class documentation
     119           6 :   assert(pHandler);
     120           3 :   if (!pHandler) return -EINVAL;
     121           6 :   pHandler->AddComponent(new AliHLTAltroChannelSelectorComponent);
     122           6 :   pHandler->AddComponent(new AliHLTAltroTimebinAverageComponent);
     123           3 :   return 0;
     124           3 : }

Generated by: LCOV version 1.11