EndRun.
172 LogDebug(
"FourVectorHLTClient")<<
"FourVectorHLTClient:: endLuminosityBlock " << endl;
179 std::vector<MonitorElement*> summaryME;
182 vector<float> hltPassCount;
184 for(
unsigned int i=0;
i< summaryME.size();
i++) {
186 TString nameME = (summaryME[
i])->getName();
187 LogDebug(
"FourVectorHLTClient") <<
"ME = " << nameME << endl;
190 LogDebug(
"FourVectorHLTClient") <<
"fullPathME = " << fullPathToME << endl;
192 if(nameME.Contains(
"Filters_")) {
195 TH1F* MEHist = summaryME[
i]->getTH1F() ;
196 LogDebug(
"FourVectorHLTClient") <<
"this is TH1 first bin label = " << MEHist->GetXaxis()->GetBinLabel(1) << endl;
197 LogDebug(
"FourVectorHLTClient") <<
"is this is TH1 = " << fullPathToME << endl;
199 TString nameMEeff = nameME+
"_Eff";
200 TString titleMEeff = nameME+
" Efficiency wrt input to L1";
202 TH1F* effHist = (TH1F*) MEHist->Clone(nameMEeff.Data());
203 effHist->SetTitle(titleMEeff.Data());
205 float firstBinContent = MEHist->GetBinContent(1);
207 if(firstBinContent !=0 ) {
209 effHist->Scale(1./firstBinContent);
214 unsigned int nBins = effHist->GetNbinsX();
215 for(
unsigned int bin = 0;
bin < nBins+1;
bin++) effHist->SetBinContent(
bin, 0);
221 dbe_->book1D(nameMEeff.Data(), effHist);
231 name.push_back(
"All");
232 name.push_back(
"Muon");
233 name.push_back(
"Egamma");
234 name.push_back(
"Tau");
235 name.push_back(
"JetMET");
236 name.push_back(
"Rest");
237 name.push_back(
"Special");
242 for (
unsigned int i=0;
i<datasetNames.size();
i++) {
244 name.push_back(datasetNames[
i]);
250 for (
unsigned int i=0;
i<name.size();
i++) {
267 TObjArray *hltPathNameColl =
new TObjArray(100);
268 hltPathNameColl->SetOwner();
269 std::vector<std::string> fullPathHLTFolders;
275 fullPathHLTFolders =
dbe_->getSubdirs();
278 LogDebug(
"FourVectorHLTClient")<<
"endRun: sourceDir_(" <<
sourceDir_.Data() <<
") has " << fullPathHLTFolders.size() <<
" folders. " << endl;
281 for(
unsigned int i=0;
i<fullPathHLTFolders.size();
i++) {
283 LogDebug(
"FourVectorHLTClient")<<
"endRun: sourceDir_(" <<
sourceDir_.Data() <<
") folder["<<
i <<
"] = " << fullPathHLTFolders[
i] << endl;
284 TString hltPath = fullPathHLTFolders[
i].substr(fullPathHLTFolders[
i].rfind(
'/')+1, fullPathHLTFolders[
i].
size());
301 LogDebug(
"FourVectorHLTClient")<<
"Custom Efficiencies dir path = " << currEffFolder << endl;
303 dbe_->setCurrentFolder(currEffFolder.Data());
307 LogDebug(
"FourVectorHLTClient")<<
"Number of MEs for this HLT path = " <<
hltMEs.size() << endl;
320 if(!hltPath.Contains(TString(custompathnamepair->first)))
continue;
322 TString numPathName=hltPath;
323 TString denPathName=TString(custompathnamepair->second);
329 vector<TString> vStage;
330 vStage.push_back(TString(
"L1"));
331 vStage.push_back(TString(
"On"));
332 vStage.push_back(TString(
"Off"));
333 vStage.push_back(TString(
"Mc"));
334 vStage.push_back(TString(
"L1UM"));
335 vStage.push_back(TString(
"OnUM"));
336 vStage.push_back(TString(
"OffUM"));
337 vStage.push_back(TString(
"McUM"));
339 vector<TString> vObj;
340 vObj.push_back(TString(
"l1Et"));
341 vObj.push_back(TString(
"onEt"));
342 vObj.push_back(TString(
"offEt"));
343 vObj.push_back(TString(
"mcEt"));
347 for (
unsigned int k=0;
k<vObj.size();
k++) {
348 for (
unsigned int l=0;
l<vStage.size();
l++) {
349 for (
unsigned int m=0;
m<vStage.size();
m++) {
351 TString oldHistPathNum;
352 TString oldHistPathNumBck;
353 TString oldHistPathDen;
356 oldHistPathNum =
sourceDir_+
"/"+hltPath+
"/"+numPathName+
"_wrt_"+denPathName+
"_"+vObj[
k]+vStage[
l]+vStage[
m];
357 oldHistPathNumBck =
sourceDir_+
"/"+hltPath+
"/"+numPathName+
"_wrt_"+denPathName+
"_"+vObj[
k]+vStage[
m]+vStage[
l];
360 TString tempDenString = vStage[
l];
361 tempDenString.ReplaceAll(
"UM",
"") ;
362 oldHistPathDen =
sourceDir_+
"/"+hltPath+
"/"+numPathName+
"_wrt_"+denPathName+
"_"+vObj[
k]+tempDenString;
368 LogDebug(
"FourVectorHLTClient")<<
" oldHistPathNum = " << oldHistPathNum << endl;
369 LogDebug(
"FourVectorHLTClient")<<
" oldHistPathNumBck = " << oldHistPathNumBck << endl;
370 LogDebug(
"FourVectorHLTClient")<<
" oldHistPathDen = " << oldHistPathDen << endl;
373 if ( numME && denME ) {
375 LogDebug(
"FourVectorHLTClient")<<
"DID find NUM and DEN histograms to derive eff " << vStage[
m]<<
"To"<<vStage[
l]<<
" using:" <<endl
376 <<
" NUM = " << oldHistPathNum << endl
377 <<
" DEN = " << oldHistPathDen << endl;
382 LogDebug(
"FourVectorHLTClient")<<
"Cannot find NUM and DEN histograms to derive eff " << vStage[
m]<<
"To"<<vStage[
l]<<
" using:" <<endl
383 <<
" NUM = " << oldHistPathNum << endl
384 <<
" DEN = " << oldHistPathDen << endl;
386 if ( numMEBck && denME) {
388 LogDebug(
"FourVectorHLTClient")<<
"DID find NUM and DEN histograms to derive eff " << vStage[
m]<<
"To"<<vStage[
l]<<
" using:" <<endl
389 <<
" NUM = " << oldHistPathNumBck << endl
390 <<
" DEN = " << oldHistPathDen << endl;
397 LogDebug(
"FourVectorHLTClient")<<
"Cannot find NUM and DEN histograms to derive eff " << vStage[
m]<<
"To"<<vStage[
l]<<
" using:" <<endl
398 <<
" NUM = " << oldHistPathNumBck << endl
399 <<
" DEN = " << oldHistPathDen << endl;
407 TH1F * numHist = numME->
getTH1F();
408 TH1F * denHist = denME->
getTH1F();
411 TString newHistName = hltPath +
"_wrt_" + denPathName +
"_"+vObj[
k]+
"_Eff_"+vStage[
m]+
"To"+vStage[
l];
414 if(newHistName.Contains(
"UM")) {
416 newHistName.ReplaceAll(
"UM",
"");
417 newHistName.Append(
"_UM");
421 TString newHistTitle = numPathName+
" given " + denPathName +
" "+vObj[
k]+
" Eff "+vStage[
m]+
"To"+vStage[
l];
424 if(newHistTitle.Contains(
"UM")) {
426 newHistTitle.ReplaceAll(
"UM",
"");
427 newHistTitle.Append(
"_UM");
431 TString newHistPath = currEffFolder+newHistName;
433 LogDebug(
"FourVectorHLTClient")<<
"Will make efficiency histogram " << newHistPath << endl;
435 TH1F* effHist = (TH1F*) numHist->Clone(newHistName.Data());
437 effHist->SetTitle(newHistTitle.Data());
459 LogDebug(
"FourVectorHLTClient")<<
"Numerator hist " << numHist->GetName() << endl;
460 LogDebug(
"FourVectorHLTClient")<<
"Denominator hist " << denHist->GetName() << endl;
462 LogDebug(
"FourVectorHLTClient")<<
"Booking efficiency histogram path " << newHistPath << endl;
463 LogDebug(
"FourVectorHLTClient")<<
"Booking efficiency histogram name " << newHistName << endl;
466 dbe_->book1D(newHistName.Data(), effHist);
474 vObj.push_back(TString(
"l1Etal1Phi"));
475 vObj.push_back(TString(
"onEtaonPhi"));
476 vObj.push_back(TString(
"offEtaoffPhi"));
477 vObj.push_back(TString(
"mcEtamcPhi"));
479 for (
unsigned int k=0;
k<vObj.size();
k++) {
480 for (
unsigned int l=0;
l<vStage.size();
l++) {
481 for (
unsigned int m=0;
m<vStage.size();
m++) {
484 TString oldHistPathNum;
485 TString oldHistPathNumBck;
486 TString oldHistPathDen;
489 oldHistPathNum =
sourceDir_+
"/"+hltPath+
"/"+numPathName+
"_wrt_"+denPathName+
"_"+vObj[
k]+vStage[
l]+vStage[
m];
490 oldHistPathNumBck =
sourceDir_+
"/"+hltPath+
"/"+numPathName+
"_wrt_"+denPathName+
"_"+vObj[
k]+vStage[
m]+vStage[
l];
493 TString tempDenString = vStage[
l];
494 tempDenString.ReplaceAll(
"UM",
"") ;
495 oldHistPathDen =
sourceDir_+
"/"+hltPath+
"/"+numPathName+
"_wrt_"+denPathName+
"_"+vObj[
k]+tempDenString;
501 LogDebug(
"FourVectorHLTClient")<<
" oldHistPathNum = " << oldHistPathNum << endl;
502 LogDebug(
"FourVectorHLTClient")<<
" oldHistPathNumBck = " << oldHistPathNumBck << endl;
503 LogDebug(
"FourVectorHLTClient")<<
" oldHistPathDen = " << oldHistPathDen << endl;
506 if ( numME && denME ) {
508 LogDebug(
"FourVectorHLTClient")<<
"DID find NUM and DEN histograms to derive eff " << vStage[
m]<<
"To"<<vStage[
l]<<
" using:" <<endl
509 <<
" NUM = " << oldHistPathNum << endl
510 <<
" DEN = " << oldHistPathDen << endl;
515 LogDebug(
"FourVectorHLTClient")<<
"Cannot find NUM and DEN histograms to derive eff " << vStage[
m]<<
"To"<<vStage[
l]<<
" using:" <<endl
516 <<
" NUM = " << oldHistPathNum << endl
517 <<
" DEN = " << oldHistPathDen << endl;
519 if ( numMEBck && denME) {
521 LogDebug(
"FourVectorHLTClient")<<
"DID find NUM and DEN histograms to derive eff " << vStage[
m]<<
"To"<<vStage[
l]<<
" using:" <<endl
522 <<
" NUM = " << oldHistPathNumBck << endl
523 <<
" DEN = " << oldHistPathDen << endl;
529 LogDebug(
"FourVectorHLTClient")<<
"Cannot find NUM and DEN histograms to derive eff " << vStage[
m]<<
"To"<<vStage[
l]<<
" using:" <<endl
530 <<
" NUM = " << oldHistPathNumBck << endl
531 <<
" DEN = " << oldHistPathDen << endl;
539 TH2F* numHist = numME->
getTH2F();
540 TH2F* denHist = denME->
getTH2F();
544 TString newHistName = hltPath +
"_wrt_" + denPathName +
"_"+vObj[
k]+
"_Eff_"+vStage[
m]+
"To"+vStage[
l];
547 if(newHistName.Contains(
"UM")) {
549 newHistName.ReplaceAll(
"UM",
"");
550 newHistName.Append(
"_UM");
554 TString newHistTitle = numPathName+
" given " + denPathName +
" "+vObj[
k]+
" Eff "+vStage[
m]+
"To"+vStage[
l];
556 if(newHistTitle.Contains(
"UM")) {
558 newHistTitle.ReplaceAll(
"UM",
"");
559 newHistTitle.Append(
"_UM");
563 TString newHistPath = currEffFolder+newHistName;
566 LogDebug(
"FourVectorHLTClient")<<
"Will make efficiency histogram " << newHistPath << endl;
568 TH2F* effHist = (TH2F*) numHist->Clone(newHistName.Data());
570 effHist->SetTitle(newHistTitle.Data());
574 effHist->Divide(numHist,denHist,1.,1.);
578 LogDebug(
"FourVectorHLTClient")<<
"Booking efficiency histogram path " << newHistPath << endl;
579 LogDebug(
"FourVectorHLTClient")<<
"Booking efficiency histogram name " << newHistName << endl;
582 dbe_->book2D(newHistName.Data(), effHist);
593 hltPathNameColl->Delete();
std::vector< MonitorElement * > v_ME_HLTPassPass_
void normalizeHLTMatrix()
std::vector< MonitorElement * > v_ME_HLTPassPass_Normalized_
TString removeVersions(TString histVersion)
std::vector< MonitorElement * > v_ME_HLTPass_Normalized_Any_
std::string pathsSummaryFilterCountsFolder_
HLTConfigProvider hltConfig_
std::string pathsSummaryFolder_
std::vector< MonitorElement * > hltMEs
std::vector< std::pair< std::string, std::string > > custompathnamepairs_
TH1F * getTH1F(void) const
void calculateRatio(TH1F *effHist, TH1F *denHist)
std::string pathsSummaryHLTCorrelationsFolder_
TH2F * getTH2F(void) const
std::string pathsSummaryFilterEfficiencyFolder_
tuple size
Write out results.
const std::vector< std::string > & datasetNames() const