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 */
9 /// @file AliHLTMuonSpectroTriggerComponent.h
10 /// @author Artur Szostak <artursz@iafrica.com>
12 /// @brief Declares the trigger component for the muon spectrometer.
14 #include "AliHLTTrigger.h"
17 * \class AliHLTMuonSpectroTriggerComponent
18 * \brief Muon spectrometer trigger component.
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.
28 * <h2>General properties:</h2>
30 * Component ID: \b MuonSpectroTrigger <br>
31 * Library: \b libAliHLTTrigger.so <br>
32 * Input Data Types: \li AliHLTMUONConstants::DDLRawDataType() = "DDL_RAW :MUON" <br>
33 * \li AliHLTMUONConstants::TriggerRecordsBlockDataType() = "TRIGRECS:MUON" <br>
34 * \li AliHLTMUONConstants::RecHitsBlockDataType() = "RECHITS :MUON" <br>
35 * \li AliHLTMUONConstants::MansoTracksBlockDataType() = "MANTRACK:MUON" <br>
36 * \li AliHLTMUONConstants::TracksBlockDataType() = "TRACKS :MUON" <br>
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>
43 * <h2>Mandatory arguments:</h2>
46 * <h2>Optional arguments:</h2>
48 * If specified then the summary statistics scalars object is generated as output.
49 * The default is not to generate the statistics object. <br>
50 * \li -triggerddls <br>
51 * Indicates that the component should trigger if any ddls are found in the muon
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
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
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>
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>
77 * <h2>Configuration:</h2>
78 * Currently there is no configuration required.
80 * <h2>Default CDB entries:</h2>
83 * <h2>Performance:</h2>
84 * Under a millisecond per event.
86 * <h2>Memory consumption:</h2>
87 * Memory consumption is minimal. It should be less than 1 MBytes.
89 * <h2>Output size:</h2>
90 * Requires up to 4 kBytes
92 * \ingroup alihlt_trigger_components
94 class AliHLTMuonSpectroTriggerComponent : public AliHLTTrigger
97 AliHLTMuonSpectroTriggerComponent();
98 virtual ~AliHLTMuonSpectroTriggerComponent();
101 * Inherited from AliHLTTrigger.
102 * @return string containing the global trigger name.
104 virtual const char* GetTriggerName() const { return "MuonSpectroTrigger"; }
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"
112 * AliHLTMUONConstants::TracksBlockDataType() = "TRACKS :MUON"
113 * AliHLTMUONConstants::SinglesDecisionBlockDataType() = "DECIDSIN:MUON"
114 * AliHLTMUONConstants::PairsDecisionBlockDataType() = "DECIDPAR:MUON"
115 * @param [out] list The list of data types to be filled.
117 virtual void GetInputDataTypes(AliHLTComponentDataTypeList& list) const;
120 * Inherited from AliHLTTrigger. Returns the following output types generated
122 * kAliHLTDataTypeTriggerDecision
123 * kAliHLTDataTypeEventStatistics|kAliHLTDataOriginHLT
124 * Including the type kAliHLTDataTypeReadoutList implicitly.
125 * @param [out] list The list of data types to be filled.
127 virtual void GetOutputDataTypes(AliHLTComponentDataTypeList& list) const;
130 * Inherited from AliHLTTrigger. Returns the estimated data volume required
131 * in bytes: constBase + input_volume * inputMultiplier
132 * @param [out] constBase Additive part, independent of the input data volume.
133 * @param [out] inputMultiplier Multiplication ratio.
135 virtual void GetOutputDataSize(unsigned long& constBase, double& inputMultiplier);
138 * Inherited from AliHLTComponent.
139 * \returns a new instance of AliHLTMuonSpectroTriggerComponent.
141 virtual AliHLTComponent* Spawn();
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.
151 virtual Int_t DoInit(int argc, const char** argv);
154 * Inherited from AliHLTComponent. Cleans up the component.
155 * \returns Zero on success and negative number on failure.
157 virtual Int_t DoDeinit();
160 * Inherited from AliHLTComponent. Makes a trigger decision for the muon
162 * @return Zero is returned on success and a negative error code on failure.
164 virtual int DoTrigger();
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*/);
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.
179 template <typename BlockReader>
180 bool IsBlockOk(const BlockReader& reader, const AliHLTComponentDataType& type) const;
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.
185 bool fTriggerDDLs; //! If true then the component will trigger on any dll in the tracking and trigger chambers.
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.
191 ClassDef(AliHLTMuonSpectroTriggerComponent, 0); // Trigger component for the muon spectrometer.
194 #endif // AliHLTMUONSPECTROTRIGGERCOMPONENT_H