CMS 3D CMS Logo

LTCDigi Class Reference

Data from the Local Trigger Controller (LTC). More...

#include <DataFormats/LTCDigi/interface/LTCDigi.h>

List of all members.

Public Member Functions

uint64_t bstGpsTime () const
unsigned int bunchNumber () const
unsigned int bxMask () const
unsigned char cyclicTriggerMask () const
int daqPartition () const
unsigned int eventID () const
unsigned int eventNumber () const
unsigned char externTriggerMask () const
bool HasTriggered (int i) const
 LTCDigi (const unsigned char *data)
 LTCDigi ()
uint32_t orbitNumber () const
unsigned int ramTrigger () const
unsigned int runNumber () const
int sourceID () const
uint32_t triggerInhibitNumber () const
uint32_t triggerInputStatus () const
int version () const
unsigned int vmeTrigger () const

Static Public Member Functions

static uint32_t GetEventNumberFromBuffer (const unsigned char *databuffer)
static uint32_t GetRunNumberFromBuffer (const unsigned char *databuffer)
static std::string locTime (uint64_t t)
static std::string utcTime (uint64_t t)

Private Attributes

uint64_t bstGpsTime_
unsigned int bunchNumber_
int daqPartition_
unsigned int eventID_
uint32_t eventNumber_
uint32_t orbitNumber_
unsigned int runNumber_
unsigned int sourceID_
uint32_t trigInhibitNumber_
uint32_t trigInputStat_
unsigned int trigType_
int versionNumber_


Detailed Description

Data from the Local Trigger Controller (LTC).

Id
LTCDigi.h,v 1.4 2006/06/29 19:13:04 wittich Exp

Definition at line 17 of file LTCDigi.h.


Constructor & Destructor Documentation

LTCDigi::LTCDigi (  )  [inline]

Definition at line 21 of file LTCDigi.h.

00021 {}

LTCDigi::LTCDigi ( const unsigned char *  data  ) 

Definition at line 5 of file LTCDigi.cc.

References bstGpsTime_, bunchNumber_, daqPartition_, eventID_, eventNumber_, orbitNumber_, runNumber_, sourceID_, trigInhibitNumber_, trigInputStat_, trigType_, and versionNumber_.

00006 {
00007   // six 64 bit words
00008   uint64_t *ld = (uint64_t*)data;
00009 
00010   trigType_   = (ld[0]>>56)&        0xFULL; // 4 bits
00011 
00012   eventID_     = (ld[0]>>32)&0x00FFFFFFULL; // 24 bits
00013   runNumber_   = (ld[2]>>32)&0xFFFFFFFFULL; // 32 bits
00014   eventNumber_ = (ld[2])    &0xFFFFFFFFULL; // 32 bits
00015   
00016   sourceID_      = (ld[0]>> 8)&0x00000FFFULL; // 12 bits
00017   // this should always be 815?
00018   //assert(sourceID_ == 815);
00019 
00020   bunchNumber_   = (ld[0]>>20)&     0xFFFULL; // 12 bits
00021   orbitNumber_   = (ld[1]>>32)&0xFFFFFFFFULL; // 32 bits
00022 
00023   versionNumber_ = (ld[1]>>24)&0xFFULL;       // 8 bits
00024   
00025   daqPartition_  = (ld[1]    )&0xFULL;        // 4 bits
00026 
00027 
00028   trigInputStat_ = (ld[3]    )&0xFFFFFFFFULL; // 32 bits
00029 
00030   trigInhibitNumber_ = (ld[3]>>32)&0xFFFFFFFFULL; // 32 bits
00031 
00032   bstGpsTime_    = ld[4]; // 64 bits
00033 
00034 }


Member Function Documentation

uint64_t LTCDigi::bstGpsTime (  )  const [inline]

Definition at line 49 of file LTCDigi.h.

References bstGpsTime_.

Referenced by operator<<().

00049 { return bstGpsTime_;};

unsigned int LTCDigi::bunchNumber (  )  const [inline]

Definition at line 38 of file LTCDigi.h.

References bunchNumber_.

Referenced by operator<<().

00038 { return bunchNumber_;};

unsigned int LTCDigi::bxMask (  )  const [inline]

Definition at line 51 of file LTCDigi.h.

References triggerInputStatus().

00051 { return ((triggerInputStatus()>>28)&0x1); } ;

unsigned char LTCDigi::cyclicTriggerMask (  )  const [inline]

Definition at line 64 of file LTCDigi.h.

References triggerInputStatus().

00065   { 
00066     return (triggerInputStatus()&0x3FU); 
00067   } ;

int LTCDigi::daqPartition (  )  const [inline]

Definition at line 44 of file LTCDigi.h.

References daqPartition_.

Referenced by operator<<().

00044 { return daqPartition_; };

unsigned int LTCDigi::eventID (  )  const [inline]

Definition at line 35 of file LTCDigi.h.

References eventID_.

00035 { return eventID_; };

unsigned int LTCDigi::eventNumber (  )  const [inline]

Definition at line 34 of file LTCDigi.h.

References eventNumber_.

Referenced by GetEventNumberFromBuffer(), and operator<<().

00034 { return eventNumber_; };

unsigned char LTCDigi::externTriggerMask (  )  const [inline]

Definition at line 60 of file LTCDigi.h.

References triggerInputStatus().

Referenced by HasTriggered().

00061   { 
00062     return ((triggerInputStatus()>>20)&0x3FU); 
00063   } ;

uint32_t LTCDigi::GetEventNumberFromBuffer ( const unsigned char *  databuffer  )  [static]

Definition at line 36 of file LTCDigi.cc.

References eventNumber().

00037 {
00038   // six 64 bit words
00039   uint64_t *ld = (uint64_t*)data;
00040   uint32_t eventNumber = (ld[2])    &0xFFFFFFFFULL; // 32 bits
00041   return eventNumber;
00042 }

uint32_t LTCDigi::GetRunNumberFromBuffer ( const unsigned char *  databuffer  )  [static]

Definition at line 44 of file LTCDigi.cc.

References runNumber().

00045 {
00046   // six 64 bit words
00047   uint64_t *ld = (uint64_t*)data;
00048   uint32_t runNumber   = (ld[2]>>32)&0xFFFFFFFFULL; // 32 bits
00049   return runNumber;
00050 }

bool LTCDigi::HasTriggered ( int  i  )  const [inline]

Definition at line 71 of file LTCDigi.h.

References externTriggerMask().

Referenced by operator<<(), and HcalMTCCMonitor::processEvent().

00071                                    {
00072     if ( i > 5 ) return false; // throw exception?
00073     return ((externTriggerMask()&(0x1U<<i))!=0);
00074   }

std::string LTCDigi::locTime ( uint64_t  t  )  [static]

Definition at line 110 of file LTCDigi.cc.

References a.

Referenced by operator<<().

00111 {
00112   time_t tsmall = t/1000000;
00113   std::string a("LOC: ");
00114   a+= std::string(ctime(&tsmall));
00115   a.replace(a.find("\n"),a.size(), "");
00116   return a;
00117 }

uint32_t LTCDigi::orbitNumber (  )  const [inline]

Definition at line 39 of file LTCDigi.h.

References orbitNumber_.

Referenced by operator<<().

00039 { return orbitNumber_;};

unsigned int LTCDigi::ramTrigger (  )  const [inline]

Definition at line 56 of file LTCDigi.h.

References triggerInputStatus().

Referenced by operator<<().

00057   { 
00058     return ((triggerInputStatus()>>26)&0x1); 
00059   } ;

unsigned int LTCDigi::runNumber (  )  const [inline]

Definition at line 36 of file LTCDigi.h.

References runNumber_.

Referenced by GetRunNumberFromBuffer(), and operator<<().

00036 { return runNumber_;   };

int LTCDigi::sourceID (  )  const [inline]

Definition at line 42 of file LTCDigi.h.

References sourceID_.

Referenced by operator<<().

00042 { return sourceID_; };

uint32_t LTCDigi::triggerInhibitNumber (  )  const [inline]

Definition at line 47 of file LTCDigi.h.

References trigInhibitNumber_.

Referenced by operator<<().

00047 { return trigInhibitNumber_; };

uint32_t LTCDigi::triggerInputStatus (  )  const [inline]

Definition at line 46 of file LTCDigi.h.

References trigInputStat_.

Referenced by bxMask(), cyclicTriggerMask(), externTriggerMask(), operator<<(), ramTrigger(), and vmeTrigger().

00046 { return trigInputStat_; };

std::string LTCDigi::utcTime ( uint64_t  t  )  [static]

Definition at line 99 of file LTCDigi.cc.

References tstr.

Referenced by operator<<().

00100 {
00101   // note that gmtime isn't reentrant and we don't own the data
00102   time_t tsmall = t/1000000;
00103   tm *utct = gmtime(&tsmall);
00104   std::string tstr("UTC: ");
00105   tstr += asctime(utct);
00106   tstr.replace(tstr.find("\n"),tstr.size(), "");
00107   return tstr;
00108 }

int LTCDigi::version (  )  const [inline]

Definition at line 41 of file LTCDigi.h.

References versionNumber_.

00041 { return versionNumber_; } ;

unsigned int LTCDigi::vmeTrigger (  )  const [inline]

Definition at line 52 of file LTCDigi.h.

References triggerInputStatus().

Referenced by operator<<().

00053   { 
00054     return ((triggerInputStatus()>>27)&0x1); 
00055   } ;


Member Data Documentation

uint64_t LTCDigi::bstGpsTime_ [private]

Definition at line 98 of file LTCDigi.h.

Referenced by bstGpsTime(), and LTCDigi().

unsigned int LTCDigi::bunchNumber_ [private]

Definition at line 87 of file LTCDigi.h.

Referenced by bunchNumber(), and LTCDigi().

int LTCDigi::daqPartition_ [private]

Definition at line 92 of file LTCDigi.h.

Referenced by daqPartition(), and LTCDigi().

unsigned int LTCDigi::eventID_ [private]

Definition at line 82 of file LTCDigi.h.

Referenced by eventID(), and LTCDigi().

uint32_t LTCDigi::eventNumber_ [private]

Definition at line 94 of file LTCDigi.h.

Referenced by eventNumber(), and LTCDigi().

uint32_t LTCDigi::orbitNumber_ [private]

Definition at line 88 of file LTCDigi.h.

Referenced by LTCDigi(), and orbitNumber().

unsigned int LTCDigi::runNumber_ [private]

Definition at line 83 of file LTCDigi.h.

Referenced by LTCDigi(), and runNumber().

unsigned int LTCDigi::sourceID_ [private]

Definition at line 85 of file LTCDigi.h.

Referenced by LTCDigi(), and sourceID().

uint32_t LTCDigi::trigInhibitNumber_ [private]

Definition at line 97 of file LTCDigi.h.

Referenced by LTCDigi(), and triggerInhibitNumber().

uint32_t LTCDigi::trigInputStat_ [private]

Definition at line 96 of file LTCDigi.h.

Referenced by LTCDigi(), and triggerInputStatus().

unsigned int LTCDigi::trigType_ [private]

Definition at line 80 of file LTCDigi.h.

Referenced by LTCDigi().

int LTCDigi::versionNumber_ [private]

Definition at line 90 of file LTCDigi.h.

Referenced by LTCDigi(), and version().


The documentation for this class was generated from the following files:
Generated on Tue Jun 9 18:27:56 2009 for CMSSW by  doxygen 1.5.4