Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2025-07-09 05:00:04

0001 #ifndef DataFormats_HGCalReco_Common_h
0002 #define DataFormats_HGCalReco_Common_h
0003 
0004 #include <vector>
0005 #include <array>
0006 #include <cstdint>
0007 
0008 #include "DataFormats/HGCalReco/interface/Trackster.h"
0009 
0010 namespace ticl {
0011   struct TileConstants {
0012     static constexpr float minEta = 1.5f;
0013     static constexpr float maxEta = 3.2f;
0014     static constexpr int nEtaBins = 34;
0015     static constexpr int nPhiBins = 126;
0016     static constexpr int nLayers = 104;
0017     static constexpr int iterations = 4;
0018     static constexpr int nBins = nEtaBins * nPhiBins;
0019   };
0020 
0021   struct TileConstantsHFNose {
0022     static constexpr float minEta = 3.0f;
0023     static constexpr float maxEta = 4.2f;
0024     static constexpr int nEtaBins = 24;
0025     static constexpr int nPhiBins = 126;
0026     static constexpr int nLayers = 16;  // 8x2
0027     static constexpr int iterations = 4;
0028     static constexpr int nBins = nEtaBins * nPhiBins;
0029   };
0030 
0031   struct TileConstantsBarrel {
0032     static constexpr float minEta = -1.5f;
0033     static constexpr float maxEta = 1.5f;
0034     static constexpr int nEtaBins = 68;
0035     static constexpr int nPhiBins = 36;
0036     static constexpr int nLayers = 5;
0037     static constexpr int iterations = 1;
0038     static constexpr int nBins = nEtaBins * nPhiBins;
0039   };
0040 
0041 }  // namespace ticl
0042 
0043 namespace ticl {
0044   typedef std::vector<std::pair<unsigned int, float> > TICLClusterFilterMask;
0045 }  // namespace ticl
0046 
0047 namespace ticl {
0048 
0049   //constants
0050   constexpr double mpion = 0.13957;
0051   constexpr float mpion2 = mpion * mpion;
0052   typedef math::XYZVectorF Vector;
0053 
0054   inline Trackster::ParticleType tracksterParticleTypeFromPdgId(int pdgId, int charge) {
0055     if (pdgId == 111) {
0056       return Trackster::ParticleType::neutral_pion;
0057     } else {
0058       pdgId = std::abs(pdgId);
0059       if (pdgId == 22) {
0060         return Trackster::ParticleType::photon;
0061       } else if (pdgId == 11) {
0062         return Trackster::ParticleType::electron;
0063       } else if (pdgId == 13) {
0064         return Trackster::ParticleType::muon;
0065       } else {
0066         bool isHadron = (pdgId > 100 and pdgId < 900) or (pdgId > 1000 and pdgId < 9000);
0067         if (isHadron) {
0068           if (charge != 0) {
0069             return Trackster::ParticleType::charged_hadron;
0070           } else {
0071             return Trackster::ParticleType::neutral_hadron;
0072           }
0073         } else {
0074           return Trackster::ParticleType::unknown;
0075         }
0076       }
0077     }
0078   }
0079 
0080   // verbosity levels for ticl algorithms
0081   enum VerbosityLevel { None = 0, Basic, Advanced, Expert, Guru };
0082 
0083 }  // namespace ticl
0084 
0085 #endif  // DataFormats_HGCalReco_Common_h