]> git.uio.no Git - u/mrichter/AliRoot.git/blob - HLT/RCU/AliHLTAltroChannelSelectorComponent.h
Update master to aliroot
[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 class TH1F;
21
22 /**
23  * @class AliHLTAltroChannelSelectorComponent
24  * A selector component for ALTRO Raw data. The component subscribes
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
36  *
37  *
38  * The AliAltroRawStreamV3 is used as input decoder to read and scan the
39  * Altro Raw data.
40  * 
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>
47  *
48  * Mandatory arguments: <br>
49  * <!-- NOTE: ignore the \li. <i> and </i>: it's just doxygen formatting -->
50  *
51  * Optional arguments: <br>
52  * <!-- NOTE: ignore the \li. <i> and </i>: it's just doxygen formatting -->
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>
66  *
67  * @ingroup alihlt_rcu_components
68  */
69 class 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
101   /** skip corrupted channels */
102   bool fSkipCorrupted; //!transient
103
104   /** more verbose output */
105   bool fTalkative; //!transient
106
107   unsigned int fStartTimeBin; //!transient
108   unsigned int fEndTimeBin; //!transient
109   unsigned int fSignalThreshold; //!transient
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"
115
116   ClassDef(AliHLTAltroChannelSelectorComponent, 0);
117 };
118
119 #endif