Back to home page

sPhenix code displayed by LXR

 
 

    


File indexing completed on 2025-08-06 08:17:57

0001 #ifndef PARTICLEFLOW_PARTICLEFLOWELEMENT_H
0002 #define PARTICLEFLOW_PARTICLEFLOWELEMENT_H
0003 
0004 //===========================================================
0005 /// \file ParticleFlowElement.h
0006 /// \brief Base class for simple particle flow element objects
0007 /// \author Dennis V. Perepelitsa
0008 //===========================================================
0009 
0010 #include <phool/PHObject.h>
0011 
0012 #include <cmath>
0013 #include <iostream>
0014 #include <limits>
0015 
0016 class SvtxTrack;
0017 class RawCluster;
0018 
0019 class ParticleFlowElement : public PHObject
0020 {
0021  public:
0022   // enums can be extended with new values, but values not altered
0023 
0024   enum PFLOWTYPE
0025   {
0026     UNASSIGNED = -1,
0027     MATCHED_CHARGED_HADRON = 0,
0028     UNMATCHED_CHARGED_HADRON = 1,
0029     UNMATCHED_EM_PARTICLE = 2,
0030     UNMATCHED_NEUTRAL_HADRON = 3,
0031     LEFTOVER_EM_PARTICLE = 4
0032   };
0033 
0034   ParticleFlowElement() {}
0035   ~ParticleFlowElement() override {}
0036 
0037   void identify(std::ostream& os = std::cout) const override;
0038   int isValid() const override { return 0; }
0039 
0040   virtual unsigned int get_id() const { return 0xFFFFFFFF; }
0041   virtual void set_id(unsigned int) { return; }
0042 
0043   virtual ParticleFlowElement::PFLOWTYPE get_type() const { return ParticleFlowElement::PFLOWTYPE::UNASSIGNED; }
0044   virtual void set_type(ParticleFlowElement::PFLOWTYPE) { return; }
0045 
0046   virtual float get_px() const { return std::numeric_limits<float>::quiet_NaN(); }
0047   virtual void set_px(float) { return; }
0048 
0049   virtual float get_py() const { return std::numeric_limits<float>::quiet_NaN(); }
0050   virtual void set_py(float) { return; }
0051 
0052   virtual float get_pz() const { return std::numeric_limits<float>::quiet_NaN(); }
0053   virtual void set_pz(float) { return; }
0054 
0055   virtual float get_e() const { return std::numeric_limits<float>::quiet_NaN(); }
0056   virtual void set_e(float) { return; }
0057 
0058   virtual SvtxTrack* get_track() const { return nullptr; }
0059   virtual void set_track(SvtxTrack*) { return; }
0060 
0061   virtual std::vector<RawCluster*> get_eclusters() const { return std::vector<RawCluster*>(); }
0062   virtual void set_eclusters(const std::vector<RawCluster*>&) { return; }
0063 
0064   virtual RawCluster* get_hcluster() const { return nullptr; }
0065   virtual void set_hcluster(RawCluster*) { return; }
0066 
0067   virtual float get_p() const { return std::numeric_limits<float>::quiet_NaN(); }
0068   virtual float get_pt() const { return std::numeric_limits<float>::quiet_NaN(); }
0069   virtual float get_et() const { return std::numeric_limits<float>::quiet_NaN(); }
0070   virtual float get_eta() const { return std::numeric_limits<float>::quiet_NaN(); }
0071   virtual float get_phi() const { return std::numeric_limits<float>::quiet_NaN(); }
0072   virtual float get_mass() const { return std::numeric_limits<float>::quiet_NaN(); }
0073 
0074   ClassDefOverride(ParticleFlowElement, 1);
0075 };
0076 
0077 #endif