12 return o1.first < o2.first;
15 return o1.second.sum() < o2.second.sum();
27 for (std::vector<ChamberAndPartition>::const_iterator it = theChamberAndPartitions.begin();
28 it != theChamberAndPartitions.end();
33 theChamberAndPartitions.push_back(
part);
38 for (std::vector<LinkBoardElectronicIndex>::const_iterator it = theElePaths.begin(); it != theElePaths.end(); ++it) {
43 theElePaths.push_back(ele);
48 for (
unsigned int i = 0;
i < 8; ++
i)
56 theCounts[bxDiff] = 1;
65 for (
unsigned int i = 0;
i < 8; ++
i)
72 for (
unsigned int i = 0;
i < 8; ++
i)
79 for (
unsigned int i = 0;
i < 8; ++
i)
85 unsigned int sum = mom0();
86 return sum == 0 ? 0. : mom1() / sum;
94 double mean = mom1() / sum;
95 for (
int i = 0;
i < 8; ++
i)
102 std::ostringstream
str;
103 str <<
" mean: " << std::setw(8) <<
mean();
104 str <<
" rms: " << std::setw(8) <<
rms();
106 for (
int i = 0;
i < 8; ++
i)
107 str <<
" " << std::setw(4) << theCounts[
i];
112 for (
unsigned int idx = 0;
idx < 8; ++
idx)
113 if (theCounts[
idx] !=
o.theCounts[
idx])
122 for (
unsigned int i4 = 0; i4 <=
MAXLBINDEX; ++i4) {
134 std::vector<const DccSpec*> dccs = theCabling->
dccList();
135 for (std::vector<const DccSpec*>::const_iterator it1 = dccs.begin(); it1 != dccs.end(); ++it1) {
136 const std::vector<TriggerBoardSpec>& rmbs = (*it1)->triggerBoards();
137 for (std::vector<TriggerBoardSpec>::const_iterator it2 = rmbs.begin(); it2 != rmbs.end(); ++it2) {
138 const std::vector<LinkConnSpec>&
links = it2->linkConns();
139 for (std::vector<LinkConnSpec>::const_iterator it3 =
links.begin(); it3 !=
links.end(); ++it3) {
140 const std::vector<LinkBoardSpec>& lbs = it3->linkBoards();
141 for (std::vector<LinkBoardSpec>::const_iterator it4 = lbs.begin(); it4 != lbs.end(); ++it4) {
143 (*it1)->id(), it2->
dccInputChannelNum(), it3->triggerBoardInputNumber(), it4->linkBoardNumInLink()};
144 LinkBoard linkBoard(it4->linkBoardName());
146 std::vector<BoardAndCounts>::iterator candid_place =
148 if (candid_place !=
theLinkStatMap.end() && candid.first == candid_place->first) {
149 candid_place->first.add(ele);
152 candid_place->first.add(ele);
153 if (addChamberInfo) {
154 const std::vector<FebConnectorSpec>& febs = it4->febs();
155 for (std::vector<FebConnectorSpec>::const_iterator it5 = febs.begin(); it5 != febs.end(); ++it5) {
156 std::string chamberName = it5->chamber().chamberLocationName();
159 candid_place->first.add(chamberAndPartition);
169 for (std::vector<LinkBoardElectronicIndex>::const_iterator it =
paths.begin(); it !=
paths.end(); ++it) {
178 std::vector<ShortLinkInfo> slis;
179 for (RPCRawSynchro::ProdItem::const_iterator it = vItem.begin(); it != vItem.end(); ++it) {
181 unsigned int bxDiff = it->second;
183 path.tbLinkInputNum * 10 +
path.lbNumInLink;
191 std::vector<unsigned int>&
v = slis[
hits[
idx] - 1].hit_paths;
192 std::vector<unsigned int>::iterator iv =
lower_bound(
v.begin(),
v.end(), eleCode);
193 if (iv ==
v.end() || (*iv) != eleCode)
194 v.insert(iv, eleCode);
196 slis[
hits[
idx] - 1].counts.set(bxDiff);
199 for (std::vector<ShortLinkInfo>::const_iterator ic = slis.begin(); ic != slis.end(); ++ic) {
205 if (
theLinkStatMap[ic->idx].first.paths().size() != ic->hit_paths.size()) {
206 const std::vector<LinkBoardElectronicIndex>&
paths =
theLinkStatMap[ic->idx].first.paths();
213 std::ostringstream
str;
215 stable_sort(sortedStat.begin(), sortedStat.end(),
LessCountSum());
216 for (
unsigned int idx = 0;
idx < sortedStat.size(); ++
idx) {
221 str << std::setw(20) << board.
name();
228 const std::vector<LinkBoardElectronicIndex>&
paths = board.
paths();
229 for (std::vector<LinkBoardElectronicIndex>::const_iterator ip =
paths.begin(); ip !=
paths.end(); ++ip)
230 str <<
"{" << ip->dccId <<
"," << std::setw(2) << ip->dccInputChannelNum <<
"," << std::setw(2)
231 << ip->tbLinkInputNum <<
"," << ip->lbNumInLink <<
"}";
234 std::map<std::string, std::vector<std::string> > chMap;
235 const std::vector<LinkBoard::ChamberAndPartition>& chamberAndPartitions = board.
chamberAndPartitions();
236 for (std::vector<LinkBoard::ChamberAndPartition>::const_iterator it = chamberAndPartitions.begin();
237 it != chamberAndPartitions.end();
239 std::vector<std::string>&
partitions = chMap[it->first];
243 str <<
" chambers: ";
244 for (
std::map<
std::string, std::vector<std::string> >::const_iterator im = chMap.begin(); im != chMap.end(); ++im) {
245 str << im->first <<
"(";
246 for (std::vector<std::string>::const_iterator ip = im->second.begin(); ip != im->second.end(); ++ip) {
248 if ((ip + 1) != (im->second.end()))
257 LogTrace(
"RPCLinkSynchroStat") <<
"RPCLinkSynchroStat::dumpDelays, SIZE OF LINKS IS: " <<
theLinkStatMap.size()