Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:19:44

0001 //-------------------------------------------------
0002 //
0003 //   Class: DTTracoTrig
0004 //
0005 //   Description: TRACO Trigger Data
0006 //
0007 //
0008 //   Author List:
0009 //   C. Grandi
0010 //   Modifications:
0011 //   22/VI/04 SV: last trigger code update
0012 //
0013 //
0014 //--------------------------------------------------
0015 
0016 // #include "Utilities/Configuration/interface/Architecture.h"
0017 
0018 //-----------------------
0019 // This Class's Header --
0020 //-----------------------
0021 #include "L1Trigger/DTTraco/interface/DTTracoTrig.h"
0022 
0023 //-------------------------------
0024 // Collaborating Class Headers --
0025 //-------------------------------
0026 #include "L1Trigger/DTBti/interface/DTBtiTrigData.h"
0027 #include "L1Trigger/DTTraco/interface/DTTracoChip.h"
0028 
0029 //---------------
0030 // C++ Headers --
0031 //---------------
0032 
0033 using namespace std;
0034 
0035 //----------------
0036 // Constructors --
0037 //----------------
0038 DTTracoTrig::DTTracoTrig() {
0039   // reserve the appropriate amount of space for vectors
0040   _btitrig.reserve(2);
0041   clear();
0042 }
0043 
0044 DTTracoTrig::DTTracoTrig(DTTracoChip *tparent, int step) : _tparent(tparent) {
0045   // reserve the appropriate amount of space for vectors
0046   _btitrig.reserve(2);
0047   clear();
0048 
0049   // data part of the trigger
0050   _data.setStep(step);
0051   _data.setParent(tparent->id());
0052 }
0053 
0054 DTTracoTrig::DTTracoTrig(DTTracoChip *parent, DTTracoTrigData data) : _tparent(parent), _data(data) {
0055   // reserve the appropriate amount of space for vectors
0056   _btitrig.reserve(2);
0057 }
0058 
0059 //--------------
0060 // Destructor --
0061 //--------------
0062 DTTracoTrig::~DTTracoTrig() {}
0063 
0064 bool DTTracoTrig::operator==(const DTTracoTrig &tt) const {
0065   if (qdec() == 7 && tt.qdec() == 7)
0066     return true;
0067 
0068   if (!(isFirst() == tt.isFirst()) || !(pvK() == tt.pvK()) ||
0069       ((fmod(double(pvCode()), 8.) == 0) ^ (fmod(double(tt.pvCode()), 8.) == 0)) || !(pvCorr() == tt.pvCorr()) ||
0070       !(psiR() == tt.psiR()) || !(DeltaPsiR() == tt.DeltaPsiR()) || !(qdec() == tt.qdec()) ||
0071       !(data().pvIO() == tt.data().pvIO())) {
0072     cout << "fs:" << isFirst() << "," << tt.isFirst() << endl;
0073     cout << "pvCode:" << pvCode() << "," << tt.pvCode() << endl;
0074     cout << "pvK:" << pvK() << "," << tt.pvK() << endl;
0075     cout << "pvCorr:" << pvCorr() << "," << tt.pvCorr() << endl;
0076     cout << "psiR:" << psiR() << "," << tt.psiR() << endl;
0077     cout << "DeltaPsiR:" << DeltaPsiR() << "," << tt.DeltaPsiR() << endl;
0078     cout << "qdec:" << qdec() << "," << tt.qdec() << endl;
0079     cout << "data().pvIO:" << data().pvIO() << "," << tt.data().pvIO() << endl;
0080 
0081     return false;
0082   }
0083   return true;
0084 }