ATLAS Offline Software
Loading...
Searching...
No Matches
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 65 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 227 of file LArQuickHistMerge.cxx.

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

Member Data Documentation

◆ mergeMethod

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

Definition at line 70 of file LArQuickHistMerge.cxx.

◆ name

std::string histCollection::histPerDir_t::name

Definition at line 68 of file LArQuickHistMerge.cxx.

◆ obj

TObject* histCollection::histPerDir_t::obj

Definition at line 69 of file LArQuickHistMerge.cxx.


The documentation for this class was generated from the following file: