4 #ifndef ALIHLTALTROCHANNELSELECTORCOMPONENT_H
5 #define ALIHLTALTROCHANNELSELECTORCOMPONENT_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 *
10 /** @file AliHLTAltroChannelSelectorComponent.h
11 @author Matthias Richter
13 @brief A filter/selective readout component for Altro data.
16 // visit http://web.ift.uib.no/~kjeks/doc/alice-hlt
18 #include "AliHLTProcessor.h"
21 * @class AliHLTAltroChannelSelectorComponent
22 * A selector component for ALTRO Raw data. The component subscribes
23 * to the RAW data {***:DDL_RAW } and gets in addition a list of channels
24 * to select. The list must be of identical specification as the RAW data
25 * and can be of data type:
26 * - {***:HWADDR16}: 16 bit hardware addresses
28 * In Oct 2008 the component has been extended in order to select channels
29 * by calculating average/sigma and applying thresholds.
31 * The AliAltroRawStreamV3 is used as input decoder to read and scan the
34 * <h2>General properties:</h2>
36 * Component ID: \b AltroChannelSelector <br>
37 * Library: \b libAliHLTRCU <br>
38 * Input Data Types: kAliHLTDataTypeDDLRaw, kAliHLTDataTypeHwAddr16 <br>
39 * Output Data Types: kAliHLTDataTypeDDLRaw <br>
41 * Mandatory arguments: <br>
42 * <!-- NOTE: ignore the \li. <i> and </i>: it's just doxygen formatting -->
44 * Optional arguments: <br>
45 * <!-- NOTE: ignore the \li. <i> and </i>: it's just doxygen formatting -->
47 * keep corrupted channels, by default ignored
49 * be a bit more verbose, prints out statistics message and warnings
50 * \li -start-timebin <i> bin </i>
51 * all time bins below will be ignored
52 * \li -end-timebin <i> bin </i>
53 * all time bins above will be ignored
54 * \li -signal-threshold <i> adc_counts </i>
55 * the average will be calculated from all bins between start and end,
56 * a channel is considered active if the maximum is bigger than averge
58 * \li -rms-threshold <i> sigma </i>
60 * @ingroup alihlt_rcu_components
62 class AliHLTAltroChannelSelectorComponent : public AliHLTProcessor {
64 /** default constructor */
65 AliHLTAltroChannelSelectorComponent();
67 virtual ~AliHLTAltroChannelSelectorComponent();
69 // interface functions: property getters
70 const char* GetComponentID();
71 void GetInputDataTypes(AliHLTComponentDataTypeList& list);
72 AliHLTComponentDataType GetOutputDataType();
73 void GetOutputDataSize(unsigned long& constBase, double& inputMultiplier);
74 AliHLTComponent* Spawn();
77 // interface functions: processing
78 int DoInit(int argc, const char** argv);
80 int DoEvent(const AliHLTComponentEventData& evtData,
81 const AliHLTComponentBlockData* blocks,
82 AliHLTComponentTriggerData& trigData,
83 AliHLTUInt8_t* outputPtr,
85 AliHLTComponentBlockDataList& outputBlocks );
89 /** copy constructor prohibited */
90 AliHLTAltroChannelSelectorComponent(const AliHLTAltroChannelSelectorComponent&);
91 /** assignment operator prohibited */
92 AliHLTAltroChannelSelectorComponent& operator=(const AliHLTAltroChannelSelectorComponent&);
95 * Copy a data block at the end of a buffer.
96 * The source buffer is inserted at given position relative to the buffer
98 * @param pTgt target buffer
99 * @param capacity capacity (size) of the buffer
100 * @param position porition relative to the END of the buffer
101 * @param pSrc source buffer to be copied
102 * @param size size of the source buffer
103 * @return copied size, neg error code if failed
105 int CopyBlockToEnd(AliHLTUInt8_t* pTgt, unsigned capacity, unsigned position, void* pSrc, unsigned size);
107 /** skip corrupted channels */
108 bool fSkipCorrupted; //!transient
110 /** more verbose output */
111 bool fTalkative; //!transient
113 unsigned int fStartTimeBin; //!transient
114 unsigned int fEndTimeBin; //!transient
115 unsigned int fSignalThreshold; //!transient
116 unsigned int fRMSThreshold; //!transient
118 ClassDef(AliHLTAltroChannelSelectorComponent, 2);