ATLAS Offline Software
Public Member Functions | Public Attributes | List of all members
histCollection::histPerDir_t Class Reference
Collaboration diagram for histCollection::histPerDir_t:

Public Member Functions

 histPerDir_t (const std::string &nameIn, TObject *objIn, TTree *md, bool dbg=false)
 

Public Attributes

std::string name
 
TObject * obj
 
void(* mergeMethod )(TObject *a, const TObject *b)
 

Detailed Description

Definition at line 70 of file LArQuickHistMerge.cxx.

Constructor & Destructor Documentation

◆ histPerDir_t()

histCollection::histPerDir_t::histPerDir_t ( const std::string &  nameIn,
TObject *  objIn,
TTree *  md,
bool  dbg = false 
)

Definition at line 231 of file LArQuickHistMerge.cxx.

231  :
232  name (nameIn),
233  obj(objIn),
234  mergeMethod(nullptr)
235 {
236 
237  //Some sanity checks:
238  if (!objIn) {
239  std::cout << "ERROR while adding " << nameIn << ": Histogram pointer is NULL" << std::endl;
240  return;
241  }
242 
243  char howToMerge[256]={};
244  char mdName[256]={};
245  strcpy(howToMerge,"<default>");
246  if (!md) {
247  std::cout << "ERROR while adding " << nameIn << ": No metadata tree. Use default merging method" << std::endl;
248  }
249  else {
250  md->SetBranchAddress("MergeMethod", howToMerge);
251  md->SetBranchAddress("Name", mdName);
252  unsigned nEntries = md->GetEntries();
253  for (unsigned i=0;i<nEntries;++i) {
254  md->GetEntry(i);
255  if (name.compare(mdName)==0) break;
256  }
257  }
258 
259  if (dbg) std::cout << "Name:" << mdName << " mergeMethod=" << howToMerge << std::endl;
260  if (nullptr!=dynamic_cast<TH1*>(obj)) {
261  if (!strcmp(howToMerge,"<default>"))
262  mergeMethod=&defaultMerge<TH1>;
263  else if (!strcmp(howToMerge,"weightedAverage"))
264  mergeMethod=&weightedAverageTH1;
265  else if (!strcmp(howToMerge,"weightedEff"))
266  mergeMethod=&weightedEff;
267  else if (!strcmp(howToMerge,"mergeRMS"))
268  mergeMethod=&mergeRMS;
269  else if (!strcmp(howToMerge,"RMSpercentDeviation"))
270  mergeMethod=&RMSpercentDeviation;
271  else if (!strcmp(howToMerge,"perBinEffPerCent"))
272  mergeMethod=&perBinEffPerCent;
273  else if (!strcmp(howToMerge,"lowerLB"))
275  else if (!strcmp(howToMerge,"identical"))
277 
278  else {
279  std::cout << "ERROR: Unknown merging method (" << howToMerge << ") for object of type TH1 named " << nameIn << std::endl;
280  obj=nullptr;
281  }
282  }// end if TH1
283  else if (nullptr!=dynamic_cast<TH2*>(obj)) {
284  if (!strcmp(howToMerge,"<default>"))
285  mergeMethod=&defaultMerge<TH2>;
286  else if (!strcmp(howToMerge,"weightedAverage"))
287  mergeMethod=&weightedAverageTH2;
288  else {
289  std::cout << "ERROR: Unknown merging method (" << howToMerge << ") for object of type TH2 named " << nameIn << std::endl;
290  obj=nullptr;
291  }
292 
293  }// end if TH2
294  else {
295  std::cout << "Object "<< name << " has unkown type" << std::endl;
296  obj=nullptr;
297  }
298 }

Member Data Documentation

◆ mergeMethod

void(* histCollection::histPerDir_t::mergeMethod) (TObject *a, const TObject *b)

Definition at line 75 of file LArQuickHistMerge.cxx.

◆ name

std::string histCollection::histPerDir_t::name

Definition at line 73 of file LArQuickHistMerge.cxx.

◆ obj

TObject* histCollection::histPerDir_t::obj

Definition at line 74 of file LArQuickHistMerge.cxx.


The documentation for this class was generated from the following file:
dbg
bool dbg
Definition: listroot.cxx:36
lumiFormat.i
int i
Definition: lumiFormat.py:92
histCollection::histPerDir_t::obj
TObject * obj
Definition: LArQuickHistMerge.cxx:74
hotSpotInTAG.lowerLB
int lowerLB
Definition: hotSpotInTAG.py:175
TH2
Definition: rootspy.cxx:373
identical
void identical(TObject *a, const TObject *b)
Definition: LArQuickHistMerge.cxx:214
TH1
Definition: rootspy.cxx:268
histCollection::histPerDir_t::name
std::string name
Definition: LArQuickHistMerge.cxx:73
dqBeamSpot.nEntries
int nEntries
Definition: dqBeamSpot.py:73
histCollection::histPerDir_t::mergeMethod
void(* mergeMethod)(TObject *a, const TObject *b)
Definition: LArQuickHistMerge.cxx:75