]>
Commit | Line | Data |
---|---|---|
3dd14e20 | 1 | #ifndef ALIHLTMUONRECHITSSOURCE_H |
2 | #define ALIHLTMUONRECHITSSOURCE_H | |
bef07620 | 3 | /************************************************************************** |
1d8ae082 | 4 | * This file is property of and copyright by the ALICE HLT Project * |
bef07620 | 5 | * All rights reserved. * |
6 | * * | |
7 | * Primary Authors: * | |
8 | * Artur Szostak <artursz@iafrica.com> * | |
9 | * * | |
10 | * Permission to use, copy, modify and distribute this software and its * | |
11 | * documentation strictly for non-commercial purposes is hereby granted * | |
12 | * without fee, provided that the above copyright notice appears in all * | |
13 | * copies and that both the copyright notice and this permission notice * | |
14 | * appear in the supporting documentation. The authors make no claims * | |
1d8ae082 | 15 | * about the suitability of this software for any purpose. It is * |
bef07620 | 16 | * provided "as is" without express or implied warranty. * |
17 | **************************************************************************/ | |
3dd14e20 | 18 | |
1d8ae082 | 19 | // $Id$ |
3dd14e20 | 20 | |
6253e09b | 21 | /// |
22 | /// @file AliHLTMUONRecHitsSource.h | |
23 | /// @author Artur Szostak <artursz@iafrica.com> | |
1d8ae082 | 24 | /// @date 28 May 2007 |
6253e09b | 25 | /// @brief Class for generating reconstructed hits data blocks from AliRoot data. |
26 | /// | |
3dd14e20 | 27 | |
28 | #include "AliHLTOfflineDataSource.h" | |
29 | ||
8d33d1c2 | 30 | class AliMUONMCDataInterface; |
31 | class AliMUONDataInterface; | |
3dd14e20 | 32 | |
33 | /** | |
34 | * AliHLTMUONRecHitsSource is a HLT-AliRoot data source object which generates | |
35 | * and serves AliHLTMUONRecHitsBlockStruct type data blocks to the HLT system. | |
36 | * This is meant as a debugging utility which can optionally generate the data | |
159b743b | 37 | * blocks from simulated GEANT hits or MUON offline reconstructed hits. |
38 | * | |
39 | * Command line flags: | |
40 | * -simdata | |
41 | * Specify this option to publish GEANT hits. | |
42 | * -recdata | |
43 | * Specify this option to publish offline reconstructed raw clusters. | |
44 | * -plane left|right|all | |
45 | * Specifies if data from the left (x < 0), right (x >= 0) or the whole XY | |
46 | * plane should be published. | |
47 | * -chamber <number>|<number>-<number>[,<number>|<number>-<number>]... | |
48 | * Selects the chambers from which to publish data. Valid chamber numbers | |
49 | * in the range [1..10]. The string after '-chamber' is a comma separated | |
50 | * list of numbers or ranges. Some examples of strings: | |
51 | * 1 1-2 1,2,3 1,3-5,7 etc... | |
c06fe66f | 52 | * -firstevent <number> |
53 | * Indicates the first event number to fetch from AliRoot. The default is to | |
54 | * start from zero and increment the event number after every GetEvent call. | |
55 | * This mode causes the component to ignore the event number passed to it by | |
56 | * the system and rather use an internal counter. This mode can be overriden | |
57 | * with the -event_number_literal flag. | |
58 | * -event_number_literal | |
59 | * This flag indicates to use the event numbers as literal indices into the | |
60 | * AliRoot trees. This option will cause the component to ignore the -firstevent | |
61 | * flag. | |
3dd14e20 | 62 | */ |
63 | class AliHLTMUONRecHitsSource : public AliHLTOfflineDataSource | |
64 | { | |
65 | public: | |
66 | ||
67 | AliHLTMUONRecHitsSource(); | |
68 | virtual ~AliHLTMUONRecHitsSource(); | |
69 | ||
3dd14e20 | 70 | virtual const char* GetComponentID(); |
71 | ||
72 | virtual AliHLTComponentDataType GetOutputDataType(); | |
73 | ||
74 | virtual void GetOutputDataSize(unsigned long& constBase, double& inputMultiplier); | |
75 | ||
76 | virtual AliHLTComponent* Spawn(); | |
77 | ||
78 | protected: | |
79 | ||
80 | virtual int DoInit(int argc, const char** argv); | |
81 | virtual int DoDeinit(); | |
82 | ||
6253e09b | 83 | virtual int GetEvent( |
84 | const AliHLTComponentEventData& evtData, | |
85 | AliHLTComponentTriggerData& trigData, | |
86 | AliHLTUInt8_t* outputPtr, | |
87 | AliHLTUInt32_t& size, | |
ffb64d3e | 88 | AliHLTComponentBlockDataList& outputBlocks |
6253e09b | 89 | ); |
90 | ||
91 | using AliHLTOfflineDataSource::GetEvent; | |
92 | ||
3dd14e20 | 93 | private: |
94 | ||
baff881d | 95 | // Prevent copying of these objects. |
96 | AliHLTMUONRecHitsSource(const AliHLTMUONRecHitsSource& /*object*/); | |
97 | AliHLTMUONRecHitsSource& operator = (const AliHLTMUONRecHitsSource& /*object*/); | |
98 | ||
99 | AliMUONMCDataInterface* fMCDataInterface; // access to MUON MC-related data | |
100 | AliMUONDataInterface* fDataInterface; // access to MUON data | |
8d33d1c2 | 101 | |
5df25c2a | 102 | enum SelectionType |
103 | { | |
104 | kLeftPlane, // everything from x < 0 | |
105 | kRightPlane, // everything from x >= 0 | |
106 | kWholePlane // for all x | |
107 | }; | |
108 | ||
159b743b | 109 | /** |
110 | * Parses a string with the following format: | |
111 | * <number>|<number>-<number>[,<number>|<number>-<number>]... | |
112 | * For example: 1 1,2,3 1-2 1,2-4,5 etc... | |
113 | * Flags in the fServeChamber will be set to 'true' for all appropriate | |
114 | * values parsed. | |
115 | * @param str The string to parse. | |
116 | * @return Zero on success and EINVAL if there is a parse error. | |
117 | */ | |
5df25c2a | 118 | int ParseChamberString(const char* str); |
119 | ||
5df25c2a | 120 | SelectionType fSelection; //! Indicates if we should publish from the left, right or whole XY plane. |
121 | bool fServeChamber[10]; //! Flag to indicate if hits from a given chamber should be published. | |
c06fe66f | 122 | |
6253e09b | 123 | Int_t fCurrentEventIndex; //! The current event index that is loaded. |
124 | // -1 indicates that we should rather use the event | |
125 | // numbers as given by the system. | |
3dd14e20 | 126 | |
127 | ClassDef(AliHLTMUONRecHitsSource, 0); // dHLT data source for reconstructed hit data blocks. | |
128 | }; | |
129 | ||
130 | #endif // ALIHLTMUONRECHITSSOURCE_H |