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