]>
Commit | Line | Data |
---|---|---|
b12fe461 | 1 | #ifndef ALIHLTMUONHITRECONSTRUCTOR_H |
2 | #define ALIHLTMUONHITRECONSTRUCTOR_H | |
960d54ad | 3 | /************************************************************************** |
4 | * This file is property of and copyright by the ALICE HLT Project * | |
5 | * All rights reserved. * | |
6 | * * | |
7 | * Primary Authors: * | |
8 | * Indranil Das <indra.das@saha.ac.in> * | |
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 | **************************************************************************/ | |
b12fe461 | 18 | |
19 | /* $Id$ */ | |
20 | ||
21 | /////////////////////////////////////////////// | |
22 | //Author : Indranil Das, SINP, INDIA | |
23 | // Sukalyan Chattopadhyay, SINP, INDIA | |
24 | // | |
b12fe461 | 25 | //Email : indra.das@saha.ac.in |
26 | // sukalyan.chattopadhyay@saha.ac.in | |
27 | /////////////////////////////////////////////// | |
28 | ||
29486e5a | 29 | #include "AliHLTMUONDataTypes.h" |
b12fe461 | 30 | #include <iostream> |
31 | #include <cstdio> | |
32 | #include <fstream> | |
33 | #include <cstring> | |
34 | #include <cmath> | |
35 | #include <map> | |
36 | ||
960d54ad | 37 | #include <TString.h> |
38 | ||
b12fe461 | 39 | #include <AliHLTLogging.h> |
b12fe461 | 40 | |
960d54ad | 41 | #include "AliRawReader.h" |
42 | #include "AliRawReaderFile.h" | |
43 | #include "AliRawReaderRoot.h" | |
44 | #include "AliRawReaderDate.h" | |
b12fe461 | 45 | |
960d54ad | 46 | #if __GNUC__ < 3 |
47 | #define std | |
48 | #endif | |
b12fe461 | 49 | |
960d54ad | 50 | |
51 | typedef std::map<int,int> BusToDetElem; | |
52 | typedef std::map<int,int> BusToDDL; | |
53 | ||
54 | extern "C" struct AliHLTMUONRecHitStruct; | |
b12fe461 | 55 | |
56 | ||
57 | class AliHLTMUONHitReconstructor : public AliHLTLogging | |
58 | { | |
59 | public: | |
60 | ||
baff881d | 61 | struct DHLTLut{ |
62 | int fIdManuChannel; // Manu channel address | |
63 | int fIX,fIY; // The X,Y number of the pad. | |
64 | float fRealX,fRealY,fRealZ; // The real coordinate of the pad. | |
65 | int fPlane,fPcbZone; // The plane and PCB zone ID numbers. | |
66 | }; | |
67 | ||
68 | struct DHLTPad{ | |
69 | int fDetElemId; // The detector element ID of the pad. | |
70 | int fBuspatchId; // The bus patch ID number for the pad. | |
71 | int fIdManuChannel; // The Manu channel address. | |
72 | int fIX,fIY; // The X,Y number of the pad. | |
73 | float fRealX,fRealY,fRealZ; // The real coordinate of the pad. | |
74 | int fPlane,fPcbZone; // The plane and PCB zone ID numbers. | |
75 | int fCharge; // The charge measured on the pad. | |
76 | }; | |
77 | ||
b12fe461 | 78 | AliHLTMUONHitReconstructor(); |
79 | virtual ~AliHLTMUONHitReconstructor(void); | |
80 | ||
81 | bool LoadLookUpTable(DHLTLut* lookUpTableData, int lookUpTableId); | |
82 | bool SetBusToDetMap(BusToDetElem busToDetElem); | |
960d54ad | 83 | bool SetBusToDDLMap(BusToDDL busToDDL); |
b12fe461 | 84 | |
29486e5a | 85 | bool Run( |
86 | const AliHLTUInt32_t* rawData, | |
87 | AliHLTUInt32_t rawDataSize, | |
88 | AliHLTMUONRecHitStruct* recHit, | |
89 | AliHLTUInt32_t& nofHit | |
90 | ); | |
b12fe461 | 91 | void SetDCCut(int dcCut) {fDCCut = dcCut;} |
92 | void SetDebugLevel(int debugLevel) {fDebugLevel = debugLevel;} | |
baff881d | 93 | int GetDebugLevel() const {return fDebugLevel;} |
b12fe461 | 94 | int GetDEId(int iBusPatch) {return fBusToDetElem[iBusPatch] ;} |
95 | ||
baff881d | 96 | int GetLutLine(int iDDL) const; |
97 | ||
98 | static int GetkDetectorId() { return fgkDetectorId; } | |
99 | static int GetkDDLOffSet() { return fgkDDLOffSet; } | |
100 | static int GetkNofDDL() { return fgkNofDDL; } | |
101 | static int GetkDDLHeaderSize() { return fgkDDLHeaderSize; } | |
b12fe461 | 102 | |
baff881d | 103 | private: |
b12fe461 | 104 | static const int fgkDetectorId ; // DDL Offset |
105 | static const int fgkDDLOffSet ; // DDL Offset | |
106 | static const int fgkNofDDL ; // Number of DDL | |
960d54ad | 107 | static const int fgkDDLHeaderSize ; // DDL header size |
108 | ||
b12fe461 | 109 | protected: |
110 | AliHLTMUONHitReconstructor(const AliHLTMUONHitReconstructor& rhs); // copy constructor | |
111 | AliHLTMUONHitReconstructor& operator=(const AliHLTMUONHitReconstructor& rhs); // assignment operator | |
b12fe461 | 112 | |
960d54ad | 113 | private: |
b12fe461 | 114 | |
960d54ad | 115 | static const int fgkEvenLutSize ; // Size of the LookupTable with event DDLID |
116 | static const int fgkOddLutSize ; // Size of the LookupTable with odd DDLID | |
117 | static const int fgkLutLine[2]; // nof Line in LookupTable | |
b12fe461 | 118 | |
960d54ad | 119 | static const int fgkMinIdManuChannel[2]; // Minimum value of idManuChannel in LookupTable |
120 | static const int fgkMaxIdManuChannel[2]; // Maximum value of idManuChannel in LookupTable | |
121 | static const float fgkHalfPadSize[3]; // pad halflength for the pcb zones | |
b12fe461 | 122 | |
960d54ad | 123 | int fkBlockHeaderSize; // Block header size |
124 | int fkDspHeaderSize; // DSP header size | |
125 | int fkBuspatchHeaderSize; // buspatch header size | |
b12fe461 | 126 | |
960d54ad | 127 | int fDCCut; // DC Cut value |
b12fe461 | 128 | |
960d54ad | 129 | DHLTPad* fPadData; // pointer to the array containing the information of each padhits |
130 | DHLTLut* fLookUpTableData; // pointer to the array of Lookuptable data | |
b12fe461 | 131 | |
960d54ad | 132 | AliHLTMUONRecHitStruct *fRecPoints; // Reconstructed hits |
29486e5a | 133 | AliHLTUInt32_t *fRecPointsCount; // nof reconstructed hit |
134 | AliHLTUInt32_t fMaxRecPointsCount; // max nof reconstructed hit | |
b12fe461 | 135 | |
960d54ad | 136 | int fCentralCountB, fCentralCountNB; // centeral hits |
b12fe461 | 137 | int fIdOffSet,fDDLId; // DDLId and DDL id offset |
960d54ad | 138 | int fDigitPerDDL; // Total nof Digits perDDL |
b12fe461 | 139 | |
140 | int *fDetManuChannelIdList; // pointer to an array of idManuChannel | |
141 | int *fCentralChargeB,*fCentralChargeNB; // pointer to an array of central hit | |
142 | float *fRecX,*fRecY; // pointer to an array of reconstructed hit | |
143 | float *fAvgChargeX,*fAvgChargeY; // average charge on central pad found using CG method | |
144 | int fGetIdTotalData[336][80][2] ; // an array of idManuChannel with argumrnt of centralX,centralY and planeType | |
145 | int fNofFiredDetElem,fMaxFiredPerDetElem[13]; // counter for detector elements that are fired | |
146 | int fDebugLevel; | |
baff881d | 147 | BusToDetElem fBusToDetElem; // Mapping between bus address and detector element ID. |
960d54ad | 148 | BusToDetElem fBusToDDL; // Mapping between bus address and DDL. |
149 | ||
b12fe461 | 150 | |
29486e5a | 151 | bool ReadDDL(const AliHLTUInt32_t* rawData, AliHLTUInt32_t rawDataSize); |
b12fe461 | 152 | void FindCentralHits(int minPadId, int maxPadId); |
153 | bool FindRecHits() ; | |
154 | void RecXRecY(); | |
155 | bool MergeRecHits(); | |
156 | ||
b12fe461 | 157 | }; |
158 | ||
b12fe461 | 159 | #endif // ALIHLTMUONHITRECONSTRUCTOR_H |