1 #ifndef ALIHLTMUONHITRECONSTRUCTOR_H
2 #define ALIHLTMUONHITRECONSTRUCTOR_H
3 /**************************************************************************
4 * This file is property of and copyright by the ALICE HLT Project *
5 * All rights reserved. *
8 * Indranil Das <indra.das@saha.ac.in> *
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 **************************************************************************/
21 ///////////////////////////////////////////////
22 //Author : Indranil Das, SINP, INDIA
23 // Sukalyan Chattopadhyay, SINP, INDIA
25 //Email : indra.das@saha.ac.in
26 // sukalyan.chattopadhyay@saha.ac.in
27 ///////////////////////////////////////////////
38 #include <AliHLTLogging.h>
40 #include "AliRawReader.h"
41 #include "AliRawReaderFile.h"
42 #include "AliRawReaderRoot.h"
43 #include "AliRawReaderDate.h"
50 typedef std::map<int,int> BusToDetElem;
51 typedef std::map<int,int> BusToDDL;
53 extern "C" struct AliHLTMUONRecHitStruct;
56 class AliHLTMUONHitReconstructor : public AliHLTLogging
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.
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.
77 AliHLTMUONHitReconstructor();
78 virtual ~AliHLTMUONHitReconstructor(void);
80 bool LoadLookUpTable(DHLTLut* lookUpTableData, int lookUpTableId);
81 bool SetBusToDetMap(BusToDetElem busToDetElem);
82 bool SetBusToDDLMap(BusToDDL busToDDL);
84 bool Run(int* rawData, int *rawDataSize, AliHLTMUONRecHitStruct recHit[], int *nofHit);
85 void SetDCCut(int dcCut) {fDCCut = dcCut;}
86 void SetDebugLevel(int debugLevel) {fDebugLevel = debugLevel;}
87 int GetDebugLevel() const {return fDebugLevel;}
88 int GetDEId(int iBusPatch) {return fBusToDetElem[iBusPatch] ;}
90 int GetLutLine(int iDDL) const;
92 static int GetkDetectorId() { return fgkDetectorId; }
93 static int GetkDDLOffSet() { return fgkDDLOffSet; }
94 static int GetkNofDDL() { return fgkNofDDL; }
95 static int GetkDDLHeaderSize() { return fgkDDLHeaderSize; }
98 static const int fgkDetectorId ; // DDL Offset
99 static const int fgkDDLOffSet ; // DDL Offset
100 static const int fgkNofDDL ; // Number of DDL
101 static const int fgkDDLHeaderSize ; // DDL header size
104 AliHLTMUONHitReconstructor(const AliHLTMUONHitReconstructor& rhs); // copy constructor
105 AliHLTMUONHitReconstructor& operator=(const AliHLTMUONHitReconstructor& rhs); // assignment operator
109 static const int fgkEvenLutSize ; // Size of the LookupTable with event DDLID
110 static const int fgkOddLutSize ; // Size of the LookupTable with odd DDLID
111 static const int fgkLutLine[2]; // nof Line in LookupTable
113 static const int fgkMinIdManuChannel[2]; // Minimum value of idManuChannel in LookupTable
114 static const int fgkMaxIdManuChannel[2]; // Maximum value of idManuChannel in LookupTable
115 static const float fgkHalfPadSize[3]; // pad halflength for the pcb zones
117 int fkBlockHeaderSize; // Block header size
118 int fkDspHeaderSize; // DSP header size
119 int fkBuspatchHeaderSize; // buspatch header size
121 int fDCCut; // DC Cut value
123 DHLTPad* fPadData; // pointer to the array containing the information of each padhits
124 DHLTLut* fLookUpTableData; // pointer to the array of Lookuptable data
126 AliHLTMUONRecHitStruct *fRecPoints; // Reconstructed hits
127 int *fRecPointsCount; // nof reconstructed hit
128 int fMaxRecPointsCount; // max nof reconstructed hit
130 int fCentralCountB, fCentralCountNB; // centeral hits
131 int fIdOffSet,fDDLId; // DDLId and DDL id offset
132 int fDigitPerDDL; // Total nof Digits perDDL
134 int *fDetManuChannelIdList; // pointer to an array of idManuChannel
135 int *fCentralChargeB,*fCentralChargeNB; // pointer to an array of central hit
136 float *fRecX,*fRecY; // pointer to an array of reconstructed hit
137 float *fAvgChargeX,*fAvgChargeY; // average charge on central pad found using CG method
138 int fGetIdTotalData[336][80][2] ; // an array of idManuChannel with argumrnt of centralX,centralY and planeType
139 int fNofFiredDetElem,fMaxFiredPerDetElem[13]; // counter for detector elements that are fired
141 BusToDetElem fBusToDetElem; // Mapping between bus address and detector element ID.
142 BusToDetElem fBusToDDL; // Mapping between bus address and DDL.
145 bool ReadDDL(int* rawData, int *rawDataSize);
146 void FindCentralHits(int minPadId, int maxPadId);
153 #endif // ALIHLTMUONHITRECONSTRUCTOR_H