CMS 3D CMS Logo

/afs/cern.ch/work/a/aaltunda/public/www/CMSSW_5_3_13_patch3/src/DataFormats/Scalers/interface/L1TriggerRates.h

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