309 map<std::string, pair<double, double> > resultsMap;
310 vector<pair<double, double> > vertexResults;
318 resultsMap[itBS->first] = pair<double, double>(itBS->second.x0(), itBS->second.x0Error());
319 }
else if (*itV ==
"y") {
320 resultsMap[itBS->first] = pair<double, double>(itBS->second.y0(), itBS->second.y0Error());
321 }
else if (*itV ==
"z") {
322 resultsMap[itBS->first] = pair<double, double>(itBS->second.z0(), itBS->second.z0Error());
323 }
else if (*itV ==
"sigmaX") {
324 resultsMap[itBS->first] = pair<double, double>(itBS->second.BeamWidthX(), itBS->second.BeamWidthXError());
325 }
else if (*itV ==
"sigmaY") {
326 resultsMap[itBS->first] = pair<double, double>(itBS->second.BeamWidthY(), itBS->second.BeamWidthYError());
327 }
else if (*itV ==
"sigmaZ") {
328 resultsMap[itBS->first] = pair<double, double>(itBS->second.sigmaZ(), itBS->second.sigmaZ0Error());
330 LogInfo(
"AlcaBeamMonitor") <<
"The histosMap_ has been built with the name " << *itV
331 <<
" that I can't recognize!";
336 vertexResults.clear();
337 for (vector<VertexCollection>::iterator itPV =
vertices_.begin(); itPV !=
vertices_.end(); itPV++) {
338 if (!itPV->empty()) {
339 for (VertexCollection::const_iterator
pv = itPV->begin();
pv != itPV->end();
pv++) {
340 if (
pv->isFake() ||
pv->tracksSize() < 10)
343 vertexResults.push_back(pair<double, double>(
pv->x(),
pv->xError()));
344 }
else if (*itV ==
"y") {
345 vertexResults.push_back(pair<double, double>(
pv->y(),
pv->yError()));
346 }
else if (*itV ==
"z") {
347 vertexResults.push_back(pair<double, double>(
pv->z(),
pv->zError()));
348 }
else if (*itV !=
"sigmaX" && *itV !=
"sigmaY" && *itV !=
"sigmaZ") {
349 LogInfo(
"AlcaBeamMonitor") <<
"The histosMap_ has been built with the name " << *itV
350 <<
" that I can't recognize!";
377 if (itM->first ==
"run" && (histo =
histosMap_[*itV][itM->first][itM->second]) ==
nullptr) {
379 }
else if (itM->first !=
"run") {
382 if (itM->second ==
"Coordinate") {
386 }
else if (itM->second ==
"PrimaryVertex fit-DataBase") {
387 if (resultsMap.find(
"PV") != resultsMap.end() && resultsMap.find(
"DB") != resultsMap.end()) {
390 }
else if (itM->second ==
"PrimaryVertex fit-BeamFit") {
391 if (resultsMap.find(
"PV") != resultsMap.end() && resultsMap.find(
"BF") != resultsMap.end()) {
394 }
else if (itM->second ==
"PrimaryVertex fit-Scalers") {
395 if (resultsMap.find(
"PV") != resultsMap.end() && resultsMap.find(
"SC") != resultsMap.end()) {
398 }
else if (itM->second ==
"PrimaryVertex-DataBase") {
399 if (resultsMap.find(
"PV") != resultsMap.end() && resultsMap.find(
"DB") != resultsMap.end()) {
400 for (vector<pair<double, double> >::iterator itPV = vertexResults.begin(); itPV != vertexResults.end();
402 histo->
Fill(itPV->first - resultsMap[
"DB"].first);
405 }
else if (itM->second ==
"PrimaryVertex-BeamFit") {
406 if (resultsMap.find(
"PV") != resultsMap.end() && resultsMap.find(
"BF") != resultsMap.end()) {
407 for (vector<pair<double, double> >::iterator itPV = vertexResults.begin(); itPV != vertexResults.end();
409 histo->
Fill(itPV->first - resultsMap[
"BF"].first);
412 }
else if (itM->second ==
"PrimaryVertex-Scalers") {
413 if (resultsMap.find(
"PV") != resultsMap.end() && resultsMap.find(
"SC") != resultsMap.end()) {
414 for (vector<pair<double, double> >::iterator itPV = vertexResults.begin(); itPV != vertexResults.end();
416 histo->
Fill(itPV->first - resultsMap[
"SC"].first);
419 }
else if (itM->second ==
"Lumibased BeamSpotFit") {
420 if (resultsMap.find(
"BF") != resultsMap.end()) {
425 }
else if (itM->second ==
"Lumibased PrimaryVertex") {
426 if (resultsMap.find(
"PV") != resultsMap.end()) {
431 }
else if (itM->second ==
"Lumibased DataBase") {
432 if (resultsMap.find(
"DB") != resultsMap.end()) {
437 }
else if (itM->second ==
"Lumibased Scalers") {
438 if (resultsMap.find(
"SC") != resultsMap.end()) {
443 }
else if (itM->second ==
"Lumibased PrimaryVertex-DataBase fit") {
444 if (resultsMap.find(
"PV") != resultsMap.end() && resultsMap.find(
"DB") != resultsMap.end()) {
451 }
else if (itM->second ==
"Lumibased PrimaryVertex-Scalers fit") {
452 if (resultsMap.find(
"PV") != resultsMap.end() && resultsMap.find(
"SC") != resultsMap.end()) {
459 }
else if (itM->second ==
"Lumibased Scalers-DataBase fit") {
460 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();
488 }
else if (itM->second ==
"Lumibased PrimaryVertex-Scalers") {
489 if (resultsMap.find(
"SC") != resultsMap.end() && !vertexResults.empty()) {
490 for (vector<pair<double, double> >::iterator itPV = vertexResults.begin(); itPV != vertexResults.end();
516 LogInfo(
"AlcaBeamMonitor") <<
"The histosMap_ have a histogram named " << itM->second
517 <<
" that I can't recognize in this loop!";
std::multimap< std::string, std::string > histoByCategoryNames_
PositionContainer positionsMap_
U second(std::pair< T, U > const &p)
std::vector< std::string > varNamesV_
BeamSpotContainer beamSpotsMap_
BeamFitter * theBeamFitter_
virtual TProfile * getTProfile()
HistosContainer histosMap_
static int position[264][3]
reco::BeamSpot getBeamSpot()
MonitorElement * theValuesContainer_
reco::BeamSpot getBeamSpot()
Power< A, B >::type pow(const A &a, const B &b)
std::vector< reco::VertexCollection > vertices_