322 auto beamSpotInfo = luminosityBlockCache(iLumi.
index());
332 beamSpotInfo->beamSpotMap_[
"PV"] =
thePVFitter_->getBeamSpot();
337 map<std::string, pair<double, double> > resultsMap;
338 vector<pair<double, double> > vertexResults;
342 for (BeamSpotContainer::iterator itBS = beamSpotInfo->beamSpotMap_.begin();
343 itBS != beamSpotInfo->beamSpotMap_.end();
347 resultsMap[itBS->first] = pair<double, double>(itBS->second.x0(), itBS->second.x0Error());
348 }
else if (*itV ==
"y") {
349 resultsMap[itBS->first] = pair<double, double>(itBS->second.y0(), itBS->second.y0Error());
350 }
else if (*itV ==
"z") {
351 resultsMap[itBS->first] = pair<double, double>(itBS->second.z0(), itBS->second.z0Error());
352 }
else if (*itV ==
"sigmaX") {
353 resultsMap[itBS->first] = pair<double, double>(itBS->second.BeamWidthX(), itBS->second.BeamWidthXError());
354 }
else if (*itV ==
"sigmaY") {
355 resultsMap[itBS->first] = pair<double, double>(itBS->second.BeamWidthY(), itBS->second.BeamWidthYError());
356 }
else if (*itV ==
"sigmaZ") {
357 resultsMap[itBS->first] = pair<double, double>(itBS->second.sigmaZ(), itBS->second.sigmaZ0Error());
359 LogInfo(
"AlcaBeamMonitor") <<
"The histosMap_ has been built with the name " << *itV
360 <<
" that I can't recognize!";
365 vertexResults.clear();
366 for (vector<VertexCollection>::iterator itPV = beamSpotInfo->vertices_.begin();
367 itPV != beamSpotInfo->vertices_.end();
369 if (!itPV->empty()) {
370 for (VertexCollection::const_iterator
pv = itPV->begin();
pv != itPV->end();
pv++) {
371 if (
pv->isFake() ||
pv->tracksSize() < 10)
374 vertexResults.push_back(pair<double, double>(
pv->x(),
pv->xError()));
375 }
else if (*itV ==
"y") {
376 vertexResults.push_back(pair<double, double>(
pv->y(),
pv->yError()));
377 }
else if (*itV ==
"z") {
378 vertexResults.push_back(pair<double, double>(
pv->z(),
pv->zError()));
379 }
else if (*itV !=
"sigmaX" && *itV !=
"sigmaY" && *itV !=
"sigmaZ") {
380 LogInfo(
"AlcaBeamMonitor") <<
"The histosMap_ has been built with the name " << *itV
381 <<
" that I can't recognize!";
392 if (itM->second ==
"Coordinate") {
393 if (beamSpotInfo->beamSpotMap_.find(
"DB") != beamSpotInfo->beamSpotMap_.end()) {
396 }
else if (itM->second ==
"PrimaryVertex fit-DataBase") {
397 if (resultsMap.find(
"PV") != resultsMap.end() && resultsMap.find(
"DB") != resultsMap.end()) {
400 }
else if (itM->second ==
"PrimaryVertex fit-BeamFit") {
401 if (resultsMap.find(
"PV") != resultsMap.end() && resultsMap.find(
"BF") != resultsMap.end()) {
404 }
else if (itM->second ==
"PrimaryVertex fit-Online") {
405 if (resultsMap.find(
"PV") != resultsMap.end() && resultsMap.find(
"SC") != resultsMap.end()) {
408 }
else if (itM->second ==
"PrimaryVertex-DataBase") {
409 if (resultsMap.find(
"PV") != resultsMap.end() && resultsMap.find(
"DB") != resultsMap.end()) {
410 for (
vector<pair<double, double> >::iterator itPV = vertexResults.begin(); itPV != vertexResults.end();
412 histo->Fill(itPV->first - resultsMap[
"DB"].first);
415 }
else if (itM->second ==
"PrimaryVertex-BeamFit") {
416 if (resultsMap.find(
"PV") != resultsMap.end() && resultsMap.find(
"BF") != resultsMap.end()) {
417 for (
vector<pair<double, double> >::iterator itPV = vertexResults.begin(); itPV != vertexResults.end();
419 histo->Fill(itPV->first - resultsMap[
"BF"].first);
422 }
else if (itM->second ==
"PrimaryVertex-Online") {
423 if (resultsMap.find(
"PV") != resultsMap.end() && resultsMap.find(
"SC") != resultsMap.end()) {
424 for (
vector<pair<double, double> >::iterator itPV = vertexResults.begin(); itPV != vertexResults.end();
426 histo->Fill(itPV->first - resultsMap[
"SC"].first);
429 }
else if (itM->second ==
"Lumibased BeamSpotFit") {
430 if (resultsMap.find(
"BF") != resultsMap.end()) {
434 }
else if (itM->second ==
"Lumibased PrimaryVertex") {
435 if (resultsMap.find(
"PV") != resultsMap.end()) {
439 }
else if (itM->second ==
"Lumibased DataBase") {
440 if (resultsMap.find(
"DB") != resultsMap.end()) {
444 }
else if (itM->second ==
"Lumibased Online") {
445 if (resultsMap.find(
"SC") != resultsMap.end()) {
449 }
else if (itM->second ==
"Lumibased PrimaryVertex-DataBase fit") {
450 if (resultsMap.find(
"PV") != resultsMap.end() && resultsMap.find(
"DB") != resultsMap.end()) {
455 }
else if (itM->second ==
"Lumibased PrimaryVertex-Online fit") {
456 if (resultsMap.find(
"PV") != resultsMap.end() && resultsMap.find(
"SC") != resultsMap.end()) {
461 }
else if (itM->second ==
"Lumibased Online-DataBase fit") {
462 if (resultsMap.find(
"SC") != resultsMap.end() && resultsMap.find(
"DB") != resultsMap.end()) {
467 }
else if (itM->second ==
"Lumibased PrimaryVertex-DataBase") {
468 if (resultsMap.find(
"DB") != resultsMap.end() && !vertexResults.empty()) {
469 for (
vector<pair<double, double> >::iterator itPV = vertexResults.begin(); itPV != vertexResults.end();
476 }
else if (itM->second ==
"Lumibased PrimaryVertex-Online") {
477 if (resultsMap.find(
"SC") != resultsMap.end() && !vertexResults.empty()) {
478 for (
vector<pair<double, double> >::iterator itPV = vertexResults.begin(); itPV != vertexResults.end();
492 LogInfo(
"AlcaBeamMonitor") <<
"The histosMap_ have a histogram named " << itM->second
493 <<
" that I can't recognize in this loop!";
LuminosityBlockNumber_t luminosityBlock() const
std::multimap< std::string, std::string > histoByCategoryNames_
U second(std::pair< T, U > const &p)
std::vector< std::string > varNamesV_
std::vector< int > processedLumis_
Log< level::Info, false > LogInfo
std::unique_ptr< PVFitter > thePVFitter_
std::unique_ptr< BeamFitter > theBeamFitter_
LuminosityBlockID id() const
HistosContainer histosMap_
LuminosityBlockIndex index() const