Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:05:08

0001 /*
0002  *  File: DataFormats/Scalers/interface/L1AcceptBunchCrossing.h   (W.Badgett)
0003  *
0004  *  Bunch crossing information for a single L1 accept.  The information 
0005  *  comes from the Scalers FED.   Normally there are four of these objects 
0006  *  per event, each representing the current L1 accept, as well as the 
0007  *  previous three L1 accepts in time.
0008  *
0009  *  orbitNumber_     32-bits     Orbit counter since last reset
0010  *  bunchCrossing_   0...3563    Bunch counter within orbit
0011  *  eventType_       0...7       Event Type: 
0012  *                               1: Physics
0013  *                               2: Calibration
0014  *                               3: Test
0015  *                               4: Technical
0016  *  l1AcceptOffset_              Offset of the L1 Accept relative to 
0017  *                               the current event's L1 accept
0018  *                               Typically 0, -1, -2, -3
0019  */
0020 
0021 #ifndef DATAFORMATS_SCALERS_L1ACCEPTBUNCHCROSSING_H
0022 #define DATAFORMATS_SCALERS_L1ACCEPTBUNCHCROSSING_H
0023 
0024 #include <ostream>
0025 #include <vector>
0026 
0027 /*! \file L1AcceptBunchCrossings.h
0028  * \Header file for L1Accept bunch crossing data from the scalers system
0029  * 
0030  * \author: William Badgett
0031  *
0032  */
0033 
0034 /// \class L1AcceptBunchCrossings.h
0035 /// \brief Persistable copy of Scalers L1Accept bunch crossing info
0036 
0037 class L1AcceptBunchCrossing {
0038 public:
0039   L1AcceptBunchCrossing();
0040   L1AcceptBunchCrossing(const int l1AcceptOffset__,
0041                         const unsigned int orbitNumber__,
0042                         const unsigned int bunchCrossing__,
0043                         const unsigned int eventType__);
0044   L1AcceptBunchCrossing(const int index, const unsigned long long data);
0045   virtual ~L1AcceptBunchCrossing();
0046 
0047   enum {
0048     ORBIT_NUMBER_SHIFT = 32ULL,
0049     ORBIT_NUMBER_MASK = 0xFFFFFFFFULL,
0050     BUNCH_CROSSING_SHIFT = 4ULL,
0051     BUNCH_CROSSING_MASK = 0xFFFULL,
0052     EVENT_TYPE_SHIFT = 0,
0053     EVENT_TYPE_MASK = 0xFULL
0054   };
0055 
0056   /// name method
0057   std::string name() const { return "L1AcceptBunchCrossing"; }
0058 
0059   /// empty method (= false)
0060   bool empty() const { return false; }
0061 
0062   int l1AcceptOffset() const { return (l1AcceptOffset_); }
0063   unsigned int orbitNumber() const { return (orbitNumber_); }
0064   unsigned int bunchCrossing() const { return (bunchCrossing_); }
0065   unsigned int eventType() const { return (eventType_); }
0066 
0067   /// equality operator
0068   int operator==(const L1AcceptBunchCrossing& e) const { return false; }
0069 
0070   /// inequality operator
0071   int operator!=(const L1AcceptBunchCrossing& e) const { return false; }
0072 
0073 protected:
0074   int l1AcceptOffset_;
0075   unsigned int orbitNumber_;
0076   unsigned int bunchCrossing_;
0077   unsigned int eventType_;
0078 };
0079 
0080 /// Pretty-print operator for L1AcceptBunchCrossings
0081 std::ostream& operator<<(std::ostream& s, const L1AcceptBunchCrossing& c);
0082 
0083 typedef std::vector<L1AcceptBunchCrossing> L1AcceptBunchCrossingCollection;
0084 
0085 #endif