117 for (vector<string>::const_iterator iHw =
hwSources.begin(); iHw !=
hwSources.end(); ++iHw) {
121 for (
int wh = -2; wh <= 2; ++wh) {
122 for (
int sect = 1; sect <= 12; ++sect) {
127 TH2F* BXvsQual = getHisto<TH2F>(igetter.get(
getMEName(
"BXvsQual_In",
"LocalTriggerPhiIn", chId)));
128 TH1F* BestQual = getHisto<TH1F>(igetter.get(
getMEName(
"BestQual_In",
"LocalTriggerPhiIn", chId)));
129 TH2F* Flag1stvsQual = getHisto<TH2F>(igetter.get(
getMEName(
"Flag1stvsQual_In",
"LocalTriggerPhiIn", chId)));
130 if (BXvsQual && Flag1stvsQual && BestQual) {
132 int secondSummary = 1;
136 double corrFrac = 0.;
137 double secondFrac = 0.;
138 double besttrigs = 0.;
139 if (BestQual->GetEntries() > 1) {
140 TH1D* BXHH = BXvsQual->ProjectionY(
"", 6, 7,
"");
141 TH1D* Flag1st = Flag1stvsQual->ProjectionY();
142 int BXOK_bin = BXHH->GetEntries() >= 1 ? BXHH->GetMaximumBin() : 51;
143 BXMean = BXHH->GetEntries() >= 1 ? BXHH->GetMean() : 51;
144 BX_OK = BXvsQual->GetYaxis()->GetBinCenter(BXOK_bin);
145 double trigsFlag2nd = Flag1st->GetBinContent(2);
146 double trigs = Flag1st->GetEntries();
147 besttrigs = BestQual->GetEntries();
148 double besttrigsCorr = BestQual->Integral(5, 7,
"");
152 corrFrac = besttrigsCorr / besttrigs;
153 secondFrac = trigsFlag2nd / trigs;
154 if (corrFrac <
parameters.getUntrackedParameter<
double>(
"corrFracError", .5)) {
156 }
else if (corrFrac <
parameters.getUntrackedParameter<
double>(
"corrFracWarning", .6)) {
161 if (secondFrac >
parameters.getUntrackedParameter<
double>(
"secondFracError", .2)) {
163 }
else if (secondFrac >
parameters.getUntrackedParameter<
double>(
"secondFracWarning", .1)) {
174 TH1D* BXDistr = BXvsQual->ProjectionY();
175 TH1D* QualDistr = BXvsQual->ProjectionX();
176 std::map<std::string, MonitorElement*>* innerME = &(
secME[sector_id]);
178 int nbinsBX = BXDistr->GetNbinsX();
179 int firstBinCenter =
static_cast<int>(BXDistr->GetBinCenter(1));
180 int lastBinCenter =
static_cast<int>(BXDistr->GetBinCenter(nbinsBX));
181 int iMin = firstBinCenter > -4 ? firstBinCenter : -4;
182 int iMax = lastBinCenter < 20 ? lastBinCenter : 20;
183 for (
int ibin = iMin + 5; ibin <= iMax + 5; ++ibin) {
184 innerME->find(
fullName(
"BXDistribPhiIn"))
185 ->second->setBinContent(ibin,
stat, BXDistr->GetBinContent(ibin - 5 - firstBinCenter + 1));
187 for (
int ibin = 1; ibin <= 7; ++ibin) {
188 innerME->find(
fullName(
"QualDistribPhiIn"))
189 ->second->setBinContent(ibin,
stat, QualDistr->GetBinContent(ibin));
196 std::map<std::string, MonitorElement*>* innerME = &(
secME[sector_id]);
206 innerME = &(
whME[wh]);
207 innerME->find(
fullName(
"CorrectBXPhiIn"))->second->setBinContent(sect,
stat, BX_OK + 0.00001);
208 innerME->find(
fullName(
"ResidualBXPhiIn"))
209 ->second->setBinContent(sect,
stat, round(25. * (BXMean - BX_OK)) + 0.00001);
210 innerME->find(
fullName(
"CorrFractionPhiIn"))->second->setBinContent(sect,
stat, corrFrac);
211 innerME->find(
fullName(
"TriggerInclusivePhiIn"))->second->setBinContent(sect,
stat, besttrigs);
212 innerME->find(
fullName(
"2ndFractionPhiIn"))->second->setBinContent(sect,
stat, secondFrac);
214 whME[wh].find(
fullName(
"CorrFractionSummaryIn"))->second->setBinContent(sect,
stat, corrSummary);
215 whME[wh].find(
fullName(
"2ndFractionSummaryIn"))->second->setBinContent(sect,
stat, secondSummary);
222 TH2F* BXvsQual = getHisto<TH2F>(igetter.get(
getMEName(
"BXvsQual_Out",
"LocalTriggerPhiOut", chId)));
223 TH1F* BestQual = getHisto<TH1F>(igetter.get(
getMEName(
"BestQual_Out",
"LocalTriggerPhiOut", chId)));
224 TH2F* Flag1stvsQual =
225 getHisto<TH2F>(igetter.get(
getMEName(
"Flag1stvsQual_Out",
"LocalTriggerPhiOut", chId)));
226 if (BXvsQual && Flag1stvsQual && BestQual) {
228 int secondSummary = 1;
232 double corrFrac = 0.;
233 double secondFrac = 0.;
234 double besttrigs = 0.;
236 if (BestQual->GetEntries() > 1) {
237 TH1D* BXHH = BXvsQual->ProjectionY(
"", 6, 7,
"");
238 TH1D* Flag1st = Flag1stvsQual->ProjectionY();
239 int BXOK_bin = BXHH->GetEntries() >= 1 ? BXHH->GetMaximumBin() : 51;
240 BXMean = BXHH->GetEntries() >= 1 ? BXHH->GetMean() : 51;
241 BX_OK = BXvsQual->GetYaxis()->GetBinCenter(BXOK_bin);
242 double trigsFlag2nd = Flag1st->GetBinContent(2);
243 double trigs = Flag1st->GetEntries();
244 besttrigs = BestQual->GetEntries();
245 double besttrigsCorr = BestQual->Integral(5, 7,
"");
249 corrFrac = besttrigsCorr / besttrigs;
250 secondFrac = trigsFlag2nd / trigs;
251 if (corrFrac <
parameters.getUntrackedParameter<
double>(
"corrFracError", .5)) {
253 }
else if (corrFrac <
parameters.getUntrackedParameter<
double>(
"corrFracWarning", .6)) {
258 if (secondFrac >
parameters.getUntrackedParameter<
double>(
"secondFracError", .2)) {
260 }
else if (secondFrac >
parameters.getUntrackedParameter<
double>(
"secondFracWarning", .1)) {
271 TH1D* BXDistr = BXvsQual->ProjectionY();
272 TH1D* QualDistr = BXvsQual->ProjectionX();
273 std::map<std::string, MonitorElement*>* innerME = &(
secME[sector_id]);
275 int nbinsBX = BXDistr->GetNbinsX();
276 int firstBinCenter =
static_cast<int>(BXDistr->GetBinCenter(1));
277 int lastBinCenter =
static_cast<int>(BXDistr->GetBinCenter(nbinsBX));
278 int iMin = firstBinCenter > -4 ? firstBinCenter : -4;
279 int iMax = lastBinCenter < 20 ? lastBinCenter : 20;
280 for (
int ibin = iMin + 5; ibin <= iMax + 5; ++ibin) {
281 innerME->find(
fullName(
"BXDistribPhiOut"))
282 ->second->setBinContent(ibin,
stat, BXDistr->GetBinContent(ibin - 5 - firstBinCenter + 1));
284 for (
int ibin = 1; ibin <= 7; ++ibin) {
285 innerME->find(
fullName(
"QualDistribPhiOut"))
286 ->second->setBinContent(ibin,
stat, QualDistr->GetBinContent(ibin));
293 std::map<std::string, MonitorElement*>* innerME = &(
secME[sector_id]);
303 innerME = &(
whME[wh]);
304 innerME->find(
fullName(
"CorrectBXPhiOut"))->second->setBinContent(sect,
stat, BX_OK + 0.00001);
305 innerME->find(
fullName(
"ResidualBXPhiOut"))
306 ->second->setBinContent(sect,
stat, round(25. * (BXMean - BX_OK)) + 0.00001);
307 innerME->find(
fullName(
"CorrFractionPhiOut"))->second->setBinContent(sect,
stat, corrFrac);
308 innerME->find(
fullName(
"TriggerInclusivePhiOut"))->second->setBinContent(sect,
stat, besttrigs);
309 innerME->find(
fullName(
"2ndFractionPhiOut"))->second->setBinContent(sect,
stat, secondFrac);
311 whME[wh].find(
fullName(
"CorrFractionSummaryOut"))->second->setBinContent(sect,
stat, corrSummary);
312 whME[wh].find(
fullName(
"2ndFractionSummaryOut"))->second->setBinContent(sect,
stat, secondSummary);
320 TH2F* ThetaPosvsBX = getHisto<TH2F>(igetter.get(
getMEName(
"PositionvsBX",
"LocalTriggerTheta", chId)));
323 if (ThetaPosvsBX && stat < 4 && ThetaPosvsBX->GetEntries() > 1) {
324 TH1D*
BX = ThetaPosvsBX->ProjectionX();
325 int BXOK_bin = BX->GetEffectiveEntries() >= 1 ? BX->GetMaximumBin() : 10;
326 BX_OK = ThetaPosvsBX->GetXaxis()->GetBinCenter(BXOK_bin);
332 std::map<std::string, MonitorElement*>* innerME = &(
whME.find(wh)->second);
333 innerME->find(
fullName(
"CorrectBXTheta"))->second->setBinContent(sect,
stat, BX_OK + 0.00001);
336 TH2F* ThetaBXvsQual = getHisto<TH2F>(igetter.get(
getMEName(
"ThetaBXvsQual",
"LocalTriggerTheta", chId)));
337 TH1F* ThetaBestQual = getHisto<TH1F>(igetter.get(
getMEName(
"ThetaBestQual",
"LocalTriggerTheta", chId)));
338 if (ThetaBXvsQual && ThetaBestQual && stat < 4 && ThetaBestQual->GetEntries() > 1) {
339 double trigs = ThetaBestQual->GetEntries();
340 double trigsH = ThetaBestQual->GetBinContent(
345 std::map<std::string, MonitorElement*>* innerME = &(
whME.find(wh)->second);
346 innerME->find(
fullName(
"HFractionTheta"))->second->setBinContent(sect,
stat, trigsH / trigs);
358 for (vector<string>::const_iterator iHw =
hwSources.begin(); iHw !=
hwSources.end(); ++iHw) {
360 for (
int wh = -2; wh <= 2; ++wh) {
361 std::map<std::string, MonitorElement*>* innerME = &(
whME[wh]);
363 TH2F* corrWhSummaryIn = getHisto<TH2F>(innerME->find(
fullName(
"CorrFractionSummaryIn"))->second);
364 TH2F* secondWhSummaryIn = getHisto<TH2F>(innerME->find(
fullName(
"2ndFractionSummaryIn"))->second);
365 for (
int sect = 1; sect <= 12; ++sect) {
369 int secondNoData = 0;
371 switch (static_cast<int>(corrWhSummaryIn->GetBinContent(sect,
stat))) {
378 switch (static_cast<int>(secondWhSummaryIn->GetBinContent(sect,
stat))) {
388 if (secondNoData == 4)
394 TH2F* corrWhSummaryOut = getHisto<TH2F>(innerME->find(
fullName(
"CorrFractionSummaryOut"))->second);
395 TH2F* secondWhSummaryOut = getHisto<TH2F>(innerME->find(
fullName(
"2ndFractionSummaryOut"))->second);
396 for (
int sect = 1; sect <= 12; ++sect) {
400 int secondNoData = 0;
402 switch (static_cast<int>(corrWhSummaryOut->GetBinContent(sect,
stat))) {
409 switch (static_cast<int>(secondWhSummaryOut->GetBinContent(sect,
stat))) {
419 if (secondNoData == 4)
std::vector< std::string > trigSources
void Bookings(DQMStore::IBooker &, DQMStore::IGetter &)
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
void fillGlobalSummary(DQMStore::IGetter &)
std::map< int, std::map< std::string, MonitorElement * > > whME
std::string getMEName(std::string histoTag, std::string subfolder, const DTChamberId &chambid)
Get the ME name (by chamber)
void bookSectorHistos(DQMStore::IBooker &, int wheel, int sector, std::string hTag, std::string folder="")
Book the new MEs (for each sector)
std::map< std::string, MonitorElement * > cmsME
const int wheelArrayShift
std::vector< std::string > hwSources
std::map< int, std::map< std::string, MonitorElement * > > secME
void bookWheelHistos(DQMStore::IBooker &, int wheel, std::string hTag, std::string folder="")
Book the new MEs (for each wheel)
std::string fullName(std::string htype)
Create fullname from histo partial name.