CMS 3D CMS Logo

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

Go to the documentation of this file.
00001 /*
00002  *  File: DataFormats/Scalers/interface/Level1TriggerScalers.h   (W.Badgett)
00003  *
00004  *  Various Level 1 Trigger Scalers from the GT/TS
00005  *
00006  */
00007 
00008 #ifndef DATAFORMATS_SCALERS_LEVEL1TRIGGERSCALERS_H
00009 #define DATAFORMATS_SCALERS_LEVEL1TRIGGERSCALERS_H
00010 
00011 #include <ostream>
00012 #include <vector>
00013 
00014 #include "DataFormats/Scalers/interface/TimeSpec.h"
00015 
00024 
00025 
00026 
00027 class Level1TriggerScalers
00028 {
00029  public:
00030 
00031   enum 
00032   {
00033     nLevel1Triggers          = 128,
00034     nLevel1TestTriggers      = 64,
00035     firstShortLSRun          = 125574
00036   };
00037 
00038   static const unsigned long long N_BX = 3564ULL;
00039   static const unsigned long long N_BX_ACTIVE = 2808ULL;
00040   static const unsigned long long N_ORBITS_LUMI_SECTION = 0x100000ULL;
00041   static const unsigned long long N_BX_LUMI_SECTION = N_ORBITS_LUMI_SECTION * N_BX;
00042 
00043   Level1TriggerScalers();
00044   Level1TriggerScalers(const unsigned char * rawData);
00045   virtual ~Level1TriggerScalers();
00046 
00048   std::string name() const { return "Level1TriggerScalers"; }
00049 
00051   bool empty() const { return false; }
00052 
00053   // Data accessor methods
00054   int version() const { return(version_);}
00055 
00056   unsigned int trigType() const            { return(trigType_);}
00057   unsigned int eventID() const             { return(eventID_);}
00058   unsigned int sourceID() const            { return(sourceID_);}
00059   unsigned int bunchNumber() const         { return(bunchNumber_);}
00060 
00061   struct timespec collectionTime() const
00062   { return(collectionTime_.get_timespec());}
00063 
00064   unsigned int lumiSegmentNr() const        { return(lumiSegmentNr_);}
00065   unsigned int lumiSegmentOrbits() const    { return(lumiSegmentOrbits_);}
00066   unsigned int orbitNr() const              { return(orbitNr_);}
00067 
00068   unsigned int gtResets() const             { return(gtResets_);}
00069   unsigned int bunchCrossingErrors() const  { return(bunchCrossingErrors_);}
00070   unsigned long long gtTriggers() const     { return(gtTriggers_);}
00071   unsigned long long gtEvents() const       { return(gtEvents_);}
00072   float gtTriggersRate() const              { return(gtTriggersRate_);}
00073   float gtEventsRate() const                { return(gtEventsRate_);}
00074   int prescaleIndexAlgo() const             { return(prescaleIndexAlgo_);}
00075   int prescaleIndexTech() const             { return(prescaleIndexTech_);}
00076 
00077   struct timespec collectionTimeLumiSeg() const
00078   { return(collectionTimeLumiSeg_.get_timespec());}
00079 
00080   unsigned int lumiSegmentNrLumiSeg() const      
00081   { return(lumiSegmentNrLumiSeg_);}
00082 
00083   unsigned long long triggersPhysicsGeneratedFDL() const 
00084   { return(triggersPhysicsGeneratedFDL_);}
00085   unsigned long long triggersPhysicsLost() const 
00086   { return(triggersPhysicsLost_);}
00087   unsigned long long triggersPhysicsLostBeamActive() const 
00088   { return(triggersPhysicsLostBeamActive_);}
00089   unsigned long long triggersPhysicsLostBeamInactive() const 
00090   { return(triggersPhysicsLostBeamInactive_);}
00091   unsigned long long l1AsPhysics() const 
00092   { return(l1AsPhysics_);}
00093   unsigned long long l1AsRandom() const 
00094   { return(l1AsRandom_);}
00095   unsigned long long l1AsTest() const 
00096   { return(l1AsTest_);}
00097   unsigned long long l1AsCalibration() const 
00098   { return(l1AsCalibration_);}
00099   unsigned long long deadtime() const 
00100   { return(deadtime_);}
00101   unsigned long long deadtimeBeamActive() const 
00102   { return(deadtimeBeamActive_);}
00103   unsigned long long deadtimeBeamActiveTriggerRules() const 
00104   { return(deadtimeBeamActiveTriggerRules_);}
00105   unsigned long long deadtimeBeamActiveCalibration() const 
00106   { return(deadtimeBeamActiveCalibration_);}
00107   unsigned long long deadtimeBeamActivePrivateOrbit() const 
00108   { return(deadtimeBeamActivePrivateOrbit_);}
00109   unsigned long long deadtimeBeamActivePartitionController() const 
00110   { return(deadtimeBeamActivePartitionController_);}
00111   unsigned long long deadtimeBeamActiveTimeSlot() const 
00112   { return(deadtimeBeamActiveTimeSlot_);}
00113 
00114   unsigned int lastOrbitCounter0() const { return(lastOrbitCounter0_);}
00115   unsigned int lastTestEnable() const    { return(lastTestEnable_);}
00116   unsigned int lastResync() const        { return(lastResync_);}
00117   unsigned int lastStart() const         { return(lastStart_);}
00118   unsigned int lastEventCounter0() const { return(lastEventCounter0_);}
00119   unsigned int lastHardReset() const     { return(lastHardReset_);}
00120   unsigned long long spare0() const      { return(spare0_);}
00121   unsigned long long spare1() const      { return(spare1_);}
00122   unsigned long long spare2() const      { return(spare2_);}
00123 
00124   static double rateLS(unsigned long long counts);
00125   static double rateLS(unsigned int counts);
00126   static double percentLS(unsigned long long counts);
00127   static double percentLSActive(unsigned long long counts);
00128 
00129   static double rateLS(unsigned long long counts, int runNumber);
00130   static double rateLS(unsigned int counts, int runNumber);
00131   static double percentLS(unsigned long long counts, int runNumber);
00132   static double percentLSActive(unsigned long long counts, int runNumber);
00133 
00134   std::vector<unsigned int> gtAlgoCounts() const 
00135   { return(gtAlgoCounts_);}
00136 
00137   std::vector<unsigned int> gtTechCounts() const
00138   { return(gtTechCounts_);}
00139 
00141   int operator==(const Level1TriggerScalers& e) const { return false; }
00142 
00144   int operator!=(const Level1TriggerScalers& e) const { return false; }
00145 
00146 protected:
00147   int version_;
00148 
00149   unsigned int trigType_;
00150   unsigned int eventID_;
00151   unsigned int sourceID_;
00152   unsigned int bunchNumber_;
00153 
00154   TimeSpec    collectionTime_;
00155   unsigned int lumiSegmentNr_;
00156   unsigned int lumiSegmentOrbits_;
00157   unsigned int orbitNr_;
00158   unsigned int gtResets_;
00159   unsigned int bunchCrossingErrors_;
00160   unsigned long long gtTriggers_;
00161   unsigned long long gtEvents_;
00162   float gtTriggersRate_;
00163   float gtEventsRate_;
00164   int prescaleIndexAlgo_;
00165   int prescaleIndexTech_;
00166 
00167   TimeSpec    collectionTimeLumiSeg_;
00168   unsigned int lumiSegmentNrLumiSeg_;
00169   unsigned long long triggersPhysicsGeneratedFDL_;
00170   unsigned long long triggersPhysicsLost_;
00171   unsigned long long triggersPhysicsLostBeamActive_;
00172   unsigned long long triggersPhysicsLostBeamInactive_;
00173   unsigned long long l1AsPhysics_;
00174   unsigned long long l1AsRandom_;
00175   unsigned long long l1AsTest_;
00176   unsigned long long l1AsCalibration_;
00177   unsigned long long deadtime_;
00178   unsigned long long deadtimeBeamActive_;
00179   unsigned long long deadtimeBeamActiveTriggerRules_;
00180   unsigned long long deadtimeBeamActiveCalibration_;
00181   unsigned long long deadtimeBeamActivePrivateOrbit_;
00182   unsigned long long deadtimeBeamActivePartitionController_;
00183   unsigned long long deadtimeBeamActiveTimeSlot_;
00184 
00185   std::vector<unsigned int> gtAlgoCounts_;
00186   std::vector<unsigned int> gtTechCounts_;
00187 
00188   // Orbit counter markers indicating when the last BGO 
00189   // command of a particular type was received, relative 
00190   // to the last OrbitCounter0 (OC0), for this L1 accept
00191   unsigned int lastOrbitCounter0_;
00192   unsigned int lastTestEnable_;
00193   unsigned int lastResync_;
00194   unsigned int lastStart_;
00195   unsigned int lastEventCounter0_;
00196   unsigned int lastHardReset_;
00197 
00198   // For future use
00199   unsigned long long spare0_;
00200   unsigned long long spare1_;
00201   unsigned long long spare2_;
00202 };
00203 
00204 
00206 std::ostream& operator<<(std::ostream& s, const Level1TriggerScalers& c);
00207 
00208 typedef std::vector<Level1TriggerScalers> Level1TriggerScalersCollection;
00209 
00210 #endif