310 map<std::string, pair<double, double> > resultsMap;
311 vector<pair<double, double> > vertexResults;
319 resultsMap[itBS->first] = pair<double, double>(itBS->second.x0(), itBS->second.x0Error());
320 }
else if (*itV ==
"y") {
321 resultsMap[itBS->first] = pair<double, double>(itBS->second.y0(), itBS->second.y0Error());
322 }
else if (*itV ==
"z") {
323 resultsMap[itBS->first] = pair<double, double>(itBS->second.z0(), itBS->second.z0Error());
324 }
else if (*itV ==
"sigmaX") {
325 resultsMap[itBS->first] = pair<double, double>(itBS->second.BeamWidthX(), itBS->second.BeamWidthXError());
326 }
else if (*itV ==
"sigmaY") {
327 resultsMap[itBS->first] = pair<double, double>(itBS->second.BeamWidthY(), itBS->second.BeamWidthYError());
328 }
else if (*itV ==
"sigmaZ") {
329 resultsMap[itBS->first] = pair<double, double>(itBS->second.sigmaZ(), itBS->second.sigmaZ0Error());
331 LogInfo(
"AlcaBeamMonitor") <<
"The histosMap_ has been built with the name " << *itV
332 <<
" that I can't recognize!";
337 vertexResults.clear();
338 for (vector<VertexCollection>::iterator itPV =
vertices_.begin(); itPV !=
vertices_.end(); itPV++) {
339 if (!itPV->empty()) {
340 for (VertexCollection::const_iterator
pv = itPV->begin();
pv != itPV->end();
pv++) {
341 if (
pv->isFake() ||
pv->tracksSize() < 10)
344 vertexResults.push_back(pair<double, double>(
pv->x(),
pv->xError()));
345 }
else if (*itV ==
"y") {
346 vertexResults.push_back(pair<double, double>(
pv->y(),
pv->yError()));
347 }
else if (*itV ==
"z") {
348 vertexResults.push_back(pair<double, double>(
pv->z(),
pv->zError()));
349 }
else if (*itV !=
"sigmaX" && *itV !=
"sigmaY" && *itV !=
"sigmaZ") {
350 LogInfo(
"AlcaBeamMonitor") <<
"The histosMap_ has been built with the name " << *itV
351 <<
" that I can't recognize!";
378 if (itM->first ==
"run" && (
histo =
histosMap_[*itV][itM->first][itM->second]) ==
nullptr) {
380 }
else if (itM->first !=
"run") {
383 if (itM->second ==
"Coordinate") {
387 }
else if (itM->second ==
"PrimaryVertex fit-DataBase") {
388 if (resultsMap.find(
"PV") != resultsMap.end() && resultsMap.find(
"DB") != resultsMap.end()) {
391 }
else if (itM->second ==
"PrimaryVertex fit-BeamFit") {
392 if (resultsMap.find(
"PV") != resultsMap.end() && resultsMap.find(
"BF") != resultsMap.end()) {
395 }
else if (itM->second ==
"PrimaryVertex fit-Scalers") {
396 if (resultsMap.find(
"PV") != resultsMap.end() && resultsMap.find(
"SC") != resultsMap.end()) {
399 }
else if (itM->second ==
"PrimaryVertex-DataBase") {
400 if (resultsMap.find(
"PV") != resultsMap.end() && resultsMap.find(
"DB") != resultsMap.end()) {
401 for (vector<pair<double, double> >::iterator itPV = vertexResults.begin(); itPV != vertexResults.end();
403 histo->Fill(itPV->first - resultsMap[
"DB"].first);
406 }
else if (itM->second ==
"PrimaryVertex-BeamFit") {
407 if (resultsMap.find(
"PV") != resultsMap.end() && resultsMap.find(
"BF") != resultsMap.end()) {
408 for (vector<pair<double, double> >::iterator itPV = vertexResults.begin(); itPV != vertexResults.end();
410 histo->Fill(itPV->first - resultsMap[
"BF"].first);
413 }
else if (itM->second ==
"PrimaryVertex-Scalers") {
414 if (resultsMap.find(
"PV") != resultsMap.end() && resultsMap.find(
"SC") != resultsMap.end()) {
415 for (vector<pair<double, double> >::iterator itPV = vertexResults.begin(); itPV != vertexResults.end();
417 histo->Fill(itPV->first - resultsMap[
"SC"].first);
420 }
else if (itM->second ==
"Lumibased BeamSpotFit") {
421 if (resultsMap.find(
"BF") != resultsMap.end()) {
426 }
else if (itM->second ==
"Lumibased PrimaryVertex") {
427 if (resultsMap.find(
"PV") != resultsMap.end()) {
432 }
else if (itM->second ==
"Lumibased DataBase") {
433 if (resultsMap.find(
"DB") != resultsMap.end()) {
438 }
else if (itM->second ==
"Lumibased Scalers") {
439 if (resultsMap.find(
"SC") != resultsMap.end()) {
444 }
else if (itM->second ==
"Lumibased PrimaryVertex-DataBase fit") {
445 if (resultsMap.find(
"PV") != resultsMap.end() && resultsMap.find(
"DB") != resultsMap.end()) {
452 }
else if (itM->second ==
"Lumibased PrimaryVertex-Scalers fit") {
453 if (resultsMap.find(
"PV") != resultsMap.end() && resultsMap.find(
"SC") != resultsMap.end()) {
460 }
else if (itM->second ==
"Lumibased Scalers-DataBase fit") {
461 if (resultsMap.find(
"SC") != resultsMap.end() && resultsMap.find(
"DB") != resultsMap.end()) {
468 }
else if (itM->second ==
"Lumibased PrimaryVertex-DataBase") {
469 if (resultsMap.find(
"DB") != resultsMap.end() && !vertexResults.empty()) {
470 for (vector<pair<double, double> >::iterator itPV = vertexResults.begin(); itPV != vertexResults.end();
489 }
else if (itM->second ==
"Lumibased PrimaryVertex-Scalers") {
490 if (resultsMap.find(
"SC") != resultsMap.end() && !vertexResults.empty()) {
491 for (vector<pair<double, double> >::iterator itPV = vertexResults.begin(); itPV != vertexResults.end();
517 LogInfo(
"AlcaBeamMonitor") <<
"The histosMap_ have a histogram named " << itM->second
518 <<
" that I can't recognize in this loop!";