]> git.uio.no Git - u/mrichter/AliRoot.git/blob - HLT/PHOS/AliHLTPHOSRcuProperties.cxx
- fixes due to new PHOS mapping
[u/mrichter/AliRoot.git] / HLT / PHOS / AliHLTPHOSRcuProperties.cxx
1 // $Id$
2
3 /**************************************************************************
4  * This file is property of and copyright by the Experimental Nuclear     *
5  * Physics Group, Dep. of Physics                                         *
6  * University of Oslo, Norway, 2007                                       *
7  *                                                                        *
8  * Author: Per Thomas Hille <perthi@fys.uio.no> for the ALICE HLT Project.*
9  * Contributors are mentioned in the code where appropriate.              *
10  * Please report bugs to perthi@fys.uio.no                                *
11  *                                                                        *
12  * Permission to use, copy, modify and distribute this software and its   *
13  * documentation strictly for non-commercial purposes is hereby granted   *
14  * without fee, provided that the above copyright notice appears in all   *
15  * copies and that both the copyright notice and this permission notice   *
16  * appear in the supporting documentation. The authors make no claims     *
17  * about the suitability of this software for any purpose. It is          *
18  * provided "as is" without express or implied warranty.                  *
19  **************************************************************************/
20
21 #include "AliHLTPHOSRcuProperties.h"
22 #include "AliHLTPHOSUtilities.h"
23
24
25
26 AliHLTPHOSRcuProperties::AliHLTPHOSRcuProperties() :fkEquippmentID(0),
27                                                     fModID(2), 
28                                                     fRcuID(0),
29                                                     fRcuX(0), 
30                                                     fRcuZ(0),
31                                                     fRcuZOffset(0),
32                                                     fRcuXOffset(0),
33                                                     fPrintInfo(false),
34                                                     fPrintInfoFrequncy(10000),
35                                                     fIsSetEquippmentID(kFALSE),
36                                                     fLog(),
37                                                     fIsInitialized(false),
38                                                     fUtilitiesPtr(0)
39 {
40  
41   fUtilitiesPtr = new AliHLTPHOSUtilities();
42
43 }
44
45
46 AliHLTPHOSRcuProperties::~AliHLTPHOSRcuProperties()
47 {
48
49 }
50
51
52 int
53 AliHLTPHOSRcuProperties::GetEquippmentID() const
54 {
55   return fkEquippmentID;
56 }
57
58
59 int 
60 AliHLTPHOSRcuProperties::GetRCUID() const
61 {
62   return fRcuID;
63 }
64
65
66 int
67 AliHLTPHOSRcuProperties::ScanArguments(int argc, const char** argv)
68 {
69   int iResult=0; 
70   //       -equipmentID
71   fIsSetEquippmentID = fUtilitiesPtr->ScanSingleIntArgument(argc, argv, "-equipmentID", &fkEquippmentID);
72
73   if(fIsSetEquippmentID == true)
74     {
75       //     cout << "AliHLTPHOSRcuProperties::ScanArguments fIsSetEquippmentID  == true" << endl;
76     }
77   else
78     {
79       //     cout << "AliHLTPHOSRcuProperties::ScanArguments  fIsSetEquippmentID  == false" << endl;
80     }
81   
82
83   InitializeCoordinates(fkEquippmentID);
84   //  fPrintInfo = fIsSetEquippmentID = fUtilitiesPtr->ScanSingleIntArgument(argc, argv, "-printinfo", &fPrintInfoFrequncy);
85   fPrintInfo  = fUtilitiesPtr->ScanSingleIntArgument(argc, argv, "-printinfo", &fPrintInfoFrequncy);
86   
87   if(fIsSetEquippmentID == kFALSE)
88     {
89       fLog.Logging( kHLTLogFatal, "HLT::AliHLTPHOSRcuProperties::DoInt( int argc, const char** argv )", "Missing argument",
90                "The argument equippmentID is not set: set it with a component argumet like this: -equippmentID  <number>");
91       iResult = -3; 
92     }
93   
94   return iResult;
95 }
96
97
98 void 
99 AliHLTPHOSRcuProperties::InitializeCoordinates(AliHLTUInt16_t /*equippmentID*/)
100 {
101   fRcuID =  (fkEquippmentID - 1792)%NRCUSPERMODULE;
102   fModID = (fkEquippmentID  -1792 - fRcuID)/NRCUSPERMODULE;
103  
104   if( fRcuID  == 0)
105     {
106       fRcuX = 0; 
107       fRcuZ = 0;
108     }
109
110   if( fRcuID  == 1)
111     {
112       fRcuX = 0; 
113       fRcuZ = 1;
114     }
115  
116   if( fRcuID == 2)
117     {
118       fRcuX = 1; 
119       fRcuZ = 0;
120     }
121
122   if( fRcuID == 3)
123     {
124       fRcuX = 1; 
125       fRcuZ = 1;
126     }
127  
128   // if( fRcuID  == 0)
129   //   {
130   //     fRcuX = 0; 
131   //     fRcuZ = 0;
132   //   }
133
134   // if( fRcuID  == 1)
135   //   {
136   //     fRcuX = 1; 
137   //     fRcuZ = 0;
138   //   }
139  
140   // if( fRcuID == 2)
141   //   {
142   //     fRcuX = 2; 
143   //     fRcuZ = 0;
144   //   }
145
146   // if( fRcuID == 3)
147   //   {
148   //     fRcuX = 3; 
149   //     fRcuZ = 0;
150   //   }
151
152   fRcuZOffset =  NZROWSRCU*fRcuZ;
153   fRcuXOffset =  NXCOLUMNSRCU*fRcuX;
154   fIsInitialized = true;
155 }
156