69{
71
72 uint32_t nREThetaPos, nREPhiPos, nREEaWePos;
73 uint32_t nREThetaMask, nREPhiMask, nREEaWeMask;
74
75
76
77 f.open( initFile.c_str());
78
79 if( f.bad() )
80 {
81 cerr << "Error: could not open file " << initFile << endl;
82 return false;
83 }
84
86 cerr << "Error: could not find '##EmcDigiConf' in file " << initFile << endl;
87 return StatusCode::FAILURE;
88 }
89
98 return false;
99
100
101 f.close();
102
103
104
107 {
108 uint32_t TEthetaMax, TEphiMax;
109 uint32_t TEthetaMin, TEphiMin;
110 uint32_t eawe, theta, phi;
112 {
113
116 } else
117 {
118
122 eawe = 0;
123 else
124 eawe = 1;
125 }
126 for(uint32_t TEtheta = TEthetaMin; TEtheta <= TEthetaMax; TEtheta++ )
127 {
129 {
130
132 {
133 eawe = 0;
135 }
136 else {
137 eawe = 1;
139 }
142
143 } else
144 {
145
149
150 }
151
152 for(uint32_t TEphi = TEphiMin; TEphi <= TEphiMax; TEphi++ )
153 {
154 phi = TEphi + 1;
155
156
157 uint32_t reid = ((eawe<<nREEaWePos)&nREEaWeMask)|
158 ((theta<<nREThetaPos)&nREThetaMask)|
159 ((phi<<nREPhiPos)&nREPhiMask);
161
162
163
164
165 if( reid >= 8192 )
166 {
167 cerr << "Error: REID overflow !" << reid << endl;
168 exit(8);
169 }
170
171
172 m_re2te[reid] = teid;
173 m_te2reMap.insert(TE2REMAP::value_type(teid, reid)) ;
174 }
175 }
176 }
177
178 return StatusCode::SUCCESS;
179}
static bool expect(ifstream &f, string msg, string fname)
static bool expectInt(ifstream &f, string msg, string fname, uint32_t &val1, uint32_t &val2)
static bool find(ifstream &f, string msg, string fname)
static unsigned int getPHI_BARREL_MAX()
static unsigned int getBARREL_EC_MIN()
static unsigned int getBARREL_EC_MAX()
static unsigned int getTHETA_ENDCAP_MIN()
static unsigned int getTHETA_ENDCAP_MAX()
static unsigned int getBARREL()
static unsigned int getTHETA_BARREL_MIN()
static unsigned int getIntID(const unsigned int barrel_ec, const unsigned int theta_module, const unsigned int phi_module)
static unsigned int getTHETA_BARREL_MAX()
static unsigned int getPHI_ENDCAP_MAX(const unsigned int theta)
static unsigned int getPHI_ENDCAP_MIN()
static unsigned int getPHI_BARREL_MIN()