1 #ifndef ALIHLTMUONDIGITPUBLISHERCOMPONENT_H
2 #define ALIHLTMUONDIGITPUBLISHERCOMPONENT_H
3 /* This file is property of and copyright by the ALICE HLT Project *
4 * ALICE Experiment at CERN, All rights reserved. *
5 * See cxx source for full Copyright notice */
7 // $Id: AliHLTMUONDigitPublisherComponent.h 26179 2008-05-29 22:27:27Z aszostak $
10 /// @file AliHLTMUONDigitPublisherComponent.h
11 /// @author Artur Szostak <artursz@iafrica.com>
13 /// @brief Declaration of a component to publish MUON data from digits.
16 #include "AliHLTOfflineDataSource.h"
19 #if __GNUC__ && __GNUC__ < 3
23 class AliMUONVDigitStore;
24 class AliMUONVTriggerStore;
26 class AliMUONMCDataInterface;
27 class AliMUONDataInterface;
30 * @class AliHLTMUONDigitPublisherComponent
31 * The component is used to convert simulated or reconstructed digits into DDL
32 * raw data streams on the fly and publish them. This is useful for running
33 * dHLT simulations on digit data where the raw data files are not available.
34 * The component is also used during dHLT simulation under AliSimulation where
35 * we do not have access to a rawReader.<br>
37 * Component ID: \b MUONDigitPublisher <br>
38 * Library: \b libAliHLTMUON.so <br>
40 * Manditory arguments:<br>
41 * \li -ddl <number> <br>
42 * Specifies which DDL to generate raw data for. <number> should be in the
43 * range [1..22], where 1..20 are for tracker DDLs and 21 or 22 is for the
46 * Optional arguments:<br>
48 * This is an alternative to using -ddl which allows specifying a DDL in
49 * terms of the DDL equipment IDs.<br>
50 * \li -makescalars <br>
51 * If set then the scalar events will be generated for the trigger DDLs.
52 * (default is not to generate the scalars)<br>
54 * Indicates that the simulated digits should be used. (default option)<br>
56 * Indicates that the reconstructed digits tree should be used.<br>
57 * \li -firstevent <number> <br>
58 * Indicates the first event number to fetch from AliRoot. The default is to
59 * start from zero and increment the event number after every GetEvent call.
60 * This mode causes the component to ignore the event number passed to it by
61 * the system and rather use an internal counter. This mode can be overriden
62 * with the -event_number_literal flag. <br>
63 * \li -event_number_literal <br>
64 * This flag indicates to use the event numbers as literal indices into the
65 * AliRoot trees. This option will cause the component to ignore the -firstevent
67 * \li -exclude_chamber <number>|<number>-<number>[,<number>|<number>-<number>,...] <br>
68 * Allows one to exclude (mask out) digits from certain chambers in the generated
69 * raw DDL stream. The chamber numbers <number> should be in the range [1..10]. <br>
70 * \li -exclude_detelem <number>|<number>-<number>[,<number>|<number>-<number>,...] <br>
71 * Allows one to exclude (mask out) digits from certain detector elements in
72 * the generated raw DDL stream. The detector element ID numbers <number> should
73 * be in the range [100..1099]. <br>
75 * @ingroup alihlt_muon_components
77 class AliHLTMUONDigitPublisherComponent : public AliHLTOfflineDataSource
80 AliHLTMUONDigitPublisherComponent();
81 virtual ~AliHLTMUONDigitPublisherComponent();
83 // Public functions to implement AliHLTComponent's interface.
84 // These functions are required for the component registration process.
86 virtual const char* GetComponentID();
87 virtual AliHLTComponentDataType GetOutputDataType();
88 virtual void GetOutputDataSize( unsigned long& constBase, double& inputMultiplier );
89 virtual AliHLTComponent* Spawn();
93 // Protected functions to implement AliHLTComponent's interface.
94 // These functions provide initialization as well as the actual processing
95 // capabilities of the component.
97 virtual int DoInit(int argc, const char** argv);
98 virtual int DoDeinit();
100 virtual int GetEvent(
101 const AliHLTComponentEventData& evtData,
102 AliHLTComponentTriggerData& trigData,
103 AliHLTUInt8_t* outputPtr,
104 AliHLTUInt32_t& size,
105 AliHLTComponentBlockDataList& outputBlocks
108 using AliHLTOfflineDataSource::GetEvent;
112 // Do not allow copying of this class.
113 AliHLTMUONDigitPublisherComponent(const AliHLTMUONDigitPublisherComponent& /*obj*/);
114 AliHLTMUONDigitPublisherComponent& operator = (const AliHLTMUONDigitPublisherComponent& /*obj*/);
116 int ParseChamberString(const char* str);
117 int ParseDetElemString(const char* str);
119 /////////////////////////////////////////////////////////////////////////////////////////
120 // Methods copied from AliMUONRawWriter.
121 //TODO: This is not ideal. We should have AliMUONRawWriter re-factored so that
122 // we can have raw data generated into a memory resident buffer, rather than
123 // always written to a file on disk, as it is now. But this will take some time
124 // since people need to be convinced of this fact.
125 void Digits2BusPatchMap(
126 const AliMUONVDigitStore& digitStore,
127 AliMpExMap& busPatchMap, Int_t iDDL
131 const AliMUONVDigitStore* digitStore, Int_t iDDL,
132 AliHLTUInt8_t* outBuffer, AliHLTUInt32_t& outBufferSize
136 const AliMUONVTriggerStore* triggerStore, Int_t iDDL,
137 AliHLTUInt8_t* outBuffer, AliHLTUInt32_t& outBufferSize,
138 bool scalarEvent = false
141 static void LocalWordPacking(UInt_t &word, UInt_t locId, UInt_t locDec,
142 UInt_t trigY, UInt_t posY, UInt_t posX,
143 UInt_t sdevX, UInt_t devX);
145 /////////////////////////////////////////////////////////////////////////////////////////
147 AliHLTInt32_t fDDL; ///< DDL number in the range [0..21]. Set to -1 for invalid/unspecified value.
149 Int_t fCurrentEventIndex; ///< The current event index that is to be loaded.
150 // -1 indicates that we should rather use the event
151 // numbers as given by the system.
153 bool fMakeScalars; ///< Flag indicating if the scalars should be generated for the trigger DDLs.
155 AliMUONMCDataInterface* fMCDataInterface; ///< Access to MUON MC-related data.
156 AliMUONDataInterface* fDataInterface; ///< Access to MUON data.
158 TArrayI fChamberExclusionList; //! Exclusion list for tracking chambers.
159 TArrayI fDetElemExclusionList; //! Exclusion list for tracking detector elements.
161 ClassDef(AliHLTMUONDigitPublisherComponent, 0) // dHLT component for publishing DDL streams from digits on the fly.
164 #endif // ALIHLTMUONDIGITPUBLISHERCOMPONENT_H