ATLAS Offline Software
Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
CaloRecGPU::CellInfoArr Struct Reference

#include <EventInfoDefinitions.h>

Collaboration diagram for CaloRecGPU::CellInfoArr:

Public Member Functions

constexpr bool is_bad (const int cell, const bool treat_L1_predicted_as_good=false) const
 GPU version of CaloBadCellHelper::isBad. More...
 
constexpr bool is_bad (const GeometryArr &geom, const int cell, const bool treat_L1_predicted_as_good=false) const
 GPU version of CaloBadCellHelper::isBad. More...
 
constexpr bool passes_time_cut (const GeometryArr &geom, const int cell, const float threshold, const bool use_crosstalk, const float crosstalk_delta) const
 GPU equivalent of CaloTopoClusterMaker::passCellTimeCut. More...
 
constexpr bool is_valid (const int cell) const
 

Static Public Member Functions

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

Public Attributes

float energy [NCaloCells]
 
unsigned char gain [NCaloCells]
 
float time [NCaloCells]
 
QualityProvenance::carrier qualityProvenance [NCaloCells]
 

Detailed Description

Definition at line 187 of file EventInfoDefinitions.h.

Member Function Documentation

◆ is_bad() [1/3]

static constexpr bool CaloRecGPU::CellInfoArr::is_bad ( 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 199 of file EventInfoDefinitions.h.

200  {
201  bool ret = false;
202 
203  if (is_tile)
204  {
205 
206  const unsigned int mask = 0x08U;
207 
208  ret = (qp.tile_qbit1() & mask) && (qp.tile_qbit2() & mask);
209  //From TileCell::badcell()
210  //badch1() && badch2()
211  //badch1() -> m_tileQual[2]&TileCell::MASK_BADCH
212  //badch2() -> m_tileQual[3]&TileCell::MASK_BADCH
213  //
214  //TileCell::MASK_BADCH= 0x08
215  //
216  //From CaloCell:
217  //union {
218  // int m_quality ;
219  // uint16_t m_qualProv[2];
220  // uint8_t m_tileQual[4];
221  //};
222  //quality returns m_qualProv[0]
223  //provenance returns m_qualProv[1]
224  //These are used to build our QualityProvenance...
225  //
226  //It's packing and unpacking back and forth, how fun!
227  }
228  else
229  {
230  const unsigned int provenance = qp.provenance();
231  ret = provenance & 0x0800U;
232  //As in LArCell::badcell()
233 
234  if (treat_L1_predicted_as_good && (provenance & 0x0200U))
235  //As in CaloBadCellHelper::isBad
236  {
237  ret = false;
238  }
239  }
240  return ret;
241  }

◆ is_bad() [2/3]

constexpr bool CaloRecGPU::CellInfoArr::is_bad ( const GeometryArr geom,
const int  cell,
const bool  treat_L1_predicted_as_good = 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 254 of file EventInfoDefinitions.h.

255  {
256  return is_bad(geom.is_tile(cell), qualityProvenance[cell], treat_L1_predicted_as_good);
257  }

◆ is_bad() [3/3]

constexpr bool CaloRecGPU::CellInfoArr::is_bad ( const int  cell,
const bool  treat_L1_predicted_as_good = 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 246 of file EventInfoDefinitions.h.

247  {
248  return is_bad(GeometryArr::is_tile(cell), qualityProvenance[cell], treat_L1_predicted_as_good);
249  }

◆ is_valid()

constexpr bool CaloRecGPU::CellInfoArr::is_valid ( const int  cell) const
inlineconstexpr

Definition at line 316 of file EventInfoDefinitions.h.

317  {
319  }

◆ passes_time_cut()

constexpr bool CaloRecGPU::CellInfoArr::passes_time_cut ( const GeometryArr geom,
const int  cell,
const float  threshold,
const bool  use_crosstalk,
const float  crosstalk_delta 
) const
inlineconstexpr

GPU equivalent of CaloTopoClusterMaker::passCellTimeCut.

Definition at line 261 of file EventInfoDefinitions.h.

263  {
264  const int sampling = geom.sampling(cell);
265  if (sampling == CaloSampling::PreSamplerB ||
266  sampling == CaloSampling::PreSamplerE ||
267  sampling == CaloSampling::Unknown )
268  {
269  return true;
270  }
271  else
272  {
273  const QualityProvenance qp = qualityProvenance[cell];
274  const unsigned int mask = geom.is_tile(cell) ? 0x8080U : 0x2000U;
275  if (qp.provenance() & mask)
276  {
277  const float this_time = time[cell];
278  if (fabsf(this_time) >= threshold)
279  {
280  if (use_crosstalk)
281  {
282  const float this_energy = energy[cell];
283  const bool eligible = (sampling == CaloSampling::EMB2 || (sampling == CaloSampling::EME2 && fabsf(geom.eta[cell]) < 2.5));
284  if (this_energy > 0 && eligible)
285  {
286  int neighbours[NMaxNeighbours] = {};
287 
289 
290  const int num_neighs = geom.get_neighbours(neigh_options, cell, neighbours);
291 
292  for (int i = 0; i < num_neighs; ++i)
293  {
294  const int neigh = neighbours[i];
295  if (is_valid(neigh) && energy[neigh] > 4 * this_energy)
296  {
297  const QualityProvenance neigh_qp = qualityProvenance[neigh];
298  if ( !(neigh_qp.provenance() & mask) || fabsf(time[neigh]) < threshold )
299  {
300  if (this_time > -threshold && this_time < threshold + crosstalk_delta)
301  {
302  return true;
303  }
304  }
305  }
306  }
307  }
308  }
309  return false;
310  }
311  }
312  }
313  return true;
314  }

Member Data Documentation

◆ energy

float CaloRecGPU::CellInfoArr::energy[NCaloCells]

Definition at line 189 of file EventInfoDefinitions.h.

◆ gain

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

Definition at line 190 of file EventInfoDefinitions.h.

◆ qualityProvenance

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

Definition at line 192 of file EventInfoDefinitions.h.

◆ time

float CaloRecGPU::CellInfoArr::time[NCaloCells]

Definition at line 191 of file EventInfoDefinitions.h.


The documentation for this struct was generated from the following file:
GetLCDefs::Unknown
@ Unknown
Definition: GetLCDefs.h:21
CaloRecGPU::CellInfoArr::gain
unsigned char gain[NCaloCells]
Definition: EventInfoDefinitions.h:190
CaloRecGPU::GainConversion::is_valid
static constexpr bool is_valid(const T &gain)
Definition: EventInfoDefinitions.h:72
ReadCellNoiseFromCool.cell
cell
Definition: ReadCellNoiseFromCool.py:53
CaloRecGPU::CellInfoArr::energy
float energy[NCaloCells]
Definition: EventInfoDefinitions.h:189
LArNeighbours::prevInPhi
@ prevInPhi
Definition: LArNeighbours.h:12
python.utils.AtlRunQueryLookup.mask
string mask
Definition: AtlRunQueryLookup.py:460
CaloRecGPU::CellInfoArr::qualityProvenance
QualityProvenance::carrier qualityProvenance[NCaloCells]
Definition: EventInfoDefinitions.h:192
LArNeighbours::nextInPhi
@ nextInPhi
Definition: LArNeighbours.h:13
constants.EMB2
int EMB2
Definition: Calorimeter/CaloClusterCorrection/python/constants.py:54
lumiFormat.i
int i
Definition: lumiFormat.py:85
CaloRecGPU::GeometryArr::is_tile
constexpr static bool is_tile(const int cell)
Definition: ConstantInfoDefinitions.h:246
CaloRecGPU::NMaxNeighbours
constexpr int NMaxNeighbours
Definition: BaseDefinitions.h:12
CaloRecGPU::CellInfoArr::time
float time[NCaloCells]
Definition: EventInfoDefinitions.h:191
threshold
Definition: chainparser.cxx:74
CaloCell_ID_FCS::PreSamplerE
@ PreSamplerE
Definition: FastCaloSim_CaloCell_ID.h:23
CaloCell_ID_FCS::PreSamplerB
@ PreSamplerB
Definition: FastCaloSim_CaloCell_ID.h:19
CaloRecGPU::CellInfoArr::is_valid
constexpr bool is_valid(const int cell) const
Definition: EventInfoDefinitions.h:316
CaloRecGPU::CellInfoArr::is_bad
static constexpr bool is_bad(const bool is_tile, const QualityProvenance qp, const bool treat_L1_predicted_as_good=false)
GPU version of CaloBadCellHelper::isBad.
Definition: EventInfoDefinitions.h:199
LArDigits2NtupleDumper.geom
geom
Definition: LArDigits2NtupleDumper.py:133
dumpTgcDigiThreshold.threshold
list threshold
Definition: dumpTgcDigiThreshold.py:34
constants.EME2
int EME2
Definition: Calorimeter/CaloClusterCorrection/python/constants.py:56