14#include "TDirectory.h"
26 , fDatasetID(iDataset)
47 LOG_IF(fatal, !
fpObjDB) <<
"ObjectHandler: object database was not defined";
48 LOG_IF(fatal, !
fpOutDir) <<
"ObjectHandler: output directory was not defined";
49 LOG_IF(fatal, (
int) vpObj.size() !=
fpObjDB->GetNofVersions())
50 <<
"ObjectHandler: Attempt to add vector with object pointers of different to the one of version labels";
52 TDirectory* pCurrDir = gDirectory;
54 for (
int iVer = 0; iVer <
fpObjDB->GetNofVersions(); ++iVer) {
59 LOG_IF(fatal, strcmp(
fsBaseName.c_str(), vpObj[iVer]->GetName()))
60 <<
"Hist1DHandler: attempt to add object of different name " <<
fsBaseName <<
" vs. " << vpObj[iVer]->GetName();
62 const char* cloneName = Form(
"%s_orig_%s",
fsBaseName.data(),
fpObjDB->GetVersionLabel(iVer).data());
63 fvpObjects.push_back((TNamed*) vpObj[iVer]->Clone(cloneName));
65 gDirectory = pCurrDir;
74 int iDef =
fpObjDB->GetDefaultID();
75 for (
int iV = 0; iV < (int)
fvpObjects.size(); ++iV) {
88 LOG_IF(fatal, !pDir) <<
"ObjectHandler: attempt to pass nullptr as a folder";
Base handler class (implementation)
Base abstract class for object handler.
std::string fsBaseName
Base names of the object.
std::shared_ptr< TCanvas > fpCanvas
Comparison canvas.
std::shared_ptr< ObjectDB > fpObjDB
Pointer to object database.
virtual ECmpInference Compare(int iVersion) const =0
Compares objects to default.
void Write()
Writes objects to file.
std::vector< TNamed * > fvpObjects
Vector of objects.
ObjectHandler(int iObject, int iFile, int iDataset, const char *objType="")
Default constructor.
virtual ~ObjectHandler()
Destructor.
TDirectory * fpOutDir
Pointer to directory.
void AddObjects(const std::vector< TNamed * > &vpObj)
Adds vector of pointer to objects.
void SetOutputDirectory(TDirectory *pDir)
Sets folder to store output.
std::vector< ECmpInference > CompareWithDefault()
Compares different versions with default.
ECmpInference
The object comparison inference.
@ StronglyEqual
All the comparison methods gave equality.