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 215 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 239 of file EventInfoDefinitions.h.

240 {
241 if (is_complete)
242 {
243 return index;
244 }
245 else
246 {
248 }
249 }
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 227 of file EventInfoDefinitions.h.

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

◆ get_number_of_cells()

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

Definition at line 196 of file EventInfoDefinitions.h.

197 {
198 if (is_complete)
199 {
200 return NCaloCells;
201 }
202 else
203 {
204 return number;
205 }
206 }
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 301 of file EventInfoDefinitions.h.

302 {
303 return is_bad_general(GeometryArr::is_tile(get_hash_ID(cell, is_complete)), qualityProvenance[cell], treat_L1_predicted_as_good);
304 }
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 254 of file EventInfoDefinitions.h.

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

◆ 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 364 of file EventInfoDefinitions.h.

365 {
366 if (all_cells_are_valid)
367 {
368 return true;
369 }
370 else if (is_complete)
371 {
372 return GainConversion::is_valid(gain[hash_ID]);
373 }
374 else
375 {
376 return hashIDToCollection[hash_ID] >= 0;
377 }
378 }
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 308 of file EventInfoDefinitions.h.

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

◆ complete

bool CaloRecGPU::CellBaseInfo::complete
inherited

Definition at line 192 of file EventInfoDefinitions.h.

◆ energy

float CaloRecGPU::CellInfoArr::energy[NCaloCells]

Definition at line 218 of file EventInfoDefinitions.h.

◆ gain

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

Definition at line 217 of file EventInfoDefinitions.h.

◆ hashID

int CaloRecGPU::CellInfoArr::hashID[NCaloCells]

Definition at line 224 of file EventInfoDefinitions.h.

◆ hashIDToCollection

int CaloRecGPU::CellInfoArr::hashIDToCollection[NCaloCells]

Definition at line 225 of file EventInfoDefinitions.h.

◆ number

int CaloRecGPU::CellBaseInfo::number
inherited

Definition at line 194 of file EventInfoDefinitions.h.

◆ qualityProvenance

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

Definition at line 220 of file EventInfoDefinitions.h.

◆ time

float CaloRecGPU::CellInfoArr::time[NCaloCells]

Definition at line 219 of file EventInfoDefinitions.h.


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