157{
158 int n_cells = 0, n_masked_1 = 0, n_masked_2 = 0, n_masked_12 = 0;
159 double ene_before = 0.0, ene_after = 0.0;
160
163
164 for (size_t iCell = firstCell; iCell <= lastCell; ++iCell) {
165
166 CaloCell* aCell = (*theCont)[iCell];
167 const CaloDetDescrElement * caloDDE = aCell->
caloDDE();
168
170
172 ++n_cells;
173 ene_before += aCell->
energy();
174 }
175
176 IdentifierHash hash1 = caloDDE->
onl1();
177 IdentifierHash hash2 = caloDDE->
onl2();
178
181
182 TileCell* pCell = static_cast<TileCell*>(aCell);
185
186 if (bit1) {
187
188 if (!bit2) {
189
191 ++n_masked_12;
192 if (
msgLvl(MSG::VERBOSE)) {
193 msg(MSG::VERBOSE) <<
" second channel is OFF"
194 << ", hash2: " << hash2
195 <<
" before " << pCell->
ene1()
196 <<
" + " << pCell->
ene2()
197 <<
" = " << pCell->
energy();
198 }
199 }
200
201 float ene1 = pCell->
ene1();
202 pCell->
setEnergy(ene1, ene1, gain1, gain1);
205
206 if (
msgLvl(MSG::VERBOSE)) {
207 msg(MSG::VERBOSE) <<
" after " << pCell -> ene1()
208 << " + " << pCell -> ene2()
210 }
211 }
212 } else {
213
215
217 ++n_masked_1;
218 if (
msgLvl(MSG::VERBOSE)) {
219 msg(MSG::VERBOSE) <<
" channel in GAP is OFF"
220 << ", hash1: " << hash1
221 <<
" before " << pCell->
ene1()
222 <<
" + " << pCell->
ene2()
223 <<
" = " << pCell->
energy();
224 }
225 }
226
229 } else {
231 }
235
236 if (
msgLvl(MSG::VERBOSE)) {
237 msg(MSG::VERBOSE) <<
" after " << pCell->
ene1()
238 <<
" + " << pCell->
ene2()
240 }
241
242 } else if (bit2) {
243
245 ++n_masked_12;
246 if (
msgLvl(MSG::VERBOSE)) {
247 msg(MSG::VERBOSE) <<
" first channel is OFF"
248 << ", hash1: " << hash1
249 <<
" before " << pCell->
ene1()
250 <<
" + " << pCell->
ene2()
251 <<
" = " << pCell->
energy();
252 }
253 }
254
255 float ene2 = pCell->
ene2();
256 pCell->
setEnergy(ene2, ene2, gain2, gain2);
259
261 msg(MSG::VERBOSE) <<
" after " << pCell->
ene1()
262 <<
" + " << pCell->
ene2()
264
265 } else {
266
268 ++n_masked_2;
269 if (
msgLvl(MSG::VERBOSE)) {
270 msg(MSG::VERBOSE) <<
" both channels are OFF"
271 << ", hash1: " << hash1
272 << ", hash2: " << hash2
273 <<
" before " << pCell->
ene1()
274 <<
" + " << pCell->
ene2()
275 <<
" = " << pCell->
energy();
276 }
277 }
278
283 } else {
285 }
289
290 if (
msgLvl(MSG::VERBOSE)) {
291 msg(MSG::VERBOSE) <<
" after " << pCell->
ene1()
292 <<
" + " << pCell->
ene2()
294 }
295 }
296 }
297 ene_after += aCell->
energy();
298 }
299 }
300
302 << " N masked gap/normal/half-masked: " << n_masked_1 << " " << n_masked_2 << " " << n_masked_12
303 << " Ene before/after/delta: " << ene_before << " " << ene_after << " " << ene_after-ene_before );
304
305 return StatusCode::SUCCESS;
306}
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