00001 /* 00002 * File: DataFormats/Scalers/interface/L1TriggerRates.h (W.Badgett) 00003 * 00004 * Various Level 1 Trigger Rates from the GT/TS 00005 * 00006 */ 00007 00008 #ifndef DATAFORMATS_SCALERS_L1TRIGGERRATES_H 00009 #define DATAFORMATS_SCALERS_L1TRIGGERRATES_H 00010 00011 #include <ostream> 00012 #include <vector> 00013 00022 00023 00024 00025 class L1TriggerRates 00026 { 00027 public: 00028 00029 enum 00030 { 00031 N_BX = 3654, 00032 N_BX_ACTIVE = 2808 00033 }; 00034 00035 #define BX_SPACING (double)25E-9 00036 00037 L1TriggerRates(); 00038 L1TriggerRates(const L1TriggerScalers s); 00039 L1TriggerRates(const L1TriggerScalers s1, const L1TriggerScalers s2); 00040 virtual ~L1TriggerRates(); 00041 00042 void computeRunRates(const L1TriggerScalers t); 00043 void computeRates(const L1TriggerScalers t1, 00044 const L1TriggerScalers t2); 00045 00047 std::string name() const { return "L1TriggerRates"; } 00048 00050 bool empty() const { return false; } 00051 00053 00054 int version() const { return(version_);} 00055 struct timespec collectionTimeSummary() { return(collectionTimeSummary_);} 00056 00057 double deltaT() const { return(deltaT_);} 00058 double deltaTActive() const { return(deltaTActive_);} 00059 double deltaTRun() const { return(deltaTRun_);} 00060 double deltaTRunActive() const { return(deltaTRunActive_);} 00061 00062 // Instantaneous Rate accessors 00063 double triggerNumberRate() const 00064 { return(triggerNumberRate_);} 00065 00066 double eventNumberRate() const 00067 { return(eventNumberRate_);} 00068 00069 double finalTriggersGeneratedRate() const 00070 { return(finalTriggersGeneratedRate_);} 00071 double finalTriggersDistributedRate() const 00072 { return(finalTriggersDistributedRate_);} 00073 00074 double randomTriggersRate() const 00075 { return(randomTriggersRate_);} 00076 00077 double calibrationTriggersRate() const 00078 { return(calibrationTriggersRate_);} 00079 00080 double totalTestTriggersRate() const 00081 { return(totalTestTriggersRate_);} 00082 00083 double orbitNumberRate() const 00084 { return(orbitNumberRate_);} 00085 00086 double numberResetsRate() const 00087 { return(numberResetsRate_);} 00088 00089 double deadTimePercent() const 00090 { return(deadTimePercent_);} 00091 00092 double deadTimeActivePercent() const 00093 { return(deadTimeActivePercent_);} 00094 00095 double deadTimeActiveCalibrationPercent() const 00096 { return(deadTimeActiveCalibrationPercent_);} 00097 00098 double deadTimeActivePrivatePercent() const 00099 { return(deadTimeActivePrivatePercent_);} 00100 00101 double deadTimeActivePartitionPercent() const 00102 { return(deadTimeActivePartitionPercent_);} 00103 00104 double deadTimeActiveThrottlePercent() const 00105 { return(deadTimeActiveThrottlePercent_);} 00106 00107 double deadTimeActiveTimeSlotPercent() const 00108 { return(deadTimeActiveTimeSlotPercent_);} 00109 00110 double finalTriggersInvalidBCPercent() const 00111 { return(finalTriggersInvalidBCPercent_);} 00112 00113 double lostFinalTriggersPercent() const 00114 { return(lostFinalTriggersPercent_);} 00115 00116 double lostFinalTriggersActivePercent() const 00117 { return(lostFinalTriggersActivePercent_);} 00118 00119 struct timespec collectionTimeDetails() const 00120 { return(collectionTimeDetails_);} 00121 00122 std::vector<double> triggersRate() const { return(triggersRate_);} 00123 std::vector<double> testTriggersRate() const 00124 { return(testTriggersRate_);} 00125 00126 // Run Rate Accessors 00127 double triggerNumberRunRate() const 00128 { return(triggerNumberRunRate_);} 00129 00130 double eventNumberRunRate() const 00131 { return(eventNumberRunRate_);} 00132 00133 double finalTriggersDistributedRunRate() const 00134 { return(finalTriggersDistributedRunRate_);} 00135 00136 double finalTriggersGeneratedRunRate() const 00137 { return(finalTriggersGeneratedRunRate_);} 00138 00139 double randomTriggersRunRate() const 00140 { return(randomTriggersRunRate_);} 00141 00142 double calibrationTriggersRunRate() const 00143 { return(calibrationTriggersRunRate_);} 00144 00145 double totalTestTriggersRunRate() const 00146 { return(totalTestTriggersRunRate_);} 00147 00148 double orbitNumberRunRate() const 00149 { return(orbitNumberRunRate_);} 00150 00151 double numberResetsRunRate() const 00152 { return(numberResetsRunRate_);} 00153 00154 double deadTimeRunPercent() const 00155 { return(deadTimeRunPercent_);} 00156 00157 double deadTimeActiveRunPercent() const 00158 { return(deadTimeActiveRunPercent_);} 00159 00160 double deadTimeActiveCalibrationRunPercent() const 00161 { return(deadTimeActiveCalibrationRunPercent_);} 00162 00163 double deadTimeActivePrivateRunPercent() const 00164 { return(deadTimeActivePrivateRunPercent_);} 00165 00166 double deadTimeActivePartitionRunPercent() const 00167 { return(deadTimeActivePartitionRunPercent_);} 00168 00169 double deadTimeActiveThrottleRunPercent() const 00170 { return(deadTimeActiveThrottleRunPercent_);} 00171 00172 double deadTimeActiveTimeSlotRunPercent() const 00173 { return(deadTimeActiveTimeSlotRunPercent_);} 00174 00175 double finalTriggersInvalidBCRunPercent() const 00176 { return(finalTriggersInvalidBCRunPercent_);} 00177 00178 double lostFinalTriggersRunPercent() const 00179 { return(lostFinalTriggersRunPercent_);} 00180 00181 double lostFinalTriggersActiveRunPercent() const 00182 { return(lostFinalTriggersActiveRunPercent_);} 00183 00184 std::vector<double> triggersRunRate() const 00185 { return(triggersRunRate_);} 00186 00187 std::vector<double> testTriggersRunRate() const 00188 { return(testTriggersRunRate_);} 00189 00191 int operator==(const L1TriggerRates& e) const { return false; } 00192 00194 int operator!=(const L1TriggerRates& e) const { return false; } 00195 00196 protected: 00197 00198 int version_; 00199 struct timespec collectionTimeSummary_; 00200 00201 double deltaT_; 00202 double deltaTActive_; 00203 00204 double triggerNumberRate_; 00205 double eventNumberRate_; 00206 double finalTriggersDistributedRate_; 00207 double finalTriggersGeneratedRate_; 00208 double randomTriggersRate_; 00209 double calibrationTriggersRate_; 00210 double totalTestTriggersRate_; 00211 double orbitNumberRate_; 00212 double numberResetsRate_; 00213 double deadTimePercent_; 00214 double deadTimeActivePercent_; 00215 double deadTimeActiveCalibrationPercent_; 00216 double deadTimeActivePrivatePercent_; 00217 double deadTimeActivePartitionPercent_; 00218 double deadTimeActiveThrottlePercent_; 00219 double deadTimeActiveTimeSlotPercent_; 00220 double finalTriggersInvalidBCPercent_; 00221 double lostFinalTriggersPercent_; 00222 double lostFinalTriggersActivePercent_; 00223 00224 std::vector<double> triggersRate_; 00225 std::vector<double> testTriggersRate_; 00226 00227 double deltaTRun_; 00228 double deltaTRunActive_; 00229 00230 double triggerNumberRunRate_; 00231 double eventNumberRunRate_; 00232 double finalTriggersDistributedRunRate_; 00233 double finalTriggersGeneratedRunRate_; 00234 double randomTriggersRunRate_; 00235 double calibrationTriggersRunRate_; 00236 double totalTestTriggersRunRate_; 00237 double orbitNumberRunRate_; 00238 double numberResetsRunRate_; 00239 double deadTimeRunPercent_; 00240 double deadTimeActiveRunPercent_; 00241 double deadTimeActiveCalibrationRunPercent_; 00242 double deadTimeActivePrivateRunPercent_; 00243 double deadTimeActivePartitionRunPercent_; 00244 double deadTimeActiveThrottleRunPercent_; 00245 double deadTimeActiveTimeSlotRunPercent_; 00246 double finalTriggersInvalidBCRunPercent_; 00247 double lostFinalTriggersRunPercent_; 00248 double lostFinalTriggersActiveRunPercent_; 00249 00250 struct timespec collectionTimeDetails_; 00251 std::vector<double> triggersRunRate_; 00252 std::vector<double> testTriggersRunRate_; 00253 }; 00254 00255 00257 std::ostream& operator<<(std::ostream& s, const L1TriggerRates& c); 00258 00259 typedef std::vector<L1TriggerRates> L1TriggerRatesCollection; 00260 00261 #endif