]> git.uio.no Git - u/mrichter/AliRoot.git/blob - HLT/MUON/OfflineInterface/AliHLTMUONRecHitsSource.h
Introducing Raw data QA and replacing the QA data histograms by a Tlist of histograms
[u/mrichter/AliRoot.git] / HLT / MUON / OfflineInterface / AliHLTMUONRecHitsSource.h
1 #ifndef ALIHLTMUONRECHITSSOURCE_H
2 #define ALIHLTMUONRECHITSSOURCE_H
3 /**************************************************************************
4  * This file is property of and copyright by the ALICE HLT Project        * 
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     *
15  * about the suitability of this software for any purpose. It is          * 
16  * provided "as is" without express or implied warranty.                  *
17  **************************************************************************/
18
19 /* $Id$ */
20
21 /**
22  * @file   AliHLTMUONRecHitsSource.h
23  * @author Artur Szostak <artursz@iafrica.com>
24  * @date   
25  * @brief  Class for generating reconstructed hits data blocks from AliRoot data.
26  */
27
28 #include "AliHLTOfflineDataSource.h"
29
30 class AliMUONMCDataInterface;
31 class AliMUONDataInterface;
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
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...
52  */
53 class AliHLTMUONRecHitsSource : public AliHLTOfflineDataSource
54 {
55 public:
56
57         AliHLTMUONRecHitsSource();
58         virtual ~AliHLTMUONRecHitsSource();
59         
60         virtual int GetEvent(
61                         const AliHLTComponentEventData& evtData,
62                         AliHLTComponentTriggerData& trigData,
63                         AliHLTUInt8_t* outputPtr, 
64                         AliHLTUInt32_t& size,
65                         vector<AliHLTComponentBlockData>& outputBlocks
66                 );
67         
68         virtual const char* GetComponentID();
69
70         virtual AliHLTComponentDataType GetOutputDataType();
71
72         virtual void GetOutputDataSize(unsigned long& constBase, double& inputMultiplier);
73
74         virtual AliHLTComponent* Spawn();
75
76 protected:
77
78         virtual int DoInit(int argc, const char** argv);
79         virtual int DoDeinit();
80         
81 private:
82
83         // Prevent copying of these objects.
84         AliHLTMUONRecHitsSource(const AliHLTMUONRecHitsSource& /*object*/);
85         AliHLTMUONRecHitsSource& operator = (const AliHLTMUONRecHitsSource& /*object*/);
86         
87         AliMUONMCDataInterface* fMCDataInterface; // access to MUON MC-related data
88         AliMUONDataInterface* fDataInterface; // access to MUON data
89
90         enum SelectionType
91         {
92                 kLeftPlane,  // everything from x < 0
93                 kRightPlane, // everything from x >= 0
94                 kWholePlane  // for all x
95         };
96         
97         /**
98          * Parses a string with the following format:
99          *   <number>|<number>-<number>[,<number>|<number>-<number>]...
100          * For example: 1  1,2,3  1-2   1,2-4,5  etc...
101          * Flags in the fServeChamber will be set to 'true' for all appropriate
102          * values parsed.
103          * @param str  The string to parse.
104          * @return  Zero on success and EINVAL if there is a parse error.
105          */
106         int ParseChamberString(const char* str);
107
108         SelectionType fSelection; //! Indicates if we should publish from the left, right or whole XY plane.
109         bool fServeChamber[10]; //! Flag to indicate if hits from a given chamber should be published.
110
111         ClassDef(AliHLTMUONRecHitsSource, 0); // dHLT data source for reconstructed hit data blocks.
112 };
113
114 #endif // ALIHLTMUONRECHITSSOURCE_H