File indexing completed on 2024-04-06 12:19:43
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022 #include "L1Trigger/DTTraco/interface/DTTracoCand.h"
0023
0024
0025
0026
0027 #include "L1Trigger/DTBti/interface/DTBtiTrigData.h"
0028 #include "L1Trigger/DTTraco/interface/DTTracoChip.h"
0029 #include "L1TriggerConfig/DTTPGConfig/interface/DTConfigTraco.h"
0030
0031
0032
0033
0034 #include <iostream>
0035
0036
0037
0038
0039 DTTracoCand::DTTracoCand(DTTracoChip *tc, const DTBtiTrigData *btitr, int pos, int step)
0040 : _traco(tc), _btitr(btitr), _step(step), _position(pos), _usable(1) {
0041 if (pos < 1 || pos > 4 * DTConfigTraco::NBTITC) {
0042 std::cout << "DTTracoCand::DTTracoCand: wrong position: " << pos;
0043 std::cout << ", dummy coordinates set!" << std::endl;
0044 _tcX = 9999;
0045 _tcK = 9999;
0046 return;
0047 }
0048
0049
0050
0051 _tcK = abs(btitr->K() - tc->KRad() - tc->BTIC());
0052
0053
0054
0055 int lstep = tc->BTIC();
0056 _tcX = btitr->X() + lstep * ((pos <= DTConfigTraco::NBTITC) * (pos - 1 + DTConfigTraco::NBTITC) +
0057 (pos > DTConfigTraco::NBTITC) * (pos - 1 - DTConfigTraco::NBTITC));
0058
0059
0060 if (btitr->btiSL() == 1)
0061 _tcX += tc->IBTIOFF();
0062
0063
0064
0065
0066
0067
0068
0069
0070
0071
0072
0073
0074
0075
0076
0077
0078
0079
0080
0081
0082
0083
0084
0085
0086
0087 }
0088
0089 DTTracoCand::DTTracoCand(const DTTracoCand &tccand)
0090 : _traco(tccand._traco),
0091 _btitr(tccand._btitr),
0092 _step(tccand._step),
0093 _position(tccand._position),
0094 _usable(tccand._usable),
0095 _tcX(tccand._tcX),
0096 _tcK(tccand._tcK) {}
0097
0098
0099
0100
0101 DTTracoCand::~DTTracoCand() {}
0102
0103
0104
0105
0106
0107 DTTracoCand &DTTracoCand::operator=(const DTTracoCand &tccand) {
0108 if (this != &tccand) {
0109 _traco = tccand._traco;
0110 _btitr = tccand._btitr;
0111 _position = tccand._position;
0112 _step = tccand._step;
0113 _usable = tccand._usable;
0114 _tcX = tccand._tcX;
0115 _tcK = tccand._tcK;
0116 }
0117 return *this;
0118 }
0119
0120 void DTTracoCand::print() const {
0121
0122 std::cout << " step " << _step;
0123 std::cout << " Position " << _position;
0124 std::cout << " Code = " << _btitr->code();
0125 std::cout << " SL = " << _btitr->btiSL();
0126 std::cout << " N = " << _btitr->btiNumber();
0127 std::cout << " X = " << _btitr->X();
0128 std::cout << " K = " << _btitr->K();
0129 std::cout << " Kr = " << _traco->KRad();
0130 std::cout << " |K-Kr| = " << _tcK << std::endl;
0131 }