CMS 3D CMS Logo

List of all members | Static Public Member Functions
DQMTTreeIO::DQMMergeHelper Class Reference

Static Public Member Functions

static bool CheckBinLabels (const TAxis *a1, const TAxis *a2)
 
static void mergeTogether (TH1 *original, TH1 *toAdd)
 

Detailed Description

Definition at line 59 of file DQMRootSource.cc.

Member Function Documentation

◆ CheckBinLabels()

static bool DQMTTreeIO::DQMMergeHelper::CheckBinLabels ( const TAxis *  a1,
const TAxis *  a2 
)
inlinestatic

Definition at line 63 of file DQMRootSource.cc.

63  {
64  // Check that axis have same labels
65  THashList* l1 = (const_cast<TAxis*>(a1))->GetLabels();
66  THashList* l2 = (const_cast<TAxis*>(a2))->GetLabels();
67 
68  if (!l1 && !l2)
69  return true;
70  if (!l1 || !l2) {
71  return false;
72  }
73 
74  // Check now labels sizes are the same
75  if (l1->GetSize() != l2->GetSize()) {
76  return false;
77  }
78 
79  for (int i = 1; i <= a1->GetNbins(); ++i) {
80  std::string_view label1 = a1->GetBinLabel(i);
81  std::string_view label2 = a2->GetBinLabel(i);
82  if (label1 != label2) {
83  return false;
84  }
85  }
86 
87  return true;
88  }

References testProducerWithPsetDescEmpty_cfi::a2, mps_fire::i, bTagCommon_cff::label1, and bTagCommon_cff::label2.

Referenced by mergeTogether().

◆ mergeTogether()

static void DQMTTreeIO::DQMMergeHelper::mergeTogether ( TH1 *  original,
TH1 *  toAdd 
)
inlinestatic

Definition at line 91 of file DQMRootSource.cc.

91  {
92  if (original->CanExtendAllAxes() && toAdd->CanExtendAllAxes()) {
93  TList list;
94  list.Add(toAdd);
95  if (original->Merge(&list) == -1) {
96  edm::LogError("MergeFailure") << "Failed to merge DQM element " << original->GetName();
97  }
98  } else {
99  // TODO: Redo. This is both more strict than what ROOT checks for yet
100  // allows cases where ROOT fails with merging.
101  if (original->GetNbinsX() == toAdd->GetNbinsX() &&
102  original->GetXaxis()->GetXmin() == toAdd->GetXaxis()->GetXmin() &&
103  original->GetXaxis()->GetXmax() == toAdd->GetXaxis()->GetXmax() &&
104  original->GetNbinsY() == toAdd->GetNbinsY() &&
105  original->GetYaxis()->GetXmin() == toAdd->GetYaxis()->GetXmin() &&
106  original->GetYaxis()->GetXmax() == toAdd->GetYaxis()->GetXmax() &&
107  original->GetNbinsZ() == toAdd->GetNbinsZ() &&
108  original->GetZaxis()->GetXmin() == toAdd->GetZaxis()->GetXmin() &&
109  original->GetZaxis()->GetXmax() == toAdd->GetZaxis()->GetXmax() &&
110  CheckBinLabels(original->GetXaxis(), toAdd->GetXaxis()) &&
111  CheckBinLabels(original->GetYaxis(), toAdd->GetYaxis()) &&
112  CheckBinLabels(original->GetZaxis(), toAdd->GetZaxis())) {
113  original->Add(toAdd);
114  } else {
115  edm::LogError("MergeFailure") << "Found histograms with different axis limits or different labels '"
116  << original->GetName() << "' not merged.";
117  }
118  }
119  }

References CheckBinLabels(), list(), definitions::original, and HLT_2018_cff::toAdd.

Referenced by DQMTTreeIO::TreeObjectReader< T >::read().

mps_fire.i
i
Definition: mps_fire.py:355
testProducerWithPsetDescEmpty_cfi.a2
a2
Definition: testProducerWithPsetDescEmpty_cfi.py:35
bTagCommon_cff.label2
label2
Definition: bTagCommon_cff.py:168
DQMTTreeIO::DQMMergeHelper::CheckBinLabels
static bool CheckBinLabels(const TAxis *a1, const TAxis *a2)
Definition: DQMRootSource.cc:63
edm::LogError
Definition: MessageLogger.h:183
definitions.original
original
Definition: definitions.py:57
bTagCommon_cff.label1
label1
Definition: bTagCommon_cff.py:167
HLT_2018_cff.toAdd
toAdd
Definition: HLT_2018_cff.py:50595
list
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision and the trigger will pass if any such matching triggers are FAIL or EXCEPTION A wildcarded negative criterion that matches more than one trigger in the trigger list("!*", "!HLTx*" if it matches 2 triggers or more) will accept the event if all the matching triggers are FAIL. It will reject the event if any of the triggers are PASS or EXCEPTION(this matches the behavior of "!*" before the partial wildcard feature was incorporated). Triggers which are in the READY state are completely ignored.(READY should never be returned since the trigger paths have been run