Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
edep-reader
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
dune
edep-reader
Merge requests
!6
To be used with kf only
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
To be used with kf only
To-be-used-with-KF-only
into
develop
Overview
0
Commits
4
Pipelines
0
Changes
4
Merged
Valerio Pia
requested to merge
To-be-used-with-KF-only
into
develop
5 months ago
Overview
0
Commits
4
Pipelines
0
Changes
4
Expand
0
0
Merge request reports
Compare
develop
version 1
2c2d3c7f
5 months ago
develop (base)
and
latest version
latest version
371b7d50
4 commits,
5 months ago
version 1
2c2d3c7f
3 commits,
5 months ago
4 files
+
122
−
109
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
4
Search (e.g. *.vue) (Ctrl+P)
include/EDEPHit.h
+
103
−
103
Options
#ifndef EDEPHIT_H
#define EDEPHIT_H
#include
<iostream>
#include
"utils.h"
#include
"TG4Event.h"
/**
* @class EDEPHit
* @brief Represents a hit in a detector.
*
* This class encapsulates information about a hit in a detector, such as its start and stop positions,
* energy deposition, secondary deposition, track length, contribution, primary ID, and index.
*/
class
EDEPHit
{
public:
/**
* @brief Constructor for EDEPHit.
* @param hit The TG4HitSegment object containing hit information.
*/
EDEPHit
(
TG4HitSegment
hit
)
:
start_
(
hit
.
GetStart
()),
stop_
(
hit
.
GetStop
()),
energy_deposit_
(
hit
.
GetEnergyDeposit
()),
secondary_deposit_
(
hit
.
GetSecondaryDeposit
()),
track_length_
(
hit
.
GetTrackLength
()),
contrib_
(
hit
.
Contrib
[
0
]),
primary_id_
(
hit
.
GetPrimaryId
()),
h_index
(
-
1
)
{};
/**
* @brief Constructor for EDEPHit.
* @param hit The TG4HitSegment object containing hit information.
* @param i The index of the hit.
*/
EDEPHit
(
TG4HitSegment
hit
,
int
i
)
:
start_
(
hit
.
GetStart
()),
stop_
(
hit
.
GetStop
()),
energy_deposit_
(
hit
.
GetEnergyDeposit
()),
secondary_deposit_
(
hit
.
GetSecondaryDeposit
()),
track_length_
(
hit
.
GetTrackLength
()),
contrib_
(
hit
.
Contrib
[
0
]),
primary_id_
(
hit
.
GetPrimaryId
()),
h_index
(
i
)
{};
/**
* @brief Destructor for EDEPHit.
*/
~
EDEPHit
()
{};
/**
* @brief Get the start position of the hit.
* @return The start position as a TLorentzVector.
*/
const
TLorentzVector
&
GetStart
()
const
{
return
start_
;};
/**
* @brief Get the stop position of the hit.
* @return The stop position as a TLorentzVector.
*/
const
TLorentzVector
&
GetStop
()
const
{
return
stop_
;};
/**
* @brief Get the energy deposited by the hit.
* @return The energy deposited as a double.
*/
const
double
&
GetEnergyDeposit
()
const
{
return
energy_deposit_
;};
/**
* @brief Get the secondary deposition of the hit.
* @return The secondary deposition as a double.
*/
const
double
&
GetSecondaryDeposit
()
const
{
return
secondary_deposit_
;};
/**
* @brief Get the track length of the hit.
* @return The track length as a double.
*/
const
double
&
GetTrackLength
()
const
{
return
track_length_
;};
/**
* @brief Get the main contributor to the hit.
* @return The contribution as an integer.
*/
const
int
&
GetGetContrib
()
const
{
return
contrib_
;};
/**
* @brief Get the ID of the primary particle generating the hit.
* @return The primary ID as an integer.
*/
const
int
&
GetPrimaryId
()
const
{
return
primary_id_
;};
/**
* @brief Get the ID of the hit.
* @return The ID as an integer.
*/
const
int
&
GetId
()
const
{
return
h_index
;};
private
:
TLorentzVector
start_
;
///< Start position of the hit.
TLorentzVector
stop_
;
///< Stop position of the hit.
double
energy_deposit_
;
///< Energy deposited by the hit.
double
secondary_deposit_
;
///< Secondary deposition of the hit.
double
track_length_
;
///< Track length of the hit.
int
contrib_
;
///< Main contributor of the hit.
int
primary_id_
;
///< ID of primary particle generating the hit.
int
h_index
;
///< ID of the hit.
};
/**
* @brief Alias for a map of component to vector of EDEPHit.
*/
using
EDEPHitsMap
=
std
::
map
<
component
,
std
::
vector
<
EDEPHit
>>
;
#ifndef EDEPHIT_H
#define EDEPHIT_H
#include
<iostream>
#include
"utils.h"
#include
"TG4Event.h"
/**
* @class EDEPHit
* @brief Represents a hit in a detector.
*
* This class encapsulates information about a hit in a detector, such as its start and stop positions,
* energy deposition, secondary deposition, track length, contribution, primary ID, and index.
*/
class
EDEPHit
{
public:
/**
* @brief Constructor for EDEPHit.
* @param hit The TG4HitSegment object containing hit information.
*/
EDEPHit
(
TG4HitSegment
hit
)
:
start_
(
hit
.
GetStart
()),
stop_
(
hit
.
GetStop
()),
energy_deposit_
(
hit
.
GetEnergyDeposit
()),
secondary_deposit_
(
hit
.
GetSecondaryDeposit
()),
track_length_
(
hit
.
GetTrackLength
()),
contrib_
(
hit
.
Contrib
[
0
]),
primary_id_
(
hit
.
GetPrimaryId
()),
h_index
(
-
1
)
{};
/**
* @brief Constructor for EDEPHit.
* @param hit The TG4HitSegment object containing hit information.
* @param i The index of the hit.
*/
EDEPHit
(
TG4HitSegment
hit
,
int
i
)
:
start_
(
hit
.
GetStart
()),
stop_
(
hit
.
GetStop
()),
energy_deposit_
(
hit
.
GetEnergyDeposit
()),
secondary_deposit_
(
hit
.
GetSecondaryDeposit
()),
track_length_
(
hit
.
GetTrackLength
()),
contrib_
(
hit
.
Contrib
[
0
]),
primary_id_
(
hit
.
GetPrimaryId
()),
h_index
(
i
)
{};
/**
* @brief Destructor for EDEPHit.
*/
~
EDEPHit
()
{};
/**
* @brief Get the start position of the hit.
* @return The start position as a TLorentzVector.
*/
const
TLorentzVector
&
GetStart
()
const
{
return
start_
;};
/**
* @brief Get the stop position of the hit.
* @return The stop position as a TLorentzVector.
*/
const
TLorentzVector
&
GetStop
()
const
{
return
stop_
;};
/**
* @brief Get the energy deposited by the hit.
* @return The energy deposited as a double.
*/
const
double
&
GetEnergyDeposit
()
const
{
return
energy_deposit_
;};
/**
* @brief Get the secondary deposition of the hit.
* @return The secondary deposition as a double.
*/
const
double
&
GetSecondaryDeposit
()
const
{
return
secondary_deposit_
;};
/**
* @brief Get the track length of the hit.
* @return The track length as a double.
*/
const
double
&
GetTrackLength
()
const
{
return
track_length_
;};
/**
* @brief Get the main contributor to the hit.
* @return The contribution as an integer.
*/
const
int
&
GetGetContrib
()
const
{
return
contrib_
;};
/**
* @brief Get the ID of the primary particle generating the hit.
* @return The primary ID as an integer.
*/
const
int
&
GetPrimaryId
()
const
{
return
primary_id_
;};
/**
* @brief Get the ID of the hit.
* @return The ID as an integer.
*/
const
int
&
GetId
()
const
{
return
h_index
;};
private
:
TLorentzVector
start_
;
///< Start position of the hit.
TLorentzVector
stop_
;
///< Stop position of the hit.
double
energy_deposit_
;
///< Energy deposited by the hit.
double
secondary_deposit_
;
///< Secondary deposition of the hit.
double
track_length_
;
///< Track length of the hit.
int
contrib_
;
///< Main contributor of the hit.
int
primary_id_
;
///< ID of primary particle generating the hit.
int
h_index
;
///< ID of the hit.
};
/**
* @brief Alias for a map of component to vector of EDEPHit.
*/
using
EDEPHitsMap
=
std
::
map
<
component
,
std
::
vector
<
EDEPHit
>>
;
#endif
\ No newline at end of file
Loading