158{
159 int n_cells = 0, n_masked_1 = 0, n_masked_2 = 0, n_masked_12 = 0;
160 double ene_before = 0.0, ene_after = 0.0;
161
164
165 for (size_t iCell = firstCell; iCell <= lastCell; ++iCell) {
166
167 CaloCell* aCell = (*theCont)[iCell];
168 const CaloDetDescrElement * caloDDE = aCell->
caloDDE();
169
171
173 ++n_cells;
174 ene_before += aCell->
energy();
175 }
176
177 IdentifierHash hash1 = caloDDE->
onl1();
178 IdentifierHash hash2 = caloDDE->
onl2();
179
182
183 TileCell* pCell = static_cast<TileCell*>(aCell);
186
187 if (bit1) {
188
189 if (!bit2) {
190
192 ++n_masked_12;
193 if (
msgLvl(MSG::VERBOSE)) {
194 msg(MSG::VERBOSE) <<
" second channel is OFF"
195 << ", hash2: " << hash2
196 <<
" before " << pCell->
ene1()
197 <<
" + " << pCell->
ene2()
198 <<
" = " << pCell->
energy();
199 }
200 }
201
202 float ene1 = pCell->
ene1();
203 pCell->
setEnergy(ene1, ene1, gain1, gain1);
206
207 if (
msgLvl(MSG::VERBOSE)) {
208 msg(MSG::VERBOSE) <<
" after " << pCell -> ene1()
209 << " + " << pCell -> ene2()
211 }
212 }
213 } else {
214
216
218 ++n_masked_1;
219 if (
msgLvl(MSG::VERBOSE)) {
220 msg(MSG::VERBOSE) <<
" channel in GAP is OFF"
221 << ", hash1: " << hash1
222 <<
" before " << pCell->
ene1()
223 <<
" + " << pCell->
ene2()
224 <<
" = " << pCell->
energy();
225 }
226 }
227
230 } else {
232 }
236
237 if (
msgLvl(MSG::VERBOSE)) {
238 msg(MSG::VERBOSE) <<
" after " << pCell->
ene1()
239 <<
" + " << pCell->
ene2()
241 }
242
243 } else if (bit2) {
244
246 ++n_masked_12;
247 if (
msgLvl(MSG::VERBOSE)) {
248 msg(MSG::VERBOSE) <<
" first channel is OFF"
249 << ", hash1: " << hash1
250 <<
" before " << pCell->
ene1()
251 <<
" + " << pCell->
ene2()
252 <<
" = " << pCell->
energy();
253 }
254 }
255
256 float ene2 = pCell->
ene2();
257 pCell->
setEnergy(ene2, ene2, gain2, gain2);
260
262 msg(MSG::VERBOSE) <<
" after " << pCell->
ene1()
263 <<
" + " << pCell->
ene2()
265
266 } else {
267
269 ++n_masked_2;
270 if (
msgLvl(MSG::VERBOSE)) {
271 msg(MSG::VERBOSE) <<
" both channels are OFF"
272 << ", hash1: " << hash1
273 << ", hash2: " << hash2
274 <<
" before " << pCell->
ene1()
275 <<
" + " << pCell->
ene2()
276 <<
" = " << pCell->
energy();
277 }
278 }
279
284 } else {
286 }
290
291 if (
msgLvl(MSG::VERBOSE)) {
292 msg(MSG::VERBOSE) <<
" after " << pCell->
ene1()
293 <<
" + " << pCell->
ene2()
295 }
296 }
297 }
298 ene_after += aCell->
energy();
299 }
300 }
301
303 << " N masked gap/normal/half-masked: " << n_masked_1 << " " << n_masked_2 << " " << n_masked_12
304 << " Ene before/after/delta: " << ene_before << " " << ene_after << " " << ene_after-ene_before );
305
306 return StatusCode::SUCCESS;
307}
bool msgLvl(const MSG::Level lvl) const
double energy() const
get energy (data member)
const CaloDetDescrElement * caloDDE() const
get pointer to CaloDetDescrElement (data member)
bool is_tile() const
cell belongs to Tile
IdentifierHash onl2() const
cell online identifier 2
IdentifierHash onl1() const
cell online identifier 1
uint8_t qual1(void) const
get quality of first PMT (data member)
float time1(void) const
get time of first PMT
virtual void setEnergy(float ene) override final
set total energy, reset eneDiff to zero (final override of CaloCell method)
int gain2(void) const
get gain of second PMT
uint8_t qbit2(void) const
get quality bits of second PMT (data member)
int gain1(void) const
get gain of first PMT
uint8_t qual2(void) const
get quality of second PMT (data member)
void setQuality(unsigned char qual, unsigned char qbit, int pmt)
set quality value and quality bits for one PMT (TileCell specific overloads)
float ene1(void) const
get energy of first PMT
virtual void setTime(float t) override final
set cell time, reset timeDiff
float time2(void) const
get time of second PMT
uint8_t qbit1(void) const
get quality bits of first PMT (data member)
float ene2(void) const
get energy of second PMT