Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:05:08

0001 /*
0002  *  File: DataFormats/Scalers/interface/Level1TriggerRates.h   (W.Badgett)
0003  *
0004  *  Various Level 1 Trigger Rates from the GT/TS
0005  *
0006  */
0007 
0008 #ifndef DATAFORMATS_SCALERS_LEVEL1TRIGGERRATES_H
0009 #define DATAFORMATS_SCALERS_LEVEL1TRIGGERRATES_H
0010 
0011 #include "DataFormats/Scalers/interface/TimeSpec.h"
0012 
0013 #include <ctime>
0014 #include <iosfwd>
0015 #include <string>
0016 #include <vector>
0017 
0018 /*! \file Level1TriggerRates.h
0019  * \Header file for Level 1 Global Trigger Rates
0020  * 
0021  * \author: William Badgett
0022  *
0023  */
0024 
0025 /// \class Level1TriggerRates.h
0026 /// \brief Persistable copy of Level1 Trigger Rates
0027 
0028 class Level1TriggerScalers;
0029 
0030 class Level1TriggerRates {
0031 public:
0032 #define BX_SPACING (double)25E-9
0033 
0034   Level1TriggerRates();
0035   Level1TriggerRates(Level1TriggerScalers const& s);
0036   Level1TriggerRates(Level1TriggerScalers const& s, int runNumber);
0037   Level1TriggerRates(Level1TriggerScalers const& s1, Level1TriggerScalers const& s2);
0038   Level1TriggerRates(Level1TriggerScalers const& s1, Level1TriggerScalers const& s2, int runNumber);
0039   virtual ~Level1TriggerRates();
0040 
0041   void computeRates(Level1TriggerScalers const& t1);
0042   void computeRates(Level1TriggerScalers const& t1, int runNumber);
0043 
0044   void computeRates(Level1TriggerScalers const& t1, Level1TriggerScalers const& t2);
0045   void computeRates(Level1TriggerScalers const& t1, Level1TriggerScalers const& t2, int runNumber);
0046 
0047   /// name method
0048   std::string name() const { return "Level1TriggerRates"; }
0049 
0050   /// empty method (= false)
0051   bool empty() const { return false; }
0052 
0053   /// get the data
0054 
0055   int version() const { return (version_); }
0056   timespec collectionTime() { return (collectionTime_.get_timespec()); }
0057 
0058   unsigned long long deltaNS() const { return (deltaNS_); }
0059   double deltaT() const { return (deltaT_); }
0060 
0061   double gtTriggersRate() const { return (gtTriggersRate_); }
0062 
0063   double gtEventsRate() const { return (gtEventsRate_); }
0064 
0065   timespec collectionTimeLumiSeg() { return (collectionTimeLumiSeg_.get_timespec()); }
0066 
0067   double triggersPhysicsGeneratedFDLRate() const { return (triggersPhysicsGeneratedFDLRate_); }
0068 
0069   double triggersPhysicsLostRate() const { return (triggersPhysicsLostRate_); }
0070 
0071   double triggersPhysicsLostBeamActiveRate() const { return (triggersPhysicsLostBeamActiveRate_); }
0072 
0073   double triggersPhysicsLostBeamInactiveRate() const { return (triggersPhysicsLostBeamInactiveRate_); }
0074 
0075   double l1AsPhysicsRate() const { return (l1AsPhysicsRate_); }
0076 
0077   double l1AsRandomRate() const { return (l1AsRandomRate_); }
0078 
0079   double l1AsTestRate() const { return (l1AsTestRate_); }
0080 
0081   double l1AsCalibrationRate() const { return (l1AsCalibrationRate_); }
0082 
0083   double deadtimePercent() const { return (deadtimePercent_); }
0084 
0085   double deadtimeBeamActivePercent() const { return (deadtimeBeamActivePercent_); }
0086 
0087   double deadtimeBeamActiveTriggerRulesPercent() const { return (deadtimeBeamActiveTriggerRulesPercent_); }
0088 
0089   double deadtimeBeamActiveCalibrationPercent() const { return (deadtimeBeamActiveCalibrationPercent_); }
0090 
0091   double deadtimeBeamActivePrivateOrbitPercent() const { return (deadtimeBeamActivePrivateOrbitPercent_); }
0092 
0093   double deadtimeBeamActivePartitionControllerPercent() const {
0094     return (deadtimeBeamActivePartitionControllerPercent_);
0095   }
0096 
0097   double deadtimeBeamActiveTimeSlotPercent() const { return (deadtimeBeamActiveTimeSlotPercent_); }
0098 
0099   timespec collectionTime() const { return (collectionTime_.get_timespec()); }
0100 
0101   timespec collectionTimeLumiSeg() const { return (collectionTimeLumiSeg_.get_timespec()); }
0102 
0103   std::vector<double> gtAlgoCountsRate() const { return (gtAlgoCountsRate_); }
0104   std::vector<double> gtTechCountsRate() const { return (gtTechCountsRate_); }
0105 
0106   /// equality operator
0107   int operator==(const Level1TriggerRates& e) const { return false; }
0108 
0109   /// inequality operator
0110   int operator!=(const Level1TriggerRates& e) const { return false; }
0111 
0112 protected:
0113   int version_;
0114 
0115   TimeSpec collectionTime_;
0116   unsigned long long deltaNS_;
0117   double deltaT_;
0118   double gtTriggersRate_;
0119   double gtEventsRate_;
0120 
0121   TimeSpec collectionTimeLumiSeg_;
0122   double triggersPhysicsGeneratedFDLRate_;
0123   double triggersPhysicsLostRate_;
0124   double triggersPhysicsLostBeamActiveRate_;
0125   double triggersPhysicsLostBeamInactiveRate_;
0126   double l1AsPhysicsRate_;
0127   double l1AsRandomRate_;
0128   double l1AsTestRate_;
0129   double l1AsCalibrationRate_;
0130   double deadtimePercent_;
0131   double deadtimeBeamActivePercent_;
0132   double deadtimeBeamActiveTriggerRulesPercent_;
0133   double deadtimeBeamActiveCalibrationPercent_;
0134   double deadtimeBeamActivePrivateOrbitPercent_;
0135   double deadtimeBeamActivePartitionControllerPercent_;
0136   double deadtimeBeamActiveTimeSlotPercent_;
0137 
0138   std::vector<double> gtAlgoCountsRate_;
0139   std::vector<double> gtTechCountsRate_;
0140 };
0141 
0142 /// Pretty-print operator for Level1TriggerRates
0143 std::ostream& operator<<(std::ostream& s, const Level1TriggerRates& c);
0144 
0145 typedef std::vector<Level1TriggerRates> Level1TriggerRatesCollection;
0146 
0147 #endif