//////////////////////////////////////////////////////////////////////////
// //
// TMBTree class for BCJet taggers //
// //
// Created: 18-JUL-2002 A. Naumann (axel@fnal.gov) //
// //
//////////////////////////////////////////////////////////////////////////
#include "tmb_tree/TMBBCTagger.hpp"
#include "tmb_tree/TMBBCJet.hpp"
ClassImp(TMBBCTagger)
const Float_t TMBBCTagger::InvalidValue = 9E9;
TMBBCTagger::~TMBBCTagger() {
if (fParameters) delete[] fParameters;
if (fErrors) delete[] fErrors;
if (fTagObjects) delete fTagObjects;
};
TMBBCTagger* TMBBCTagger::Get(const TMBBCJet* jet){
// Returns the jet's tag
return Get(jet, IsA());
}
TMBBCTagger* TMBBCTagger::Get(const TMBBCJet* jet, const TClass* cl){
// Returns the jet's tag of type cl
if (!jet) {
Warning("GetTag(const TMBBCJet* jet)","jet is NULL!n");
return NULL;
}
return jet->GetTagger(cl?cl:IsA());
}
TMBBCTagger& TMBBCTagger::SetSize(UInt_t numparams, UInt_t numtagobjs) {
if (fNumEntries) {
delete [] fParameters;
delete [] fErrors;
fParameters=0;
fErrors=0;
}
// fTagObjects.Expand(numtagobjs);
fNumTags=numtagobjs;
fNumEntries = numparams * numtagobjs;
if (fNumEntries) {
fParameters = new Float_t[fNumEntries];
fErrors = new Float_t[fNumEntries];
memset(fParameters,0,sizeof(Float_t)*fNumEntries);
memset(fErrors,0,sizeof(Float_t)*fNumEntries);
}
return *this;
}
Float_t TMBBCTagger::GetParameterOutput(UInt_t param) {
if (GetNumTags()==1)
return GetParameterOutput(param,0);
Warning("GetParameterOutput(BIDParameter param)",
"This method (combining all tag objects' parameters for a given parameter) has not been implemented yet.");
return InvalidValue;
}
Float_t TMBBCTagger::GetParameterError(UInt_t param){
if (GetNumTags()==1)
return GetParameterError(param,0);
Warning("GetParameterError(BIDParameter param)",
"This method (combining all tag objects' errors for a given parameter) has not been implemented yet.");
return InvalidValue;
}
Float_t TMBBCTagger::GetTagOutput(UInt_t obj){
if (GetNumParameters()==1)
return GetParameterOutput(0,obj);
Warning("GetCombinedOutput(UInt_t obj)",
"This method (combining all parameters) has not been implemeted yet.");
return InvalidValue;
}
Float_t TMBBCTagger::GetTagError(UInt_t obj){
if (GetNumParameters()==1)
return GetParameterError(0,obj);
Warning("GetCombinedError(UInt_t obj)",
"This method (error on combining all parameters) has not been implemeted yet.");
return InvalidValue;
}
Float_t TMBBCTagger::GetOutput() {
if (GetNumParameters()==1 && GetNumTags()==1)
return GetParameterOutput(0,0);
Warning("GetParameterOutput()",
"This method (combining all parameters of all tag object) has not been implemeted yet.");
return InvalidValue;
}
Float_t TMBBCTagger::GetError() {
if (GetNumParameters()==1 && GetNumTags()==1)
return GetParameterError(0,0);
Warning("GetParameterError()",
"This method (combining all errors of all tag object) has not been implemeted yet.");
return InvalidValue;
}
Float_t TMBBCTagger::GetParameterOutput(UInt_t param, UInt_t obj) {
if (GetNumParameters()>param && GetNumTags()>obj && (fParameters))
return fParameters[obj*GetNumParameters() + param];
if (GetNumParameters()>param)
Warning("GetParameterOutput(UInt_t, UInt_t)",
"Parameter out of range.");
else
Warning("GetParameterOutput(UInt_t, UInt_t)",
"Tag object out of range.");
return InvalidValue;
}
Float_t TMBBCTagger::GetParameterError(UInt_t param, UInt_t obj) {
if (GetNumParameters()>param && GetNumTags()>obj && (fErrors))
return fErrors[obj*GetNumParameters() + param];
if (GetNumParameters()>param)
Warning("GetParameterError(UInt_t, UInt_t)",
"Parameter out of range.");
else
Warning("GetParameterError(UInt_t, UInt_t)",
"Tag object out of range.");
return InvalidValue;
}
TMBBCTagger& TMBBCTagger::SetParameterOutput(UInt_t param, UInt_t obj, Float_t value) {
if (GetNumParameters()>param && GetNumTags()>obj && (fParameters))
fParameters[obj*GetNumParameters() + param]=value;
else
if (GetNumParameters()>param)
Warning("SetParameterOutput(UInt_t, UInt_t)",
"Parameter out of range.");
else
Warning("SetParameterOutput(UInt_t, UInt_t)",
"Tag object out of range.");
return *this;
}
TMBBCTagger& TMBBCTagger::SetParameterError(UInt_t param, UInt_t obj, Float_t value) {
if (GetNumParameters()>param && GetNumTags()>obj && (fErrors))
fErrors[obj*GetNumParameters() + param]=value;
else
if (GetNumParameters()>param)
Warning("SetParameterError(UInt_t, UInt_t)",
"Parameter out of range.");
else
Warning("SetParameterError(UInt_t, UInt_t)",
"Tag object out of range.");
return *this;
}
TMBBCTagger& TMBBCTagger::SetTagObject(UInt_t obj, TObject* objref){
// can't use const * for TObject as AddAt expects non-const
// (in D0's current ROOT version)
// should be changed later
if (obj>GetNumTags())
Warning("SetTagObject(Int_t, const TObject*)","Tag object number out of range (number of tag objects was set to %d)!", GetNumTags());
else {
if (!fTagObjects)
fTagObjects=new TRefArray(GetNumTags());
fTagObjects->AddAt(objref,obj);
}
return *this;
}
ROOT page - Class index - Class Hierarchy - Top of the page
This page has been automatically generated. If you have any comments or suggestions about the page layout send a mail to ROOT support, or contact the developers with any questions or problems regarding ROOT.