8 : onlineDbConnectionString(
pset.getParameter<
std::
string>(
"onlineDB")),
11 lastValueFileName(
pset.getParameter<
std::
string>(
"lastValueFile")),
12 fromFile(
pset.getParameter<
bool>(
"lastValueFromFile")),
13 psuDetIdMapFile_(
pset.getParameter<
std::
string>(
"PsuDetIdMapFile")),
14 debug_(
pset.getParameter<
bool>(
"debugModeOn")),
19 deltaTmin_(
pset.getParameter<uint32_t>(
"DeltaTmin")),
20 maxIOVlength_(
pset.getParameter<uint32_t>(
"MaxIOVlength")),
21 detIdListFile_(
pset.getParameter<
std::
string>(
"DetIdListFile")),
22 excludedDetIdListFile_(
pset.getParameter<
std::
string>(
"ExcludedDetIdListFile")),
23 highVoltageOnThreshold_(
pset.getParameter<double>(
"HighVoltageOnThreshold")) {
27 edm::LogError(
"SiStripDetVOffBuilder") <<
"[SiStripDetVOffBuilder::SiStripDetVOffBuilder] constructor" << endl;
51 <<
"[SiStripDetVOffBuilder::SiStripDetVOffBuilder] DB name has not been set properly ... Returning ...";
56 edm::LogError(
"SiStripDetVOffBuilder") <<
"[SiStripDetVOffBuilder::SiStripDetVOffBuilder] File expected for "
57 "lastValue table, but filename not specified ... Returning ...";
63 ss <<
"[SiStripDetVOffBuilder::SiStripDetVOffBuilder]\n"
67 <<
" Table to be queried: " <<
whichTable <<
"\n"
89 edm::LogError(
"SiStripDetVOffBuilder") <<
"[SiStripDetVOffBuilder::" << __func__ <<
"]: destructing ...";
104 edm::LogError(
"SiStripDetVOffBuilder") <<
"[SiStripDetVOffBuilder::BuildDetVOff]: Query type is " <<
whichTable
109 <<
"[SiStripDetVOffBuilder::BuildDetVOff]: Use file? " << ((
fromFile) ?
"TRUE" :
"FALSE");
114 <<
"[SiStripDetVOffBuilder::BuildDetVOff]: retrieved last time stamp from DB: " <<
lastStoredCondObj.second
167 for (
unsigned int i = 0;
i < dStruct.
detidV.size();
i++) {
170 std::vector<uint32_t>* detids = &(dStruct.
detidV[
i].first);
189 if (iovtime != saveIovTime) {
199 const std::map<uint32_t, SiStripDetInfoFileReader::DetInfo>& detInfos =
reader.getAllData();
208 std::vector<std::pair<uint32_t, std::string> > excludedDetIdMap;
212 for (std::map<uint32_t, SiStripDetInfoFileReader::DetInfo>::const_iterator it = detInfos.begin();
213 it != detInfos.end();
215 std::vector<std::pair<uint32_t, std::string> >::const_iterator exclIt = excludedDetIdMap.begin();
216 bool excluded =
false;
217 for (; exclIt != excludedDetIdMap.end(); ++exclIt) {
218 if (it->first == exclIt->first) {
224 modV->
put(it->first, 1, 1);
238 std::vector<uint32_t> beforeV;
250 for (
unsigned int j = 0;
j < detids->size();
j++) {
252 cout <<
"at time = " << iovtime <<
" detid[" <<
j <<
"] = " << (*detids)[
j] <<
" has hv = " << hvlv.first
253 <<
" and lv = " << hvlv.second << endl;
254 modV->
put((*detids)[
j], hvlv.first, hvlv.second);
258 unsigned int numAdded = 0, numRemoved = 0;
259 if (iovtime == saveIovTime) {
261 numAdded = oldStats[1];
262 numRemoved = oldStats[2];
264 std::vector<uint32_t> afterV;
267 if ((afterV.size() - beforeV.size()) > 0) {
268 numAdded += afterV.size() - beforeV.size();
269 }
else if ((beforeV.size() - afterV.size()) > 0) {
270 numRemoved += beforeV.size() - afterV.size();
274 if (iovtime != saveIovTime) {
279 if (
modulesOff.empty() || !(*modV == *testV)) {
280 modulesOff.push_back(std::make_pair(modV, iovtime));
282 saveIovTime = iovtime;
314 std::vector<uint32_t> finalids;
316 std::cout <<
"Index = " <<
i <<
" Size of DetIds vector = " << finalids.size() << std::endl;
318 for (
unsigned int j = 0;
j < finalids.size();
j++) {
319 std::cout <<
"detid = " << finalids[
j] <<
" LV off = " << (
modulesOff[
i].first)->IsModuleLVOff(finalids[
j])
320 <<
" HV off = " << (
modulesOff[
i].first)->IsModuleHVOff(finalids[
j]) << std::endl;
327 const coral::TimeStamp& changeDate,
328 const std::vector<uint32_t>& settingID,
329 const std::vector<coral::TimeStamp>& settingDate) {
332 std::vector<int> locations;
333 for (
unsigned int i = 0;
i < settingID.size();
i++) {
334 if (settingID[
i] ==
id) {
335 locations.push_back((
int)
i);
340 if (locations.empty()) {
342 }
else if (locations.size() == 1) {
343 setting = locations[0];
348 for (
unsigned int j = 0;
j < locations.size();
j++) {
349 #ifdef USING_NEW_CORAL
350 const boost::posix_time::ptime& testSec = changeDate.time();
351 const boost::posix_time::ptime& limitSec = settingDate[(
unsigned int)locations[
j]].
time();
353 long testSec = changeDate.time().ns();
354 long limitSec = settingDate[(
unsigned int)locations[
j]].
time().ns();
356 if (testSec >= limitSec) {
357 setting = locations[
j];
365 const coral::TimeStamp& changeDate,
366 const std::vector<std::string>& settingDpname,
367 const std::vector<coral::TimeStamp>& settingDate) {
370 std::vector<int> locations;
371 for (
unsigned int i = 0;
i < settingDpname.size();
i++) {
372 if (settingDpname[
i] == dpname) {
373 locations.push_back((
int)
i);
378 if (locations.empty()) {
380 }
else if (locations.size() == 1) {
381 setting = locations[0];
386 for (
unsigned int j = 0;
j < locations.size();
j++) {
387 #ifdef USING_NEW_CORAL
388 const boost::posix_time::ptime& testSec = changeDate.time();
389 const boost::posix_time::ptime& limitSec = settingDate[(
unsigned int)locations[
j]].
time();
391 long testSec = changeDate.time().ns();
392 long limitSec = settingDate[(
unsigned int)locations[
j]].
time().ns();
394 if (testSec >= limitSec) {
395 setting = locations[
j];
403 std::vector<float>& vmonValues,
404 std::vector<coral::TimeStamp>& dateChange) {
406 if (lastValueFile.bad()) {
408 <<
"[SiStripDetVOffBuilder::" << __func__ <<
"]: last Value file does not exist!";
415 std::vector<std::string> changeDates;
422 while (std::getline(lastValueFile,
line)) {
423 std::istringstream
ss(
line);
427 ss >> std::skipws >> dpid >> vmon >> changeDate;
428 dpIDs.push_back(dpid);
429 vmonValues.push_back(vmon);
430 changeDates.push_back(changeDate);
432 lastValueFile.close();
435 for (
unsigned int i = 0;
i < changeDates.size();
i++) {
437 int year = atoi(
part.c_str());
440 part = changeDates[
i].substr(5, 2);
441 int month = atoi(
part.c_str());
444 part = changeDates[
i].substr(8, 2);
448 part = changeDates[
i].substr(11, 2);
449 int hour = atoi(
part.c_str());
452 part = changeDates[
i].substr(14, 2);
453 int minute = atoi(
part.c_str());
456 part = changeDates[
i].substr(17, 2);
460 coral::TimeStamp
date(year, month,
day, hour, minute,
second, 0);
461 dateChange.push_back(
date);
464 if (changeDates.size() != dateChange.size()) {
465 edm::LogError(
"SiStripDetVOffBuilder") <<
"[SiStripDetVOffBuilder::" << __func__ <<
"]: date conversion failed!!";
487 unsigned long long iovSec = iovTime >> 32;
488 uint32_t iovNanoSec = uint32_t(iovTime);
490 cout <<
"[SiStripDetVOffBuilder::getCoralTime] Converting CondTime into CoralTime: "
491 <<
" condTime = " << iovSec <<
" - " << iovNanoSec <<
" getCondTime(coralTime) = " << (testTime >> 32) <<
" - "
492 << (testTime & 0xFFFFFFFF) << endl;
499 std::sort(vec.begin(), vec.end());
500 std::vector<uint32_t>::iterator it =
std::unique(vec.begin(), vec.end());
501 vec.resize(it - vec.begin());
513 std::cout <<
"latestDate: condTime = " << (latestDate >> 32) <<
" - "
514 << (latestDate & 0xFFFFFFFF)
519 for (
unsigned int i = 1;
i < coralDate.size();
i++) {
521 if (testDate > latestDate) {
522 latestDate = testDate;
529 std::vector<std::pair<SiStripDetVOff*, cond::Time_t> >::iterator& initialIt,
530 std::vector<std::pair<SiStripDetVOff*, cond::Time_t> >& resultVec,
535 if (
distance(resultVec.begin(), initialIt) == 0) {
539 if (
debug_ && (it->first->getLVoffCounts() - initialIt->first->getLVoffCounts() == 0) &&
540 (it->first->getHVoffCounts() - initialIt->first->getHVoffCounts() == 0)) {
541 cout <<
"Same number of LV and HV at start and end of sequence: LV off = " << it->first->getLVoffCounts()
542 <<
" HV off = " << it->first->getHVoffCounts() << endl;
546 if ((it->first->getLVoffCounts() - initialIt->first->getLVoffCounts() > 0) ||
547 (it->first->getHVoffCounts() - initialIt->first->getHVoffCounts() > 0)) {
554 cout <<
"Reducing IOV sequence (going off)" << endl;
557 else if ((it->first->getLVoffCounts() - initialIt->first->getLVoffCounts() <= 0) ||
558 (it->first->getHVoffCounts() - initialIt->first->getHVoffCounts() <= 0)) {
562 cout <<
"Reducing IOV sequence (going on)" << endl;
567 std::vector<std::pair<SiStripDetVOff*, cond::Time_t> >::iterator& initialIt,
568 std::vector<std::pair<SiStripDetVOff*, cond::Time_t> >& resultVec,
570 const unsigned int first) {
572 cout <<
"first (1->means the sequence started at the first timestamp in the query results, 0-> that it did not)= "
574 cout <<
"initial->first (initial SiStripDetVOff object of the IOV sequence)= " << initialIt->first
575 <<
", second (initial timestamp of the IOV sequence) = " << initialIt->second << endl;
576 cout <<
"last (0->means that the sequence is not ending with the last item in the query results, 1-> that it "
581 resultVec.erase(initialIt +
first, it + 1);
583 it = resultVec.end() - 2;
585 it = resultVec.erase(initialIt +
first, it);
592 std::vector<std::pair<SiStripDetVOff*, cond::Time_t> >::iterator initialIt;
595 int resultsIndex = 0;
597 if (resultVecSize > 1) {
598 std::vector<std::pair<SiStripDetVOff*, cond::Time_t> >::iterator it =
modulesOff.begin();
599 for (; it !=
modulesOff.end() - 1; ++it, ++resultsIndex) {
600 unsigned long long deltaT = ((it + 1)->
second - it->second) >> 32;
601 unsigned long long deltaTsequence = 0;
603 deltaTsequence = ((it + 1)->
second - initialIt->second) >> 32;
606 if ((deltaT < deltaTmin) && ((
count == 0) || (deltaTsequence < maxIOVlength))) {
615 else if (
count > 1) {
624 if (resultsIndex == resultVecSize - 2 &&
count != 0) {
662 std::vector<coral::TimeStamp> settingDate;
663 std::vector<float> settingValue;
664 std::vector<std::string> settingDpname;
665 std::vector<uint32_t> settingDpid;
667 LogDebug(
"SiStripDetVOffBuilder") <<
"[SiStripDetVOffBuilder::BuildDetVOff]: Channel settings retrieved";
668 LogDebug(
"SiStripDetVOffBuilder") <<
"[SiStripDetVOffBuilder::BuildDetVOff]: Number of PSU channels: "
669 << settingDpname.size();
672 std::stringstream
ss;
673 for (
unsigned int j = 0;
j < tStruct.
dpname.size();
j++) {
684 ss <<
"Channel = " << tStruct.
dpname[
j] << std::endl;
688 <<
"[SiStripDetVOffBuilder::BuildDetVOff]: Number of channels with no setting information " <<
missing;
689 LogDebug(
"SiStripDetVOffBuilder") <<
"[SiStripDetVOffBuilder::BuildDetVOff]: Number of entries in dpname vector "
697 <<
"[SiStripDetVOffBuilder::BuildDetVOff]: File access complete \n\t Number of values read from file: "
698 << tStruct.
dpid.size();
701 std::vector<coral::TimeStamp> settingDate;
702 std::vector<float> settingValue;
703 std::vector<std::string> settingDpname;
704 std::vector<uint32_t> settingDpid;
707 LogDebug(
"SiStripDetVOffBuilder") <<
"[SiStripDetVOffBuilder::BuildDetVOff]: Channel settings retrieved";
708 LogDebug(
"SiStripDetVOffBuilder") <<
"[SiStripDetVOffBuilder::BuildDetVOff]: Number of PSU channels: "
709 << settingDpname.size();
712 std::stringstream
ss;
716 for (
unsigned int j = 0;
j < tStruct.
dpid.size();
j++) {
724 tStruct.
dpname[
j] = settingDpname[setting];
729 ss <<
"DP ID = " << tStruct.
dpid[
j] << std::endl;
732 LogDebug(
"SiStripDetVOffBuilder") <<
"Number of missing psu channels = " <<
missing << std::endl;
733 LogDebug(
"SiStripDetVOffBuilder") <<
"IDs are: = " <<
ss.str();
738 ss << comment << (condTime >> 32) <<
" - " << (condTime & 0xFFFFFFFF) << std::endl;
744 ss <<
"Starting from IOV time in the database : year = " << coralTime.year() <<
", month = " << coralTime.month()
745 <<
", day = " << coralTime.day() <<
", hour = " << coralTime.hour() <<
", minute = " << coralTime.minute()
746 <<
", second = " << coralTime.second() <<
", nanosecond = " << coralTime.nanosecond() << std::endl;
772 std::cout <<
"PLEASE provide the name of a valid PSUDetIDMapFile in the cfg: currently still necessary to have a "
773 "file, soon will access the info straight from the DB!"
779 LogTrace(
"SiStripDetVOffBuilder") <<
"[SiStripDetVOffBuilder::BuildDetVOff] PSU(Channel)-detID map(s) built";
787 unsigned int ch0bad = 0, ch1bad = 0, ch2bad = 0, ch3bad = 0;
788 std::vector<unsigned int> numLvBad, numHvBad;
793 std::map<std::string, bool> UnmappedState, CrosstalkingState;
795 std::map<std::string, std::vector<uint32_t> > UnmappedPSUs = map_.
getHVUnmappedMap();
797 if (
FileExists(
"HVUnmappedChannelState.dat")) {
798 std::cout <<
"File HVUnmappedChannelState.dat exists!" << std::endl;
799 std::ifstream ifs(
"HVUnmappedChannelState.dat");
801 while (getline(ifs,
line)) {
810 std::string PSU = PSUChannel.substr(0, PSUChannel.size() - 10);
812 std::map<std::string, std::vector<uint32_t> >::iterator iter = UnmappedPSUs.find(PSU);
813 if (iter != UnmappedPSUs.end()) {
814 UnmappedState[PSUChannel] = HVStatus;
816 std::cout <<
"WARNING!!! There are channels in the local file with the channel status for HVUnmapped "
817 "channels, that ARE NOT CONSIDERED AS UNMAPPED in the current map!"
824 bool MissingChannels =
false;
825 for (
std::map<
std::string, vector<uint32_t> >::iterator it = UnmappedPSUs.begin(); it != UnmappedPSUs.end(); it++) {
828 std::map<std::string, bool>::iterator iter = UnmappedState.find(chan002);
829 if (iter == UnmappedState.end()) {
830 std::cout <<
"ERROR! The local file with the channel status for HVUnmapped channels IS MISSING one of the "
831 "following unmapped channel voltage status information:"
834 MissingChannels =
true;
836 iter = UnmappedState.find(chan003);
837 if (iter == UnmappedState.end()) {
838 std::cout <<
"ERROR! The local file with the channel status for HVUnmapped channels IS MISSING one of the "
839 "following unmapped channel voltage status information:"
842 MissingChannels =
true;
846 if (MissingChannels) {
848 <<
"Exiting now... please check the local HVUnmappedChannelState.dat and the mapfile you provided ("
854 for (
std::map<
std::string, vector<uint32_t> >::iterator it = UnmappedPSUs.begin(); it != UnmappedPSUs.end(); it++) {
857 UnmappedState[chan002] =
false;
858 UnmappedState[chan003] =
false;
864 if (
FileExists(
"HVCrosstalkingChannelState.dat")) {
865 std::cout <<
"File HVCrosstalkingChannelState.dat exists!" << std::endl;
866 std::ifstream ifs(
"HVCrosstalkingChannelState.dat");
868 while (getline(ifs,
line)) {
877 std::string PSU = PSUChannel.substr(0, PSUChannel.size() - 10);
879 std::map<std::string, std::vector<uint32_t> >::iterator iter = CrosstalkingPSUs.find(PSU);
880 if (iter != CrosstalkingPSUs.end()) {
881 CrosstalkingState[PSUChannel] = HVStatus;
883 std::cout <<
"WARNING!!! There are channels in the local file with the channel status for HVUnmapped "
884 "channels, that ARE NOT CONSIDERED AS UNMAPPED in the current map!"
891 bool MissingChannels =
false;
892 for (
std::map<
std::string, vector<uint32_t> >::iterator it = CrosstalkingPSUs.begin(); it != CrosstalkingPSUs.end();
896 std::map<std::string, bool>::iterator iter = CrosstalkingState.find(chan002);
897 if (iter == CrosstalkingState.end()) {
898 std::cout <<
"ERROR! The local file with the channel status for HVCrosstalking channels IS MISSING one of the "
899 "following unmapped channel voltage status information:"
902 MissingChannels =
true;
904 iter = CrosstalkingState.find(chan003);
905 if (iter == CrosstalkingState.end()) {
906 std::cout <<
"ERROR! The local file with the channel status for HVCrosstalking channels IS MISSING one of the "
907 "following unmapped channel voltage status information:"
910 MissingChannels =
true;
914 if (MissingChannels) {
916 <<
"Exiting now... please check the local HVCrosstalkingChannelState.dat and the mapfile you provided ("
922 for (
std::map<
std::string, vector<uint32_t> >::iterator it = CrosstalkingPSUs.begin(); it != CrosstalkingPSUs.end();
926 CrosstalkingState[chan002] =
false;
927 CrosstalkingState[chan003] =
false;
933 std::cout <<
"Printing the UnmappedChannelState initial map:" << std::endl;
934 std::cout <<
"PSUChannel\t\tHVON?(true or false)" << std::endl;
935 for (std::map<std::string, bool>::iterator it = UnmappedState.begin(); it != UnmappedState.end(); it++) {
936 std::cout << it->first <<
"\t\t" << it->second << std::endl;
939 std::cout <<
"Printing the CrosstalkingChannelState initial map:" << std::endl;
940 std::cout <<
"PSUChannel\t\tHVON?(true or false)" << std::endl;
941 for (std::map<std::string, bool>::iterator it = CrosstalkingState.begin(); it != CrosstalkingState.end(); it++) {
942 std::cout << it->first <<
"\t\t" << it->second << std::endl;
951 for (
unsigned int dp = 0;
dp < psuStruct.
dpname.size();
dp++) {
955 if (PSUChannel !=
"UNKNOWN") {
958 PSUChannel.substr(PSUChannel.size() - 10);
959 std::string PSU = PSUChannel.substr(0, PSUChannel.size() - 10);
983 std::vector<uint32_t> ids;
990 std::vector<uint32_t> unmapped_ids, crosstalking_ids;
1012 cout <<
"Corresponding to LV (PSU-)matching detids: " << endl;
1013 for (
unsigned int i_detid = 0; i_detid < ids.size(); i_detid++) {
1014 cout << ids[i_detid] << std::endl;
1017 cout <<
"Corresponding to straight HV matching detids: " << endl;
1018 for (
unsigned int i_detid = 0; i_detid < ids.size(); i_detid++) {
1019 cout << ids[i_detid] << std::endl;
1024 if (!unmapped_ids.empty()) {
1025 cout <<
"Corresponding to HV unmapped (PSU-)matching detids: " << endl;
1026 for (
unsigned int i_detid = 0; i_detid < unmapped_ids.size(); i_detid++) {
1027 cout << unmapped_ids[i_detid] << std::endl;
1030 if (!crosstalking_ids.empty()) {
1031 cout <<
"Corresponding to HV crosstalking (PSU-)matching detids: " << endl;
1032 for (
unsigned int i_detid = 0; i_detid < crosstalking_ids.size(); i_detid++) {
1033 cout << crosstalking_ids[i_detid] << std::endl;
1067 numLvBad.insert(numLvBad.end(), ids.begin(), ids.end());
1070 detIdStruct.
isHV.push_back(0);
1073 detIdStruct.
psuName.push_back(PSUChannel);
1079 if (!ids.empty() || !unmapped_ids.empty() || !crosstalking_ids.empty()) {
1080 if (
Channel ==
"channel002") {
1082 }
else if (
Channel ==
"channel003") {
1087 std::vector<uint32_t> OFFids;
1088 OFFids.insert(OFFids.end(), ids.begin(), ids.end());
1089 OFFids.insert(OFFids.end(), unmapped_ids.begin(), unmapped_ids.end());
1091 if (!crosstalking_ids
1094 CrosstalkingState[PSUChannel] =
false;
1097 if (!CrosstalkingState[PSUChannel.substr(0, PSUChannel.size() - 1) +
"2"] &&
1098 !CrosstalkingState[PSUChannel.substr(0, PSUChannel.size() - 1) +
"3"]) {
1101 crosstalking_ids.begin(),
1102 crosstalking_ids.end());
1104 std::cout <<
"Adding the unmapped detids corresponding to (HV1/2 cross-talking) PSU "
1105 << PSUChannel.substr(0, PSUChannel.size() - 10) <<
" to the list of detids turning OFF"
1113 UnmappedState[PSUChannel] =
false;
1115 if (!OFFids.empty()) {
1130 numHvBad.insert(numHvBad.end(), ids.begin(), ids.end());
1133 detIdStruct.
isHV.push_back(1);
1136 detIdStruct.
psuName.push_back(PSUChannel);
1159 detIdStruct.
isHV.push_back(0);
1162 detIdStruct.
psuName.push_back(PSUChannel);
1168 std::vector<uint32_t> ONids;
1169 ONids.insert(ONids.end(), ids.begin(), ids.end());
1171 ONids.end(), crosstalking_ids.begin(), crosstalking_ids.end());
1176 UnmappedState[PSUChannel] =
true;
1179 if (UnmappedState[PSUChannel.substr(0, PSUChannel.size() - 1) +
"2"] &&
1180 UnmappedState[PSUChannel.substr(0, PSUChannel.size() - 1) +
"3"]) {
1181 ONids.insert(ONids.end(),
1182 unmapped_ids.begin(),
1183 unmapped_ids.end());
1185 std::cout <<
"Adding the detids corresponding to HV-unmapped PSU "
1186 << PSUChannel.substr(0, PSUChannel.size() - 10) <<
" to the list of detids turning ON"
1192 if (!crosstalking_ids
1194 CrosstalkingState[PSUChannel] =
true;
1196 if (!ONids.empty()) {
1211 detIdStruct.
isHV.push_back(1);
1214 detIdStruct.
psuName.push_back(PSUChannel);
1227 std::ofstream ofsUnmapped(
"HVUnmappedChannelState.dat");
1228 for (std::map<std::string, bool>::iterator it = UnmappedState.begin(); it != UnmappedState.end(); it++) {
1229 ofsUnmapped << it->first <<
"\t" << it->second << std::endl;
1231 std::ofstream ofsCrosstalking(
"HVCrosstalkingChannelState.dat");
1232 for (std::map<std::string, bool>::iterator it = CrosstalkingState.begin(); it != CrosstalkingState.end(); it++) {
1233 ofsCrosstalking << it->first <<
"\t" << it->second << std::endl;
1241 std::cout <<
"Number of channels that turned OFF in this O2O interval" << std::endl;
1242 std::cout <<
"Channel000 = " << ch0bad <<
" Channel001 = " << ch1bad << std::endl;
1243 std::cout <<
"Channel002 = " << ch2bad <<
" Channel003 = " << ch3bad << std::endl;
1244 std::cout <<
"Number of LV detIDs that turned OFF in this O2O interval = " << numLvBad.size() << std::endl;
1245 std::cout <<
"Number of HV detIDs that turned OFF in this O2O interval = " << numHvBad.size() << std::endl;
1248 LogTrace(
"SiStripDetVOffBuilder") <<
"[SiStripDetVOffBuilder::" << __func__
1249 <<
"]: Number of PSUs retrieved from DB with map information "
1250 << detIdStruct.
detidV.size();
1251 LogTrace(
"SiStripDetVOffBuilder") <<
"[SiStripDetVOffBuilder::" << __func__
1252 <<
"]: Number of PSUs retrieved from DB with no map information "
1255 unsigned int dupCount = 0;
1256 for (
unsigned int t = 0;
t < numLvBad.size();
t++) {
1257 std::vector<unsigned int>::iterator iter =
std::find(numHvBad.begin(), numHvBad.end(), numLvBad[
t]);
1258 if (iter != numHvBad.end()) {
1263 std::cout <<
"Number of channels for which LV & HV turned OFF in this O2O interval = " << dupCount << std::endl;
1267 std::vector<uint32_t> pStats(3, 0);
1268 pStats.push_back(afterV);
1269 pStats.push_back(numAdded);
1270 pStats.push_back(numRemoved);
1278 int lv_off = -1, hv_off = -1;
1279 if (detIdStruct.
isHV[
i] == 0) {
1282 if (detIdStruct.
isHV[
i] == 1) {
1293 if (iChannel ==
"002" || iChannel ==
"003") {
1294 bool lastStatusOfOtherChannel =
true;
1295 for (
unsigned int j = 0;
j <
i;
j++) {
1298 if (iPsu == jPsu && iChannel != jChannel && (jChannel ==
"002" || jChannel ==
"003")) {
1301 <<
" with status = " << detIdStruct.
StatusGood[
i] <<
" and psu[" <<
j
1302 <<
"] = " << detIdStruct.
psuName[
j] <<
" with status " << detIdStruct.
StatusGood[
j] << endl;
1303 lastStatusOfOtherChannel = detIdStruct.
StatusGood[
j];
1306 if (detIdStruct.
StatusGood[
i] != lastStatusOfOtherChannel) {
1308 cout <<
"turning off hv" << endl;
1318 return make_pair(hv_off, lv_off);