CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_3_10_patch1/src/DataFormats/Scalers/interface/Level1TriggerRates.h

Go to the documentation of this file.
00001 /*
00002  *  File: DataFormats/Scalers/interface/Level1TriggerRates.h   (W.Badgett)
00003  *
00004  *  Various Level 1 Trigger Rates from the GT/TS
00005  *
00006  */
00007 
00008 #ifndef DATAFORMATS_SCALERS_LEVEL1TRIGGERRATES_H
00009 #define DATAFORMATS_SCALERS_LEVEL1TRIGGERRATES_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 Level1TriggerScalers;
00030 
00031 class Level1TriggerRates
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   Level1TriggerRates();
00044   Level1TriggerRates(Level1TriggerScalers const& s);
00045   Level1TriggerRates(Level1TriggerScalers const& s,
00046                      int runNumber);
00047   Level1TriggerRates(Level1TriggerScalers const& s1, 
00048                      Level1TriggerScalers const& s2);
00049   Level1TriggerRates(Level1TriggerScalers const& s1, 
00050                      Level1TriggerScalers const& s2,
00051                      int runNumber);
00052   virtual ~Level1TriggerRates();
00053 
00054   void computeRates(Level1TriggerScalers const& t1);
00055   void computeRates(Level1TriggerScalers const& t1, 
00056                     int runNumber);
00057 
00058   void computeRates(Level1TriggerScalers const& t1,
00059                     Level1TriggerScalers const& t2);
00060   void computeRates(Level1TriggerScalers const& t1,
00061                     Level1TriggerScalers const& t2,
00062                     int runNumber);
00063 
00065   std::string name() const { return "Level1TriggerRates"; }
00066 
00068   bool empty() const { return false; }
00069 
00071 
00072   int version() const { return(version_);}
00073   timespec collectionTime() { return(collectionTime_.get_timespec());}
00074 
00075   unsigned long long deltaNS()  const { return(deltaNS_);}
00076   double deltaT()               const { return(deltaT_);}
00077 
00078   double gtTriggersRate() const 
00079   { return(gtTriggersRate_);}
00080 
00081   double gtEventsRate() const 
00082   { return(gtEventsRate_);}
00083 
00084   timespec collectionTimeLumiSeg() 
00085   { return(collectionTimeLumiSeg_.get_timespec());}
00086 
00087   double triggersPhysicsGeneratedFDLRate() const 
00088   { return(triggersPhysicsGeneratedFDLRate_);}
00089 
00090   double triggersPhysicsLostRate() const 
00091   { return(triggersPhysicsLostRate_);}
00092 
00093   double triggersPhysicsLostBeamActiveRate() const 
00094   { return(triggersPhysicsLostBeamActiveRate_);}
00095 
00096   double triggersPhysicsLostBeamInactiveRate() const 
00097   { return(triggersPhysicsLostBeamInactiveRate_);}
00098 
00099   double l1AsPhysicsRate() const     { return(l1AsPhysicsRate_);}
00100 
00101   double l1AsRandomRate() const      { return(l1AsRandomRate_);}
00102 
00103   double l1AsTestRate() const        { return(l1AsTestRate_);}
00104 
00105   double l1AsCalibrationRate() const { return(l1AsCalibrationRate_);}
00106 
00107   double deadtimePercent() const     { return(deadtimePercent_);}
00108 
00109   double deadtimeBeamActivePercent() const 
00110   { return(deadtimeBeamActivePercent_);}
00111 
00112   double deadtimeBeamActiveTriggerRulesPercent() const 
00113   { return(deadtimeBeamActiveTriggerRulesPercent_);}
00114 
00115   double deadtimeBeamActiveCalibrationPercent() const 
00116   { return(deadtimeBeamActiveCalibrationPercent_);}
00117 
00118   double deadtimeBeamActivePrivateOrbitPercent() const 
00119   { return(deadtimeBeamActivePrivateOrbitPercent_);}
00120 
00121   double deadtimeBeamActivePartitionControllerPercent() const 
00122   { return(deadtimeBeamActivePartitionControllerPercent_);}
00123 
00124   double deadtimeBeamActiveTimeSlotPercent() const 
00125   { return(deadtimeBeamActiveTimeSlotPercent_);}
00126 
00127   timespec collectionTime() const 
00128   { return(collectionTime_.get_timespec());}
00129 
00130   timespec collectionTimeLumiSeg() const 
00131   { return(collectionTimeLumiSeg_.get_timespec());}
00132 
00133   std::vector<double> gtAlgoCountsRate() const { return(gtAlgoCountsRate_);}
00134   std::vector<double> gtTechCountsRate() const { return(gtTechCountsRate_);}
00135 
00137   int operator==(const Level1TriggerRates& e) const { return false; }
00138 
00140   int operator!=(const Level1TriggerRates& e) const { return false; }
00141 
00142 protected:
00143 
00144   int version_;
00145 
00146   TimeSpec collectionTime_;
00147   unsigned long long deltaNS_;
00148   double deltaT_;
00149   double gtTriggersRate_;
00150   double gtEventsRate_;
00151 
00152   TimeSpec collectionTimeLumiSeg_;
00153   double triggersPhysicsGeneratedFDLRate_;
00154   double triggersPhysicsLostRate_;
00155   double triggersPhysicsLostBeamActiveRate_;
00156   double triggersPhysicsLostBeamInactiveRate_;
00157   double l1AsPhysicsRate_;
00158   double l1AsRandomRate_;
00159   double l1AsTestRate_;
00160   double l1AsCalibrationRate_;
00161   double deadtimePercent_;
00162   double deadtimeBeamActivePercent_;
00163   double deadtimeBeamActiveTriggerRulesPercent_;
00164   double deadtimeBeamActiveCalibrationPercent_;
00165   double deadtimeBeamActivePrivateOrbitPercent_;
00166   double deadtimeBeamActivePartitionControllerPercent_;
00167   double deadtimeBeamActiveTimeSlotPercent_;
00168 
00169   std::vector<double> gtAlgoCountsRate_;
00170   std::vector<double> gtTechCountsRate_;
00171 };
00172 
00173 
00175 std::ostream& operator<<(std::ostream& s, const Level1TriggerRates& c);
00176 
00177 typedef std::vector<Level1TriggerRates> Level1TriggerRatesCollection;
00178 
00179 #endif