File indexing completed on 2022-08-30 22:39:05
0001 #ifndef RecoHGCal_TICL_interface_commons_h
0002 #define RecoHGCal_TICL_interface_commons_h
0003 #include <vector>
0004 #include "DataFormats/Common/interface/Ref.h"
0005 #include "DataFormats/CaloRecHit/interface/CaloClusterFwd.h"
0006 #include "DataFormats/HGCalReco/interface/Trackster.h"
0007
0008 namespace ticl {
0009
0010
0011 constexpr double mpion = 0.13957;
0012 constexpr float mpion2 = mpion * mpion;
0013
0014 inline Trackster::ParticleType tracksterParticleTypeFromPdgId(int pdgId, int charge) {
0015 if (pdgId == 111) {
0016 return Trackster::ParticleType::neutral_pion;
0017 } else {
0018 pdgId = std::abs(pdgId);
0019 if (pdgId == 22) {
0020 return Trackster::ParticleType::photon;
0021 } else if (pdgId == 11) {
0022 return Trackster::ParticleType::electron;
0023 } else if (pdgId == 13) {
0024 return Trackster::ParticleType::muon;
0025 } else {
0026 bool isHadron = (pdgId > 100 and pdgId < 900) or (pdgId > 1000 and pdgId < 9000);
0027 if (isHadron) {
0028 if (charge != 0) {
0029 return Trackster::ParticleType::charged_hadron;
0030 } else {
0031 return Trackster::ParticleType::neutral_hadron;
0032 }
0033 } else {
0034 return Trackster::ParticleType::unknown;
0035 }
0036 }
0037 }
0038 }
0039
0040
0041 enum VerbosityLevel { None = 0, Basic, Advanced, Expert, Guru };
0042
0043 }
0044
0045 #endif