Back to home page

sPhenix code displayed by LXR

 
 

    


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

0001 // Tell emacs that this is a C++ source
0002 //  -*- C++ -*-.
0003 #ifndef FFAOBJECTS_EVENTHEADER_H
0004 #define FFAOBJECTS_EVENTHEADER_H
0005 
0006 #include <phool/PHObject.h>
0007 
0008 #include <cmath>
0009 #include <cstdint>  // for int64_t
0010 #include <ctime>
0011 #include <iostream>  // for cout, ostream
0012 #include <string>    // for string
0013 
0014 //! base class for EventHeaders
0015 class EventHeader : public PHObject
0016 {
0017  public:
0018   /// dtor
0019   ~EventHeader() override = default;
0020 
0021   /// Clear Event
0022   void Reset() override;
0023 
0024   /*
0025    * identify Function from PHObject
0026    * @param os Output Stream
0027    */
0028   void identify(std::ostream &os = std::cout) const override;
0029 
0030   /// isValid returns non zero if object contains valid data
0031   int isValid() const override;
0032 
0033   virtual void CopyTo(EventHeader *) { return; }
0034 
0035   /// get Run Number
0036   virtual int get_RunNumber() const { return 0; }
0037   /// set Run Number
0038   virtual void set_RunNumber(const int /*run*/) { return; }
0039 
0040   /// get Event Number
0041   virtual int get_EvtSequence() const { return 0; }
0042   /// set Event Number
0043   virtual void set_EvtSequence(const int /*ival*/) { return; }
0044 
0045   //! bunch crossing
0046   virtual void set_BunchCrossing(int64_t bcr) { set_intval("bcr", bcr); }
0047 
0048   //! bunch crossing
0049   virtual int64_t get_BunchCrossing() const { return get_intval("bcr"); }
0050 
0051   virtual void set_floatval(const std::string & /*name*/, const float /*fval*/) { return; }
0052   virtual float get_floatval(const std::string & /*name*/) const { return NAN; }
0053 
0054   virtual void set_intval(const std::string & /*name*/, const int64_t /*ival*/) { return; }
0055   virtual int64_t get_intval(const std::string & /*name*/) const { return -999999; }
0056 
0057   /// get Event Type (Data,rejected,EOR,BOR,...)
0058   int get_EvtType() const { return get_intval("type"); }
0059   /// set Event Type (Data,rejected,EOR,BOR,...)
0060   void set_EvtType(const int ival) { set_intval("type", ival); }
0061 
0062   void set_ImpactParameter(const double rval) { set_floatval("bimp", rval); }
0063   float get_ImpactParameter() const { return get_floatval("bimp"); }
0064 
0065   void set_EventPlaneAngle(const double rval) { set_floatval("rplane", rval); }
0066   float get_EventPlaneAngle() const { return get_floatval("rplane"); }
0067 
0068   void set_eccentricity(const double rval) { set_floatval("ecc", rval); }
0069   float get_eccentricity() const { return get_floatval("ecc"); }
0070 
0071   void set_ncoll(const int ival) { set_intval("ncoll", ival); }
0072   int get_ncoll() const { return get_intval("ncoll"); }
0073 
0074   void set_npart(const int ival) { set_intval("npart", ival); }
0075   int get_npart() const { return get_intval("npart"); }
0076 
0077   void set_TimeStamp(const time_t tval) { set_intval("time", tval); }
0078   time_t get_TimeStamp() const { return get_intval("time"); }
0079 
0080  private:  // prevent doc++ from showing ClassDefOverride
0081   ClassDefOverride(EventHeader, 1)
0082 };
0083 
0084 #endif