ATLAS Offline Software
Loading...
Searching...
No Matches
CaloRecGPU::CellInfoArr Class Reference

Contains the per-event cell information: energy, timing, gain, quality and provenance. More...

#include <EventInfoDefinitions.h>

Inheritance diagram for CaloRecGPU::CellInfoArr:
Collaboration diagram for CaloRecGPU::CellInfoArr:

Public Member Functions

constexpr int get_hash_ID (const int cell, const bool is_complete=false) const
constexpr int get_cell_with_hash_ID (const int index, const bool is_complete=false) const
constexpr bool is_bad (const int cell, const bool treat_L1_predicted_as_good=false, const bool is_complete=false) const
 GPU version of CaloBadCellHelper::isBad.
constexpr bool passes_time_cut (const GeometryArr &geom, const int cell, const float threshold, const bool use_crosstalk, const float crosstalk_delta, const bool is_complete=false) const
 GPU equivalent of CaloTopoClusterMaker::passCellTimeCut.
constexpr bool is_valid (const int hash_ID, const bool is_complete=false, const bool all_cells_are_valid=false) const
constexpr int get_number_of_cells (const bool is_complete=false) const

Static Public Member Functions

static constexpr bool is_bad_general (const bool is_tile, const QualityProvenance qp, const bool treat_L1_predicted_as_good=false)
 GPU version of CaloBadCellHelper::isBad.

Public Attributes

unsigned char gain [NCaloCells]
float energy [NCaloCells]
float time [NCaloCells]
QualityProvenance::carrier qualityProvenance [NCaloCells]
int hashID [NCaloCells]
int hashIDToCollection [NCaloCells]
bool complete
bool all_cells_valid
int number

Detailed Description

Contains the per-event cell information: energy, timing, gain, quality and provenance.

Since this is ordered in the same way as the CPU cell collection, functionalities to map between cell hash ID and cell index within the collection

Definition at line 216 of file EventInfoDefinitions.h.

Member Function Documentation

◆ get_cell_with_hash_ID()

int CaloRecGPU::CellInfoArr::get_cell_with_hash_ID ( const int index,
const bool is_complete = false ) const
inlineconstexpr

Definition at line 240 of file EventInfoDefinitions.h.

241 {
242 if (is_complete)
243 {
244 return index;
245 }
246 else
247 {
249 }
250 }
str index
Definition DeMoScan.py:362

◆ get_hash_ID()

int CaloRecGPU::CellInfoArr::get_hash_ID ( const int cell,
const bool is_complete = false ) const
inlineconstexpr

Definition at line 228 of file EventInfoDefinitions.h.

229 {
230 if (is_complete)
231 {
232 return cell;
233 }
234 else
235 {
236 return hashID[cell];
237 }
238 }

◆ get_number_of_cells()

int CaloRecGPU::CellBaseInfo::get_number_of_cells ( const bool is_complete = false) const
inlineconstexprinherited

Definition at line 197 of file EventInfoDefinitions.h.

198 {
199 if (is_complete)
200 {
201 return NCaloCells;
202 }
203 else
204 {
205 return number;
206 }
207 }
constexpr int NCaloCells

◆ is_bad()

bool CaloRecGPU::CellInfoArr::is_bad ( const int cell,
const bool treat_L1_predicted_as_good = false,
const bool is_complete = false ) const
inlineconstexpr

GPU version of CaloBadCellHelper::isBad.

If treat_L1_predicted_as_good is false, has the same effect as cell->badcell() (just like CaloBadCellHelper::isBad).

Definition at line 302 of file EventInfoDefinitions.h.

303 {
304 return is_bad_general(GeometryArr::is_tile(get_hash_ID(cell, is_complete)), qualityProvenance[cell], treat_L1_predicted_as_good);
305 }
QualityProvenance::carrier qualityProvenance[NCaloCells]
constexpr int get_hash_ID(const int cell, const bool is_complete=false) const
static constexpr bool is_bad_general(const bool is_tile, const QualityProvenance qp, const bool treat_L1_predicted_as_good=false)
GPU version of CaloBadCellHelper::isBad.
static constexpr bool is_tile(const int cell)

◆ is_bad_general()

constexpr bool CaloRecGPU::CellInfoArr::is_bad_general ( const bool is_tile,
const QualityProvenance qp,
const bool treat_L1_predicted_as_good = false )
inlinestaticconstexpr

GPU version of CaloBadCellHelper::isBad.

If treat_L1_predicted_as_good is false, has the same effect as cell->badcell() (just like CaloBadCellHelper::isBad).

Definition at line 255 of file EventInfoDefinitions.h.

256 {
257 bool ret = false;
258
259 if (is_tile)
260 {
261
262 const unsigned int mask = 0x08U;
263
264 ret = (qp.tile_qbit1() & mask) && (qp.tile_qbit2() & mask);
265 //From TileCell::badcell()
266 //badch1() && badch2()
267 //badch1() -> m_tileQual[2]&TileCell::MASK_BADCH
268 //badch2() -> m_tileQual[3]&TileCell::MASK_BADCH
269 //
270 //TileCell::MASK_BADCH= 0x08
271 //
272 //From CaloCell:
273 //union {
274 // int m_quality ;
275 // uint16_t m_qualProv[2];
276 // uint8_t m_tileQual[4];
277 //};
278 //quality returns m_qualProv[0]
279 //provenance returns m_qualProv[1]
280 //These are used to build our QualityProvenance...
281 //
282 //It's packing and unpacking back and forth, how fun!
283 }
284 else
285 {
286 const unsigned int provenance = qp.provenance();
287 ret = provenance & 0x0800U;
288 //As in LArCell::badcell()
289
290 if (treat_L1_predicted_as_good && (provenance & 0x0200U))
291 //As in CaloBadCellHelper::isBad
292 {
293 ret = false;
294 }
295 }
296 return ret;
297 }

◆ is_valid()

bool CaloRecGPU::CellInfoArr::is_valid ( const int hash_ID,
const bool is_complete = false,
const bool all_cells_are_valid = false ) const
inlineconstexpr

Definition at line 365 of file EventInfoDefinitions.h.

366 {
367 if (all_cells_are_valid)
368 {
369 return true;
370 }
371 else if (is_complete)
372 {
373 return GainConversion::is_valid(gain[hash_ID]);
374 }
375 else
376 {
377 return hashIDToCollection[hash_ID] >= 0;
378 }
379 }
static constexpr bool is_valid(const T &gain)
unsigned char gain[NCaloCells]

◆ passes_time_cut()

bool CaloRecGPU::CellInfoArr::passes_time_cut ( const GeometryArr & geom,
const int cell,
const float threshold,
const bool use_crosstalk,
const float crosstalk_delta,
const bool is_complete = false ) const
inlineconstexpr

GPU equivalent of CaloTopoClusterMaker::passCellTimeCut.

Definition at line 309 of file EventInfoDefinitions.h.

311 {
312 const int real_cell = get_hash_ID(cell, is_complete);
313 const int sampling = geom.sampling(real_cell);
314 if (sampling == CaloSampling::PreSamplerB ||
315 sampling == CaloSampling::PreSamplerE ||
316 sampling == CaloSampling::Unknown )
317 {
318 return true;
319 }
320 else
321 {
322 const QualityProvenance qp = qualityProvenance[cell];
323 const unsigned int mask = geom.is_tile(real_cell) ? 0x8080U : 0x2000U;
324 if (qp.provenance() & mask)
325 {
326 const float this_time = time[cell];
327 if (fabsf(this_time) >= threshold)
328 {
329 if (use_crosstalk)
330 {
331 const float this_energy = energy[cell];
332 const bool eligible = (sampling == CaloSampling::EMB2 || (sampling == CaloSampling::EME2 && fabsf(geom.eta[real_cell]) < 2.5));
333 if (this_energy > 0 && eligible)
334 {
335 int neighbours[NMaxNeighbours] = {};
336
338
339 const int num_neighs = geom.get_neighbours(neigh_options, real_cell, neighbours);
340
341 for (int i = 0; i < num_neighs; ++i)
342 {
343 const int neigh_index = get_cell_with_hash_ID(neighbours[i], is_complete);
344 if (neigh_index >= 0 && energy[neigh_index] > 4 * this_energy)
345 {
346 const QualityProvenance neigh_qp = qualityProvenance[neigh_index];
347 if ( !(neigh_qp.provenance() & mask) || fabsf(time[neigh_index]) < threshold )
348 {
349 if (this_time > -threshold && this_time < threshold + crosstalk_delta)
350 {
351 return true;
352 }
353 }
354 }
355 }
356 }
357 }
358 return false;
359 }
360 }
361 }
362 return true;
363 }
constexpr int NMaxNeighbours
constexpr int get_cell_with_hash_ID(const int index, const bool is_complete=false) const

Member Data Documentation

◆ all_cells_valid

bool CaloRecGPU::CellBaseInfo::all_cells_valid
inherited

Definition at line 194 of file EventInfoDefinitions.h.

◆ complete

bool CaloRecGPU::CellBaseInfo::complete
inherited

Definition at line 193 of file EventInfoDefinitions.h.

◆ energy

float CaloRecGPU::CellInfoArr::energy[NCaloCells]

Definition at line 219 of file EventInfoDefinitions.h.

◆ gain

unsigned char CaloRecGPU::CellInfoArr::gain[NCaloCells]

Definition at line 218 of file EventInfoDefinitions.h.

◆ hashID

int CaloRecGPU::CellInfoArr::hashID[NCaloCells]

Definition at line 225 of file EventInfoDefinitions.h.

◆ hashIDToCollection

int CaloRecGPU::CellInfoArr::hashIDToCollection[NCaloCells]

Definition at line 226 of file EventInfoDefinitions.h.

◆ number

int CaloRecGPU::CellBaseInfo::number
inherited

Definition at line 195 of file EventInfoDefinitions.h.

◆ qualityProvenance

QualityProvenance::carrier CaloRecGPU::CellInfoArr::qualityProvenance[NCaloCells]

Definition at line 221 of file EventInfoDefinitions.h.

◆ time

float CaloRecGPU::CellInfoArr::time[NCaloCells]

Definition at line 220 of file EventInfoDefinitions.h.


The documentation for this class was generated from the following file: