]> git.uio.no Git - u/mrichter/AliRoot.git/blob - HLT/RCU/AliHLTAltroChannelSelectorComponent.h
minor update of documentation
[u/mrichter/AliRoot.git] / HLT / RCU / AliHLTAltroChannelSelectorComponent.h
1 //-*- Mode: C++ -*-
2 // @(#) $Id$
3
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                               *
9
10 /** @file   AliHLTAltroChannelSelectorComponent.h
11     @author Matthias Richter
12     @date   
13     @brief  A filter/selective readout component for Altro data.
14 */
15
16 // visit http://web.ift.uib.no/~kjeks/doc/alice-hlt   
17
18 #include "AliHLTProcessor.h"
19
20 /**
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
27  *
28  * In Oct 2008 the component has been extended in order to select channels
29  * by calculating average/sigma and applying thresholds.
30  *
31  * TheAliAltroDecoder is used as input decoder to read and scan the
32  * Altro Raw data.
33  * 
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>
40  *
41  * Mandatory arguments: <br>
42  * <!-- NOTE: ignore the \li. <i> and </i>: it's just doxygen formatting -->
43  *
44  * Optional arguments: <br>
45  * <!-- NOTE: ignore the \li. <i> and </i>: it's just doxygen formatting -->
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>
59  *
60  * @ingroup alihlt_rcu_components
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
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
107   /** skip corrupted channels */
108   bool fSkipCorrupted; //!transient
109
110   /** more verbose output */
111   bool fTalkative; //!transient
112
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);
119 };
120
121 #endif