CMS 3D CMS Logo

DTTracoTrig.cc
Go to the documentation of this file.
1 //-------------------------------------------------
2 //
3 // Class: DTTracoTrig
4 //
5 // Description: TRACO Trigger Data
6 //
7 //
8 // Author List:
9 // C. Grandi
10 // Modifications:
11 // 22/VI/04 SV: last trigger code update
12 //
13 //
14 //--------------------------------------------------
15 
16 // #include "Utilities/Configuration/interface/Architecture.h"
17 
18 //-----------------------
19 // This Class's Header --
20 //-----------------------
22 
23 //-------------------------------
24 // Collaborating Class Headers --
25 //-------------------------------
28 
29 //---------------
30 // C++ Headers --
31 //---------------
32 
33 using namespace std;
34 
35 //----------------
36 // Constructors --
37 //----------------
39 
40  // reserve the appropriate amount of space for vectors
41  _btitrig.reserve(2);
42  clear();
43 }
44 
45 DTTracoTrig::DTTracoTrig(DTTracoChip *tparent, int step) : _tparent(tparent) {
46 
47  // reserve the appropriate amount of space for vectors
48  _btitrig.reserve(2);
49  clear();
50 
51  // data part of the trigger
52  _data.setStep(step);
53  _data.setParent(tparent->id());
54 }
55 
57  : _tparent(parent), _data(data) {
58 
59  // reserve the appropriate amount of space for vectors
60  _btitrig.reserve(2);
61 }
62 
63 //--------------
64 // Destructor --
65 //--------------
67 
69  if (qdec() == 7 && tt.qdec() == 7)
70  return true;
71 
72  if (!(isFirst() == tt.isFirst()) || !(pvK() == tt.pvK()) ||
73  ((fmod(double(pvCode()), 8.) == 0) ^
74  (fmod(double(tt.pvCode()), 8.) == 0)) ||
75  !(pvCorr() == tt.pvCorr()) || !(psiR() == tt.psiR()) ||
76  !(DeltaPsiR() == tt.DeltaPsiR()) || !(qdec() == tt.qdec()) ||
77  !(data().pvIO() == tt.data().pvIO())) {
78 
79  cout << "fs:" << isFirst() << "," << tt.isFirst() << endl;
80  cout << "pvCode:" << pvCode() << "," << tt.pvCode() << endl;
81  cout << "pvK:" << pvK() << "," << tt.pvK() << endl;
82  cout << "pvCorr:" << pvCorr() << "," << tt.pvCorr() << endl;
83  cout << "psiR:" << psiR() << "," << tt.psiR() << endl;
84  cout << "DeltaPsiR:" << DeltaPsiR() << "," << tt.DeltaPsiR() << endl;
85  cout << "qdec:" << qdec() << "," << tt.qdec() << endl;
86  cout << "data().pvIO:" << data().pvIO() << "," << tt.data().pvIO() << endl;
87 
88  return false;
89  }
90  return true;
91 }
void setParent(DTTracoId tracoid)
Set the parent TRACO Identifier.
DTTracoTrigData data() const
Return the data part.
Definition: DTTracoTrig.h:122
void clear()
Clear.
Definition: DTTracoTrig.h:107
std::vector< const DTBtiTrigData * > _btitrig
Definition: DTTracoTrig.h:192
DTTracoTrigData _data
Definition: DTTracoTrig.h:189
DTTracoTrig()
Constructors.
Definition: DTTracoTrig.cc:38
DTTracoChip * _tparent
Definition: DTTracoTrig.h:186
void clear(CLHEP::HepGenMatrix &m)
Helper function: Reset all elements of a matrix to 0.
Definition: matutil.cc:167
int pvCode() const
Return the preview code.
Definition: DTTracoTrig.h:152
void setStep(int step)
Set trigger step.
int pvCorr() const
Return the preview correaltion bit.
Definition: DTTracoTrig.h:158
int qdec() const
Return the trigger code in new format.
Definition: DTTracoTrig.h:176
int psiR() const
Return trigger X parameter converted to angle.
Definition: DTTracoTrig.h:170
int isFirst() const
Return non 0 if the track is a first track.
Definition: DTTracoTrig.h:149
int pvK() const
Return the preview K.
Definition: DTTracoTrig.h:155
bool operator==(const DTTracoTrig &) const
comparison operator
Definition: DTTracoTrig.cc:68
step
Definition: StallMonitor.cc:94
int pvIO() const
Return the preview i/o bit.
~DTTracoTrig() override
Destructor.
Definition: DTTracoTrig.cc:66
int DeltaPsiR() const
Return DeltaPsiR.
Definition: DTTracoTrig.h:173
DTTracoId id() const
Return TRACO id.
Definition: DTTracoChip.h:99