]> git.uio.no Git - u/mrichter/AliRoot.git/blob - HLT/MUON/AliHLTMUONDataTypes.h
Adding definitions for the fields of the lookup tables used in the dHLT analysis...
[u/mrichter/AliRoot.git] / HLT / MUON / AliHLTMUONDataTypes.h
1 #ifndef ALIHLTMUONDATATYPES_H
2 #define ALIHLTMUONDATATYPES_H
3 /**************************************************************************
4  * Copyright(c) 1998-2007, ALICE Experiment at CERN, All rights reserved. *
5  *                                                                        *
6  * Author: The ALICE Off-line Project.                                    *
7  * Contributors are mentioned in the code where appropriate.              *
8  *                                                                        *
9  * Permission to use, copy, modify and distribute this software and its   *
10  * documentation strictly for non-commercial purposes is hereby granted   *
11  * without fee, provided that the above copyright notice appears in all   *
12  * copies and that both the copyright notice and this permission notice   *
13  * appear in the supporting documentation. The authors make no claims     *
14  * about the suitability of this software for any purpose. It is          *
15  * provided "as is" without express or implied warranty.                  *
16  **************************************************************************/
17
18 /* $Id$ */
19
20 /**
21  * @file   AliHLTMUONDataTypes.h
22  * @author Artur Szostak <artursz@iafrica.com>
23  * @date   
24  * @brief  Declaration of basic data types used in HLT/MUON module.
25  *
26  * The types and structs are defined with C linkage since C generally gives us
27  * more binary compatibility between compilers.
28  */
29
30 #include "AliHLTDataTypes.h"
31 #include <ostream>
32
33 extern "C"
34 {
35
36 /**
37  * The common internal dimuon HLT data block header.
38  * These headers help to identify the data block when it is written to disk and
39  * helps to check the integrity of the data blocks in the system.
40  */
41 struct AliHLTMUONDataBlockHeader
42 {
43         AliHLTUInt16_t fType; // The type of the data block. Must contain a value
44                               // defined by AliHLTMUONDataBlockType.
45         AliHLTUInt16_t fRecordWidth; // The number of bytes each record uses. 
46         AliHLTUInt32_t fNrecords; // Number of records in this data block.
47 };
48
49 /**
50  * The field structure of a single row of the AliHLTMUONHitReconstructor component's
51  * lookup table.
52  */
53 struct AliHLTMUONHitRecoLutRow
54 {
55         AliHLTInt32_t fDetElemId;  // The detector element ID of the pad.
56         AliHLTInt32_t fIX, fIY;    // The X,Y number of the pad.
57         AliHLTFloat32_t fRealX, fRealY, fRealZ;  // The real coordinate of the pad.
58         AliHLTFloat32_t fHalfPadSize; // half padsize in X for bending and Y for nonbending
59         AliHLTInt32_t fPlane;  // The plane and PCB zone ID numbers.
60         AliHLTFloat32_t fPed, fSigma, fA0, fA1; // Calibration values
61         AliHLTInt32_t fThres, fSat; //Calibration values
62 };
63
64 /**
65  * The field structure of a single row of the AliHLTMUONTriggerReconstructor component's
66  * lookup table.
67  */
68 struct AliHLTMUONTriggerRecoLutRow
69 {
70         AliHLTFloat32_t fX;  // Global X coordinate of channel.
71         AliHLTFloat32_t fY;  // Global Y coordinate of channel.
72         AliHLTFloat32_t fZ;  // Global Z coordinate of channel.
73 };
74
75 } // extern "C"
76
77
78 /**
79  * The sign/charge of a particle.
80  */
81 enum AliHLTMUONParticleSign
82 {
83         kSignMinus   = -1,
84         kSignUnknown = 0,
85         kSignPlus    = 1
86 };
87
88 /**
89  * The chamber names of the dimuon spectrometer.
90  */
91 enum AliHLTMUONChamberName
92 {
93         kUnknownChamber = -1,
94         kChamber1 = 0,
95         kChamber2 = 1,
96         kChamber3 = 2,
97         kChamber4 = 3,
98         kChamber5 = 4,
99         kChamber6 = 5,
100         kChamber7 = 6,
101         kChamber8 = 7,
102         kChamber9 = 8,
103         kChamber10 = 9,
104         kChamber11 = 10,
105         kChamber12 = 11,
106         kChamber13 = 12,
107         kChamber14 = 13
108 };
109
110 /**
111  * The internal data block type codes.
112  */
113 enum AliHLTMUONDataBlockType
114 {
115         kUnknownDataBlock = 0,
116         kTriggerRecordsDataBlock = 1000,
117         kTrigRecsDebugDataBlock = 1001,
118         kTriggerChannelsDataBlock = 1002,
119         kRecHitsDataBlock = 2000,
120         kClustersDataBlock = 2001,
121         kChannelsDataBlock = 2002,
122         kMansoTracksDataBlock = 3000,
123         kMansoCandidatesDataBlock = 3001,
124         kSinglesDecisionDataBlock = 4000,
125         kPairsDecisionDataBlock = 4001
126 };
127
128
129 /**
130  * Stream operator to be able to print AliHLTMUONParticleSign with human
131  * readable names to some stream object like cout (standard output).
132  */
133 inline std::ostream& operator << (std::ostream& stream, AliHLTMUONParticleSign sign)
134 {
135         switch (sign)
136         {
137         case kSignMinus:   stream << "kSignMinus";   break;
138         case kSignUnknown: stream << "kSignUnknown"; break;
139         case kSignPlus:    stream << "kSignPlus";    break;
140         default:           stream << "INVALID";
141         }
142         return stream;
143 }
144
145 /**
146  * Stream operator to be able to print AliHLTMUONChamberName with human
147  * readable names to some stream object like cout (standard output).
148  */
149 inline std::ostream& operator << (std::ostream& stream, AliHLTMUONChamberName chamber)
150 {
151         switch (chamber)
152         {
153         case kUnknownChamber:  stream << "kUnknownChamber";  break;
154         case kChamber1:        stream << "kChamber1";        break;
155         case kChamber2:        stream << "kChamber2";        break;
156         case kChamber3:        stream << "kChamber3";        break;
157         case kChamber4:        stream << "kChamber4";        break;
158         case kChamber5:        stream << "kChamber5";        break;
159         case kChamber6:        stream << "kChamber6";        break;
160         case kChamber7:        stream << "kChamber7";        break;
161         case kChamber8:        stream << "kChamber8";        break;
162         case kChamber9:        stream << "kChamber9";        break;
163         case kChamber10:       stream << "kChamber10";       break;
164         case kChamber11:       stream << "kChamber11";       break;
165         case kChamber12:       stream << "kChamber12";       break;
166         case kChamber13:       stream << "kChamber13";       break;
167         case kChamber14:       stream << "kChamber14";       break;
168         default:               stream << "INVALID";
169         }
170         return stream;
171 }
172
173 /**
174  * Stream operator to be able to print AliHLTMUONDataBlockType with human
175  * readable names to some stream object like cout (standard output).
176  */
177 inline std::ostream& operator << (std::ostream& stream, AliHLTMUONDataBlockType type)
178 {
179         switch (type)
180         {
181         case kUnknownDataBlock:         stream << "kUnknownDataBlock";         break;
182         case kTriggerRecordsDataBlock:  stream << "kTriggerRecordsDataBlock";  break;
183         case kTrigRecsDebugDataBlock:   stream << "kTrigRecsDebugDataBlock";   break;
184         case kTriggerChannelsDataBlock: stream << "kTriggerChannelsDataBlock"; break;
185         case kRecHitsDataBlock:         stream << "kRecHitsDataBlock";         break;
186         case kClustersDataBlock:        stream << "kClustersDataBlock";        break;
187         case kChannelsDataBlock:        stream << "kChannelsDataBlock";        break;
188         case kMansoTracksDataBlock:     stream << "kMansoTracksDataBlock";     break;
189         case kMansoCandidatesDataBlock: stream << "kMansoCandidatesDataBlock"; break;
190         case kSinglesDecisionDataBlock: stream << "kSinglesDecisionDataBlock"; break;
191         case kPairsDecisionDataBlock:   stream << "kPairsDecisionDataBlock";   break;
192         default:                        stream << "INVALID";
193         }
194         return stream;
195 }
196
197 /**
198  * Stream operator for usage with std::ostream classes which prints the common
199  * data block header in the following format:
200  *  {fType = xx, fRecordWidth = yy, fNrecords = zz}
201  */
202 inline std::ostream& operator << (
203                 std::ostream& stream, const AliHLTMUONDataBlockHeader& header
204         )
205 {
206         stream  << "{fType = " << AliHLTMUONDataBlockType(header.fType)
207                 << ", fRecordWidth = " << header.fRecordWidth
208                 << ", fNrecords = " << header.fNrecords << "}";
209         return stream;
210 }
211
212
213 inline bool operator == (
214                 const AliHLTMUONDataBlockHeader& a, const AliHLTMUONDataBlockHeader& b
215         )
216 {
217         return a.fType == b.fType and a.fRecordWidth == b.fRecordWidth
218                 and a.fNrecords == b.fNrecords;
219 }
220
221 inline bool operator != (
222                 const AliHLTMUONDataBlockHeader& a, const AliHLTMUONDataBlockHeader& b
223         )
224 {
225         return not operator == (a, b);
226 }
227
228 #endif // ALIHLTMUONDATATYPES_H