CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_4_1_8_patch9/src/DataFormats/Scalers/src/L1AcceptBunchCrossing.cc

Go to the documentation of this file.
00001 /*
00002  *   File: DataFormats/Scalers/src/L1AcceptBunchCrossing.cc   (W.Badgett)
00003  */
00004 
00005 #include "DataFormats/Scalers/interface/L1AcceptBunchCrossing.h"
00006 #include "DataFormats/Scalers/interface/ScalersRaw.h"
00007 #include <cstdio>
00008 
00009 L1AcceptBunchCrossing::L1AcceptBunchCrossing() : 
00010   l1AcceptOffset_(0),
00011   orbitNumber_(0),
00012   bunchCrossing_(0),
00013   eventType_(0)
00014 { 
00015 }
00016 
00017 L1AcceptBunchCrossing::L1AcceptBunchCrossing(const int l1AcceptOffset__,
00018                                              const unsigned int orbitNumber__,
00019                                              const unsigned int bunchCrossing__,
00020                                              const unsigned int eventType__) : 
00021   l1AcceptOffset_(l1AcceptOffset__),
00022   orbitNumber_(orbitNumber__),
00023   bunchCrossing_(bunchCrossing__),
00024   eventType_(eventType__)
00025 { 
00026 }
00027 
00028 L1AcceptBunchCrossing::L1AcceptBunchCrossing(const int index, 
00029                                              const unsigned long long data)
00030 { 
00031   l1AcceptOffset_ =  - index;
00032   orbitNumber_    = (unsigned int) (( data >> ORBIT_NUMBER_SHIFT ) 
00033                                     & ORBIT_NUMBER_MASK);
00034   bunchCrossing_  = (unsigned int) (( data >> BUNCH_CROSSING_SHIFT ) 
00035                                     & BUNCH_CROSSING_MASK );
00036   eventType_      = (unsigned int) (( data >> EVENT_TYPE_SHIFT )
00037                                     & EVENT_TYPE_MASK);
00038 }
00039 
00040 L1AcceptBunchCrossing::~L1AcceptBunchCrossing() { } 
00041 
00043 std::ostream& operator<<(std::ostream& s, const L1AcceptBunchCrossing& c) 
00044 {
00045   char line[128];
00046 
00047   sprintf(line, 
00048   "L1AcceptBC Offset:%2d  Orbit:%10d [0x%8.8X]  BC:%4d [0x%3.3X]  EvtTyp:%d", 
00049           c.l1AcceptOffset(),
00050           c.orbitNumber(), 
00051           c.orbitNumber(), 
00052           c.bunchCrossing(), 
00053           c.bunchCrossing(), 
00054           c.eventType());
00055   s << line << std::endl;
00056 
00057   return s;
00058 }