]>
Commit | Line | Data |
---|---|---|
3e6ec852 | 1 | //-*- Mode: C++ -*- |
2 | // @(#) $Id$ | |
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 | |
10 | /** @file AliHLTAltroChannelSelectorComponent.h | |
11 | @author Matthias Richter | |
12 | @date | |
3dcae0cc | 13 | @brief A filter/selective readout component for Altro data. |
3e6ec852 | 14 | */ |
15 | ||
3e6ec852 | 16 | // visit http://web.ift.uib.no/~kjeks/doc/alice-hlt |
17 | ||
18 | #include "AliHLTProcessor.h" | |
19 | ||
20 | /** | |
21 | * @class AliHLTAltroChannelSelectorComponent | |
64defa03 | 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: | |
64defa03 | 26 | * - {***:HWADDR16}: 16 bit hardware addresses |
27 | * | |
2a32beb8 | 28 | * In Oct 2008 the component has been extended in order to select channels |
29 | * by calculating average/sigma and applying thresholds. | |
30 | * | |
4ca5858d | 31 | * TheAliAltroDecoder is used as input decoder to read and scan the |
32 | * Altro Raw data. | |
3e6ec852 | 33 | * |
2a32beb8 | 34 | * <h2>General properties:</h2> |
35 | * | |
36 | * Component ID: \b AltroChannelSelector <br> | |
37 | * Library: \b libAliHLTRCU <br> | |
38 | * Input Data Types: kAliHLTDataTypeDDLRaw, kAliHLTDataTypeHwAddr16 <br> | |
39 | * Output Data Types: kAliHLTDataTypeDDLRaw <br> | |
3e6ec852 | 40 | * |
41 | * Mandatory arguments: <br> | |
1ac82ce6 | 42 | * <!-- NOTE: ignore the \li. <i> and </i>: it's just doxygen formatting --> |
3e6ec852 | 43 | * |
44 | * Optional arguments: <br> | |
1ac82ce6 | 45 | * <!-- NOTE: ignore the \li. <i> and </i>: it's just doxygen formatting --> |
2a32beb8 | 46 | * \li -keep-corrupted |
47 | * keep corrupted channels, by default ignored | |
48 | * \li -talkative | |
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 | |
57 | * plus threshold | |
58 | * \li -rms-threshold <i> sigma </i> | |
3e6ec852 | 59 | * |
2a32beb8 | 60 | * @ingroup alihlt_rcu_components |
3e6ec852 | 61 | */ |
62 | class AliHLTAltroChannelSelectorComponent : public AliHLTProcessor { | |
63 | public: | |
64 | /** default constructor */ | |
65 | AliHLTAltroChannelSelectorComponent(); | |
66 | /** destructor */ | |
67 | virtual ~AliHLTAltroChannelSelectorComponent(); | |
68 | ||
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(); | |
75 | ||
76 | protected: | |
77 | // interface functions: processing | |
78 | int DoInit(int argc, const char** argv); | |
79 | int DoDeinit(); | |
80 | int DoEvent(const AliHLTComponentEventData& evtData, | |
81 | const AliHLTComponentBlockData* blocks, | |
82 | AliHLTComponentTriggerData& trigData, | |
83 | AliHLTUInt8_t* outputPtr, | |
84 | AliHLTUInt32_t& size, | |
85 | AliHLTComponentBlockDataList& outputBlocks ); | |
86 | ||
87 | ||
88 | private: | |
89 | /** copy constructor prohibited */ | |
90 | AliHLTAltroChannelSelectorComponent(const AliHLTAltroChannelSelectorComponent&); | |
91 | /** assignment operator prohibited */ | |
92 | AliHLTAltroChannelSelectorComponent& operator=(const AliHLTAltroChannelSelectorComponent&); | |
93 | ||
e1440dab | 94 | /** |
95 | * Copy a data block at the end of a buffer. | |
96 | * The source buffer is inserted at given position relative to the buffer | |
97 | * end. | |
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 | |
104 | */ | |
105 | int CopyBlockToEnd(AliHLTUInt8_t* pTgt, unsigned capacity, unsigned position, void* pSrc, unsigned size); | |
106 | ||
4ca5858d | 107 | /** skip corrupted channels */ |
108 | bool fSkipCorrupted; //!transient | |
e1440dab | 109 | |
4ca5858d | 110 | /** more verbose output */ |
111 | bool fTalkative; //!transient | |
112 | ||
2a32beb8 | 113 | unsigned int fStartTimeBin; //!transient |
114 | unsigned int fEndTimeBin; //!transient | |
115 | unsigned int fSignalThreshold; //!transient | |
116 | unsigned int fRMSThreshold; //!transient | |
117 | ||
118 | ClassDef(AliHLTAltroChannelSelectorComponent, 2); | |
3e6ec852 | 119 | }; |
120 | ||
121 | #endif |