Applying fixes and updates (Indra)
[u/mrichter/AliRoot.git] / HLT / MUON / OnlineAnalysis / AliHLTMUONTriggerReconstructor.h
CommitLineData
6efe69e7 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>
6efe69e7 30
31#include <AliHLTLogging.h>
960d54ad 32
6efe69e7 33#include "AliHLTMUONTriggerRecordsBlockStruct.h"
34#include "AliHLTMUONHitReconstructor.h"
960d54ad 35
36#if __GNUC__ < 3
37#define std
38#endif
39
40typedef std::vector<int> DataIdIndex;
6efe69e7 41
42class AliHLTMUONTriggerReconstructor : public AliHLTLogging
43{
44
45 public:
46
960d54ad 47 struct RegToLoc{
48 int fTrigDDL; // trigger id (0 or 1)
49 int fRegId,fLoc,fLocId; // regeonal and local id.
50 int fSwitch; // packed switch word of 10 bits.
51 int fDetElemId[4]; // Four detection element correspond to four detection element for each local card.
52 };
53
54
6efe69e7 55 AliHLTMUONTriggerReconstructor();
56 virtual ~AliHLTMUONTriggerReconstructor();
57
58 bool LoadLookUpTable(AliHLTMUONHitReconstructor::DHLTLut* lookUpTableData, int lookUpTableId);
960d54ad 59
60 bool SetRegToLocCardMap(RegToLoc* regToLoc);
6efe69e7 61 //bool Run(int iEvent, int iDDL, AliHLTMUONTriggerRecordStruct trigRecord, int *nofTrigRec); // for Reading using rawreader
62 bool Run(int *rawData, int *rawDataSize, AliHLTMUONTriggerRecordStruct trigRecord[], int *nofTrigRec);
63
64 int GetLutLine(){return fgkLutLine ;}
65
960d54ad 66 static int GetkDetectorId() { return AliHLTMUONTriggerReconstructor::fgkDetectorId ; }
67 static int GetkDDLOffSet() { return AliHLTMUONTriggerReconstructor::fgkDDLOffSet; }
68 static int GetkNofDDL() { return AliHLTMUONTriggerReconstructor::fgkNofDDL; }
69 static int GetkDDLHeaderSize() { return AliHLTMUONTriggerReconstructor::fgkDDLHeaderSize; }
6efe69e7 70
960d54ad 71 private:
72 static const int fgkDetectorId ; // Detector ID
6efe69e7 73 static const int fgkDDLOffSet ; // DDL Offset
74 static const int fgkNofDDL ; // Number of DDL
75 static const int fgkDDLHeaderSize ; // DDL header size
76
77 protected:
78
79 AliHLTMUONTriggerReconstructor(const AliHLTMUONTriggerReconstructor& rhs); // copy constructor
80 AliHLTMUONTriggerReconstructor& operator=(const AliHLTMUONTriggerReconstructor& rhs); // assignment operator
81
82 private:
83
84 static const int fgkEvenLutSize ; // Size of the LookupTable with event DDLID
85 static const int fgkOddLutSize ; // Size of the LookupTable with odd DDLID
86 static const int fgkLutLine; // nof Line in LookupTable
87
960d54ad 88 static const int fgkMinIdManuChannel[2]; // Minimum value of idManuChannel in LookupTable, 2 corresponds to two types of DDL (even/odd)
6efe69e7 89 static const int fgkMaxIdManuChannel[2]; // Maximum value of idManuChannel in LookupTable
960d54ad 90 static const float fgkHalfPadSizeXB[3]; // pad halflength for the pcb zones, 3 corresponds to 3 types of pad in bending side
91 static const float fgkHalfPadSizeYNB[2]; // pad halflength for the pcb zones, 2 corresponds to 2 types on nonbneding pad
6efe69e7 92
93 static const int fgkDetElem; // nof Detection element per DDL
94
95
96 AliHLTMUONHitReconstructor::DHLTPad* fPadData; // pointer to the array containing the information of each padhits
97 AliHLTMUONHitReconstructor::DHLTLut* fLookUpTableData; // pointer to the array of Lookuptable data
98
99 AliHLTMUONTriggerRecordStruct *fRecPoints; // Reconstructed hits
100 int *fRecPointsCount; // nof reconstructed hit
101 int fMaxRecPointsCount; // max nof reconstructed hit
6efe69e7 102
960d54ad 103 //104 correspond to maximum nuber of x indices a nonbending side of detelem may have (i.e. 1101)
104 //and 64 corresponds to the maximum number of y indices occurs in bending side of detelem (i.e 1100)
6efe69e7 105 int fGetIdTotalData[104][64][2] ; // an array of idManuChannel with argumrnt of centralX,centralY and planeType
960d54ad 106 RegToLoc fRegToLocCard[128]; // 8 regional card per ddl and 16 slots per regional crate together made 16*8 = 128.
6efe69e7 107
960d54ad 108 map<int,int> fMaxFiredPerDetElem; // counter for detector elements that are fired
109 map<int,DataIdIndex> fDetElemToDataId; // detelem to pointer to dataId index mapping
110
6efe69e7 111 int fDDLId ;
112 int fIdOffSet ;
113
960d54ad 114 bool MergeTrigHits(DataIdIndex& dataIndex);
6efe69e7 115 bool FindTrigHits() ;
116
117 bool ReadDDL(int *rawData, int *rawDataSize);
6efe69e7 118};
119
120#endif // AliHLTMUONTRIGGERRECONSTRUCTOR_H