LCOV - code coverage report
Current view: top level - HLT/BASE - AliHLTOfflineInterface.h (source / functions) Hit Total Coverage
Test: coverage.info Lines: 1 1 100.0 %
Date: 2016-06-14 17:26:59 Functions: 1 5 20.0 %

          Line data    Source code
       1             : // -*- Mode: C++ -*-
       2             : // $Id$
       3             : 
       4             : #ifndef ALIHLTOFFLINEINTERFACE_H
       5             : #define ALIHLTOFFLINEINTERFACE_H
       6             : //* This file is property of and copyright by the                          * 
       7             : //* ALICE Experiment at CERN, All rights reserved.                         *
       8             : //* See cxx source for full Copyright notice                               *
       9             : 
      10             : /// @file   AliHLTOfflineInterface.h
      11             : /// @author Matthias Richter
      12             : /// @date   
      13             : /// @brief  the HLT interface to AliRoot
      14             : ///
      15             : 
      16             : #include <TObject.h>
      17             : #include <TList.h>
      18             : 
      19             : class AliRunLoader;
      20             : class AliRawReader;
      21             : class AliESDEvent;
      22             : class TTree;
      23             : 
      24             : /******************************************************************************/
      25             : 
      26             : /**
      27             :  * @class AliHLTOfflineInterface
      28             :  * The class implements the basic interface to the AliRoot objects during
      29             :  * reconstructions.
      30             :  * It serves as a base class for offline source and sink interface components
      31             :  * and provides access methods for the AliRunLoader, AliRawReader and AliESDEvent
      32             :  * objects. The AliRunLoader and the AliRawReader are fixed during one run,
      33             :  * while the AliESDEvent object will be changed from event to event.<br>
      34             :  * \em Note: The digits and clusters trees are not available through this
      35             :  * interface class as they are completetly detector (AliLoader) dependend.
      36             :  *
      37             :  * @note This class is only used for the @ref alihlt_system.
      38             :  *
      39             :  * @ingroup alihlt_system
      40             :  */
      41             : class AliHLTOfflineInterface : public TObject {
      42             :  public:
      43             :   /** standard constructor */
      44             :   AliHLTOfflineInterface();
      45             :   /** constructor
      46             :    *  @param pRunLoader   pointer to AliRoot run loader
      47             :    *  @param pRawReader   pointer to AliRoot raw reader
      48             :    */
      49             :   AliHLTOfflineInterface(AliRunLoader* pRunLoader, AliRawReader* pRawReader);
      50             :   /** destructor */
      51             :   virtual ~AliHLTOfflineInterface();
      52             : 
      53             :   /**
      54             :    * Get the AliRoot run loader.
      55             :    */
      56             :   AliRunLoader* GetRunLoader() const;
      57             : 
      58             :   /**
      59             :    * Get the AliRoot raw reader
      60             :    */
      61             :   AliRawReader* GetRawReader() const;
      62             : 
      63             :   /**
      64             :    * Set AliRoot ESD for the current event.
      65             :    */
      66             :   int SetESD(Int_t eventNo, AliESDEvent* pESD);
      67             : 
      68             :   /**
      69             :    * Get the AliRoot ESD
      70             :    */
      71             :   AliESDEvent* GetESD() const;
      72             : 
      73             :   /**
      74             :    * Set AliRoot external params.
      75             :    *
      76             :    * @param runLoader     the AliRoot runloader
      77             :    * @param rawReader     the AliRoot RawReader
      78             :    * @return neg. error code if failed 
      79             :    */
      80             :   int SetParams(AliRunLoader* runLoader, AliRawReader* rawReader);
      81             : 
      82             :   /**
      83             :    * Reset AliRoot internal params.
      84             :    */
      85             :   int Reset();
      86             : 
      87             :   /**
      88             :    * Set AliRoot external params.
      89             :    * This method works on the global list.
      90             :    * @param runLoader     the AliRoot runloader
      91             :    * @param rawReader     the AliRoot RawReader
      92             :    * @return neg. error code if failed 
      93             :    */
      94             :   static int SetParamsToComponents(AliRunLoader* runLoader, AliRawReader* rawReader);
      95             : 
      96             :   /**
      97             :    * Fill ESD for one event.
      98             :    * Fill the ESD with the previously reconstructed data. It must be implmented
      99             :    * by the child class.
     100             :    * @param eventNo       event No. \em Note: this is an internal enumeration of the
     101             :    *                      processed events.
     102             :    * @param runLoader     the AliRoot runloader
     103             :    * @param esd           an AliESDEvent instance
     104             :    * @return neg. error code if failed 
     105             :    */
     106             :   virtual int FillESD(int eventNo, AliRunLoader* runLoader, AliESDEvent* esd)=0;
     107             : 
     108             :   /**
     109             :    * Fill ESD for one event.
     110             :    * The FillESD method of all active AliHLTOfflineDataSink's is called in
     111             :    * order to fill the ESD with the previously reconstructed data. This method
     112             :    * works on the global list.
     113             :    * @param eventNo       event No. \em Note: this is an internal enumeration of the
     114             :    *                      processed events.
     115             :    * @param runLoader     the AliRoot runloader
     116             :    * @param esd           an AliESDEvent instance
     117             :    * @return neg. error code if failed 
     118             :    */
     119             :   static int FillComponentESDs(int eventNo, AliRunLoader* runLoader, AliESDEvent* esd);
     120             : 
     121             :   /**
     122             :    * Reset AliRoot internal params of all active components.
     123             :    * This method works on the global list.
     124             :    */
     125             :   static int ResetComponents();
     126             : 
     127             : protected:
     128             :   /**
     129             :    * Register an OfflineInterface.
     130             :    * @param me            instance of AliHLTOfflineInterface
     131             :    * @return neg. error code if failed
     132             :    */
     133             :   static int Register(AliHLTOfflineInterface* me);
     134             : 
     135             :   /**
     136             :    * Unregister  an OfflineInterface.
     137             :    * @param me            instance of AliHLTOfflineInterface
     138             :    * @return neg. error code if failed
     139             :    */
     140             :   static int Unregister(AliHLTOfflineInterface* me);
     141             : 
     142             :  private:
     143             :   /** copy constructor prohibited */
     144             :   AliHLTOfflineInterface(const AliHLTOfflineInterface&);
     145             :   /** assignment operator prohibited */
     146             :   AliHLTOfflineInterface& operator=(const AliHLTOfflineInterface&);
     147             : 
     148             :   /** global AliRoot run loader instance (for all components) */
     149             :   static AliRunLoader* fgpRunLoader;                              //! transient
     150             :   /** global AliRoot raw reader instance (for all components) */
     151             :   static AliRawReader* fgpRawReader;                              //! transient
     152             : 
     153             :   /** private AliRoot run loader instance */
     154             :   AliRunLoader* fpRunLoader;                                      //! transient
     155             :   /** private AliRoot raw reader instance */
     156             :   AliRawReader* fpRawReader;                                      //! transient
     157             :   /** AliRoot HLT ESD instance */
     158             :   AliESDEvent* fpESD;                                                  //! transient
     159             : 
     160             :   /** the list of active interfaces */
     161             :   static AliHLTOfflineInterface* fgAnchor;                        //! transient
     162             : 
     163             :   /** next element in the list */
     164             :   AliHLTOfflineInterface* fpNext;                                 //! transient
     165             : 
     166             :   /** the current element */
     167             :   static AliHLTOfflineInterface* fgCurrent;                       //! transient
     168             : 
     169             :   /** number of interfaces */
     170             :   static int fgCount;                                             //! see above
     171             : 
     172         126 :   ClassDef(AliHLTOfflineInterface, 0);
     173             : };
     174             : 
     175             : #endif

Generated by: LCOV version 1.11