update of AltroChannelSelector component by Jason: added monitoring histograms, make...
[u/mrichter/AliRoot.git] / HLT / RCU / AliHLTAltroChannelSelectorComponent.h
CommitLineData
3e6ec852 1//-*- Mode: C++ -*-
1ea9f419 2// $Id$
3e6ec852 3
4#ifndef ALIHLTALTROCHANNELSELECTORCOMPONENT_H
5#define ALIHLTALTROCHANNELSELECTORCOMPONENT_H
2a32beb8 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 *
3e6ec852 9
1ea9f419 10/// @file AliHLTAltroChannelSelectorComponent.h
11/// @author Matthias Richter
12/// @date
13/// @brief A filter/selective readout component for Altro data.
14///
3e6ec852 15
3e6ec852 16// visit http://web.ift.uib.no/~kjeks/doc/alice-hlt
17
18#include "AliHLTProcessor.h"
19
72ecb506 20class TH1F;
21
3e6ec852 22/**
23 * @class AliHLTAltroChannelSelectorComponent
64defa03 24 * A selector component for ALTRO Raw data. The component subscribes
f5bd9c68 25 * to the RAW data {***:DDL_RAW }, and produces the same raw data block
26 * with only the selected ALTRO channels. <br>
27 * Three different modes are supported:
28 * - -signal-threshold <br>
29 * the average of all signals in the channel is calculated and it is
30 * selected when the maximum signal exceeds average+threshold
31 * - -rms-threshold <br>
32 * the implemented logic needs to be checked, never been used
33 * - list of channels to select.
34 * The list must be of identical specification as the RAW data and of
35 * data type {***:HWADDR16}: 16 bit hardware addresses
64defa03 36 *
2a32beb8 37 *
ff4a65b9 38 * The AliAltroRawStreamV3 is used as input decoder to read and scan the
4ca5858d 39 * Altro Raw data.
3e6ec852 40 *
2a32beb8 41 * <h2>General properties:</h2>
42 *
43 * Component ID: \b AltroChannelSelector <br>
44 * Library: \b libAliHLTRCU <br>
45 * Input Data Types: kAliHLTDataTypeDDLRaw, kAliHLTDataTypeHwAddr16 <br>
46 * Output Data Types: kAliHLTDataTypeDDLRaw <br>
3e6ec852 47 *
48 * Mandatory arguments: <br>
1ac82ce6 49 * <!-- NOTE: ignore the \li. <i> and </i>: it's just doxygen formatting -->
3e6ec852 50 *
51 * Optional arguments: <br>
1ac82ce6 52 * <!-- NOTE: ignore the \li. <i> and </i>: it's just doxygen formatting -->
2a32beb8 53 * \li -keep-corrupted
54 * keep corrupted channels, by default ignored
55 * \li -talkative
56 * be a bit more verbose, prints out statistics message and warnings
57 * \li -start-timebin <i> bin </i>
58 * all time bins below will be ignored
59 * \li -end-timebin <i> bin </i>
60 * all time bins above will be ignored
61 * \li -signal-threshold <i> adc_counts </i>
62 * the average will be calculated from all bins between start and end,
63 * a channel is considered active if the maximum is bigger than averge
64 * plus threshold
65 * \li -rms-threshold <i> sigma </i>
3e6ec852 66 *
2a32beb8 67 * @ingroup alihlt_rcu_components
3e6ec852 68 */
69class AliHLTAltroChannelSelectorComponent : public AliHLTProcessor {
70 public:
71 /** default constructor */
72 AliHLTAltroChannelSelectorComponent();
73 /** destructor */
74 virtual ~AliHLTAltroChannelSelectorComponent();
75
76 // interface functions: property getters
77 const char* GetComponentID();
78 void GetInputDataTypes(AliHLTComponentDataTypeList& list);
79 AliHLTComponentDataType GetOutputDataType();
80 void GetOutputDataSize(unsigned long& constBase, double& inputMultiplier);
81 AliHLTComponent* Spawn();
82
83 protected:
84 // interface functions: processing
85 int DoInit(int argc, const char** argv);
86 int DoDeinit();
87 int DoEvent(const AliHLTComponentEventData& evtData,
88 const AliHLTComponentBlockData* blocks,
89 AliHLTComponentTriggerData& trigData,
90 AliHLTUInt8_t* outputPtr,
91 AliHLTUInt32_t& size,
92 AliHLTComponentBlockDataList& outputBlocks );
93
94
95 private:
96 /** copy constructor prohibited */
97 AliHLTAltroChannelSelectorComponent(const AliHLTAltroChannelSelectorComponent&);
98 /** assignment operator prohibited */
99 AliHLTAltroChannelSelectorComponent& operator=(const AliHLTAltroChannelSelectorComponent&);
100
4ca5858d 101 /** skip corrupted channels */
102 bool fSkipCorrupted; //!transient
e1440dab 103
4ca5858d 104 /** more verbose output */
105 bool fTalkative; //!transient
106
2a32beb8 107 unsigned int fStartTimeBin; //!transient
108 unsigned int fEndTimeBin; //!transient
109 unsigned int fSignalThreshold; //!transient
72ecb506 110 float fRMSThreshold; //!transient
111 bool fMakeHistogram; //!transient
112
113 TH1F *fhThreshold;//! Histgram of the "threshold value"
114 TH1F *fhRMS;//! Histgrams of the "RMS value"
2a32beb8 115
72ecb506 116 ClassDef(AliHLTAltroChannelSelectorComponent, 0);
3e6ec852 117};
118
119#endif