]> git.uio.no Git - u/mrichter/AliRoot.git/blob - HLT/MUON/OnlineAnalysis/AliHLTMUONTriggerReconstructor.h
340419252b3c9a8b4bde6a9919b2768bde8ccd48
[u/mrichter/AliRoot.git] / HLT / MUON / OnlineAnalysis / AliHLTMUONTriggerReconstructor.h
1 #ifndef AliHLTMUONTRIGGERRECONSTRUCTOR_H
2 #define AliHLTMUONTRIGGERRECONSTRUCTOR_H
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  **************************************************************************/
18
19 /* $Id$ */
20
21 /**********************************************************************
22  Created on : 16/05/2007
23  Purpose    : This class is supposed to read the trigger DDL files and 
24               give the output AliHLTMUONTriggerRecordStruct
25  Author     : Indranil Das, HEP Division, SINP
26  Email      : indra.das@saha.ac.in | indra.ehep@gmail.com
27 **********************************************************************/
28
29 #include <vector>
30 #include <TArrayS.h>
31
32 #include <AliHLTLogging.h>
33 #include "AliHLTMUONTriggerRecordsBlockStruct.h"
34 #include "AliHLTMUONHitReconstructor.h"
35 #include "AliMUONTriggerCrateStore.h"
36
37 class AliHLTMUONTriggerReconstructor : public AliHLTLogging
38 {
39
40  public:
41
42   AliHLTMUONTriggerReconstructor();
43   virtual ~AliHLTMUONTriggerReconstructor();
44
45   bool LoadLookUpTable(AliHLTMUONHitReconstructor::DHLTLut* lookUpTableData, int lookUpTableId);
46
47   //bool Run(int iEvent, int iDDL, AliHLTMUONTriggerRecordStruct trigRecord, int *nofTrigRec); // for Reading using rawreader
48   bool Run(int *rawData, int *rawDataSize, AliHLTMUONTriggerRecordStruct trigRecord[], int *nofTrigRec);
49
50   int GetLutLine(){return fgkLutLine ;}
51
52   static int GetkDetectorId() { return fgkDetectorId; }
53   static int GetkDDLOffSet() { return fgkDDLOffSet; }
54   static int GetkNofDDL() { return fgkNofDDL; }
55   static int GetkDDLHeaderSize() { return fgkDDLHeaderSize; }
56   
57 private: 
58   static const int fgkDetectorId ;            // DDL Offset
59   static const int fgkDDLOffSet ;             // DDL Offset
60   static const int fgkNofDDL ;                // Number of DDL 
61   static const int fgkDDLHeaderSize  ;        // DDL header size  
62
63  protected:
64
65   AliHLTMUONTriggerReconstructor(const AliHLTMUONTriggerReconstructor& rhs); // copy constructor
66   AliHLTMUONTriggerReconstructor& operator=(const AliHLTMUONTriggerReconstructor& rhs); // assignment operator
67   
68  private:
69
70   static const int fgkEvenLutSize ;           // Size of the LookupTable with event DDLID
71   static const int fgkOddLutSize ;            // Size of the LookupTable with odd DDLID
72   static const int fgkLutLine;                // nof Line in LookupTable    
73
74   static const int fgkMinIdManuChannel[2];    // Minimum value of idManuChannel in LookupTable  
75   static const int fgkMaxIdManuChannel[2];    // Maximum value of idManuChannel in LookupTable  
76   static const float fgkHalfPadSizeXB[3];       // pad halflength for the pcb zones  
77   static const float fgkHalfPadSizeYNB[2];       // pad halflength for the pcb zones  
78
79   static const int fgkDetElem;                // nof Detection element per DDL    
80
81   
82   AliHLTMUONHitReconstructor::DHLTPad* fPadData;                          // pointer to the array containing the information of each padhits
83   AliHLTMUONHitReconstructor::DHLTLut* fLookUpTableData;                  // pointer to the array of Lookuptable data
84   
85   AliHLTMUONTriggerRecordStruct *fRecPoints;    // Reconstructed hits
86   int *fRecPointsCount;                       // nof reconstructed hit  
87   int fMaxRecPointsCount;                    // max nof reconstructed hit  
88   int fDigitPerDDL;                                    // Total nof Digits perDDL 
89
90
91   int fGetIdTotalData[104][64][2] ;           // an array of idManuChannel with argumrnt of centralX,centralY and  planeType
92   int fNofFiredDetElem,*fMaxFiredPerDetElem;        // counter for detector elements that are fired 
93   int *fDetManuChannelIdList;                          // pointer to an array of idManuChannel
94   int *fCentralChargeB,*fCentralChargeNB;              // pointer to an array of central hit
95
96
97   int fDDLId ;
98   int fIdOffSet ;
99
100   AliMUONTriggerCrateStore* fCrateManager;
101
102   bool MergeTrigHits(int minPadId, int maxPadId);
103   bool FindTrigHits() ;
104
105   bool ReadDDL(int *rawData, int *rawDataSize);
106   bool Pattern2Pad(int nBoard, TArrayS* xyPattern, vector<AliHLTMUONHitReconstructor::DHLTPad>& padList);
107
108 };
109
110 #endif // AliHLTMUONTRIGGERRECONSTRUCTOR_H