]> git.uio.no Git - u/mrichter/AliRoot.git/blob - HLT/global/AliHLTGlobalEsdConverterComponent.h
first working version of GlobalEsdConverter
[u/mrichter/AliRoot.git] / HLT / global / AliHLTGlobalEsdConverterComponent.h
1 //-*- Mode: C++ -*-
2 // $Id$
3 #ifndef ALIHLTGLOBALESDCONVERTERCOMPONENT_H
4 #define ALIHLTGLOBALESDCONVERTERCOMPONENT_H
5 //* This file is property of and copyright by the ALICE HLT Project        * 
6 //* ALICE Experiment at CERN, All rights reserved.                         *
7 //* See cxx source for full Copyright notice                               *
8
9 /** @file   AliHLTGlobalEsdConverterComponent.h
10     @author Matthias Richter
11     @date   
12     @brief  Global ESD converter component.
13 */
14
15 #include "AliHLTProcessor.h"
16 #include <vector>
17
18 // forward declarations
19 class AliESDEvent;
20 class TTree;
21 struct AliHLTTracksData;
22
23 /**
24  * @class AliHLTGlobalEsdConverterComponent
25  * Global collector for information designated for the HLT ESD.
26  *
27  * componentid: \b GlobalEsdConverter <br>
28  * componentlibrary: \b libAliHLTGlobal.so <br>
29  * Arguments: <br>
30  * <!-- NOTE: ignore the \li. <i> and </i>: it's just doxygen formatting -->
31  * \li -notree                                                          <br>
32  *      write ESD directly to output (::kAliHLTDataTypeESDObject)
33  *      this has been made the default behavior in Sep 2008.
34  * \li -tree                                                            <br>
35  *      write ESD directly to TTree and to output (::kAliHLTDataTypeESDTree)
36  *
37  * @ingroup alihlt_tpc_components
38  */
39 class AliHLTGlobalEsdConverterComponent : public AliHLTProcessor
40 {
41  public:
42   /** standard constructor */
43   AliHLTGlobalEsdConverterComponent();
44   /** destructor */
45   ~AliHLTGlobalEsdConverterComponent();
46
47   // interface methods of base class
48   const char* GetComponentID() {return "GlobalEsdConverter";};
49   void GetInputDataTypes(AliHLTComponentDataTypeList& list);
50   AliHLTComponentDataType GetOutputDataType();
51   void GetOutputDataSize(unsigned long& constBase, double& inputMultiplier);
52   AliHLTComponent* Spawn() {return new AliHLTGlobalEsdConverterComponent;}
53
54  protected:
55   // interface methods of base class
56   int DoInit(int argc, const char** argv);
57   int DoDeinit();
58   int DoEvent( const AliHLTComponentEventData& evtData,
59                AliHLTComponentTriggerData& trigData);
60
61   using AliHLTProcessor::DoEvent;
62
63   /**
64    * Process the input data blocks.
65    * @param pTree    tree to be filled
66    * @param pESD     ESD to be filled
67    * @return neg. error code if failed
68    */
69   int ProcessBlocks(TTree* pTree, AliESDEvent* pESD);
70
71  private:
72   /** copy constructor prohibited */
73   AliHLTGlobalEsdConverterComponent(const AliHLTGlobalEsdConverterComponent&);
74   /** assignment operator prohibited */
75   AliHLTGlobalEsdConverterComponent& operator=(const AliHLTGlobalEsdConverterComponent&);
76
77   /**
78    * (Re)Configure from the CDB
79    * Loads the following objects:
80    * - HLT/ConfigHLT/SolenoidBz
81    */
82   int Reconfigure(const char* cdbEntry, const char* chainId);
83
84   /**
85    * Configure the component.
86    * Parse a string for the configuration arguments and set the component
87    * properties.
88    */
89   int Configure(const char* arguments);
90
91   /// the ESD
92   AliESDEvent* fESD; //! transient value
93
94   /// solenoid b field
95   Double_t fSolenoidBz; //! transient
96
97   /// write object to TTree or directly
98   int fWriteTree; //!transient
99
100   /// verbosity level
101   int fVerbosity; //!transient
102
103   ClassDef(AliHLTGlobalEsdConverterComponent, 0)
104 };
105 #endif