]> git.uio.no Git - u/mrichter/AliRoot.git/blob - HLT/MUON/src/PubSub/HLTMUONHitReconstructor.h
HLT hit's reconstruction: online version (Indra)
[u/mrichter/AliRoot.git] / HLT / MUON / src / PubSub / HLTMUONHitReconstructor.h
1 ///////////////////////////////////////////////
2 //Author : Indranil Das, SINP, INDIA
3 //         Sukalyan Chattopadhyay, SINP, INDIA
4 //         
5 //
6 //Email :  indra.das@saha.ac.in
7 //         sukalyan.chattopadhyay@saha.ac.in 
8 ///////////////////////////////////////////////
9
10 #ifndef HLTMUONHITRECONSTRUCTOR_H
11 #define HLTMUONHITRECONSTRUCTOR_H
12
13 #include <iostream>
14 #include <cstdio>
15 #include <fstream>
16 #include <cstring>
17 #include <cmath>
18 #include <map>
19
20 // and hand control to the PubSub logging level
21 //#define DEBUG
22
23
24 using namespace std; 
25
26 struct DHLTLut{
27   int fIdManuChannel;
28   int fIX,fIY;
29   float fRealX,fRealY,fRealZ;
30   int fPlane,fPcbZone;
31 };
32
33 struct DHLTPad{
34   int fDetElemId;
35   int fBuspatchId;
36   int fIdManuChannel;
37   int fIX,fIY;
38   float fRealX,fRealY,fRealZ;
39   int fPlane,fPcbZone;
40   int fCharge;
41 };
42
43 struct DHLTRecPoint{
44   float X,Y,Z;
45   int DetElemId;
46 };
47
48 typedef  map<int,int> BusToDetElem ;
49
50 class HLTMUONHitReconstructor 
51 {
52 public:
53   HLTMUONHitReconstructor();
54   virtual ~HLTMUONHitReconstructor(void);
55
56   bool LoadLookUpTable(DHLTLut* lookUpTableData, int lookUpTableId);
57   bool SetBusToDetMap(BusToDetElem busToDetElem);
58   
59   //bool Init();
60   bool Run(const int* rawData, int rawDataSize, DHLTRecPoint recHit[], int *nofHit);
61
62   void SetDCCut(int dcCut) {fDCCut = dcCut;}
63   void SetDebugLevel(int debugLevel) {fDebugLevel = debugLevel;}
64   int GetDebugLevel(){return fDebugLevel;}
65   int GetDEId(int iBusPatch) {return fBusToDetElem[iBusPatch] ;}           
66     
67   const int GetLutLine(int iDDL);
68   
69   static const int fgkDetectorId ;            // DDL Offset
70   static const int fgkDDLOffSet ;             // DDL Offset
71   static const int fgkNofDDL ;                // Number of DDL 
72   static const int fgkDDLHeaderSize  ;                      // DDL header size  
73 protected:
74   HLTMUONHitReconstructor(const HLTMUONHitReconstructor& rhs); // copy constructor
75   HLTMUONHitReconstructor& operator=(const HLTMUONHitReconstructor& rhs); // assignment operator
76 private:
77   
78
79   static const int fgkEvenLutSize ;           // Size of the LookupTable with event DDLID
80   static const int fgkOddLutSize ;            // Size of the LookupTable with odd DDLID
81   static const int fgkLutLine[2];             // nof Line in LookupTable    
82
83   static const int fgkMinIdManuChannel[2];    // Minimum value of idManuChannel in LookupTable  
84   static const int fgkMaxIdManuChannel[2];    // Maximum value of idManuChannel in LookupTable  
85   static const float fgkHalfPadSize[3];       // pad halflength for the pcb zones  
86   
87
88   int fkBlockHeaderSize ;                     // Block header size
89   int fkDspHeaderSize  ;                      // DSP header size
90   int fkBuspatchHeaderSize ;                  // buspatch header size
91   
92   int fDCCut;                                 // DC Cut value
93
94   DHLTPad* fPadData;                          // pointer to the array containing the information of each padhits
95   DHLTLut* fLookUpTableData;                      // pointer to the array of Lookuptable data
96   
97   DHLTRecPoint *fRecPoints;                   // Reconstructed hits
98   int *fRecPointsCount;                       // nof reconstructed hit  
99   int fMaxRecPointsCount;                    // max nof reconstructed hit  
100    
101   int fCentralCountB, fCentralCountNB;                 // centeral hits 
102   int fIdOffSet,fDDLId;                       // DDLId and DDL id offset
103   int fDigitPerDDL;                                    // Total nof Digits perDDL 
104   
105   int *fDetManuChannelIdList;                          // pointer to an array of idManuChannel
106   int *fCentralChargeB,*fCentralChargeNB;              // pointer to an array of central hit
107   float *fRecX,*fRecY;                                 // pointer to an array of reconstructed hit
108   float *fAvgChargeX,*fAvgChargeY;                     // average charge on central pad found using CG method
109   int fGetIdTotalData[336][80][2] ;                    // an array of idManuChannel with argumrnt of centralX,centralY and  planeType
110   int fNofFiredDetElem,fMaxFiredPerDetElem[13];        // counter for detector elements that are fired 
111   int fDebugLevel;
112   BusToDetElem fBusToDetElem;
113
114   bool ReadDDL(const int* rawData, int rawDataSize);
115   void FindCentralHits(int minPadId, int maxPadId);
116   bool FindRecHits() ;
117   void RecXRecY();
118   bool MergeRecHits();
119   void CleanUp();
120
121 };
122
123
124 #endif // HLTMUONHITRECONSTRUCTOR_H