Major update required to handle old and new AliHLTEventDDL structures within HLT...
[u/mrichter/AliRoot.git] / HLT / BASE / util / AliHLTReadoutListDumpComponent.h
CommitLineData
209986b4 1// -*- Mode: C++ -*-
2// $Id$
3
4#ifndef ALIHLTREADOUTLISTDUMPCOMPONENT_H
5#define ALIHLTREADOUTLISTDUMPCOMPONENT_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 AliHLTReadoutListDumpComponent.h
11 @author Matthias Richter
12 @date
13 @brief Collect ESDs of multiple events and write toi file
14*/
15
16#include "AliHLTFileWriter.h"
17
18class TH1I;
19class TH2I;
20class AliHLTReadoutList;
21
22/**
23 * @class AliHLTReadoutListDumpComponent
24 * The ReadoutListDump component fetches the DAQ readout list object
25 * and can store the information in different ways, like e.g. in a histogram
26 * or a tree.
27 *
28 * <h2>General properties:</h2>
29 *
30 * Component ID: \b ReadoutListDump <br>
31 * Library: \b libAliHLTUtil.so <br>
32 * Input Data Types: {HLTRDLST:HLT }, <br>
33 * Output Data Types: none <br>
34 *
35 * <h2>Mandatory arguments:</h2>
36 * <!-- NOTE: ignore the \li. <i> and </i>: it's just doxygen formatting -->
37 *
38 * <h2>Optional arguments:</h2>
39 * \li -binary <br>
40 * fetch the binary readout list block (default)
41 * \li -decision <br>
42 * fetch the readout list from the HLT decision object
43 * The only AliHLTFileWriter argument of relevance is the \em -directory
44 * argument. See AliHLTFileWriter for full list of arguments.
45 *
46 * <h2>Configuration:</h2>
47 * <!-- NOTE: ignore the \li. <i> and </i>: it's just doxygen formatting -->
48 * Configuration by component arguments.
49 *
50 * <h2>Default CDB entries:</h2>
51 * The component loads no CDB entries.
52 *
53 * <h2>Performance:</h2>
54 * The component does not process any event data.
55 *
56 * <h2>Memory consumption:</h2>
57 * The component does not process any event data.
58 *
59 * <h2>Output size:</h2>
60 * No data published (AliHLTDataSink).
61 *
62 * @ingroup alihlt_util_components
63 */
64class AliHLTReadoutListDumpComponent : public AliHLTFileWriter
65{
66 public:
67 /** standard constructor */
68 AliHLTReadoutListDumpComponent();
69 /** destructor */
70 virtual ~AliHLTReadoutListDumpComponent();
71
72 /**
73 * The id of the component.
74 * @return component id (string)
75 */
76 const char* GetComponentID() {return "ReadoutListDump";};
77
78 /**
79 * Spawn function.
80 * @return new class instance
81 */
82 AliHLTComponent* Spawn() {return new AliHLTReadoutListDumpComponent;}
83
84 enum {
85 kModeBinaryList = 1, // fetch the readout list block
86 kModeHLTDecision = 2 // fetch the readout list from the HLT decision object
87 };
88
89 protected:
90 // interface functions
91
92 /// inherited form AliHLTFileWriter
93 int InitWriter();
94
95 /// inherited form AliHLTFileWriter
96 int CloseWriter();
97
98 /// inherited form AliHLTDataSink
99 int DumpEvent( const AliHLTComponentEventData& evtData,
100 const AliHLTComponentBlockData* blocks,
101 AliHLTComponentTriggerData& trigData );
102
103 using AliHLTFileWriter::DumpEvent;
104
105 /// inherited form AliHLTFileWriter
106 int ScanArgument(int argc, const char** argv);
107
108 /**
109 * Create the histogram for monitoring of the readout list.
110 * Each bin corresponds to a bit in the bitfield of the readout
111 * list.
112 * The object has to be deleted by the caller.
113 */
114 static TH1I* CreateReadoutListHistogram();
115
116 /**
117 * Create the histogram for monitoring of the readout list.
118 * Plot readout list bits vs. CTP trigger bit
119 * The object has to be deleted by the caller.
120 */
121 static TH2I* CreateReadoutListVsCTPHistogram();
122
123 /**
124 * Fill histogram from the readout list.
125 */
126 static int FillReadoutListHistogram(TH1I* histo, const AliHLTReadoutList* list);
89413559 127
209986b4 128 /**
129 * Fill histogram from the readout list.
130 */
131 static int FillReadoutListVsCTP(TH2I* histo, const AliHLTReadoutList* list, const AliHLTComponentTriggerData* trigData);
209986b4 132
133private:
134 /** copy constructor prohibited */
135 AliHLTReadoutListDumpComponent(const AliHLTReadoutListDumpComponent&);
136 /** assignment operator prohibited */
137 AliHLTReadoutListDumpComponent& operator=(const AliHLTReadoutListDumpComponent&);
138
139 unsigned fMode; /// how to get the readout list (kModeBinaryList, kModeHLTDecision)
140 TH1I* fBitsHisto; /// the histogram to be filled
141 TH2I* fBitsVsCTP; /// histogram of bits vs. ctp triggers
142
143 ClassDef(AliHLTReadoutListDumpComponent, 0)
144};
145#endif