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
68 * @ingroup alihlt_dimuon_component
70 class AliHLTMUONDigitPublisherComponent : public AliHLTOfflineDataSource
73 AliHLTMUONDigitPublisherComponent();
74 virtual ~AliHLTMUONDigitPublisherComponent();
76 // Public functions to implement AliHLTComponent's interface.
77 // These functions are required for the component registration process.
79 virtual const char* GetComponentID();
80 virtual AliHLTComponentDataType GetOutputDataType();
81 virtual void GetOutputDataSize( unsigned long& constBase, double& inputMultiplier );
82 virtual AliHLTComponent* Spawn();
86 // Protected functions to implement AliHLTComponent's interface.
87 // These functions provide initialization as well as the actual processing
88 // capabilities of the component.
90 virtual int DoInit(int argc, const char** argv);
91 virtual int DoDeinit();
94 const AliHLTComponentEventData& evtData,
95 AliHLTComponentTriggerData& trigData,
96 AliHLTUInt8_t* outputPtr,
98 vector<AliHLTComponentBlockData>& outputBlocks
101 using AliHLTOfflineDataSource::GetEvent;
105 // Do not allow copying of this class.
106 AliHLTMUONDigitPublisherComponent(const AliHLTMUONDigitPublisherComponent& /*obj*/);
107 AliHLTMUONDigitPublisherComponent& operator = (const AliHLTMUONDigitPublisherComponent& /*obj*/);
109 int ParseChamberString(const char* str);
110 int ParseDetElemString(const char* str);
112 /////////////////////////////////////////////////////////////////////////////////////////
113 // Methods copied from AliMUONRawWriter.
114 //TODO: This is not ideal. We should have AliMUONRawWriter re-factored so that
115 // we can have raw data generated into a memory resident buffer, rather than
116 // always written to a file on disk, as it is now. But this will take some time
117 // since people need to be convinced of this fact.
118 void Digits2BusPatchMap(
119 const AliMUONVDigitStore& digitStore,
120 AliMpExMap& busPatchMap, Int_t iDDL
124 const AliMUONVDigitStore* digitStore, Int_t iDDL,
125 AliHLTUInt8_t* outBuffer, AliHLTUInt32_t& outBufferSize
129 const AliMUONVTriggerStore* triggerStore, Int_t iDDL,
130 AliHLTUInt8_t* outBuffer, AliHLTUInt32_t& outBufferSize,
131 bool scalarEvent = false
134 static void LocalWordPacking(UInt_t &word, UInt_t locId, UInt_t locDec,
135 UInt_t trigY, UInt_t posY, UInt_t posX,
136 UInt_t sdevX, UInt_t devX);
138 /////////////////////////////////////////////////////////////////////////////////////////
140 AliHLTInt32_t fDDL; ///< DDL number in the range [0..21]. Set to -1 for invalid/unspecified value.
142 Int_t fCurrentEventIndex; ///< The current event index that is to be loaded.
143 // -1 indicates that we should rather use the event
144 // numbers as given by the system.
146 bool fMakeScalars; ///< Flag indicating if the scalars should be generated for the trigger DDLs.
148 AliMUONMCDataInterface* fMCDataInterface; ///< Access to MUON MC-related data.
149 AliMUONDataInterface* fDataInterface; ///< Access to MUON data.
151 TArrayI fChamberExclusionList; //! Exclusion list for tracking chambers.
152 TArrayI fDetElemExclusionList; //! Exclusion list for tracking detector elements.
154 ClassDef(AliHLTMUONDigitPublisherComponent, 0) // dHLT component for publishing DDL streams from digits on the fly.
157 #endif // ALIHLTMUONDIGITPUBLISHERCOMPONENT_H