11 if (detId > 536870911) {
12 std::stringstream
error;
13 error <<
"ERROR: the detId = " << detId
14 <<
" is bigger than the maximum acceptable value = 2^(29) - 1 = " << 536870911 << std::endl;
15 error <<
"Since we are using 29 bits for the detId and 3 bits for the apv value. The maximum tracker detId at the "
19 <<
"of the writing of this class was 47017836 as defined in CalibTracker/SiStripCommon/data/SiStripDetInfo.dat."
21 error <<
"If the maximum value has changed a revision of this calss is needed, possibly changing the detIdAndApv "
24 error <<
"from uint32_t to uint64_t." << std::endl;
30 uint32_t detIdAndApv = (detId << 3) | apv;
34 std::cout <<
"Value already inserted, skipping insertion" << std::endl;
47 if (((lat + 1) !=
latencies_.end()) && ((lat + 1)->mode == lat->mode) && ((lat + 1)->latency == lat->latency)) {
74 return std::make_pair(255, 0);
76 return std::make_pair(
pos->latency,
pos->mode);
83 int differentLatenciesNum = 0;
86 if (it->latency != (it + 1)->latency) {
87 ++differentLatenciesNum;
90 if (differentLatenciesNum == 0) {
100 int differentModesNum = 0;
103 if (it->mode != (it + 1)->mode) {
107 if (differentModesNum == 0) {
115 allModesVector.push_back(it->mode);
118 sort(allModesVector.begin(), allModesVector.end());
119 allModesVector.erase(
unique(allModesVector.begin(), allModesVector.end()), allModesVector.end());
131 bool allInPeakMode =
true;
132 bool allInDecoMode =
true;
133 std::vector<uint16_t> allModesVector;
135 std::vector<uint16_t>::const_iterator it = allModesVector.begin();
136 if (allModesVector.size() == 1 && allModesVector[0] == 0)
137 allInPeakMode =
false;
139 for (; it != allModesVector.end(); ++it) {
143 allInDecoMode =
false;
145 allInPeakMode =
false;
158 allLatenciesVector.push_back(it->latency);
161 sort(allLatenciesVector.begin(), allLatenciesVector.end());
162 allLatenciesVector.erase(
unique(allLatenciesVector.begin(), allLatenciesVector.end()), allLatenciesVector.end());
176 ss <<
"SingleReadOut = PEAK" << std::endl;
178 ss <<
"SingleReadOut = DECO" << std::endl;
180 ss <<
"SingleReadOut = MIXED" << std::endl;
184 ss <<
"All the Tracker has the same latency = " << lat << std::endl;
186 std::vector<uint16_t> allLatenciesVector;
188 if (allLatenciesVector.size() > 1) {
189 ss <<
"There is more than one latency value in the Tracker" << std::endl;
191 ss <<
"Latency value is " << lat <<
" that means invalid" << std::endl;
194 ss <<
"Total number of ranges = " <<
latencies_.size() << std::endl;
199 ss <<
"List of all the latencies and modes for the " <<
latencies_.size() <<
" ranges in the object:" << std::endl;
201 int detId = it->detIdAndApv >> 3;
202 int apv = it->detIdAndApv & 7;
203 ss <<
"for detId = " << detId <<
" and apv pair = " << apv <<
" latency = " <<
int(it->latency)
204 <<
" and mode = " <<
int(it->mode) << std::endl;