CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_3_8_patch3/src/DataFormats/DTDigi/src/DTLocalTrigger.cc

Go to the documentation of this file.
00001 
00009 #include <DataFormats/DTDigi/interface/DTLocalTrigger.h>
00010 
00011 
00012 using namespace std;
00013 
00014 
00015 DTLocalTrigger::DTLocalTrigger (int eventBx, int bx, int data) : 
00016   theEventBX(eventBx),
00017   theBX (bx),
00018   theData(data)
00019 {}
00020 
00021 
00022 DTLocalTrigger::DTLocalTrigger () : 
00023   theEventBX(0),
00024   theBX (0),
00025   theData(0)
00026 {}
00027 
00028 
00029 // Comparison
00030 bool DTLocalTrigger::operator == (const DTLocalTrigger& trig) const {
00031   if ( theBX != trig.bx() ||
00032        this->quality() != trig.quality() ) return false;
00033   return true;
00034 }
00035 
00036 // Getters
00037 
00038 
00039 uint16_t DTLocalTrigger::bx() const { return theBX; }
00040 
00041 uint16_t DTLocalTrigger::quality() const {
00042   return ( (theData & 0xE) >> 1 );
00043 }
00044 uint16_t DTLocalTrigger::trTheta() const {
00045   return ( (theData & 0x30) >> 4 );
00046 }
00047 
00048 bool DTLocalTrigger::secondTrack() const {
00049   return ( theData & 0x1 );
00050 }
00051 bool DTLocalTrigger::trOut() const {
00052   return ( (theData & 0x40) >> 6 );
00053 }
00054 
00055 // Setters ??
00056 
00057 // Debug
00058 
00059 void
00060 DTLocalTrigger::print() const {
00061   cout << " trigger at BX "<<bx()<<": "<<theData;   
00062   if (secondTrack()) 
00063     cout << " IT IS A SECOND TRACK !! ";
00064   cout << " Quality "<<quality();
00065   if (trTheta() == 1) 
00066     cout << " with a low Theta trigger ";
00067   if (trTheta() == 3) 
00068     cout << " with a high Theta trigger ";
00069   if (trOut()) 
00070     cout << " Trigger Out set ";
00071   cout << endl;
00072 }
00073 
00074 uint16_t DTLocalTrigger::eventBx() const {
00075   return theEventBX;
00076 }