EndRun.
173 LogDebug(
"FourVectorHLTClient")<<
"FourVectorHLTClient:: endLuminosityBlock " << endl;
180 std::vector<MonitorElement*> summaryME;
183 vector<float> hltPassCount;
185 for(
unsigned int i=0;
i< summaryME.size();
i++) {
187 TString nameME = (summaryME[
i])->
getName();
188 LogDebug(
"FourVectorHLTClient") <<
"ME = " << nameME << endl;
191 LogDebug(
"FourVectorHLTClient") <<
"fullPathME = " << fullPathToME << endl;
193 if(nameME.Contains(
"Filters_")) {
196 TH1F* MEHist = summaryME[
i]->getTH1F() ;
197 LogDebug(
"FourVectorHLTClient") <<
"this is TH1 first bin label = " << MEHist->GetXaxis()->GetBinLabel(1) << endl;
198 LogDebug(
"FourVectorHLTClient") <<
"is this is TH1 = " << fullPathToME << endl;
200 TString nameMEeff = nameME+
"_Eff";
201 TString titleMEeff = nameME+
" Efficiency wrt input to L1";
203 TH1F* effHist = (TH1F*) MEHist->Clone(nameMEeff.Data());
204 effHist->SetTitle(titleMEeff.Data());
206 float firstBinContent = MEHist->GetBinContent(1);
208 if(firstBinContent !=0 ) {
210 effHist->Scale(1./firstBinContent);
215 unsigned int nBins = effHist->GetNbinsX();
216 for(
unsigned int bin = 0;
bin < nBins+1;
bin++) effHist->SetBinContent(
bin, 0);
232 name.push_back(
"All");
233 name.push_back(
"Muon");
234 name.push_back(
"Egamma");
235 name.push_back(
"Tau");
236 name.push_back(
"JetMET");
237 name.push_back(
"Rest");
238 name.push_back(
"Special");
243 for (
unsigned int i=0;
i<datasetNames.size();
i++) {
245 name.push_back(datasetNames[
i]);
251 for (
unsigned int i=0;
i<name.size();
i++) {
268 TObjArray *hltPathNameColl =
new TObjArray(100);
269 hltPathNameColl->SetOwner();
270 std::vector<std::string> fullPathHLTFolders;
279 LogDebug(
"FourVectorHLTClient")<<
"endRun: sourceDir_(" <<
sourceDir_.Data() <<
") has " << fullPathHLTFolders.size() <<
" folders. " << endl;
282 for(
unsigned int i=0;
i<fullPathHLTFolders.size();
i++) {
284 LogDebug(
"FourVectorHLTClient")<<
"endRun: sourceDir_(" <<
sourceDir_.Data() <<
") folder["<<
i <<
"] = " << fullPathHLTFolders[
i] << endl;
285 TString hltPath = fullPathHLTFolders[
i].substr(fullPathHLTFolders[
i].rfind(
'/')+1, fullPathHLTFolders[
i].
size());
302 LogDebug(
"FourVectorHLTClient")<<
"Custom Efficiencies dir path = " << currEffFolder << endl;
308 LogDebug(
"FourVectorHLTClient")<<
"Number of MEs for this HLT path = " <<
hltMEs.size() << endl;
321 if(!hltPath.Contains(TString(custompathnamepair->first)))
continue;
323 TString numPathName=hltPath;
324 TString denPathName=TString(custompathnamepair->second);
330 vector<TString> vStage;
331 vStage.push_back(TString(
"L1"));
332 vStage.push_back(TString(
"On"));
333 vStage.push_back(TString(
"Off"));
334 vStage.push_back(TString(
"Mc"));
335 vStage.push_back(TString(
"L1UM"));
336 vStage.push_back(TString(
"OnUM"));
337 vStage.push_back(TString(
"OffUM"));
338 vStage.push_back(TString(
"McUM"));
340 vector<TString> vObj;
341 vObj.push_back(TString(
"l1Et"));
342 vObj.push_back(TString(
"onEt"));
343 vObj.push_back(TString(
"offEt"));
344 vObj.push_back(TString(
"mcEt"));
348 for (
unsigned int k=0;
k<vObj.size();
k++) {
349 for (
unsigned int l=0;
l<vStage.size();
l++) {
350 for (
unsigned int m=0;
m<vStage.size();
m++) {
352 TString oldHistPathNum;
353 TString oldHistPathNumBck;
354 TString oldHistPathDen;
357 oldHistPathNum =
sourceDir_+
"/"+hltPath+
"/"+numPathName+
"_wrt_"+denPathName+
"_"+vObj[
k]+vStage[
l]+vStage[
m];
358 oldHistPathNumBck =
sourceDir_+
"/"+hltPath+
"/"+numPathName+
"_wrt_"+denPathName+
"_"+vObj[
k]+vStage[
m]+vStage[
l];
361 TString tempDenString = vStage[
l];
362 tempDenString.ReplaceAll(
"UM",
"") ;
363 oldHistPathDen =
sourceDir_+
"/"+hltPath+
"/"+numPathName+
"_wrt_"+denPathName+
"_"+vObj[
k]+tempDenString;
369 LogDebug(
"FourVectorHLTClient")<<
" oldHistPathNum = " << oldHistPathNum << endl;
370 LogDebug(
"FourVectorHLTClient")<<
" oldHistPathNumBck = " << oldHistPathNumBck << endl;
371 LogDebug(
"FourVectorHLTClient")<<
" oldHistPathDen = " << oldHistPathDen << endl;
374 if ( numME && denME ) {
376 LogDebug(
"FourVectorHLTClient")<<
"DID find NUM and DEN histograms to derive eff " << vStage[
m]<<
"To"<<vStage[
l]<<
" using:" <<endl
377 <<
" NUM = " << oldHistPathNum << endl
378 <<
" DEN = " << oldHistPathDen << endl;
383 LogDebug(
"FourVectorHLTClient")<<
"Cannot find NUM and DEN histograms to derive eff " << vStage[
m]<<
"To"<<vStage[
l]<<
" using:" <<endl
384 <<
" NUM = " << oldHistPathNum << endl
385 <<
" DEN = " << oldHistPathDen << endl;
387 if ( numMEBck && denME) {
389 LogDebug(
"FourVectorHLTClient")<<
"DID find NUM and DEN histograms to derive eff " << vStage[
m]<<
"To"<<vStage[
l]<<
" using:" <<endl
390 <<
" NUM = " << oldHistPathNumBck << endl
391 <<
" DEN = " << oldHistPathDen << endl;
398 LogDebug(
"FourVectorHLTClient")<<
"Cannot find NUM and DEN histograms to derive eff " << vStage[
m]<<
"To"<<vStage[
l]<<
" using:" <<endl
399 <<
" NUM = " << oldHistPathNumBck << endl
400 <<
" DEN = " << oldHistPathDen << endl;
408 TH1F * numHist = numME->
getTH1F();
409 TH1F * denHist = denME->
getTH1F();
412 TString newHistName = hltPath +
"_wrt_" + denPathName +
"_"+vObj[
k]+
"_Eff_"+vStage[
m]+
"To"+vStage[
l];
415 if(newHistName.Contains(
"UM")) {
417 newHistName.ReplaceAll(
"UM",
"");
418 newHistName.Append(
"_UM");
422 TString newHistTitle = numPathName+
" given " + denPathName +
" "+vObj[
k]+
" Eff "+vStage[
m]+
"To"+vStage[
l];
425 if(newHistTitle.Contains(
"UM")) {
427 newHistTitle.ReplaceAll(
"UM",
"");
428 newHistTitle.Append(
"_UM");
432 TString newHistPath = currEffFolder+newHistName;
434 LogDebug(
"FourVectorHLTClient")<<
"Will make efficiency histogram " << newHistPath << endl;
436 TH1F* effHist = (TH1F*) numHist->Clone(newHistName.Data());
438 effHist->SetTitle(newHistTitle.Data());
460 LogDebug(
"FourVectorHLTClient")<<
"Numerator hist " << numHist->GetName() << endl;
461 LogDebug(
"FourVectorHLTClient")<<
"Denominator hist " << denHist->GetName() << endl;
463 LogDebug(
"FourVectorHLTClient")<<
"Booking efficiency histogram path " << newHistPath << endl;
464 LogDebug(
"FourVectorHLTClient")<<
"Booking efficiency histogram name " << newHistName << endl;
475 vObj.push_back(TString(
"l1Etal1Phi"));
476 vObj.push_back(TString(
"onEtaonPhi"));
477 vObj.push_back(TString(
"offEtaoffPhi"));
478 vObj.push_back(TString(
"mcEtamcPhi"));
480 for (
unsigned int k=0;
k<vObj.size();
k++) {
481 for (
unsigned int l=0;
l<vStage.size();
l++) {
482 for (
unsigned int m=0;
m<vStage.size();
m++) {
485 TString oldHistPathNum;
486 TString oldHistPathNumBck;
487 TString oldHistPathDen;
490 oldHistPathNum =
sourceDir_+
"/"+hltPath+
"/"+numPathName+
"_wrt_"+denPathName+
"_"+vObj[
k]+vStage[
l]+vStage[
m];
491 oldHistPathNumBck =
sourceDir_+
"/"+hltPath+
"/"+numPathName+
"_wrt_"+denPathName+
"_"+vObj[
k]+vStage[
m]+vStage[
l];
494 TString tempDenString = vStage[
l];
495 tempDenString.ReplaceAll(
"UM",
"") ;
496 oldHistPathDen =
sourceDir_+
"/"+hltPath+
"/"+numPathName+
"_wrt_"+denPathName+
"_"+vObj[
k]+tempDenString;
502 LogDebug(
"FourVectorHLTClient")<<
" oldHistPathNum = " << oldHistPathNum << endl;
503 LogDebug(
"FourVectorHLTClient")<<
" oldHistPathNumBck = " << oldHistPathNumBck << endl;
504 LogDebug(
"FourVectorHLTClient")<<
" oldHistPathDen = " << oldHistPathDen << endl;
507 if ( numME && denME ) {
509 LogDebug(
"FourVectorHLTClient")<<
"DID find NUM and DEN histograms to derive eff " << vStage[
m]<<
"To"<<vStage[
l]<<
" using:" <<endl
510 <<
" NUM = " << oldHistPathNum << endl
511 <<
" DEN = " << oldHistPathDen << endl;
516 LogDebug(
"FourVectorHLTClient")<<
"Cannot find NUM and DEN histograms to derive eff " << vStage[
m]<<
"To"<<vStage[
l]<<
" using:" <<endl
517 <<
" NUM = " << oldHistPathNum << endl
518 <<
" DEN = " << oldHistPathDen << endl;
520 if ( numMEBck && denME) {
522 LogDebug(
"FourVectorHLTClient")<<
"DID find NUM and DEN histograms to derive eff " << vStage[
m]<<
"To"<<vStage[
l]<<
" using:" <<endl
523 <<
" NUM = " << oldHistPathNumBck << endl
524 <<
" DEN = " << oldHistPathDen << endl;
530 LogDebug(
"FourVectorHLTClient")<<
"Cannot find NUM and DEN histograms to derive eff " << vStage[
m]<<
"To"<<vStage[
l]<<
" using:" <<endl
531 <<
" NUM = " << oldHistPathNumBck << endl
532 <<
" DEN = " << oldHistPathDen << endl;
540 TH2F* numHist = numME->
getTH2F();
541 TH2F* denHist = denME->
getTH2F();
545 TString newHistName = hltPath +
"_wrt_" + denPathName +
"_"+vObj[
k]+
"_Eff_"+vStage[
m]+
"To"+vStage[
l];
548 if(newHistName.Contains(
"UM")) {
550 newHistName.ReplaceAll(
"UM",
"");
551 newHistName.Append(
"_UM");
555 TString newHistTitle = numPathName+
" given " + denPathName +
" "+vObj[
k]+
" Eff "+vStage[
m]+
"To"+vStage[
l];
557 if(newHistTitle.Contains(
"UM")) {
559 newHistTitle.ReplaceAll(
"UM",
"");
560 newHistTitle.Append(
"_UM");
564 TString newHistPath = currEffFolder+newHistName;
567 LogDebug(
"FourVectorHLTClient")<<
"Will make efficiency histogram " << newHistPath << endl;
569 TH2F* effHist = (TH2F*) numHist->Clone(newHistName.Data());
571 effHist->SetTitle(newHistTitle.Data());
575 effHist->Divide(numHist,denHist,1.,1.);
579 LogDebug(
"FourVectorHLTClient")<<
"Booking efficiency histogram path " << newHistPath << endl;
580 LogDebug(
"FourVectorHLTClient")<<
"Booking efficiency histogram name " << newHistName << endl;
594 hltPathNameColl->Delete();
std::vector< std::string > getSubdirs(void) const
MonitorElement * book1D(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1D histogram.
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 getName(Reflex::Type &cc)
MonitorElement * get(const std::string &path) const
get ME from full pathname (e.g. "my/long/dir/my_histo")
std::vector< MonitorElement * > getContents(const std::string &path) const
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
MonitorElement * book2D(const char *name, const char *title, int nchX, double lowX, double highX, int nchY, double lowY, double highY)
Book 2D histogram.
std::string pathsSummaryFilterEfficiencyFolder_
tuple size
Write out results.
void setCurrentFolder(const std::string &fullpath)
const std::vector< std::string > & datasetNames() const