]> git.uio.no Git - u/mrichter/AliRoot.git/blame - HLT/trigger/AliHLTMuonSpectroTriggerComponent.h
Major update required to handle old and new AliHLTEventDDL structures within HLT...
[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"
115 * @param list <i>[out]</i>: The list of data types to be filled.
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.
125 * @param list <i>[out]</i>: The list of data types to be filled.
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
132 * @param constBase <i>[out]</i>: additive part, independent of the
133 * input data volume.
134 * @param inputMultiplier <i>[out]</i>: multiplication ratio
135 */
136 virtual void GetOutputDataSize(unsigned long& constBase, double& inputMultiplier);
137
138 /**
139 * Inherited from AliHLTComponent.
140 * \returns a new instance of AliHLTMuonSpectroTriggerComponent.
141 */
142 virtual AliHLTComponent* Spawn();
143
144protected:
145
146 /**
147 * Inherited from AliHLTComponent. Initialises the component.
148 * \param argc The number of arguments in argv.
149 * \param argv Array of component argument strings.
150 * \returns Zero on success and negative number on failure.
151 */
152 virtual Int_t DoInit(int argc, const char** argv);
153
154 /**
155 * Inherited from AliHLTComponent. Cleans up the component.
156 * \returns Zero on success and negative number on failure.
157 */
158 virtual Int_t DoDeinit();
159
160 /**
161 * Inherited from AliHLTComponent. Makes a trigger decision for the muon
162 * spectrometer.
163 * @return Zero is returned on success and a negative error code on failure.
164 */
165 virtual int DoTrigger();
166
167private:
168
169 /// Not implemented. Do not allow copying of this class.
170 AliHLTMuonSpectroTriggerComponent(const AliHLTMuonSpectroTriggerComponent& /*obj*/);
171 /// Not implemented. Do not allow copying of this class.
172 AliHLTMuonSpectroTriggerComponent& operator = (const AliHLTMuonSpectroTriggerComponent& /*obj*/);
173
174 /**
175 * Method for checking the structure of a data block.
176 * \param reader The reader for the data block.
177 * \param type The data block type as given by the pub/sub framework.
178 * \returns true if the data block structure is OK and false otherwise.
179 */
180 template <typename BlockReader>
181 bool IsBlockOk(const BlockReader& reader, const AliHLTComponentDataType& type) const;
182
183 unsigned long fBufferSizeConst; //! Constant size estimate for GetOutputDataSize.
184 double fBufferSizeMultiplier; //! Buffer size multiplier estimate for GetOutputDataSize.
185 bool fMakeStats; //! Indicates if the statistics scalars object should be generated or not.
c057e1f9 186 bool fTriggerDDLs; //! If true then the component will trigger on any dll in the tracking and trigger chambers.
c1550d2c 187 bool fTriggerHits; //! If true then the component will trigger on any hits in the tracking chambers.
188 bool fTriggerTrigRecs; //! If true then the component will trigger on any trigger records.
189 bool fTriggerTracks; //! If true then the component will trigger on any tracks found.
190 bool fTriggerDimuons; //! If true then the component will trigger on any dimuons.
191
192 ClassDef(AliHLTMuonSpectroTriggerComponent, 0); // Trigger component for the muon spectrometer.
193};
194
195#endif // AliHLTMUONSPECTROTRIGGERCOMPONENT_H