CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_2_9/src/DataFormats/Scalers/interface/L1AcceptBunchCrossing.h

Go to the documentation of this file.
00001 /*
00002  *  File: DataFormats/Scalers/interface/L1AcceptBunchCrossing.h   (W.Badgett)
00003  *
00004  *  Bunch crossing information for a single L1 accept.  The information 
00005  *  comes from the Scalers FED.   Normally there are four of these objects 
00006  *  per event, each representing the current L1 accept, as well as the 
00007  *  previous three L1 accepts in time.
00008  *
00009  *  orbitNumber_     32-bits     Orbit counter since last reset
00010  *  bunchCrossing_   0...3563    Bunch counter within orbit
00011  *  eventType_       0...7       Event Type: 
00012  *                               1: Physics
00013  *                               2: Calibration
00014  *                               3: Test
00015  *                               4: Technical
00016  *  l1AcceptOffset_              Offset of the L1 Accept relative to 
00017  *                               the current event's L1 accept
00018  *                               Typically 0, -1, -2, -3
00019  */
00020 
00021 #ifndef DATAFORMATS_SCALERS_L1ACCEPTBUNCHCROSSING_H
00022 #define DATAFORMATS_SCALERS_L1ACCEPTBUNCHCROSSING_H
00023 
00024 #include <ostream>
00025 #include <vector>
00026 
00035 
00036 
00037 
00038 class L1AcceptBunchCrossing
00039 {
00040  public:
00041 
00042   L1AcceptBunchCrossing();
00043   L1AcceptBunchCrossing(const int l1AcceptOffset__,
00044                         const unsigned int orbitNumber__,
00045                         const unsigned int bunchCrossing__,
00046                         const unsigned int eventType__);
00047   L1AcceptBunchCrossing(const int index,
00048                         const unsigned long long data);
00049   virtual ~L1AcceptBunchCrossing();
00050 
00051   enum
00052   {
00053     ORBIT_NUMBER_SHIFT   = 32ULL,
00054     ORBIT_NUMBER_MASK    = 0xFFFFFFFFULL,
00055     BUNCH_CROSSING_SHIFT = 4ULL,
00056     BUNCH_CROSSING_MASK  = 0xFFFULL,
00057     EVENT_TYPE_SHIFT     = 0,
00058     EVENT_TYPE_MASK      = 0xFULL
00059   };
00060 
00062   std::string name() const { return "L1AcceptBunchCrossing"; }
00063 
00065   bool empty() const { return false; }
00066 
00067   int l1AcceptOffset() const         { return(l1AcceptOffset_);}
00068   unsigned int orbitNumber() const   { return(orbitNumber_);}
00069   unsigned int bunchCrossing() const { return(bunchCrossing_);}
00070   unsigned int eventType() const     { return(eventType_);}
00071 
00073   int operator==(const L1AcceptBunchCrossing& e) const { return false; }
00074 
00076   int operator!=(const L1AcceptBunchCrossing& e) const { return false; }
00077 
00078 protected:
00079 
00080   int          l1AcceptOffset_;
00081   unsigned int orbitNumber_;
00082   unsigned int bunchCrossing_;
00083   unsigned int eventType_;
00084 
00085 };
00086 
00088 std::ostream& operator<<(std::ostream& s, const L1AcceptBunchCrossing& c);
00089 
00090 typedef std::vector<L1AcceptBunchCrossing> L1AcceptBunchCrossingCollection;
00091 
00092 #endif