Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-05-29 23:12:37

0001 /*
0002  *  File: DataFormats/Scalers/interface/L1TriggerRates.h   (W.Badgett)
0003  *
0004  *  Various Level 1 Trigger Rates from the GT/TS
0005  *
0006  */
0007 
0008 #ifndef DATAFORMATS_SCALERS_L1TRIGGERRATES_H
0009 #define DATAFORMATS_SCALERS_L1TRIGGERRATES_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 L1TriggerRates.h
0019  * \Header file for Level 1 Global Trigger Rates
0020  * 
0021  * \author: William Badgett
0022  *
0023  */
0024 
0025 /// \class L1TriggerRates.h
0026 /// \brief Persistable copy of L1 Trigger Rates
0027 
0028 class L1TriggerScalers;
0029 
0030 class L1TriggerRates {
0031 public:
0032   static constexpr int N_BX = 3654, N_BX_ACTIVE = 2808;
0033 
0034 #define BX_SPACING (double)25E-9
0035 
0036   L1TriggerRates();
0037   L1TriggerRates(L1TriggerScalers const& s);
0038   L1TriggerRates(L1TriggerScalers const& s1, L1TriggerScalers const& s2);
0039   virtual ~L1TriggerRates();
0040 
0041   void computeRunRates(L1TriggerScalers const& t);
0042   void computeRates(L1TriggerScalers const& t1, L1TriggerScalers const& t2);
0043 
0044   /// name method
0045   std::string name() const { return "L1TriggerRates"; }
0046 
0047   /// empty method (= false)
0048   bool empty() const { return false; }
0049 
0050   /// get the data
0051 
0052   int version() const { return (version_); }
0053   timespec collectionTimeSummary() { return (collectionTimeSummary_.get_timespec()); }
0054 
0055   double deltaT() const { return (deltaT_); }
0056   double deltaTActive() const { return (deltaTActive_); }
0057   double deltaTRun() const { return (deltaTRun_); }
0058   double deltaTRunActive() const { return (deltaTRunActive_); }
0059 
0060   // Instantaneous Rate accessors
0061   double triggerNumberRate() const { return (triggerNumberRate_); }
0062 
0063   double eventNumberRate() const { return (eventNumberRate_); }
0064 
0065   double finalTriggersGeneratedRate() const { return (finalTriggersGeneratedRate_); }
0066   double finalTriggersDistributedRate() const { return (finalTriggersDistributedRate_); }
0067 
0068   double randomTriggersRate() const { return (randomTriggersRate_); }
0069 
0070   double calibrationTriggersRate() const { return (calibrationTriggersRate_); }
0071 
0072   double totalTestTriggersRate() const { return (totalTestTriggersRate_); }
0073 
0074   double orbitNumberRate() const { return (orbitNumberRate_); }
0075 
0076   double numberResetsRate() const { return (numberResetsRate_); }
0077 
0078   double deadTimePercent() const { return (deadTimePercent_); }
0079 
0080   double deadTimeActivePercent() const { return (deadTimeActivePercent_); }
0081 
0082   double deadTimeActiveCalibrationPercent() const { return (deadTimeActiveCalibrationPercent_); }
0083 
0084   double deadTimeActivePrivatePercent() const { return (deadTimeActivePrivatePercent_); }
0085 
0086   double deadTimeActivePartitionPercent() const { return (deadTimeActivePartitionPercent_); }
0087 
0088   double deadTimeActiveThrottlePercent() const { return (deadTimeActiveThrottlePercent_); }
0089 
0090   double deadTimeActiveTimeSlotPercent() const { return (deadTimeActiveTimeSlotPercent_); }
0091 
0092   double finalTriggersInvalidBCPercent() const { return (finalTriggersInvalidBCPercent_); }
0093 
0094   double lostFinalTriggersPercent() const { return (lostFinalTriggersPercent_); }
0095 
0096   double lostFinalTriggersActivePercent() const { return (lostFinalTriggersActivePercent_); }
0097 
0098   timespec collectionTimeDetails() const { return (collectionTimeDetails_.get_timespec()); }
0099 
0100   std::vector<double> triggersRate() const { return (triggersRate_); }
0101   std::vector<double> testTriggersRate() const { return (testTriggersRate_); }
0102 
0103   // Run Rate Accessors
0104   double triggerNumberRunRate() const { return (triggerNumberRunRate_); }
0105 
0106   double eventNumberRunRate() const { return (eventNumberRunRate_); }
0107 
0108   double finalTriggersDistributedRunRate() const { return (finalTriggersDistributedRunRate_); }
0109 
0110   double finalTriggersGeneratedRunRate() const { return (finalTriggersGeneratedRunRate_); }
0111 
0112   double randomTriggersRunRate() const { return (randomTriggersRunRate_); }
0113 
0114   double calibrationTriggersRunRate() const { return (calibrationTriggersRunRate_); }
0115 
0116   double totalTestTriggersRunRate() const { return (totalTestTriggersRunRate_); }
0117 
0118   double orbitNumberRunRate() const { return (orbitNumberRunRate_); }
0119 
0120   double numberResetsRunRate() const { return (numberResetsRunRate_); }
0121 
0122   double deadTimeRunPercent() const { return (deadTimeRunPercent_); }
0123 
0124   double deadTimeActiveRunPercent() const { return (deadTimeActiveRunPercent_); }
0125 
0126   double deadTimeActiveCalibrationRunPercent() const { return (deadTimeActiveCalibrationRunPercent_); }
0127 
0128   double deadTimeActivePrivateRunPercent() const { return (deadTimeActivePrivateRunPercent_); }
0129 
0130   double deadTimeActivePartitionRunPercent() const { return (deadTimeActivePartitionRunPercent_); }
0131 
0132   double deadTimeActiveThrottleRunPercent() const { return (deadTimeActiveThrottleRunPercent_); }
0133 
0134   double deadTimeActiveTimeSlotRunPercent() const { return (deadTimeActiveTimeSlotRunPercent_); }
0135 
0136   double finalTriggersInvalidBCRunPercent() const { return (finalTriggersInvalidBCRunPercent_); }
0137 
0138   double lostFinalTriggersRunPercent() const { return (lostFinalTriggersRunPercent_); }
0139 
0140   double lostFinalTriggersActiveRunPercent() const { return (lostFinalTriggersActiveRunPercent_); }
0141 
0142   std::vector<double> triggersRunRate() const { return (triggersRunRate_); }
0143 
0144   std::vector<double> testTriggersRunRate() const { return (testTriggersRunRate_); }
0145 
0146   /// equality operator
0147   int operator==(const L1TriggerRates& e) const { return false; }
0148 
0149   /// inequality operator
0150   int operator!=(const L1TriggerRates& e) const { return false; }
0151 
0152 protected:
0153   int version_;
0154   TimeSpec collectionTimeSummary_;
0155 
0156   double deltaT_;
0157   double deltaTActive_;
0158 
0159   double triggerNumberRate_;
0160   double eventNumberRate_;
0161   double finalTriggersDistributedRate_;
0162   double finalTriggersGeneratedRate_;
0163   double randomTriggersRate_;
0164   double calibrationTriggersRate_;
0165   double totalTestTriggersRate_;
0166   double orbitNumberRate_;
0167   double numberResetsRate_;
0168   double deadTimePercent_;
0169   double deadTimeActivePercent_;
0170   double deadTimeActiveCalibrationPercent_;
0171   double deadTimeActivePrivatePercent_;
0172   double deadTimeActivePartitionPercent_;
0173   double deadTimeActiveThrottlePercent_;
0174   double deadTimeActiveTimeSlotPercent_;
0175   double finalTriggersInvalidBCPercent_;
0176   double lostFinalTriggersPercent_;
0177   double lostFinalTriggersActivePercent_;
0178 
0179   std::vector<double> triggersRate_;
0180   std::vector<double> testTriggersRate_;
0181 
0182   double deltaTRun_;
0183   double deltaTRunActive_;
0184 
0185   double triggerNumberRunRate_;
0186   double eventNumberRunRate_;
0187   double finalTriggersDistributedRunRate_;
0188   double finalTriggersGeneratedRunRate_;
0189   double randomTriggersRunRate_;
0190   double calibrationTriggersRunRate_;
0191   double totalTestTriggersRunRate_;
0192   double orbitNumberRunRate_;
0193   double numberResetsRunRate_;
0194   double deadTimeRunPercent_;
0195   double deadTimeActiveRunPercent_;
0196   double deadTimeActiveCalibrationRunPercent_;
0197   double deadTimeActivePrivateRunPercent_;
0198   double deadTimeActivePartitionRunPercent_;
0199   double deadTimeActiveThrottleRunPercent_;
0200   double deadTimeActiveTimeSlotRunPercent_;
0201   double finalTriggersInvalidBCRunPercent_;
0202   double lostFinalTriggersRunPercent_;
0203   double lostFinalTriggersActiveRunPercent_;
0204 
0205   TimeSpec collectionTimeDetails_;
0206   std::vector<double> triggersRunRate_;
0207   std::vector<double> testTriggersRunRate_;
0208 };
0209 
0210 /// Pretty-print operator for L1TriggerRates
0211 std::ostream& operator<<(std::ostream& s, const L1TriggerRates& c);
0212 
0213 typedef std::vector<L1TriggerRates> L1TriggerRatesCollection;
0214 
0215 #endif