LCIO
02.17
|
Implementation of the generic SimCalorimeterHit. More...
#include <SimCalorimeterHitImpl.h>
Public Member Functions | |
SimCalorimeterHitImpl () | |
Default constructor, initializes values to 0. More... | |
SimCalorimeterHitImpl (const EVENT::SimCalorimeterHit &hit) | |
Copy constructor - shallow copy. More... | |
virtual | ~SimCalorimeterHitImpl () |
Destructor. More... | |
virtual int | id () const |
Returns an object id for internal (debugging) use in LCIO. More... | |
virtual int | getCellID0 () const |
Create a deep copy of itself. More... | |
virtual int | getCellID1 () const |
Returns the second detector specific (geometrical) cell id. More... | |
virtual float | getEnergy () const |
Returns the energy of the hit. More... | |
virtual const float * | getPosition () const |
Returns the position of the hit in world coordinates. More... | |
virtual const float * | getStepPosition (int i) const |
Returns the position where the energy deposited (step) occurred optional, only if bit LCIO::CHBIT_STEP is set. More... | |
LCIO_DEPRECATED ("Use getNMCContributions() instead", virtual int getNMCParticles() const ) | |
Returns the number of MC contributions to the hit. More... | |
virtual int | getNMCContributions () const |
Returns the number of MC contributions to the hit. More... | |
virtual float | getEnergyCont (int i) const |
Returns the energy in [GeV] of the i-th contribution to the hit. More... | |
virtual float | getTimeCont (int i) const |
Returns the time of the i-th in [ns] contribution to the hit. More... | |
virtual float | getLengthCont (int i) const |
Returns the step length of the i-th contribution to the hit. More... | |
virtual int | getPDGCont (int i) const |
Returns the PDG code of the shower particle that caused this contribution. More... | |
virtual EVENT::MCParticle * | getParticleCont (int i) const |
Returns the MCParticle that caused the shower responsible for this contribution to the hit. More... | |
void | setCellID0 (int id0) |
Sets the first cell id;. More... | |
void | setCellID1 (int id1) |
Sets the second cell id; Only store if the flag word (bit CHBIT_ID1) of the collection is set. More... | |
void | setEnergy (float en) |
Sets the energy. More... | |
void | setPosition (const float pos[3]) |
Sets the position. More... | |
void | addMCParticleContribution (EVENT::MCParticle *p, float en, float t) |
Adds an MCParticle contribution to the hit - contributions for the same MCParticle are combined into one, where the energy is accumulated and the time is the energy weighted mean time. More... | |
void | addMCParticleContribution (EVENT::MCParticle *p, float en, float t, int pdg, float *stepPos=0) |
Adds a detailed MCParticle contribution to the hit. More... | |
void | addMCParticleContribution (EVENT::MCParticle *p, float en, float t, float l, int pdg, float *stepPos=0) |
Adds a detailed MCParticle contribution to the hit. More... | |
![]() | |
virtual | ~SimCalorimeterHit () |
Destructor. More... | |
virtual int | getNMCParticles () const =0 |
Returns the number of MC contributions to the hit. More... | |
![]() | |
virtual | ~LCObject () |
Destructor. More... | |
virtual LCObject * | clone () const |
Returns an object id for internal (debugging) use in LCIO. More... | |
![]() | |
template<class V > | |
V::ext_type | ext () |
Provides access to an extension object - the type and ownership is defined by the class V which should be a subtype of LCExtension, LCOwnedExtension, LCExtensionVector, LCExtensionList,... More... | |
template<class V > | |
const V::ext_type | ext () const |
Provides access to an extension object - the type and ownership is defined by the class V which should be a subtype of LCExtension, LCOwnedExtension, LCExtensionVector, LCExtensionList,... More... | |
template<class V > | |
V::rel_type | rel () |
Provides read access to relations - the object types and their connectivity are defined by the class V which has to be a subtype of either LC1To1Relation, LC1ToNRelation or LCNToNRelation. More... | |
![]() | |
AccessChecked () | |
virtual | ~AccessChecked () |
virtual int | simpleUID () const |
Protected Attributes | |
int | _cellID0 |
int | _cellID1 |
float | _energy |
float | _position [3] |
MCParticleContVec | _vec {} |
![]() | |
bool | _readOnly {false} |
int | _id {-1} |
Additional Inherited Members | |
![]() | |
typedef SimCalorimeterHit | lcobject_type |
Useful typedef for template programming with LCIO. More... | |
![]() | |
typedef std::type_index | ext_index |
typedef std::shared_ptr< void > | ext_type |
typedef std::map< ext_index, ext_type > | ext_map |
![]() | |
virtual void | setReadOnly (bool readOnly) |
void | checkAccess () |
void | checkAccess (const char *what) |
![]() | |
static std::atomic_int | _lCObjectId |
Implementation of the generic SimCalorimeterHit.
Definition at line 54 of file SimCalorimeterHitImpl.h.
IMPL::SimCalorimeterHitImpl::SimCalorimeterHitImpl | ( | ) |
Default constructor, initializes values to 0.
Definition at line 10 of file SimCalorimeterHitImpl.cc.
References _position.
IMPL::SimCalorimeterHitImpl::SimCalorimeterHitImpl | ( | const EVENT::SimCalorimeterHit & | hit | ) |
Copy constructor - shallow copy.
|
virtual |
Destructor.
Definition at line 53 of file SimCalorimeterHitImpl.cc.
References _vec, std::vector< T >::begin(), and std::vector< T >::end().
void IMPL::SimCalorimeterHitImpl::addMCParticleContribution | ( | EVENT::MCParticle * | p, |
float | en, | ||
float | t | ||
) |
Adds an MCParticle contribution to the hit - contributions for the same MCParticle are combined into one, where the energy is accumulated and the time is the energy weighted mean time.
Use this method for the standard LCIO mode, where one energy contribution per primary particle entering the calorimeter is stored.
Definition at line 144 of file SimCalorimeterHitImpl.cc.
References _energy, _vec, std::vector< T >::begin(), IMPL::AccessChecked::checkAccess(), std::vector< T >::end(), and std::vector< T >::push_back().
Referenced by addMCParticleContribution().
|
inline |
Adds a detailed MCParticle contribution to the hit.
This method should be used for the detailed mode, where one MCParticleContribution is stored for every simulator step.
If stepPos==0, (0,0,0) will be stored. NB: The flag word bit LCIO::CHBIT_STEP (or LCIO::CHBIT_PDG) has to be set, in order for the PDG and step position to be stored.
Definition at line 190 of file SimCalorimeterHitImpl.h.
References addMCParticleContribution().
void IMPL::SimCalorimeterHitImpl::addMCParticleContribution | ( | EVENT::MCParticle * | p, |
float | en, | ||
float | t, | ||
float | l, | ||
int | pdg, | ||
float * | stepPos = 0 |
||
) |
Adds a detailed MCParticle contribution to the hit.
This method should be used for the detailed mode, where one MCParticleContribution is stored for every simulator step.
If stepPos==0, (0,0,0) will be stored. NB: The flag word bit LCIO::CHBIT_STEP (or LCIO::CHBIT_PDG) has to be set, in order for the PDG and step position to be stored.
Definition at line 171 of file SimCalorimeterHitImpl.cc.
References _energy, _vec, IMPL::AccessChecked::checkAccess(), and std::vector< T >::push_back().
|
virtual |
Create a deep copy of itself.
Overwrites return type in LCObject::clone(). Not yet - as AID genereates virtual inheritance and g++ doesn't support virtual constructors with virtual inheritance TODO - change org.freehep.aid.CPPHeaderGenerator !Returns the detector specific (geometrical) cell id.
Implements EVENT::SimCalorimeterHit.
Definition at line 63 of file SimCalorimeterHitImpl.cc.
References _cellID0.
|
virtual |
Returns the second detector specific (geometrical) cell id.
0 if information is not stored - check the flag word (bit CHBIT_ID1) of the collection. Default is to store only cellid0.
Implements EVENT::SimCalorimeterHit.
Definition at line 67 of file SimCalorimeterHitImpl.cc.
References _cellID1.
|
virtual |
Returns the energy of the hit.
Implements EVENT::SimCalorimeterHit.
Definition at line 71 of file SimCalorimeterHitImpl.cc.
References _energy.
|
virtual |
Returns the energy in [GeV] of the i-th contribution to the hit.
Implements EVENT::SimCalorimeterHit.
Definition at line 106 of file SimCalorimeterHitImpl.cc.
References _vec.
|
virtual |
Returns the step length of the i-th contribution to the hit.
Implements EVENT::SimCalorimeterHit.
Definition at line 113 of file SimCalorimeterHitImpl.cc.
References _vec.
|
virtual |
Returns the number of MC contributions to the hit.
0 if information is not stored. There are two levels of detail: if collection flag bit LCIO.CHBIT_STEP==1 then all simulator steps' contributions to the hit are stored, otherwise there is only one contribution for every particle entering the calorimeter.
Implements EVENT::SimCalorimeterHit.
Definition at line 93 of file SimCalorimeterHitImpl.cc.
References _vec, and std::vector< T >::size().
|
virtual |
Returns the MCParticle that caused the shower responsible for this contribution to the hit.
This is the particle that flew into the calorimeter and not the shower particle that made the energy deposition.
Implements EVENT::SimCalorimeterHit.
Definition at line 97 of file SimCalorimeterHitImpl.cc.
References _vec, std::vector< T >::at(), IMPL::MCParticleCont::Particle, and std::stringstream::str().
|
virtual |
Returns the PDG code of the shower particle that caused this contribution.
Check the flag word bit LCIO.CHBIT_STEP of the collection whether this information is available.
Implements EVENT::SimCalorimeterHit.
Definition at line 117 of file SimCalorimeterHitImpl.cc.
References _vec.
|
virtual |
Returns the position of the hit in world coordinates.
NULL if information is not stored. Ask collection for flag, only available if bit LCIO.CHBIT_LONG is set.
Implements EVENT::SimCalorimeterHit.
Definition at line 75 of file SimCalorimeterHitImpl.cc.
References _position.
|
virtual |
Returns the position where the energy deposited (step) occurred optional, only if bit LCIO::CHBIT_STEP is set.
Implements EVENT::SimCalorimeterHit.
Definition at line 79 of file SimCalorimeterHitImpl.cc.
References _vec.
|
virtual |
Returns the time of the i-th in [ns] contribution to the hit.
Implements EVENT::SimCalorimeterHit.
Definition at line 110 of file SimCalorimeterHitImpl.cc.
References _vec.
|
inlinevirtual |
Returns an object id for internal (debugging) use in LCIO.
Implements EVENT::LCObject.
Definition at line 70 of file SimCalorimeterHitImpl.h.
References IMPL::AccessChecked::simpleUID().
IMPL::SimCalorimeterHitImpl::LCIO_DEPRECATED | ( | "Use getNMCContributions() instead" | , |
virtual int getNMCParticles() | const | ||
) |
Returns the number of MC contributions to the hit.
0 if information is not stored. Renamed to getNMCContributions.
void IMPL::SimCalorimeterHitImpl::setCellID0 | ( | int | id0 | ) |
Sets the first cell id;.
Definition at line 121 of file SimCalorimeterHitImpl.cc.
References _cellID0, and IMPL::AccessChecked::checkAccess().
void IMPL::SimCalorimeterHitImpl::setCellID1 | ( | int | id1 | ) |
Sets the second cell id; Only store if the flag word (bit CHBIT_ID1) of the collection is set.
Default is to store only cellid0.
Definition at line 126 of file SimCalorimeterHitImpl.cc.
References _cellID1, and IMPL::AccessChecked::checkAccess().
void IMPL::SimCalorimeterHitImpl::setEnergy | ( | float | en | ) |
Sets the energy.
Definition at line 131 of file SimCalorimeterHitImpl.cc.
References _energy, and IMPL::AccessChecked::checkAccess().
void IMPL::SimCalorimeterHitImpl::setPosition | ( | const float | pos[3] | ) |
Sets the position.
Not stored if LCIO.CHBIT_LONG isn't set.
Definition at line 136 of file SimCalorimeterHitImpl.cc.
References _position, and IMPL::AccessChecked::checkAccess().
|
protected |
Definition at line 218 of file SimCalorimeterHitImpl.h.
Referenced by getCellID0(), and setCellID0().
|
protected |
Definition at line 219 of file SimCalorimeterHitImpl.h.
Referenced by getCellID1(), and setCellID1().
|
protected |
Definition at line 220 of file SimCalorimeterHitImpl.h.
Referenced by addMCParticleContribution(), getEnergy(), and setEnergy().
|
protected |
Definition at line 221 of file SimCalorimeterHitImpl.h.
Referenced by getPosition(), setPosition(), and SimCalorimeterHitImpl().
|
protected |
Definition at line 223 of file SimCalorimeterHitImpl.h.
Referenced by addMCParticleContribution(), getEnergyCont(), getLengthCont(), getNMCContributions(), getParticleCont(), getPDGCont(), getStepPosition(), getTimeCont(), and ~SimCalorimeterHitImpl().