src
RecoHGCal
TICL
interface
commons.h
Go to the documentation of this file.
1
#ifndef RecoHGCal_TICL_interface_commons_h
2
#define RecoHGCal_TICL_interface_commons_h
3
#include <vector>
4
#include "
DataFormats/Common/interface/Ref.h
"
5
#include "
DataFormats/CaloRecHit/interface/CaloClusterFwd.h
"
6
#include "
DataFormats/HGCalReco/interface/Trackster.h
"
7
8
namespace
ticl
{
9
10
//constants
11
constexpr
double
mpion
= 0.13957;
12
constexpr
float
mpion2
=
mpion
*
mpion
;
13
14
inline
Trackster::ParticleType
tracksterParticleTypeFromPdgId
(
int
pdgId
,
int
charge
) {
15
if
(
pdgId
== 111) {
16
return
Trackster::ParticleType::neutral_pion
;
17
}
else
{
18
pdgId
=
std::abs
(
pdgId
);
19
if
(
pdgId
== 22) {
20
return
Trackster::ParticleType::photon
;
21
}
else
if
(
pdgId
== 11) {
22
return
Trackster::ParticleType::electron
;
23
}
else
if
(
pdgId
== 13) {
24
return
Trackster::ParticleType::muon
;
25
}
else
{
26
bool
isHadron = (
pdgId
> 100 and pdgId < 900) or (pdgId > 1000 and
pdgId
< 9000);
27
if
(isHadron) {
28
if
(
charge
!= 0) {
29
return
Trackster::ParticleType::charged_hadron
;
30
}
else
{
31
return
Trackster::ParticleType::neutral_hadron
;
32
}
33
}
else
{
34
return
Trackster::ParticleType::unknown
;
35
}
36
}
37
}
38
}
39
40
// verbosity levels for ticl algorithms
41
enum
VerbosityLevel
{
None
= 0,
Basic
,
Advanced
,
Expert
,
Guru
};
42
43
}
// namespace ticl
44
45
#endif
ticl::mpion
constexpr double mpion
Definition:
commons.h:11
ticl::Advanced
Definition:
commons.h:41
ticl::Trackster::ParticleType::electron
ticl::Trackster::ParticleType::charged_hadron
ticl::Trackster::ParticleType::photon
EgammaValidation_cff.pdgId
pdgId
Definition:
EgammaValidation_cff.py:117
ticl::Trackster::ParticleType::muon
ticl::Trackster::ParticleType::unknown
ticl::None
Definition:
commons.h:41
CaloClusterFwd.h
ticl::tracksterParticleTypeFromPdgId
Trackster::ParticleType tracksterParticleTypeFromPdgId(int pdgId, int charge)
Definition:
commons.h:14
funct::abs
Abs< T >::type abs(const T &t)
Definition:
Abs.h:22
ticl::Expert
Definition:
commons.h:41
ALCARECOTkAlJpsiMuMu_cff.charge
charge
Definition:
ALCARECOTkAlJpsiMuMu_cff.py:47
ticl::Guru
Definition:
commons.h:41
Ref.h
ticl::mpion2
constexpr float mpion2
Definition:
commons.h:12
ticl::Trackster::ParticleType::neutral_pion
ticl
Definition:
Common.h:8
ticl::VerbosityLevel
VerbosityLevel
Definition:
commons.h:41
ticl::Trackster::ParticleType::neutral_hadron
ticl::Trackster::ParticleType
ParticleType
Definition:
Trackster.h:26
ticl::Basic
Definition:
commons.h:41
Trackster.h
Generated for CMSSW Reference Manual by
1.8.14