Updated macros for PHOS alignment calculation
[u/mrichter/AliRoot.git] / HLT / trigger / AliHLTMuonSpectroTriggerComponent.h
CommitLineData
c1550d2c 1//-*- Mode: C++ -*-
2// $Id: $
3#ifndef AliHLTMUONSPECTROTRIGGERCOMPONENT_H
4#define AliHLTMUONSPECTROTRIGGERCOMPONENT_H
5/* This file is property of and copyright by the ALICE HLT Project *
6 * ALICE Experiment at CERN, All rights reserved. *
7 * See cxx source for full Copyright notice */
8
9/// @file AliHLTMuonSpectroTriggerComponent.h
10/// @author Artur Szostak <artursz@iafrica.com>
11/// @date 9 Nov 2009
12/// @brief Declares the trigger component for the muon spectrometer.
13
14#include "AliHLTTrigger.h"
15
16/**
17 * \class AliHLTMuonSpectroTriggerComponent
18 * \brief Muon spectrometer trigger component.
19 *
20 * This component takes the HLT MUON decision generated by the AliHLTMUONDecisionComponent
21 * and creates a HLT trigger suitable for the HLT global trigger framework. Some
22 * optional summary statistics scalars can be generated with the "-makestats" option.
23 * This extra statistics information is filled in the AliHLTMuonSpectroScalars object,
24 * and written to a kAliHLTDataTypeEventStatistics type data block. Thus, the scalars
25 * object can be automatically added to the AliHLTEventSummary object by the
26 * AliHLTEventSummaryProducerComponent.
27 *
28 * <h2>General properties:</h2>
29 *
30 * Component ID: \b MuonSpectroTrigger <br>
31 * Library: \b libAliHLTTrigger.so <br>
c057e1f9 32 * Input Data Types: \li AliHLTMUONConstants::DDLRawDataType() = "DDL_RAW :MUON" <br>
33 * \li AliHLTMUONConstants::TriggerRecordsBlockDataType() = "TRIGRECS:MUON" <br>
c1550d2c 34 * \li AliHLTMUONConstants::RecHitsBlockDataType() = "RECHITS :MUON" <br>
35 * \li AliHLTMUONConstants::MansoTracksBlockDataType() = "MANTRACK:MUON" <br>
d24a4636 36 * \li AliHLTMUONConstants::TracksBlockDataType() = "TRACKS :MUON" <br>
c1550d2c 37 * \li AliHLTMUONConstants::SinglesDecisionBlockDataType() = "DECIDSIN:MUON" <br>
38 * \li AliHLTMUONConstants::PairsDecisionBlockDataType() = "DECIDPAR:MUON" <br>
39 * Output Data Types: \li kAliHLTDataTypeTriggerDecision = "TRIG_DEC:HLT " <br>
40 * \li kAliHLTDataTypeReadoutList = "HLTRDLST:HLT " <br>
41 * \li kAliHLTDataTypeEventStatistics|kAliHLTDataOriginHLT = "EV_STATI:HLT " <br>
42 *
43 * <h2>Mandatory arguments:</h2>
44 * None.
45 *
46 * <h2>Optional arguments:</h2>
47 * \li -makestats <br>
48 * If specified then the summary statistics scalars object is generated as output.
49 * The default is not to generate the statistics object. <br>
c057e1f9 50 * \li -triggerddls <br>
51 * Indicates that the component should trigger if any ddls are found in the muon
52 * spectrometer. <br>
c1550d2c 53 * \li -triggerhits <br>
54 * Indicates that the component should trigger if any hits are found in the muon
55 * spectrometer tracking chambers. This option requires that this trigger component
56 * receives the reconstructed hits data blocks. <br>
57 * \li -triggertrigrecs <br>
58 * Indicates that the component should trigger if any trigger records are found.
59 * This option requires that this trigger component receives the trigger records
60 * data blocks. <br>
61 * \li -triggertracks <br>
62 * Indicates that the component should trigger if any Manso tracks are found.
63 * This option requires that this trigger component receives the Manso track
64 * or singles decision data blocks. <br>
65 * \li -triggerdimuons <br>
66 * Indicates that the component should trigger if any dimuon pairs are found.
67 * This option requires that this trigger component receives the pairs decision
68 * data blocks. <br>
69 * \li -triggerany <br>
70 * This option indicates that the trigger component should trigger if anything was
71 * reconstructed in the muon spectrometer by the dHLT at all. <br>
72 *
73 * \note If none of the "triggerhits", "-triggertrigrecs", "-triggertracks" or "-triggerdimuons"
74 * options are specified then the default triggering mode is to trigger on tracks
75 * and dimuon pairs. <br>
76 *
77 * <h2>Configuration:</h2>
78 * Currently there is no configuration required.
79 *
80 * <h2>Default CDB entries:</h2>
81 * None.
82 *
83 * <h2>Performance:</h2>
84 * Under a millisecond per event.
85 *
86 * <h2>Memory consumption:</h2>
87 * Memory consumption is minimal. It should be less than 1 MBytes.
88 *
89 * <h2>Output size:</h2>
90 * Requires up to 4 kBytes
91 *
92 * \ingroup alihlt_trigger_components
93 */
94class AliHLTMuonSpectroTriggerComponent : public AliHLTTrigger
95{
96public:
97 AliHLTMuonSpectroTriggerComponent();
98 virtual ~AliHLTMuonSpectroTriggerComponent();
99
100 /**
101 * Inherited from AliHLTTrigger.
102 * @return string containing the global trigger name.
103 */
104 virtual const char* GetTriggerName() const { return "MuonSpectroTrigger"; }
105
106 /**
107 * Inherited from AliHLTTrigger. Returns the following input data types
108 * handled by this component:
109 * AliHLTMUONConstants::TriggerRecordsBlockDataType() = "TRIGRECS:MUON"
110 * AliHLTMUONConstants::RecHitsBlockDataType() = "RECHITS :MUON"
111 * AliHLTMUONConstants::MansoTracksBlockDataType() = "MANTRACK:MUON"
d24a4636 112 * AliHLTMUONConstants::TracksBlockDataType() = "TRACKS :MUON"
c1550d2c 113 * AliHLTMUONConstants::SinglesDecisionBlockDataType() = "DECIDSIN:MUON"
114 * AliHLTMUONConstants::PairsDecisionBlockDataType() = "DECIDPAR:MUON"
d4212668 115 * @param [out] list The list of data types to be filled.
c1550d2c 116 */
117 virtual void GetInputDataTypes(AliHLTComponentDataTypeList& list) const;
118
119 /**
120 * Inherited from AliHLTTrigger. Returns the following output types generated
121 * by this component:
122 * kAliHLTDataTypeTriggerDecision
123 * kAliHLTDataTypeEventStatistics|kAliHLTDataOriginHLT
124 * Including the type kAliHLTDataTypeReadoutList implicitly.
d4212668 125 * @param [out] list The list of data types to be filled.
c1550d2c 126 */
127 virtual void GetOutputDataTypes(AliHLTComponentDataTypeList& list) const;
128
129 /**
130 * Inherited from AliHLTTrigger. Returns the estimated data volume required
131 * in bytes: constBase + input_volume * inputMultiplier
d4212668 132 * @param [out] constBase Additive part, independent of the input data volume.
133 * @param [out] inputMultiplier Multiplication ratio.
c1550d2c 134 */
135 virtual void GetOutputDataSize(unsigned long& constBase, double& inputMultiplier);
136
137 /**
138 * Inherited from AliHLTComponent.
139 * \returns a new instance of AliHLTMuonSpectroTriggerComponent.
140 */
141 virtual AliHLTComponent* Spawn();
142
143protected:
144
145 /**
146 * Inherited from AliHLTComponent. Initialises the component.
147 * \param argc The number of arguments in argv.
148 * \param argv Array of component argument strings.
149 * \returns Zero on success and negative number on failure.
150 */
151 virtual Int_t DoInit(int argc, const char** argv);
152
153 /**
154 * Inherited from AliHLTComponent. Cleans up the component.
155 * \returns Zero on success and negative number on failure.
156 */
157 virtual Int_t DoDeinit();
158
159 /**
160 * Inherited from AliHLTComponent. Makes a trigger decision for the muon
161 * spectrometer.
162 * @return Zero is returned on success and a negative error code on failure.
163 */
164 virtual int DoTrigger();
165
166private:
167
168 /// Not implemented. Do not allow copying of this class.
169 AliHLTMuonSpectroTriggerComponent(const AliHLTMuonSpectroTriggerComponent& /*obj*/);
170 /// Not implemented. Do not allow copying of this class.
171 AliHLTMuonSpectroTriggerComponent& operator = (const AliHLTMuonSpectroTriggerComponent& /*obj*/);
172
173 /**
174 * Method for checking the structure of a data block.
175 * \param reader The reader for the data block.
176 * \param type The data block type as given by the pub/sub framework.
177 * \returns true if the data block structure is OK and false otherwise.
178 */
179 template <typename BlockReader>
180 bool IsBlockOk(const BlockReader& reader, const AliHLTComponentDataType& type) const;
181
182 unsigned long fBufferSizeConst; //! Constant size estimate for GetOutputDataSize.
183 double fBufferSizeMultiplier; //! Buffer size multiplier estimate for GetOutputDataSize.
184 bool fMakeStats; //! Indicates if the statistics scalars object should be generated or not.
c057e1f9 185 bool fTriggerDDLs; //! If true then the component will trigger on any dll in the tracking and trigger chambers.
c1550d2c 186 bool fTriggerHits; //! If true then the component will trigger on any hits in the tracking chambers.
187 bool fTriggerTrigRecs; //! If true then the component will trigger on any trigger records.
188 bool fTriggerTracks; //! If true then the component will trigger on any tracks found.
189 bool fTriggerDimuons; //! If true then the component will trigger on any dimuons.
190
191 ClassDef(AliHLTMuonSpectroTriggerComponent, 0); // Trigger component for the muon spectrometer.
192};
193
194#endif // AliHLTMUONSPECTROTRIGGERCOMPONENT_H