Back to home page

sPhenix code displayed by LXR

 
 

    


File indexing completed on 2025-08-05 08:18:07

0001 // Tell emacs that this is a C++ source
0002 //  -*- C++ -*-.
0003 #ifndef EICEVENTHEADER_H
0004 #define EICEVENTHEADER_H
0005 
0006 #include <phool/PHObject.h>
0007 
0008 #include <iostream>
0009 #include <limits>
0010 #include <map>
0011 #include <string>
0012 #include <utility>
0013 
0014 class EicEventHeader : public PHObject
0015 {
0016  public:
0017   EicEventHeader() = default;
0018   ~EicEventHeader() override = default;
0019 
0020   void identify(std::ostream& os = std::cout) const override;
0021   void CopyFrom(const PHObject* phobj) override;
0022 
0023   void Reset() override;
0024 
0025   virtual void set_eventgenerator_type(const int) { return; }
0026   virtual int get_eventgenerator_type() const { return -99999; }
0027 
0028   // Milou
0029 
0030   virtual void set_milou_weight(const float) { return; }
0031   virtual float get_milou_weight() const { return std::numeric_limits<float>::quiet_NaN(); }
0032   virtual void set_milou_trueX(const float) { return; }
0033   virtual float get_milou_trueX() const { return std::numeric_limits<float>::quiet_NaN(); }
0034   virtual void set_milou_trueQ2(const float) { return; }
0035   virtual float get_milou_trueQ2() const { return std::numeric_limits<float>::quiet_NaN(); }
0036 
0037   //  void set_milou_weight(const float val) override { set_property(prop_milou_weight, val); }
0038   //  float get_milou_weight() const override { return get_property_float(prop_milou_weight); }
0039 
0040   // DEMP
0041   virtual void set_demp_weight(const float) { return; }
0042   virtual float get_demp_weight() const { return std::numeric_limits<float>::quiet_NaN(); }
0043 
0044   //! Procedure to add a new PROPERTY tag:
0045   //! 1.add new tag below with unique value,
0046   //! 2.add a short name to EicEventHeader::get_property_info
0047   enum PROPERTY
0048   {  //
0049     prop_eventgen = 1,
0050     prop_milou_weight = 2,
0051     prop_milou_truex = 3,
0052     prop_milou_trueq2 = 4,
0053 
0054     prop_demp_weight = 5,
0055 
0056     //! max limit in order to fit into 8 bit unsigned number
0057     prop_MAX_NUMBER = std::numeric_limits<unsigned char>::max()
0058   };
0059 
0060   enum PROPERTY_TYPE
0061   {  //
0062     type_int = 1,
0063     type_uint = 2,
0064     type_float = 3,
0065     type_unknown = -1
0066   };
0067 
0068   enum EvtGen
0069   {
0070     Milou = 1,
0071     DEMP = 2
0072   };
0073 
0074   virtual bool has_property(const PROPERTY /*prop_id*/) const { return false; }
0075   virtual float get_property_float(const PROPERTY /*prop_id*/) const { return std::numeric_limits<float>::quiet_NaN(); }
0076   virtual int get_property_int(const PROPERTY /*prop_id*/) const { return std::numeric_limits<int>::min(); }
0077   virtual unsigned int get_property_uint(const PROPERTY /*prop_id*/) const { return std::numeric_limits<unsigned int>::max(); }
0078   virtual void set_property(const PROPERTY /*prop_id*/, const float /*value*/) { return; }
0079   virtual void set_property(const PROPERTY /*prop_id*/, const int /*value*/) { return; }
0080   virtual void set_property(const PROPERTY /*prop_id*/, const unsigned int /*value*/) { return; }
0081   static std::pair<const std::string, PROPERTY_TYPE> get_property_info(PROPERTY prop_id);
0082   static bool check_property(const PROPERTY prop_id, const PROPERTY_TYPE prop_type);
0083   static std::string get_property_type(const PROPERTY_TYPE prop_type);
0084 
0085  protected:
0086   virtual unsigned int get_property_nocheck(const PROPERTY /*prop_id*/) const { return std::numeric_limits<unsigned int>::max(); }
0087   virtual void set_property_nocheck(const PROPERTY /*prop_id*/, const unsigned int) { return; }
0088 
0089   std::map<std::string, double> evInfo;
0090 
0091   ClassDefOverride(EicEventHeader, 1)
0092 };
0093 
0094 #endif