Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:25:11

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 #include "RecoLocalCalo/HGCalRecAlgos/interface/RecHitTools.h"
0008 
0009 namespace ticl {
0010 
0011   //constants
0012   constexpr double mpion = 0.13957;
0013   constexpr float mpion2 = mpion * mpion;
0014   typedef math::XYZVectorF Vector;
0015 
0016   inline Trackster::ParticleType tracksterParticleTypeFromPdgId(int pdgId, int charge) {
0017     if (pdgId == 111) {
0018       return Trackster::ParticleType::neutral_pion;
0019     } else {
0020       pdgId = std::abs(pdgId);
0021       if (pdgId == 22) {
0022         return Trackster::ParticleType::photon;
0023       } else if (pdgId == 11) {
0024         return Trackster::ParticleType::electron;
0025       } else if (pdgId == 13) {
0026         return Trackster::ParticleType::muon;
0027       } else {
0028         bool isHadron = (pdgId > 100 and pdgId < 900) or (pdgId > 1000 and pdgId < 9000);
0029         if (isHadron) {
0030           if (charge != 0) {
0031             return Trackster::ParticleType::charged_hadron;
0032           } else {
0033             return Trackster::ParticleType::neutral_hadron;
0034           }
0035         } else {
0036           return Trackster::ParticleType::unknown;
0037         }
0038       }
0039     }
0040   }
0041 
0042   // verbosity levels for ticl algorithms
0043   enum VerbosityLevel { None = 0, Basic, Advanced, Expert, Guru };
0044 
0045 }  // namespace ticl
0046 
0047 #endif