11 if (
detId > 536870911) {
12 std::stringstream
error;
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;
74 return std::make_pair(255, 0);
76 return std::make_pair(
pos->latency,
pos->mode);
86 int differentLatenciesNum = 0;
89 if (
it->latency != (
it + 1)->latency) {
90 ++differentLatenciesNum;
93 if (differentLatenciesNum == 0) {
106 int differentModesNum = 0;
109 if (
it->mode != (
it + 1)->mode) {
113 if (differentModesNum == 0) {
121 allModesVector.push_back(
it->mode);
124 sort(allModesVector.begin(), allModesVector.end());
125 allModesVector.erase(
unique(allModesVector.begin(), allModesVector.end()), allModesVector.end());
137 bool allInPeakMode =
true;
138 bool allInDecoMode =
true;
139 std::vector<uint16_t> allModesVector;
141 std::vector<uint16_t>::const_iterator
it = allModesVector.begin();
142 if (allModesVector.size() == 1 && allModesVector[0] == 0)
143 allInPeakMode =
false;
145 for (;
it != allModesVector.end(); ++
it) {
149 allInDecoMode =
false;
151 allInPeakMode =
false;
164 allLatenciesVector.push_back(
it->latency);
167 sort(allLatenciesVector.begin(), allLatenciesVector.end());
168 allLatenciesVector.erase(
unique(allLatenciesVector.begin(), allLatenciesVector.end()), allLatenciesVector.end());
182 ss <<
"SingleReadOut = PEAK" << std::endl;
184 ss <<
"SingleReadOut = DECO" << std::endl;
186 ss <<
"SingleReadOut = MIXED" << std::endl;
190 ss <<
"All the Tracker has the same latency = " <<
lat << std::endl;
192 std::vector<uint16_t> allLatenciesVector;
194 if (allLatenciesVector.size() > 1) {
195 ss <<
"There is more than one latency value in the Tracker" << std::endl;
197 ss <<
"Latency value is " <<
lat <<
" that means invalid" << std::endl;
200 ss <<
"Total number of ranges = " <<
latencies_.size() << std::endl;
205 ss <<
"List of all the latencies and modes for the " <<
latencies_.size() <<
" ranges in the object:" << std::endl;
207 int detId =
it->detIdAndApv >> 3;
208 int apv =
it->detIdAndApv & 7;
209 ss <<
"for detId = " <<
detId <<
" and apv pair = " << apv <<
" latency = " <<
int(
it->latency)
210 <<
" and mode = " <<
int(
it->mode) << std::endl;
bool put(const uint32_t detId, const uint16_t apv, const uint16_t latency, const uint16_t mode)
std::vector< Latency > allUniqueLatencyAndModes()
void printDebug(std::stringstream &ss, const TrackerTopology *trackerTopo) const
Prints the full list of all ranges and corresponding values of latency and mode.
void allLatencies(std::vector< uint16_t > &allLatenciesVector) const
Fills the passed vector with all the possible latencies in the Tracker.
Log< level::Error, false > LogError
uint16_t mode(const uint32_t detId, const uint16_t apv) const
const latConstIt position(const uint32_t detId, const uint16_t apv) const
Used to compute the position with the lower_bound binary search.
std::vector< Latency >::iterator latIt
def unique(seq, keepstr=True)
int16_t singleReadOutMode() const
uint16_t singleMode() const
std::vector< Latency > latencies_
uint16_t singleLatency() const
If all the latency values stored are equal return that value, otherwise return -1.
uint16_t latency(const uint32_t detId, const uint16_t apv) const
std::pair< uint16_t, uint16_t > latencyAndMode(const uint32_t detId, const uint16_t apv) const
std::vector< Latency >::const_iterator latConstIt
void printSummary(std::stringstream &ss, const TrackerTopology *trackerTopo) const
Prints the number of ranges as well as the value of singleLatency and singleMode. ...
void allModes(std::vector< uint16_t > &allModesVector) const
Fills the passed vector with all the possible modes in the Tracker.