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 232 of file LArQuickHistMerge.cxx.

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

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:
lumiFormat.i
int i
Definition: lumiFormat.py:85
histCollection::histPerDir_t::obj
TObject * obj
Definition: LArQuickHistMerge.cxx:74
hotSpotInTAG.lowerLB
int lowerLB
Definition: hotSpotInTAG.py:175
dbg
Definition: SGImplSvc.cxx:69
identical
void identical(TObject *a, const TObject *b)
Definition: LArQuickHistMerge.cxx:215
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