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,
"");
153 corrFrac = besttrigsCorr / besttrigs;
157 secondFrac = trigsFlag2nd / trigs;
181 TH1D* BXDistr = BXvsQual->ProjectionY();
182 TH1D* QualDistr = BXvsQual->ProjectionX();
183 std::map<std::string, MonitorElement*>* innerME = &(
secME[sector_id]);
185 int nbinsBX = BXDistr->GetNbinsX();
186 int firstBinCenter =
static_cast<int>(BXDistr->GetBinCenter(1));
187 int lastBinCenter =
static_cast<int>(BXDistr->GetBinCenter(nbinsBX));
188 int iMin = firstBinCenter > -4 ? firstBinCenter : -4;
189 int iMax = lastBinCenter < 20 ? lastBinCenter : 20;
190 for (
int ibin = iMin + 5; ibin <= iMax + 5; ++ibin) {
191 innerME->find(
fullName(
"BXDistribPhiIn"))
192 ->second->setBinContent(ibin,
stat, BXDistr->GetBinContent(ibin - 5 - firstBinCenter + 1));
194 for (
int ibin = 1; ibin <= 7; ++ibin) {
195 innerME->find(
fullName(
"QualDistribPhiIn"))
196 ->second->setBinContent(ibin,
stat, QualDistr->GetBinContent(ibin));
203 std::map<std::string, MonitorElement*>* innerME = &(
secME[sector_id]);
213 innerME = &(
whME[wh]);
214 innerME->find(
fullName(
"CorrectBXPhiIn"))->second->setBinContent(sect,
stat, BX_OK + 0.00001);
215 innerME->find(
fullName(
"ResidualBXPhiIn"))
216 ->second->setBinContent(sect,
stat, round(25. * (BXMean - BX_OK)) + 0.00001);
217 innerME->find(
fullName(
"CorrFractionPhiIn"))->second->setBinContent(sect,
stat, corrFrac);
218 innerME->find(
fullName(
"TriggerInclusivePhiIn"))->second->setBinContent(sect,
stat, besttrigs);
219 innerME->find(
fullName(
"2ndFractionPhiIn"))->second->setBinContent(sect,
stat, secondFrac);
221 whME[wh].find(
fullName(
"CorrFractionSummaryIn"))->second->setBinContent(sect,
stat, corrSummary);
222 whME[wh].find(
fullName(
"2ndFractionSummaryIn"))->second->setBinContent(sect,
stat, secondSummary);
229 TH2F* BXvsQual = getHisto<TH2F>(igetter.
get(
getMEName(
"BXvsQual_Out",
"LocalTriggerPhiOut", chId)));
230 TH1F* BestQual = getHisto<TH1F>(igetter.
get(
getMEName(
"BestQual_Out",
"LocalTriggerPhiOut", chId)));
231 TH2F* Flag1stvsQual =
232 getHisto<TH2F>(igetter.
get(
getMEName(
"Flag1stvsQual_Out",
"LocalTriggerPhiOut", chId)));
233 if (BXvsQual && Flag1stvsQual && BestQual) {
235 int secondSummary = 1;
239 double corrFrac = 0.;
240 double secondFrac = 0.;
241 double besttrigs = 0.;
243 if (BestQual->GetEntries() > 1) {
244 TH1D* BXHH = BXvsQual->ProjectionY(
"", 6, 7,
"");
245 TH1D* Flag1st = Flag1stvsQual->ProjectionY();
246 int BXOK_bin = BXHH->GetEntries() >= 1 ? BXHH->GetMaximumBin() : 51;
247 BXMean = BXHH->GetEntries() >= 1 ? BXHH->GetMean() : 51;
248 BX_OK = BXvsQual->GetYaxis()->GetBinCenter(BXOK_bin);
249 double trigsFlag2nd = Flag1st->GetBinContent(2);
250 double trigs = Flag1st->GetEntries();
251 besttrigs = BestQual->GetEntries();
252 double besttrigsCorr = BestQual->Integral(5, 7,
"");
256 corrFrac = besttrigsCorr / besttrigs;
257 secondFrac = trigsFlag2nd / trigs;
278 TH1D* BXDistr = BXvsQual->ProjectionY();
279 TH1D* QualDistr = BXvsQual->ProjectionX();
280 std::map<std::string, MonitorElement*>* innerME = &(
secME[sector_id]);
282 int nbinsBX = BXDistr->GetNbinsX();
283 int firstBinCenter =
static_cast<int>(BXDistr->GetBinCenter(1));
284 int lastBinCenter =
static_cast<int>(BXDistr->GetBinCenter(nbinsBX));
285 int iMin = firstBinCenter > -4 ? firstBinCenter : -4;
286 int iMax = lastBinCenter < 20 ? lastBinCenter : 20;
287 for (
int ibin = iMin + 5; ibin <= iMax + 5; ++ibin) {
288 innerME->find(
fullName(
"BXDistribPhiOut"))
289 ->second->setBinContent(ibin,
stat, BXDistr->GetBinContent(ibin - 5 - firstBinCenter + 1));
291 for (
int ibin = 1; ibin <= 7; ++ibin) {
292 innerME->find(
fullName(
"QualDistribPhiOut"))
293 ->second->setBinContent(ibin,
stat, QualDistr->GetBinContent(ibin));
300 std::map<std::string, MonitorElement*>* innerME = &(
secME[sector_id]);
310 innerME = &(
whME[wh]);
311 innerME->find(
fullName(
"CorrectBXPhiOut"))->second->setBinContent(sect,
stat, BX_OK + 0.00001);
312 innerME->find(
fullName(
"ResidualBXPhiOut"))
313 ->second->setBinContent(sect,
stat, round(25. * (BXMean - BX_OK)) + 0.00001);
314 innerME->find(
fullName(
"CorrFractionPhiOut"))->second->setBinContent(sect,
stat, corrFrac);
315 innerME->find(
fullName(
"TriggerInclusivePhiOut"))->second->setBinContent(sect,
stat, besttrigs);
316 innerME->find(
fullName(
"2ndFractionPhiOut"))->second->setBinContent(sect,
stat, secondFrac);
318 whME[wh].find(
fullName(
"CorrFractionSummaryOut"))->second->setBinContent(sect,
stat, corrSummary);
319 whME[wh].find(
fullName(
"2ndFractionSummaryOut"))->second->setBinContent(sect,
stat, secondSummary);
327 TH2F* ThetaPosvsBX = getHisto<TH2F>(igetter.
get(
getMEName(
"PositionvsBX",
"LocalTriggerTheta", chId)));
330 if (ThetaPosvsBX && stat < 4 && ThetaPosvsBX->GetEntries() > 1) {
331 TH1D*
BX = ThetaPosvsBX->ProjectionX();
332 int BXOK_bin =
BX->GetEffectiveEntries() >= 1 ?
BX->GetMaximumBin() : 10;
333 BX_OK = ThetaPosvsBX->GetXaxis()->GetBinCenter(BXOK_bin);
339 std::map<std::string, MonitorElement*>* innerME = &(
whME.find(wh)->second);
340 innerME->find(
fullName(
"CorrectBXTheta"))->second->setBinContent(sect,
stat, BX_OK + 0.00001);
343 TH2F* ThetaBXvsQual = getHisto<TH2F>(igetter.
get(
getMEName(
"ThetaBXvsQual",
"LocalTriggerTheta", chId)));
344 TH1F* ThetaBestQual = getHisto<TH1F>(igetter.
get(
getMEName(
"ThetaBestQual",
"LocalTriggerTheta", chId)));
345 if (ThetaBXvsQual && ThetaBestQual && stat < 4 && ThetaBestQual->GetEntries() > 1) {
346 double trigs = ThetaBestQual->GetEntries();
347 double trigsH = ThetaBestQual->GetBinContent(
352 std::map<std::string, MonitorElement*>* innerME = &(
whME.find(wh)->second);
353 innerME->find(
fullName(
"HFractionTheta"))->second->setBinContent(sect,
stat, trigsH / trigs);
365 for (vector<string>::const_iterator iHw =
hwSources.begin(); iHw !=
hwSources.end(); ++iHw) {
367 for (
int wh = -2; wh <= 2; ++wh) {
368 std::map<std::string, MonitorElement*>* innerME = &(
whME[wh]);
370 TH2F* corrWhSummaryIn = getHisto<TH2F>(innerME->find(
fullName(
"CorrFractionSummaryIn"))->second);
371 TH2F* secondWhSummaryIn = getHisto<TH2F>(innerME->find(
fullName(
"2ndFractionSummaryIn"))->second);
372 for (
int sect = 1; sect <= 12; ++sect) {
376 int secondNoData = 0;
378 switch (static_cast<int>(corrWhSummaryIn->GetBinContent(sect,
stat))) {
385 switch (static_cast<int>(secondWhSummaryIn->GetBinContent(sect,
stat))) {
395 if (secondNoData == 4)
401 TH2F* corrWhSummaryOut = getHisto<TH2F>(innerME->find(
fullName(
"CorrFractionSummaryOut"))->second);
402 TH2F* secondWhSummaryOut = getHisto<TH2F>(innerME->find(
fullName(
"2ndFractionSummaryOut"))->second);
403 for (
int sect = 1; sect <= 12; ++sect) {
407 int secondNoData = 0;
409 switch (static_cast<int>(corrWhSummaryOut->GetBinContent(sect,
stat))) {
416 switch (static_cast<int>(secondWhSummaryOut->GetBinContent(sect,
stat))) {
426 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)
T getUntrackedParameter(std::string const &, T const &) const
void fillGlobalSummary(DQMStore::IGetter &)
std::map< int, std::map< std::string, MonitorElement * > > whME
edm::ParameterSet parameters
virtual MonitorElement * get(std::string const &fullpath) const
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.