]> git.uio.no Git - u/mrichter/AliRoot.git/blame - HLT/BASE/AliHLTTTreeProcessor.h
correct creation of alignment objects in global c.s., not local
[u/mrichter/AliRoot.git] / HLT / BASE / AliHLTTTreeProcessor.h
CommitLineData
4731a36c 1//-*- Mode: C++ -*-
2// $Id$
3
4#ifndef ALIHLTTTREEPROCESSOR_H
5#define ALIHLTTTREEPROCESSOR_H
6//* This file is property of and copyright by the ALICE HLT Project *
7//* ALICE Experiment at CERN, All rights reserved. *
8//* See cxx source for full Copyright notice *
9
10/// @file AliHLTTTreeProcessor.h
11/// @author
12/// @date 05.07.2010
13/// @brief Generic component for data collection in a TTree
14
15#include "AliHLTProcessor.h"
16
17class TTree;
18class TH1;
19
20/**
21 * @class AliHLTTTreeProcessor
22 * Generic component for data collection in a TTree, or as a special case
23 * in a TNtuple (which is a tree with only float branches). Child components
24 * implement the creation and filling of the tree, which is dependent on the
25 * data itself.
26 *
27 * Child components have to implement the basic component property methods
28 * like GetComponentID(), GetInputDataTypes(), and Spawn(). Default
29 * implementations of GetOutputDataSize() and GetOutputDataType() are already
30 * provided by the base class.
31 *
32 * The base class keeps a circular TTree of a specific event count. Histograms
33 * are periodically generated by applying a table of selections and cuts. The
34 * table can be configured and changed at run-time and the data sample in the
35 * tree can be reset.
36 *
37 * @ingroup alihlt_base
38 */
39class AliHLTTTreeProcessor : public AliHLTProcessor {
40 public:
41 /// standard constructor
42 AliHLTTTreeProcessor();
43 /// destructor
44 virtual ~AliHLTTTreeProcessor();
45
46 /// inherited from AliHLTComponent, get the output data type
47 virtual AliHLTComponentDataType GetOutputDataType();
48
49 /// inherited from AliHLTComponent, get the output data size estimator
50 virtual void GetOutputDataSize( unsigned long& constBase, double& inputMultiplier );
51
52 protected:
53 /// initialization, overloaded from AliHLTComponent
54 int DoInit( int argc, const char** argv );
55 /// initialization, overloaded from AliHLTComponent
56 int DoDeinit();
57 /// inherited from AliHLTProcessor, data processing
58 int DoEvent( const AliHLTComponentEventData& evtData,
59 AliHLTComponentTriggerData& trigData );
60 using AliHLTProcessor::DoEvent;
61 /// inherited from AliHLTComponent, scan argument
62 int ScanConfigurationArgument(int argc, const char** argv);
63
64 /// create the tree instance and all branches
65 virtual TTree* CreateTree(int argc, const char** argv) = 0;
66
67 /// process input blocks and fill tree
68 virtual int FillTree(TTree* pTree) = 0;
69
70 private:
71 /// copy constructor prohibited
72 AliHLTTTreeProcessor(const AliHLTTTreeProcessor&);
73 /// assignment operator prohibited
74 AliHLTTTreeProcessor& operator=(const AliHLTTTreeProcessor&);
75
76 /// create a histogram from the tree
77 TH1* CreateHistogram(TTree* pTree,
78 const char* name,
79 const char* condition,
80 const char* selection,
81 const char* option);
82
83 /// the TTree
84 TTree* fTree; //! the tree instance
85 /// max entries
86 int fMaxEntries; //! maximum number of entries in the circular tree
87 /// publish interval in s
88 int fPublishInterval; //! publish interval in s
89
90 ClassDef(AliHLTTTreeProcessor, 0)
91};
92#endif