Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 12:54:38

0001 /*
0002  *  File: DataFormats/Scalers/interface/L1TriggerScalers.h   (W.Badgett)
0003  *
0004  *  Various Level 1 Trigger Scalers from the GT/TS
0005  *
0006  */
0007 
0008 #ifndef DATAFORMATS_SCALERS_L1TRIGGERSCALERS_H
0009 #define DATAFORMATS_SCALERS_L1TRIGGERSCALERS_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 L1TriggerScalers.h
0019  * \Header file for Level 1 Global Trigger Scalers
0020  * 
0021  * \author: William Badgett
0022  *
0023  */
0024 
0025 /// \class L1TriggerScalers.h
0026 /// \brief Persistable copy of L1 Trigger Scalers
0027 
0028 class L1TriggerScalers {
0029 public:
0030   enum { nL1Triggers = 128, nL1TestTriggers = 64 };
0031 
0032   L1TriggerScalers();
0033   L1TriggerScalers(const unsigned char* rawData);
0034   virtual ~L1TriggerScalers();
0035 
0036   /// name method
0037   std::string name() const { return "L1TriggerScalers"; }
0038 
0039   /// empty method (= false)
0040   bool empty() const { return false; }
0041 
0042   // Data accessor methods
0043   int version() const { return (version_); }
0044 
0045   unsigned int trigType() const { return (trigType_); }
0046   unsigned int eventID() const { return (eventID_); }
0047   unsigned int sourceID() const { return (sourceID_); }
0048   unsigned int bunchNumber() const { return (bunchNumber_); }
0049 
0050   timespec collectionTimeSpecial() const { return (collectionTimeSpecial_.get_timespec()); }
0051 
0052   unsigned int orbitNumber() const { return (orbitNumber_); }
0053   unsigned int luminositySection() const { return (luminositySection_); }
0054   unsigned int bunchCrossingErrors() const { return (bunchCrossingErrors_); }
0055 
0056   timespec collectionTimeSummary() const { return (collectionTimeSummary_.get_timespec()); }
0057 
0058   unsigned int triggerNumber() const { return (triggerNumber_); }
0059   unsigned int eventNumber() const { return (eventNumber_); }
0060   unsigned int finalTriggersDistributed() const { return (finalTriggersDistributed_); }
0061   unsigned int calibrationTriggers() const { return (calibrationTriggers_); }
0062   unsigned int randomTriggers() const { return (randomTriggers_); }
0063   unsigned int totalTestTriggers() const { return (totalTestTriggers_); }
0064   unsigned int finalTriggersGenerated() const { return (finalTriggersGenerated_); }
0065   unsigned int finalTriggersInvalidBC() const { return (finalTriggersInvalidBC_); }
0066 
0067   unsigned long long deadTime() const { return (deadTime_); }
0068   unsigned long long lostFinalTriggers() const { return (lostFinalTriggers_); }
0069   unsigned long long deadTimeActive() const { return (deadTimeActive_); }
0070   unsigned long long lostFinalTriggersActive() const { return (lostFinalTriggersActive_); }
0071 
0072   unsigned long long deadTimeActivePrivate() const { return (deadTimeActivePrivate_); }
0073   unsigned long long deadTimeActivePartition() const { return (deadTimeActivePartition_); }
0074   unsigned long long deadTimeActiveThrottle() const { return (deadTimeActiveThrottle_); }
0075   unsigned long long deadTimeActiveCalibration() const { return (deadTimeActiveCalibration_); }
0076   unsigned long long deadTimeActiveTimeSlot() const { return (deadTimeActiveTimeSlot_); }
0077   unsigned int numberResets() const { return (numberResets_); }
0078 
0079   timespec collectionTimeDetails() const { return (collectionTimeDetails_.get_timespec()); }
0080 
0081   std::vector<unsigned int> triggers() const { return (triggers_); }
0082 
0083   std::vector<unsigned int> testTriggers() const { return (testTriggers_); }
0084 
0085   /// equality operator
0086   int operator==(const L1TriggerScalers& e) const { return false; }
0087 
0088   /// inequality operator
0089   int operator!=(const L1TriggerScalers& e) const { return false; }
0090 
0091 protected:
0092   int version_;
0093 
0094   unsigned int trigType_;
0095   unsigned int eventID_;
0096   unsigned int sourceID_;
0097   unsigned int bunchNumber_;
0098 
0099   TimeSpec collectionTimeSpecial_;
0100   unsigned int orbitNumber_;
0101   unsigned int luminositySection_;
0102   unsigned short bunchCrossingErrors_;
0103 
0104   TimeSpec collectionTimeSummary_;
0105   unsigned int triggerNumber_;
0106   unsigned int eventNumber_;
0107   unsigned int finalTriggersDistributed_;
0108   unsigned int calibrationTriggers_;
0109   unsigned int randomTriggers_;
0110   unsigned int totalTestTriggers_;
0111   unsigned int finalTriggersGenerated_;
0112   unsigned int finalTriggersInvalidBC_;
0113   unsigned long long deadTime_;
0114   unsigned long long lostFinalTriggers_;
0115   unsigned long long deadTimeActive_;
0116   unsigned long long lostFinalTriggersActive_;
0117   unsigned long long deadTimeActivePrivate_;
0118   unsigned long long deadTimeActivePartition_;
0119   unsigned long long deadTimeActiveThrottle_;
0120   unsigned long long deadTimeActiveCalibration_;
0121   unsigned long long deadTimeActiveTimeSlot_;
0122   unsigned int numberResets_;
0123 
0124   TimeSpec collectionTimeDetails_;
0125   std::vector<unsigned int> triggers_;
0126   std::vector<unsigned int> testTriggers_;
0127 };
0128 
0129 /// Pretty-print operator for L1TriggerScalers
0130 std::ostream& operator<<(std::ostream& s, const L1TriggerScalers& c);
0131 
0132 typedef std::vector<L1TriggerScalers> L1TriggerScalersCollection;
0133 
0134 #endif