90 LogInfo(
"AlcaBeamMonitorClient") <<
"The histogram " 92 "Service/hHistoLumiValues which contains all the values has not " 93 "been found in any lumi!";
102 LogInfo(
"AlcaBeamMonitorClient") <<
"End of run " << iRun.
id().
run() <<
"(" << firstLumi <<
"-" << lastLumi <<
")";
108 for (
map<
string, map<string, MonitorElement*> >::iterator itMM = itM->second.begin(); itMM != itM->second.end();
110 if (itMM->first !=
"run") {
111 for (map<string, MonitorElement*>::iterator itMMM = itMM->second.begin(); itMMM != itMM->second.end();
113 name =
string(
"h") + itM->first + itMMM->first;
114 title = itM->first +
"_{0} " + itMMM->first;
115 if (itMM->first ==
"lumi") {
117 itMMM->second =
dbe_->
book1D(name, title, lastLumi - firstLumi + 1, firstLumi - 0.5, lastLumi + 0.5);
119 }
else if (itMM->first ==
"validation" && itMMM->first ==
"Lumibased Scalers-DataBase fit") {
121 itMMM->second =
dbe_->
book1D(name, title, lastLumi - firstLumi + 1, firstLumi - 0.5, lastLumi + 0.5);
123 }
else if (itMM->first ==
"validation" && itMMM->first !=
"Lumibased Scalers-DataBase fit" &&
124 (itM->first ==
"x" || itM->first ==
"y" || itM->first ==
"z")) {
126 itMMM->second =
dbe_->
book1D(name, title, lastLumi - firstLumi + 1, firstLumi - 0.5, lastLumi + 0.5);
128 }
else if (itMM->first ==
"validation" &&
129 (itM->first ==
"sigmaX" || itM->first ==
"sigmaY" || itM->first ==
"sigmaZ")) {
131 itMMM->second =
nullptr;
133 LogInfo(
"AlcaBeamMonitorClient") <<
"Unrecognized category " << itMM->first;
136 if (itMMM->second !=
nullptr) {
137 if (itMMM->first.find(
'-') != string::npos) {
138 itMMM->second->setAxisTitle(
string(
"#Delta ") + itM->first +
"_{0} (cm)", 2);
140 itMMM->second->setAxisTitle(itM->first +
"_{0} (cm)", 2);
142 itMMM->second->setAxisTitle(
"Lumisection", 1);
149 unsigned int bin = 0;
151 for (
map<
string, map<string, MonitorElement*> >::iterator itHH = itH->second.begin(); itHH != itH->second.end();
153 for (map<string, MonitorElement*>::iterator itHHH = itHH->second.begin(); itHHH != itHH->second.end(); itHHH++) {
157 if (itHHH->second !=
nullptr) {
160 if (itVal->second[
positionsMap_[itH->first][itHH->first][itHHH->first] + 2] == 1) {
161 bin = itHHH->second->getTH1()->FindBin(itVal->first);
162 itHHH->second->setBinContent(bin, itVal->second[
positionsMap_[itH->first][itHH->first][itHHH->first]]);
163 itHHH->second->setBinError(bin, itVal->second[
positionsMap_[itH->first][itHH->first][itHHH->first] + 1]);
172 const double bigNumber = 1000000.;
174 for (
map<
string, map<string, MonitorElement*> >::iterator itHH = itH->second.begin(); itHH != itH->second.end();
176 double min = bigNumber;
177 double max = -bigNumber;
178 double minDelta = bigNumber;
182 if (itHH->first !=
"run") {
183 for (map<string, MonitorElement*>::iterator itHHH = itHH->second.begin(); itHHH != itHH->second.end();
185 if (itHHH->second !=
nullptr) {
186 for (
int bin = 1; bin <= itHHH->second->getTH1()->GetNbinsX(); bin++) {
187 if (itHHH->second->getTH1()->GetBinError(bin) != 0 || itHHH->second->getTH1()->GetBinContent(bin) != 0) {
188 if (itHHH->first ==
"Lumibased BeamSpotFit" || itHHH->first ==
"Lumibased PrimaryVertex" ||
189 itHHH->first ==
"Lumibased DataBase" || itHHH->first ==
"Lumibased Scalers") {
190 if (min > itHHH->second->getTH1()->GetBinContent(bin)) {
191 min = itHHH->second->getTH1()->GetBinContent(bin);
193 if (max < itHHH->
second->getTH1()->GetBinContent(bin)) {
194 max = itHHH->second->getTH1()->GetBinContent(bin);
196 }
else if (itHHH->first ==
"Lumibased PrimaryVertex-DataBase fit" ||
197 itHHH->first ==
"Lumibased PrimaryVertex-Scalers fit" ||
198 itHHH->first ==
"Lumibased Scalers-DataBase fit" ||
199 itHHH->first ==
"Lumibased PrimaryVertex-DataBase" ||
200 itHHH->first ==
"Lumibased PrimaryVertex-Scalers") {
201 if (minDelta > itHHH->second->getTH1()->GetBinContent(bin)) {
202 minDelta = itHHH->second->getTH1()->GetBinContent(bin);
204 if (maxDelta < itHHH->
second->getTH1()->GetBinContent(bin)) {
205 maxDelta = itHHH->second->getTH1()->GetBinContent(bin);
208 LogInfo(
"AlcaBeamMonitorClient") <<
"The histosMap_ have a histogram named " << itHHH->first
209 <<
" that I can't recognize in this loop!";
216 for (map<string, MonitorElement*>::iterator itHHH = itHH->second.begin(); itHHH != itHH->second.end();
218 if (itHHH->second !=
nullptr) {
219 if (itHHH->first ==
"Lumibased BeamSpotFit" || itHHH->first ==
"Lumibased PrimaryVertex" ||
220 itHHH->first ==
"Lumibased DataBase" || itHHH->first ==
"Lumibased Scalers") {
221 if ((max == -bigNumber && min == bigNumber) || max - min == 0) {
222 itHHH->second->getTH1()->SetMinimum(itHHH->second->getTH1()->GetMinimum() - 0.01);
223 itHHH->second->getTH1()->SetMaximum(itHHH->second->getTH1()->GetMaximum() + 0.01);
225 itHHH->second->getTH1()->SetMinimum(min - 0.1 * (max - min));
226 itHHH->second->getTH1()->SetMaximum(max + 0.1 * (max - min));
228 }
else if (itHHH->first ==
"Lumibased PrimaryVertex-DataBase fit" ||
229 itHHH->first ==
"Lumibased PrimaryVertex-Scalers fit" ||
230 itHHH->first ==
"Lumibased Scalers-DataBase fit" ||
231 itHHH->first ==
"Lumibased PrimaryVertex-DataBase" ||
232 itHHH->first ==
"Lumibased PrimaryVertex-Scalers") {
233 if ((maxDelta == -bigNumber && minDelta == bigNumber) || maxDelta - minDelta == 0) {
234 itHHH->second->getTH1()->SetMinimum(itHHH->second->getTH1()->GetMinimum() - 0.01);
235 itHHH->second->getTH1()->SetMaximum(itHHH->second->getTH1()->GetMaximum() + 0.01);
237 itHHH->second->getTH1()->SetMinimum(minDelta - 2 * (maxDelta - minDelta));
238 itHHH->second->getTH1()->SetMaximum(maxDelta + 2 * (maxDelta - minDelta));
241 LogInfo(
"AlcaBeamMonitorClient") <<
"The histosMap_ have a histogram named " << itHHH->first
242 <<
" that I can't recognize in this loop!";
PositionContainer positionsMap_
HistosContainer histosMap_
unsigned int LuminosityBlockNumber_t
U second(std::pair< T, U > const &p)
std::map< edm::LuminosityBlockNumber_t, std::vector< double > > valuesMap_
void setCurrentFolder(std::string const &fullpath)
MonitorElement * book1D(char_string const &name, char_string const &title, int const nchX, double const lowX, double const highX)
Book 1D histogram.