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