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

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

◆ name

std::string histCollection::histPerDir_t::name

Definition at line 67 of file LArQuickHistMerge.cxx.

◆ obj

TObject* histCollection::histPerDir_t::obj

Definition at line 68 of file LArQuickHistMerge.cxx.


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