]> git.uio.no Git - u/mrichter/AliRoot.git/blob - HLT/MUON/OfflineInterface/AliHLTMUONRecHitsSource.h
Adding some extra information about the components usage.
[u/mrichter/AliRoot.git] / HLT / MUON / OfflineInterface / AliHLTMUONRecHitsSource.h
1 #ifndef ALIHLTMUONRECHITSSOURCE_H
2 #define ALIHLTMUONRECHITSSOURCE_H
3 /* Copyright(c) 1998-2007, ALICE Experiment at CERN, All rights reserved. *
4  * See cxx source for full Copyright notice                               */
5
6 /* $Id$ */
7
8 /**
9  * @file   AliHLTMUONRecHitsSource.h
10  * @author Artur Szostak <artursz@iafrica.com>
11  * @date   
12  * @brief  Class for generating reconstructed hits data blocks from AliRoot data.
13  */
14
15 #include "AliHLTOfflineDataSource.h"
16
17 class AliMUONSimData;
18 class AliMUONRecData;
19 class AliRunLoader;
20 class AliLoader;
21
22 /**
23  * AliHLTMUONRecHitsSource is a HLT-AliRoot data source object which generates
24  * and serves AliHLTMUONRecHitsBlockStruct type data blocks to the HLT system.
25  * This is meant as a debugging utility which can optionally generate the data
26  * blocks from simulated GEANT hits or MUON offline reconstructed hits.
27  *
28  * Command line flags:
29  *  -simdata
30  *      Specify this option to publish GEANT hits.
31  *  -recdata
32  *      Specify this option to publish offline reconstructed raw clusters.
33  *  -plane left|right|all
34  *      Specifies if data from the left (x < 0), right (x >= 0) or the whole XY
35  *      plane should be published.
36  *  -chamber <number>|<number>-<number>[,<number>|<number>-<number>]...
37  *      Selects the chambers from which to publish data. Valid chamber numbers
38  *      in the range [1..10]. The string after '-chamber' is a comma separated
39  *      list of numbers or ranges. Some examples of strings:
40  *      1  1-2  1,2,3  1,3-5,7 etc...
41  */
42 class AliHLTMUONRecHitsSource : public AliHLTOfflineDataSource
43 {
44 public:
45
46         AliHLTMUONRecHitsSource();
47         virtual ~AliHLTMUONRecHitsSource();
48         
49         virtual int GetEvent(
50                         const AliHLTComponentEventData& evtData,
51                         AliHLTComponentTriggerData& trigData,
52                         AliHLTUInt8_t* outputPtr, 
53                         AliHLTUInt32_t& size,
54                         vector<AliHLTComponentBlockData>& outputBlocks
55                 );
56         
57         virtual const char* GetComponentID();
58
59         virtual AliHLTComponentDataType GetOutputDataType();
60
61         virtual void GetOutputDataSize(unsigned long& constBase, double& inputMultiplier);
62
63         virtual AliHLTComponent* Spawn();
64
65 protected:
66
67         virtual int DoInit(int argc, const char** argv);
68         virtual int DoDeinit();
69         
70 private:
71
72         enum SelectionType
73         {
74                 kLeftPlane,  // everything from x < 0
75                 kRightPlane, // everything from x >= 0
76                 kWholePlane  // for all x
77         };
78         
79         /**
80          * Parses a string with the following format:
81          *   <number>|<number>-<number>[,<number>|<number>-<number>]...
82          * For example: 1  1,2,3  1-2   1,2-4,5  etc...
83          * Flags in the fServeChamber will be set to 'true' for all appropriate
84          * values parsed.
85          * @param str  The string to parse.
86          * @return  Zero on success and EINVAL if there is a parse error.
87          */
88         int ParseChamberString(const char* str);
89
90         AliMUONSimData* fSimData; //! MUON module interface to simulated data.
91         AliMUONRecData* fRecData; //! MUON module interface to reconstructed data.
92         AliRunLoader* fRunLoader; //! A pointer to the AliRunLoader instance.
93         AliLoader* fLoader; //! Pointer to the MUON loader instance.
94         SelectionType fSelection; //! Indicates if we should publish from the left, right or whole XY plane.
95         bool fServeChamber[10]; //! Flag to indicate if hits from a given chamber should be published.
96
97         ClassDef(AliHLTMUONRecHitsSource, 0); // dHLT data source for reconstructed hit data blocks.
98 };
99
100 #endif // ALIHLTMUONRECHITSSOURCE_H