Pandora
Pandora source code navigator
Loading...
Searching...
No Matches
CaloHit.h
Go to the documentation of this file.
1
8#ifndef PANDORA_CALO_HIT_H
9#define PANDORA_CALO_HIT_H 1
10
12#include "Pandora/StatusCodes.h"
13
14namespace pandora
15{
16
17template<typename T> class InputObjectManager;
18template<typename T, typename S> class PandoraObjectFactory;
19
20//------------------------------------------------------------------------------------------------------------------------------------------
21
26{
27public:
34
40 float GetX0() const;
41
48
55
62
68 float GetCellSize0() const;
69
75 float GetCellSize1() const;
76
82 float GetCellThickness() const;
83
89 float GetNCellRadiationLengths() const;
90
96 float GetNCellInteractionLengths() const;
97
103 float GetInputEnergy() const;
104
110 float GetTime() const;
111
117 bool IsDigital() const;
118
124 HitType GetHitType() const;
125
131 HitRegion GetHitRegion() const;
132
138 unsigned int GetLayer() const;
139
145 unsigned int GetPseudoLayer() const;
146
152 bool IsInOuterSamplingLayer() const;
153
159 float GetMipEquivalentEnergy() const;
160
166 float GetElectromagneticEnergy() const;
167
173 float GetHadronicEnergy() const;
174
180 float GetCellLengthScale() const;
181
187 bool IsPossibleMip() const;
188
194 bool IsIsolated() const;
195
201 float GetWeight() const;
202
209
213 const void *GetParentAddress() const;
214
220 void GetCellCorners(CartesianPointVector &cartesianPointVector) const;
221
229 bool operator< (const CaloHit &rhs) const;
230
231protected:
238
245
249 virtual ~CaloHit();
250
257
263 StatusCode SetPseudoLayer(const unsigned int pseudoLayer);
264
270 void SetMCParticleWeightMap(const MCParticleWeightMap &mcParticleWeightMap);
271
275 void RemoveMCParticles();
276
282 float CalculateCellLengthScale() const;
283
289 void GetRectangularCellCorners(CartesianPointVector &cartesianPointVector) const;
290
296 void GetPointingCellCorners(CartesianPointVector &cartesianPointVector) const;
297
303 bool IsAvailable() const;
304
310 void SetAvailability(bool isAvailable);
311
313 float m_x0;
317 const float m_cellSize0;
318 const float m_cellSize1;
319 const float m_cellThickness;
322 const float m_time;
323 const float m_inputEnergy;
326 const float m_hadronicEnergy;
327 const bool m_isDigital;
330 const unsigned int m_layer;
337 float m_weight;
339 const void *m_pParentAddress;
340
341 friend class CaloHitMetadata;
342 friend class CaloHitManager;
343 friend class InputObjectManager<CaloHit>;
345 friend class PandoraObjectFactory<object_creation::CaloHitFragment::Parameters, object_creation::CaloHitFragment::Object>;
346};
347
348//------------------------------------------------------------------------------------------------------------------------------------------
349
351{
352 return m_positionVector;
353}
354
355//------------------------------------------------------------------------------------------------------------------------------------------
356
357inline float CaloHit::GetX0() const
358{
359 return m_x0;
360}
361
362//------------------------------------------------------------------------------------------------------------------------------------------
363
365{
366 return m_expectedDirection;
367}
368
369//------------------------------------------------------------------------------------------------------------------------------------------
370
372{
373 return m_cellNormalVector;
374}
375
376//------------------------------------------------------------------------------------------------------------------------------------------
377
379{
380 return m_cellGeometry;
381}
382
383//------------------------------------------------------------------------------------------------------------------------------------------
384
385inline float CaloHit::GetCellSize0() const
386{
387 return m_cellSize0;
388}
389
390//------------------------------------------------------------------------------------------------------------------------------------------
391
392inline float CaloHit::GetCellSize1() const
393{
394 return m_cellSize1;
395}
396
397//------------------------------------------------------------------------------------------------------------------------------------------
398
399inline float CaloHit::GetCellThickness() const
400{
401 return m_cellThickness;
402}
403
404//------------------------------------------------------------------------------------------------------------------------------------------
405
407{
409}
410
411//------------------------------------------------------------------------------------------------------------------------------------------
412
414{
416}
417
418//------------------------------------------------------------------------------------------------------------------------------------------
419
420inline float CaloHit::GetInputEnergy() const
421{
422 return m_inputEnergy;
423}
424
425//------------------------------------------------------------------------------------------------------------------------------------------
426
427inline float CaloHit::GetTime() const
428{
429 return m_time;
430}
431
432//------------------------------------------------------------------------------------------------------------------------------------------
433
434inline bool CaloHit::IsDigital() const
435{
436 return m_isDigital;
437}
438
439//------------------------------------------------------------------------------------------------------------------------------------------
440
442{
443 return m_hitType;
444}
445
446//------------------------------------------------------------------------------------------------------------------------------------------
447
449{
450 return m_hitRegion;
451}
452
453//------------------------------------------------------------------------------------------------------------------------------------------
454
455inline unsigned int CaloHit::GetLayer() const
456{
457 return m_layer;
458}
459
460//------------------------------------------------------------------------------------------------------------------------------------------
461
462inline unsigned int CaloHit::GetPseudoLayer() const
463{
464 return m_pseudoLayer.Get();
465}
466
467//------------------------------------------------------------------------------------------------------------------------------------------
468
470{
472}
473
474//------------------------------------------------------------------------------------------------------------------------------------------
475
477{
479}
480
481//------------------------------------------------------------------------------------------------------------------------------------------
482
484{
486}
487
488//------------------------------------------------------------------------------------------------------------------------------------------
489
490inline float CaloHit::GetHadronicEnergy() const
491{
492 return m_hadronicEnergy;
493}
494
495//------------------------------------------------------------------------------------------------------------------------------------------
496
497inline float CaloHit::GetCellLengthScale() const
498{
499 return m_cellLengthScale;
500}
501
502//------------------------------------------------------------------------------------------------------------------------------------------
503
504inline bool CaloHit::IsPossibleMip() const
505{
506 return m_isPossibleMip;
507}
508
509//------------------------------------------------------------------------------------------------------------------------------------------
510
511inline float CaloHit::GetWeight() const
512{
513 return m_weight;
514}
515
516//------------------------------------------------------------------------------------------------------------------------------------------
517
518inline bool CaloHit::IsIsolated() const
519{
520 return m_isIsolated;
521}
522
523//------------------------------------------------------------------------------------------------------------------------------------------
524
529
530//------------------------------------------------------------------------------------------------------------------------------------------
531
532inline const void *CaloHit::GetParentAddress() const
533{
534 return m_pParentAddress;
535}
536
537//------------------------------------------------------------------------------------------------------------------------------------------
538
539inline bool CaloHit::IsAvailable() const
540{
541 return m_isAvailable;
542}
543
544//------------------------------------------------------------------------------------------------------------------------------------------
545
546inline void CaloHit::SetAvailability(bool isAvailable)
547{
548 m_isAvailable = isAvailable;
549}
550
551} // namespace pandora
552
553#endif // #ifndef PANDORA_CALO_HIT_H
Header file for pandora object creation classes.
Header file defining status codes and relevant preprocessor macros.
CaloHit class.
Definition CaloHit.h:26
float GetElectromagneticEnergy() const
Get the calibrated electromagnetic energy measure.
Definition CaloHit.h:483
void GetPointingCellCorners(CartesianPointVector &cartesianPointVector) const
Get the list of cartesian coordinates for pointing cell corners.
Definition CaloHit.cc:221
HitType GetHitType() const
Get the calorimeter hit type.
Definition CaloHit.h:441
CellGeometry GetCellGeometry() const
Get the cell geometry.
Definition CaloHit.h:378
const float m_hadronicEnergy
The calibrated hadronic energy measure, units GeV.
Definition CaloHit.h:326
bool IsInOuterSamplingLayer() const
Whether cell is in one of the outermost detector sampling layers.
Definition CaloHit.h:469
void SetAvailability(bool isAvailable)
Set availability of calo hit to be added to a cluster.
Definition CaloHit.h:546
const CellGeometry m_cellGeometry
The cell geometry type, pointing or rectangular.
Definition CaloHit.h:316
unsigned int GetPseudoLayer() const
Get pseudo layer for the calo hit.
Definition CaloHit.h:462
const CartesianVector m_cellNormalVector
Unit normal to the sampling layer, pointing outwards from the origin.
Definition CaloHit.h:315
HitRegion GetHitRegion() const
Get the region of the detector in which the calo hit is located.
Definition CaloHit.h:448
const MCParticleWeightMap & GetMCParticleWeightMap() const
Get mc particle weight map for the calo hit.
Definition CaloHit.h:525
const CartesianVector & GetPositionVector() const
Get the position vector of center of calorimeter cell, units mm.
Definition CaloHit.h:350
const bool m_isDigital
Whether cell should be treated as digital (implies constant cell energy)
Definition CaloHit.h:327
bool m_isIsolated
Whether the calo hit is isolated.
Definition CaloHit.h:335
bool m_isAvailable
Whether the calo hit is available to be added to a cluster.
Definition CaloHit.h:336
virtual ~CaloHit()
Destructor.
Definition CaloHit.cc:121
float CalculateCellLengthScale() const
Calculate the typical length scale of the cell, units mm.
Definition CaloHit.cc:171
float GetWeight() const
Get the calo hit weight, which may not be unity if the hit has been fragmented.
Definition CaloHit.h:511
const CartesianVector m_expectedDirection
Unit vector in direction of expected hit propagation.
Definition CaloHit.h:314
bool IsIsolated() const
Whether the calo hit is flagged as isolated.
Definition CaloHit.h:518
void SetMCParticleWeightMap(const MCParticleWeightMap &mcParticleWeightMap)
Set the mc particles associated with the calo hit.
Definition CaloHit.cc:157
const float m_time
Time of (earliest) energy deposition in this cell, units ns.
Definition CaloHit.h:322
float GetX0() const
For LArTPC usage, the x-coordinate shift associated with a drift time t0 shift, units mm.
Definition CaloHit.h:357
const float m_cellSize1
Cell size 1 [pointing: azimuthal angle, phi, rectangular: perpendicular to size 0 and thickness,...
Definition CaloHit.h:318
CartesianVector m_positionVector
Position vector of center of calorimeter cell, units mm.
Definition CaloHit.h:312
unsigned int GetLayer() const
Get the subdetector readout layer number.
Definition CaloHit.h:455
float GetMipEquivalentEnergy() const
Get the calibrated mip equivalent energy.
Definition CaloHit.h:476
const float m_cellSize0
Cell size 0 [pointing: pseudo rapidity, eta, rectangular: up in ENDCAP, along beam in BARREL,...
Definition CaloHit.h:317
const float m_nCellRadiationLengths
Absorber material in front of cell, units radiation lengths.
Definition CaloHit.h:320
float m_weight
The calo hit weight, which may not be unity if the hit has been fragmented.
Definition CaloHit.h:337
const float m_electromagneticEnergy
The calibrated electromagnetic energy measure, units GeV.
Definition CaloHit.h:325
const HitRegion m_hitRegion
Region of the detector in which the calo hit is located.
Definition CaloHit.h:329
InputUInt m_pseudoLayer
The pseudo layer to which the calo hit has been assigned.
Definition CaloHit.h:331
float GetNCellRadiationLengths() const
Get the absorber material in front of cell, units radiation lengths.
Definition CaloHit.h:406
void GetCellCorners(CartesianPointVector &cartesianPointVector) const
Get the list of cartesian coordinates for the cell corners.
Definition CaloHit.cc:16
const float m_inputEnergy
Corrected energy of calorimeter cell in user framework, units GeV.
Definition CaloHit.h:323
const bool m_isInOuterSamplingLayer
Whether cell is in one of the outermost detector sampling layers.
Definition CaloHit.h:332
float GetNCellInteractionLengths() const
Get the absorber material in front of cell, units interaction lengths.
Definition CaloHit.h:413
float m_x0
For LArTPC usage, the x-coordinate shift associated with a drift time t0 shift, units mm.
Definition CaloHit.h:313
bool IsPossibleMip() const
Whether the calo hit is flagged as a possible mip hit.
Definition CaloHit.h:504
bool m_isPossibleMip
Whether the calo hit is a possible mip hit.
Definition CaloHit.h:334
float GetCellThickness() const
Get the thickness of cell, units mm.
Definition CaloHit.h:399
float GetCellSize1() const
Get the cell size 1 [pointing: phi, rectangular: perpendicular to size 0 and thickness,...
Definition CaloHit.h:392
void GetRectangularCellCorners(CartesianPointVector &cartesianPointVector) const
Get the list of cartesian coordinates for rectangular cell corners.
Definition CaloHit.cc:196
StatusCode AlterMetadata(const object_creation::CaloHit::Metadata &metadata)
Alter the metadata information stored in a calo hit.
Definition CaloHit.cc:127
float GetCellLengthScale() const
Get the typical length scale of cell, units mm.
Definition CaloHit.h:497
bool IsDigital() const
Whether cell should be treated as digital.
Definition CaloHit.h:434
const unsigned int m_layer
The subdetector readout layer number.
Definition CaloHit.h:330
const void * m_pParentAddress
The address of the parent calo hit in the user framework.
Definition CaloHit.h:339
float GetCellSize0() const
Get the cell size 0 [pointing: eta, rectangular: up in ENDCAP, along beam in BARREL,...
Definition CaloHit.h:385
bool operator<(const CaloHit &rhs) const
operator< sorting by position, then energy
Definition CaloHit.cc:34
bool IsAvailable() const
Whether the calo hit is available to be added to a cluster (access this function via PandoraContentAP...
Definition CaloHit.h:539
const float m_mipEquivalentEnergy
The calibrated mip equivalent energy, units mip.
Definition CaloHit.h:324
const CartesianVector & GetCellNormalVector() const
Get the unit vector normal to the sampling layer, pointing outwards from the origin.
Definition CaloHit.h:371
float GetHadronicEnergy() const
Get the calibrated hadronic energy measure.
Definition CaloHit.h:490
float GetInputEnergy() const
Get the corrected energy of the calorimeter cell, units GeV, as supplied by the user.
Definition CaloHit.h:420
float GetTime() const
Get the time of (earliest) energy deposition in this cell, units ns.
Definition CaloHit.h:427
float m_cellLengthScale
Typical length scale [pointing: measured at cell mid-point, rectangular: std::sqrt(cellSize0 * cellSi...
Definition CaloHit.h:333
const void * GetParentAddress() const
Get the address of the parent calo hit in the user framework.
Definition CaloHit.h:532
MCParticleWeightMap m_mcParticleWeightMap
The mc particle weight map.
Definition CaloHit.h:338
const HitType m_hitType
The type of calorimeter hit.
Definition CaloHit.h:328
void RemoveMCParticles()
Remove the mc particles associated with the calo hit.
Definition CaloHit.cc:164
const float m_nCellInteractionLengths
Absorber material in front of cell, units interaction lengths.
Definition CaloHit.h:321
const float m_cellThickness
Thickness of cell, units mm.
Definition CaloHit.h:319
const CartesianVector & GetExpectedDirection() const
Get the unit vector in direction of expected hit propagation.
Definition CaloHit.h:364
StatusCode SetPseudoLayer(const unsigned int pseudoLayer)
Set the mc pseudo layer for the calo hit.
Definition CaloHit.cc:147
CaloHitManager class.
CaloHitMetadata class.
Definition Metadata.h:39
CartesianVector class.
InputObjectManager class.
const T & Get() const
Get the value held by the pandora type.
PandoraObjectFactory class.
HitType
Calorimeter hit type enum.
HitRegion
Calorimeter hit region enum.
std::unordered_map< const MCParticle *, float > MCParticleWeightMap
std::vector< CartesianVector > CartesianPointVector
CellGeometry
Cell geometry enum.
StatusCode
The StatusCode enum.