ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Tracking
Acts
ActsTruth
ActsTruth
ElasticDecayUtil.h
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
#ifndef ELASTICDECAYUTIL_H
6
#define ELASTICDECAYUTIL_H 1
7
8
#include "
xAODTruth/TruthParticle.h
"
9
10
// for debugging
11
#include "
CxxUtils/checker_macros.h
"
12
#include <type_traits>
13
#include <initializer_list>
14
#include <mutex>
15
#include "
ActsInterop/StatUtils.h
"
16
17
// Empty struct emulating enough of the interface to be used as a dummy replacement for a Gaudi property
18
struct
EmptyProperty
{
19
template
<
typename
... T_Args>
20
EmptyProperty
(T_Args... ) {}
21
// to match empty or some non-empty initializer list
22
template
<
typename
T_Arg1,
typename
T_Arg2,
typename
... T_Args>
23
EmptyProperty
(T_Arg1, T_Arg2, std::initializer_list<int> &&, T_Args... ) {}
24
template
<
typename
T_Arg1,
typename
T_Arg2,
typename
... T_Args>
25
EmptyProperty
(T_Arg1, T_Arg2, std::initializer_list<double> &&, T_Args... ) {}
26
const
EmptyProperty
&
value
() {
return
*
this
; }
27
};
28
29
template
<
bool
IsDebug=false>
30
struct
ElasticDecayUtil
{
38
const
xAOD::TruthParticle
*
getMother
(
const
xAOD::TruthParticle
&truth_particle,
float
max_energy_loss)
const
;
39
40
// only used if IsDebug=true
41
template
<
class
T_OutStream>
42
void
dumpStatistics
(T_OutStream &out)
const
;
43
44
// @param binning number of bins, lower edge, upper edge in MeV
45
void
setEnergyLossBinning
(
const
typename
std::conditional<IsDebug, std::vector<float>,
EmptyProperty
>
::type
&binning);
46
47
struct
Empty
{
48
template
<
typename
... T_Args>
49
Empty
(T_Args... ) {}
50
};
51
mutable
typename
std::conditional<IsDebug,std::mutex,Empty>::type m_mutex
ATLAS_THREAD_SAFE
;
52
53
// PDG IDs of siblings.
54
mutable
typename
std::conditional<IsDebug,std::set<int>,
Empty
>
::type
m_outgoingPdgIds
ATLAS_THREAD_SAFE
;
55
57
mutable
typename
std::conditional<IsDebug,std::set<int>,
Empty
>
::type
m_outgoingMotherPdgIds
ATLAS_THREAD_SAFE
;
58
enum
ParticleTypes
{
59
kNoSibling
,
60
kElectron
,
61
kPhoton
,
62
kOther
,
63
kNParticleTypes
64
};
65
66
mutable
typename
std::conditional<IsDebug,std::array<ActsUtils::StatHist,kNParticleTypes>,
Empty
>
::type
m_energyLossStat
ATLAS_THREAD_SAFE
;
67
68
// number of parents in a decay chain.
69
mutable
typename
std::conditional<IsDebug,ActsUtils::StatHist,Empty>::type m_nParentsStat
ATLAS_THREAD_SAFE
{20,-.5,20.-.5};
70
};
71
72
#include "
ElasticDecayUtil.icc
"
73
#endif
ElasticDecayUtil.icc
TruthParticle.h
StatUtils.h
checker_macros.h
Define macros for attributes used to control the static checker.
xAOD::TruthParticle
TruthParticle_v1 TruthParticle
Typedef to implementation.
Definition
Event/xAOD/xAODTruth/xAODTruth/TruthParticle.h:15
ElasticDecayUtil::Empty
Definition
ElasticDecayUtil.h:47
ElasticDecayUtil::Empty::Empty
Empty(T_Args...)
Definition
ElasticDecayUtil.h:49
ElasticDecayUtil
Definition
ElasticDecayUtil.h:30
ElasticDecayUtil::ATLAS_THREAD_SAFE
std::conditional< IsDebug, std::mutex, Empty >::type m_mutex ATLAS_THREAD_SAFE
Definition
ElasticDecayUtil.h:51
ElasticDecayUtil::dumpStatistics
void dumpStatistics(T_OutStream &out) const
ElasticDecayUtil::getMother
const xAOD::TruthParticle * getMother(const xAOD::TruthParticle &truth_particle, float max_energy_loss) const
follow decay chain upwards assuming quasi elastic processes.
ElasticDecayUtil::setEnergyLossBinning
void setEnergyLossBinning(const typename std::conditional< IsDebug, std::vector< float >, EmptyProperty >::type &binning)
ElasticDecayUtil::ParticleTypes
ParticleTypes
Definition
ElasticDecayUtil.h:58
ElasticDecayUtil::kPhoton
@ kPhoton
Definition
ElasticDecayUtil.h:61
ElasticDecayUtil::kNoSibling
@ kNoSibling
Definition
ElasticDecayUtil.h:59
ElasticDecayUtil::kNParticleTypes
@ kNParticleTypes
Definition
ElasticDecayUtil.h:63
ElasticDecayUtil::kOther
@ kOther
Definition
ElasticDecayUtil.h:62
ElasticDecayUtil::kElectron
@ kElectron
Definition
ElasticDecayUtil.h:60
EmptyProperty
Definition
ElasticDecayUtil.h:18
EmptyProperty::value
const EmptyProperty & value()
Definition
ElasticDecayUtil.h:26
EmptyProperty::EmptyProperty
EmptyProperty(T_Args...)
Definition
ElasticDecayUtil.h:20
EmptyProperty::EmptyProperty
EmptyProperty(T_Arg1, T_Arg2, std::initializer_list< int > &&, T_Args...)
Definition
ElasticDecayUtil.h:23
EmptyProperty::EmptyProperty
EmptyProperty(T_Arg1, T_Arg2, std::initializer_list< double > &&, T_Args...)
Definition
ElasticDecayUtil.h:25
type
Generated on
for ATLAS Offline Software by
1.17.0