Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:04:02

0001 /** \file
0002  * 
0003  *
0004  * \author FRC
0005  */
0006 
0007 #include <DataFormats/DTDigi/interface/DTLocalTrigger.h>
0008 
0009 using namespace std;
0010 
0011 DTLocalTrigger::DTLocalTrigger(int eventBx, int bx, int data) : theEventBX(eventBx), theBX(bx), theData(data) {}
0012 
0013 DTLocalTrigger::DTLocalTrigger() : theEventBX(0), theBX(0), theData(0) {}
0014 
0015 // Comparison
0016 bool DTLocalTrigger::operator==(const DTLocalTrigger& trig) const {
0017   if (theBX != trig.bx() || this->quality() != trig.quality())
0018     return false;
0019   return true;
0020 }
0021 
0022 // Getters
0023 
0024 uint16_t DTLocalTrigger::bx() const { return theBX; }
0025 
0026 uint16_t DTLocalTrigger::quality() const { return ((theData & 0xE) >> 1); }
0027 uint16_t DTLocalTrigger::trTheta() const { return ((theData & 0x30) >> 4); }
0028 
0029 bool DTLocalTrigger::secondTrack() const { return (theData & 0x1); }
0030 bool DTLocalTrigger::trOut() const { return ((theData & 0x40) >> 6); }
0031 
0032 // Setters ??
0033 
0034 // Debug
0035 
0036 void DTLocalTrigger::print() const {
0037   cout << " trigger at BX " << bx() << ": " << theData;
0038   if (secondTrack())
0039     cout << " IT IS A SECOND TRACK !! ";
0040   cout << " Quality " << quality();
0041   if (trTheta() == 1)
0042     cout << " with a low Theta trigger ";
0043   if (trTheta() == 3)
0044     cout << " with a high Theta trigger ";
0045   if (trOut())
0046     cout << " Trigger Out set ";
0047   cout << endl;
0048 }
0049 
0050 uint16_t DTLocalTrigger::eventBx() const { return theEventBX; }