|
LDMX Software
|
Stores simulated calorimeter hit information. More...
#include <SimCalorimeterHit.h>
Classes | |
| class | Contrib |
| Information about a contribution to the hit in the associated cell. More... | |
Public Member Functions | |
| SimCalorimeterHit ()=default | |
| Class constructor. | |
| virtual | ~SimCalorimeterHit ()=default |
| Class destructor. | |
| void | clear () |
| Clear the data in the object. | |
| int | getID () const |
| Get the detector ID. | |
| void | setID (const int id) |
| Set the detector ID. | |
| float | getEdep () const |
| Get the energy deposition of the hit [MeV]. | |
| void | setEdep (const float edep) |
| Set the energy deposition of the hit [MeV]. | |
| std::vector< float > | getPosition () const |
| Get the XYZ position of the hit [mm]. | |
| std::vector< float > | getPreStepPosition () const |
| Get the XYZ pre-step position of the hit in the coordinate frame of the sensitive volume [mm]. | |
| std::vector< float > | getPostStepPosition () const |
| Get the XYZ post-step position of the hit in the coordinate frame of the sensitive volume [mm]. | |
| void | setPosition (const float x, const float y, const float z) |
| Set the XYZ position of the hit [mm]. | |
| void | setPreStepPosition (const float x, const float y, const float z) |
| Set the XYZ pre-step position of the hit in the coordinate frame of the sensitive volume [mm]. | |
| void | setPostStepPosition (const float x, const float y, const float z) |
| Set the XYZ post-step position of the hit in the coordinate frame of the sensitive volume [mm]. | |
| void | setPathLength (const float length) |
| Set the physical path length for the interaction [mm]. | |
| float | getPathLength () const |
| Get the physical path length for the interaction [mm]. | |
| void | setPreStepTime (const float time) |
| Set global pre-step time of the hit [ns]. | |
| void | setPostStepTime (const float time) |
| Set global post-step time of the hit [ns]. | |
| void | setVelocity (float velocity) |
| Set the velocity of the track [mm/ns]. | |
| float | getTime () const |
| Get the global time of the hit [ns]. | |
| float | getPreStepTime () const |
| Get the pre-step time of the hit [ns]. | |
| float | getPostStepTime () const |
| Get the post-step time of the hit [ns]. | |
| float | getVelocity () const |
| Get the track velocity of the hit [mm/ns]. | |
| void | setTime (const float time) |
| Set the time of the hit [ns]. | |
| unsigned | getNumberOfContribs () const |
| Get the number of hit contributions. | |
| void | addContrib (int incidentID, int trackID, int pdgCode, float edep, float time, int originID=-1) |
| Add a hit contribution from a SimParticle. | |
| Contrib | getContrib (int i) const |
| Get a hit contribution by index_. | |
| int | findContribIndex (int trackID, int pdgCode) const |
| Find the index of a hit contribution from a SimParticle and PDG code. | |
| void | updateContrib (int i, float edep, float time) |
| Update an existing hit contribution by incrementing its edep and setting the time if the new time is less than the old one. | |
| bool | operator< (const SimCalorimeterHit &rhs) const |
| Sort by time of hit. | |
| std::vector< int > | getTrackIds () const |
| Get the list of track IDs contributing to the hit. | |
| std::vector< int > | getIncidentIds () const |
| Get the list of incident IDs contributing to the hit. | |
| std::vector< int > | getPdgIds () const |
| Get the list of PDG codes contributing to the hit. | |
| std::vector< float > | getEdeps () const |
| Get the list of energy depositions contributing to the hit. | |
| std::vector< float > | getTimes () const |
| Get the list of times contributing to the hit. | |
Static Public Attributes | |
| static const std::string | ECAL_COLLECTION = "EcalSimHits" |
| name of the ecal sim collection, should match gdml | |
| static const std::string | HCAL_COLLECTION = "HcalSimHits" |
| name of the hcal sim collection, should match gdml | |
Private Attributes | |
| int | id_ {0} |
| Member variables used in all calorimeter types. | |
| float | edep_ {0} |
| The energy deposition. | |
| float | x_ {0} |
| The X position. | |
| float | y_ {0} |
| The Y position. | |
| float | z_ {0} |
| The Z position. | |
| float | time_ {0} |
| The global time of the hit. | |
| std::vector< int > | track_id_contribs_ |
| The list of track IDs contributing to the hit. | |
| std::vector< int > | incident_id_contribs_ |
| The list of incident IDs contributing to the hit. | |
| std::vector< int > | pdg_code_contribs_ |
| The list of PDG codes contributing to the hit. | |
| std::vector< float > | edep_contribs_ |
| The list of energy depositions contributing to the hit. | |
| std::vector< float > | time_contribs_ |
| The list of times contributing to the hit. | |
| std::vector< int > | origin_contribs_ |
| The list of origin IDs contributing to the hit. | |
| unsigned | n_contribs_ {0} |
| The number of hit contributions. | |
| float | path_length_ {-1} |
| The true path length [mm]. | |
| float | pre_step_x_ {0} |
| The X, Y, and Z positions [mm] before the interaction in the coordinate frame of the sensitive volume. | |
| float | pre_step_y_ {0} |
| float | pre_step_z_ {0} |
| float | pre_step_time_ {0} |
| The global time before the interaction [ns]. | |
| float | post_step_x_ {0} |
| The X, Y, and Z positions [mm] after the interaction in the coordinate frame of the sensitive volume. | |
| float | post_step_y_ {0} |
| float | post_step_z_ {0} |
| float | post_step_time_ {0} |
| The global time after the interaction [ns]. | |
| float | velocity_ {-1} |
| The track velocity [mm/ns]. | |
Friends | |
| std::ostream & | operator<< (std::ostream &o, const SimCalorimeterHit &d) |
| Print out the object. | |
Stores simulated calorimeter hit information.
Definition at line 32 of file SimCalorimeterHit.h.
| void ldmx::SimCalorimeterHit::addContrib | ( | int | incidentID, |
| int | trackID, | ||
| int | pdgCode, | ||
| float | edep, | ||
| float | time, | ||
| int | originID = -1 ) |
Add a hit contribution from a SimParticle.
| incidentID | the Geant4 track ID for the particle's parent incident on the Calorimeter region |
| trackID | the Geant4 track ID for the particle |
| pdgCode | The PDG code of the actual track. |
| edep | The energy deposition of the hit [MeV]. |
| time | The time of the hit [ns]. |
Definition at line 38 of file SimCalorimeterHit.cxx.
References edep_, edep_contribs_, incident_id_contribs_, n_contribs_, origin_contribs_, pdg_code_contribs_, time_, time_contribs_, and track_id_contribs_.
Referenced by simcore::TrigScintSD::ProcessHits().
| void ldmx::SimCalorimeterHit::clear | ( | ) |
Clear the data in the object.
Definition at line 13 of file SimCalorimeterHit.cxx.
References edep_, edep_contribs_, id_, incident_id_contribs_, n_contribs_, pdg_code_contribs_, time_, time_contribs_, track_id_contribs_, x_, y_, and z_.
| int ldmx::SimCalorimeterHit::findContribIndex | ( | int | trackID, |
| int | pdgCode ) const |
Find the index of a hit contribution from a SimParticle and PDG code.
| trackID | the track ID of the particle causing the hit |
| pdgCode | The PDG code of the contribution. |
Definition at line 64 of file SimCalorimeterHit.cxx.
References getContrib(), n_contribs_, ldmx::SimCalorimeterHit::Contrib::pdg_code_, and ldmx::SimCalorimeterHit::Contrib::track_id_.
| SimCalorimeterHit::Contrib ldmx::SimCalorimeterHit::getContrib | ( | int | i | ) | const |
Get a hit contribution by index_.
| i | The index of the hit contribution. |
Definition at line 53 of file SimCalorimeterHit.cxx.
References ldmx::SimCalorimeterHit::Contrib::edep_, edep_contribs_, ldmx::SimCalorimeterHit::Contrib::incident_id_, incident_id_contribs_, origin_contribs_, ldmx::SimCalorimeterHit::Contrib::origin_id_, ldmx::SimCalorimeterHit::Contrib::pdg_code_, pdg_code_contribs_, ldmx::SimCalorimeterHit::Contrib::time_, time_contribs_, ldmx::SimCalorimeterHit::Contrib::track_id_, and track_id_contribs_.
Referenced by findContribIndex(), and hcal::HcalDigiProducer::produce().
|
inline |
Get the energy deposition of the hit [MeV].
Definition at line 110 of file SimCalorimeterHit.h.
References edep_.
|
inline |
Get the list of energy depositions contributing to the hit.
Definition at line 297 of file SimCalorimeterHit.h.
References edep_contribs_.
|
inline |
Get the detector ID.
Definition at line 98 of file SimCalorimeterHit.h.
References id_.
|
inline |
Get the list of incident IDs contributing to the hit.
Definition at line 287 of file SimCalorimeterHit.h.
References incident_id_contribs_.
|
inline |
Get the number of hit contributions.
Definition at line 235 of file SimCalorimeterHit.h.
References n_contribs_.
Referenced by hcal::HcalDigiProducer::produce().
|
inline |
Get the physical path length for the interaction [mm].
Definition at line 185 of file SimCalorimeterHit.h.
References path_length_.
|
inline |
Get the list of PDG codes contributing to the hit.
Definition at line 292 of file SimCalorimeterHit.h.
References pdg_code_contribs_.
|
inline |
Get the XYZ position of the hit [mm].
Definition at line 122 of file SimCalorimeterHit.h.
Referenced by hcal::HcalDigiProducer::produce().
|
inline |
Get the XYZ post-step position of the hit in the coordinate frame of the sensitive volume [mm].
Definition at line 137 of file SimCalorimeterHit.h.
References post_step_x_.
|
inline |
Get the post-step time of the hit [ns].
Definition at line 217 of file SimCalorimeterHit.h.
References post_step_time_.
|
inline |
Get the XYZ pre-step position of the hit in the coordinate frame of the sensitive volume [mm].
Definition at line 129 of file SimCalorimeterHit.h.
References pre_step_x_.
|
inline |
Get the pre-step time of the hit [ns].
Definition at line 212 of file SimCalorimeterHit.h.
References pre_step_time_.
|
inline |
Get the global time of the hit [ns].
Definition at line 207 of file SimCalorimeterHit.h.
References time_.
Referenced by operator<().
|
inline |
Get the list of times contributing to the hit.
Definition at line 302 of file SimCalorimeterHit.h.
References time_contribs_.
|
inline |
Get the list of track IDs contributing to the hit.
Definition at line 283 of file SimCalorimeterHit.h.
References track_id_contribs_.
|
inline |
Get the track velocity of the hit [mm/ns].
Definition at line 223 of file SimCalorimeterHit.h.
References velocity_.
|
inline |
Sort by time of hit.
Definition at line 276 of file SimCalorimeterHit.h.
References getTime().
|
inline |
Set the energy deposition of the hit [MeV].
| edep | The energy deposition of the hit. |
Definition at line 116 of file SimCalorimeterHit.h.
References edep_.
|
inline |
Set the detector ID.
@id The detector ID.
Definition at line 104 of file SimCalorimeterHit.h.
References id_.
Referenced by simcore::TrigScintSD::ProcessHits().
|
inline |
Set the physical path length for the interaction [mm].
| length | The physical path lenght |
Definition at line 180 of file SimCalorimeterHit.h.
References path_length_.
Referenced by simcore::TrigScintSD::ProcessHits().
|
inline |
Set the XYZ position of the hit [mm].
| x | The X position. |
| y | The Y position. |
| z | The Z position. |
Definition at line 146 of file SimCalorimeterHit.h.
Referenced by simcore::HcalSD::ProcessHits(), and simcore::TrigScintSD::ProcessHits().
|
inline |
Set the XYZ post-step position of the hit in the coordinate frame of the sensitive volume [mm].
| x | The X position. |
| y | The Y position. |
| z | The Z position. |
Definition at line 170 of file SimCalorimeterHit.h.
References post_step_x_.
Referenced by simcore::TrigScintSD::ProcessHits().
|
inline |
Set global post-step time of the hit [ns].
| time | The time before the step |
Definition at line 195 of file SimCalorimeterHit.h.
References post_step_time_.
Referenced by simcore::TrigScintSD::ProcessHits().
|
inline |
Set the XYZ pre-step position of the hit in the coordinate frame of the sensitive volume [mm].
| x | The X position. |
| y | The Y position. |
| z | The Z position. |
Definition at line 158 of file SimCalorimeterHit.h.
References pre_step_x_.
Referenced by simcore::TrigScintSD::ProcessHits().
|
inline |
Set global pre-step time of the hit [ns].
| time | The time before the step |
Definition at line 190 of file SimCalorimeterHit.h.
References pre_step_time_.
Referenced by simcore::TrigScintSD::ProcessHits().
|
inline |
Set the time of the hit [ns].
| time | The time of the hit. |
Definition at line 229 of file SimCalorimeterHit.h.
References time_.
|
inline |
Set the velocity of the track [mm/ns].
| velocity | The track velocity |
Definition at line 201 of file SimCalorimeterHit.h.
References velocity_.
Referenced by simcore::TrigScintSD::ProcessHits().
| void ldmx::SimCalorimeterHit::updateContrib | ( | int | i, |
| float | edep, | ||
| float | time ) |
Update an existing hit contribution by incrementing its edep and setting the time if the new time is less than the old one.
| i | The index of the contribution. |
| edep | The additional energy contribution [MeV]. |
| time | The time of the contribution [ns]. |
Definition at line 76 of file SimCalorimeterHit.cxx.
References edep_, edep_contribs_, and time_contribs_.
|
friend |
Print out the object.
Definition at line 29 of file SimCalorimeterHit.cxx.
|
static |
name of the ecal sim collection, should match gdml
Definition at line 35 of file SimCalorimeterHit.h.
|
private |
The energy deposition.
Definition at line 316 of file SimCalorimeterHit.h.
Referenced by addContrib(), clear(), getEdep(), setEdep(), and updateContrib().
|
private |
The list of energy depositions contributing to the hit.
Definition at line 356 of file SimCalorimeterHit.h.
Referenced by addContrib(), clear(), getContrib(), getEdeps(), and updateContrib().
|
static |
name of the hcal sim collection, should match gdml
Definition at line 38 of file SimCalorimeterHit.h.
|
private |
Member variables used in all calorimeter types.
The detector ID.
Definition at line 311 of file SimCalorimeterHit.h.
|
private |
The list of incident IDs contributing to the hit.
Definition at line 346 of file SimCalorimeterHit.h.
Referenced by addContrib(), clear(), getContrib(), and getIncidentIds().
|
private |
The number of hit contributions.
Definition at line 371 of file SimCalorimeterHit.h.
Referenced by addContrib(), clear(), findContribIndex(), and getNumberOfContribs().
|
private |
The list of origin IDs contributing to the hit.
Definition at line 366 of file SimCalorimeterHit.h.
Referenced by addContrib(), and getContrib().
|
private |
The true path length [mm].
Can in general differ from the distance between the pre and post step position.
Definition at line 382 of file SimCalorimeterHit.h.
Referenced by getPathLength(), and setPathLength().
|
private |
The list of PDG codes contributing to the hit.
Definition at line 351 of file SimCalorimeterHit.h.
Referenced by addContrib(), clear(), getContrib(), and getPdgIds().
|
private |
The global time after the interaction [ns].
Definition at line 405 of file SimCalorimeterHit.h.
Referenced by getPostStepTime(), and setPostStepTime().
|
private |
The X, Y, and Z positions [mm] after the interaction in the coordinate frame of the sensitive volume.
Definition at line 399 of file SimCalorimeterHit.h.
Referenced by getPostStepPosition(), and setPostStepPosition().
|
private |
Definition at line 400 of file SimCalorimeterHit.h.
|
private |
Definition at line 401 of file SimCalorimeterHit.h.
|
private |
The global time before the interaction [ns].
Definition at line 394 of file SimCalorimeterHit.h.
Referenced by getPreStepTime(), and setPreStepTime().
|
private |
The X, Y, and Z positions [mm] before the interaction in the coordinate frame of the sensitive volume.
Definition at line 388 of file SimCalorimeterHit.h.
Referenced by getPreStepPosition(), and setPreStepPosition().
|
private |
Definition at line 389 of file SimCalorimeterHit.h.
|
private |
Definition at line 390 of file SimCalorimeterHit.h.
|
private |
The global time of the hit.
Definition at line 336 of file SimCalorimeterHit.h.
Referenced by addContrib(), clear(), getTime(), and setTime().
|
private |
The list of times contributing to the hit.
Definition at line 361 of file SimCalorimeterHit.h.
Referenced by addContrib(), clear(), getContrib(), getTimes(), and updateContrib().
|
private |
The list of track IDs contributing to the hit.
Definition at line 341 of file SimCalorimeterHit.h.
Referenced by addContrib(), clear(), getContrib(), and getTrackIds().
|
private |
The track velocity [mm/ns].
Definition at line 410 of file SimCalorimeterHit.h.
Referenced by getVelocity(), and setVelocity().
|
private |
The X position.
Definition at line 321 of file SimCalorimeterHit.h.
Referenced by clear(), getPosition(), and setPosition().
|
private |
The Y position.
Definition at line 326 of file SimCalorimeterHit.h.
Referenced by clear(), getPosition(), and setPosition().
|
private |
The Z position.
Definition at line 331 of file SimCalorimeterHit.h.
Referenced by clear(), getPosition(), and setPosition().