Common Analysis Framework » QFRAMEWORK » TQNFCalculator

class TQNFCalculator: public TQNFBase


 TQNFCalculator

 The TQNFCalculator is a class that automates calculation of
 normalization factors based on control regions.
 It works based on a TQSampleDataReader.

 The TQNFCalculator supports two different operational modes
 1) manual subtraction of unscaled samples
 To use the TQNFCalculator in this mode, you should
 set the default data path to your data path
 subtracting all samples that have no NF applied, e.g.
 NFCalculator::setDefaultDataPath("data - sig - bkg/unscaled")
 2) automatic handling of fixed samples
 To use the TQNFCalculator in this mode, you should call
 TQNFCalculator::addFixSample(path)
 you can choose to either use the combined path, e.g.
 "sig - bkg/unscaled"
 or make several calls for individual sample groups, e.g.
 TQNFCalculator::addFixSample("sig")
 TQNFCalculator::addFixSample("bkg/unscaled")
 The central values should be the same for both methods,
 but the error calculation is more correct when using automatic mode.

 It is possible to set bounds on individual NFs for floating (non-fixed)
 samples by using the variant
 TQNFCalculator::addSample(name,path,lowerBound,upperBound);
 This should be done whenever possible, since the precision of some methods
 relies heavily on sensible bounds.

 Additionally, the TQNFCalculator supports different methods calculation
 - 'simple' or 'single mode': in cases when there is only one floating
 sample this method is not using any elaborate technique, but instead
 calculates the NF arithmeticall ('by hand')
 - 'TFractionFitter': a TFractionFitter is used to simulatenously fit all
 NFs in all regions. The error calculation is not entirely correct since
 event weights are not handled propery
 - 'MatrixInversion' : this mode is only possible if the number of floating
 samples equals the number of regions. Here, all are filled into a matrix
 which is then inverted. While this yields correct central values in principle,
 the precision and especially the correctness of the error propagation depends
 heavily on the condition of the matrix. For optimal results, lower and upper bounds
 should be set for each NF and the NFs and regions should be appended in the correct
 order, i.e. such that the matrix is mostly diagonal
 It is possible to have the TQNFCalculator try different methods successively, via
 TQNFCalculator::addMethod(methodName)
 For this purpose, two 'fallback'-methods exist:
 - 'Unity' will set all NFs to unity (NF=1)
 - 'FAIL' will unset all NFs and report an error


Function Members (Methods)

public:
virtual~TQNFCalculator()
voidTObject::AbstractMethod(const char* method) const
booladdFixSample(TString mcPath, TString name = "")
booladdMethod(const TString& methodName)
voidTQNFBase::addNFPath(const TString& path, const TString& cutname, const TString& scalescheme = ".default")
booladdRegion(TString cutName, TString myDataPath = "")
booladdSample(TString mcPath, TString name = "", bool fixed = false)
booladdSample(TString mcPath, TString name, double boundLower, double boundUpper)
boolTQTaggable::allTagsOfTypeBool()
boolTQTaggable::allTagsOfTypeDouble()
boolTQTaggable::allTagsOfTypeInteger()
boolTQTaggable::allTagsOfTypeString()
boolTQTaggable::allTagsValidBools()
boolTQTaggable::allTagsValidDoubles()
boolTQTaggable::allTagsValidIntegers()
virtual voidTObject::AppendPad(Option_t* option = "")
virtual voidTObject::Browse(TBrowser* b)
intcalculateNFs()
intcalculateNFs(const TString& methodName)
boolTQTaggable::canSetThisTag(const TString& key, bool& treatAsList)
ULong_tTObject::CheckedHash()
intTQTaggable::claimTags(const TString& definition, bool printErrMsg = false)
intTQTaggable::claimTags(const TString& definition, TString& message)
intTQTaggable::claimTags(const TString& definition, TString& missing, TString& invalid, TString& unexpected)
static TClass*Class()
virtual const char*TObject::ClassName() const
voidclear()
virtual voidTNamed::Clear(Option_t* option = "")
voidclearMethods()
intTQTaggable::clearTags()
virtual TObject*TNamed::Clone(const char* newname = "") const
voidTQNFBase::closeOutputStream()
virtual Int_tTNamed::Compare(const TObject* obj) const
virtual voidTNamed::Copy(TObject& named) const
intTQTaggable::countMatchingTags(const TString& name) const
virtual voidTObject::Delete(Option_t* option = "")MENU
intdeployNF(const TString& name, const vector<TString>& startCutNames, const vector<TString>& stopAtCut = std::vector<TString>(), int overwrite = 1, bool applyToStopCut = true)
virtual intdeployResult(const vector<TString>& startCutNames, const vector<TString>& stopAtCut, int overwrite, bool applyToStopCut)
virtual Int_tTObject::DistancetoPrimitive(Int_t px, Int_t py)
virtual voidTObject::Draw(Option_t* option = "")
virtual voidTObject::DrawClass() constMENU
virtual TObject*TObject::DrawClone(Option_t* option = "") constMENU
virtual voidTObject::Dump() constMENU
virtual voidTObject::Error(const char* method, const char* msgfmt,...) const
virtual intexecute(int itrNumber = -1)
virtual voidTObject::Execute(const char* method, const char* params, Int_t* error = 0)
virtual voidTObject::Execute(TMethod* method, TObjArray* params, Int_t* error = 0)
virtual voidTObject::ExecuteEvent(Int_t event, Int_t px, Int_t py)
boolTQTaggable::exportConfigFile(bool writeUnreadKeys = true)
boolTQTaggable::exportConfigFile(const TString& filename, bool writeUnreadKeys = true)
boolTQTaggable::exportConfigFile(const TString& filename, const TString& prefix, bool writeUnreadKeys = true)
TQSampleFolder*exportHistograms(bool postFit = true)
boolexportHistogramsToFile(const TString& destination, bool recreate = true, bool postFit = true)
boolexportHistogramsToSampleFolder(TQSampleFolder* folder, bool postFit = true)
intTQTaggable::exportTags(TQTaggable* dest, const TString& subDest = "", const TString& filter = "", bool recursive = false)
TStringTQTaggable::exportTagsAsConfigString(const TString& prefix, const TString& filter = "")
stringTQTaggable::exportTagsAsStandardConfigString(const TString& prefix, const TString& filter = "")
stringTQTaggable::exportTagsAsStandardString(const TString& filter = "", bool xmlStyle = false)
TStringTQTaggable::exportTagsAsString(const TString& filter = "", bool xmlStyle = false)
virtual voidTObject::Fatal(const char* method, const char* msgfmt,...) const
virtual voidTNamed::FillBuffer(char*& buffer)
boolTQNFBase::finalize()
virtual TObject*TObject::FindObject(const char* name) const
virtual TObject*TObject::FindObject(const TObject* obj) const
virtual TQTaggable*TQTaggable::getBaseTaggable() const
TStringgetDefaultDataPath()
virtual TList*TQTaggable::getDescendantTaggables()
virtual Option_t*TObject::GetDrawOption() const
static Longptr_tTObject::GetDtorOnly()
doublegetEpsilon()
virtual TStringTQTaggable::getFlags()
intTQTaggable::getFlagsSize()
boolTQTaggable::getGlobalIgnoreCase() const
boolTQTaggable::getGlobalOverwrite() const
static shared_ptr<TQTaggable>TQTaggable::getGlobalTaggable(const char* name)
static shared_ptr<TQTaggable>TQTaggable::getGlobalTaggable(const TString& name)
TH1*getHistogram(const TString& name)
virtual const char*TObject::GetIconName() const
TList*TQTaggable::getListOfKeys(const TString& filter = "")
virtual TList*TQTaggable::getListOfTaggables(const TString& name)
TList*TQTaggable::getListOfTagNames()
virtual TList*TQTaggable::getListOfUnreadKeys(const TString& filter = "")
TH1*getMCHistogram(const TString& name)
const TString&getMCPath(const TString& name)
virtual TStringTQNamedTaggable::getName() const
virtual const char*TNamed::GetName() const
virtual const TString&TQNamedTaggable::getNameConst() const
doublegetNF(TString name)
boolgetNFandUncertainty(TString name, double& nf, double& sigma)
const vector<TString>&TQNFBase::getNFpaths()
doublegetNFUncertainty(TString name)
intTQTaggable::getNTags() const
virtual char*TObject::GetObjectInfo(Int_t px, Int_t py) const
static Bool_tTObject::GetObjectStat()
virtual Option_t*TObject::GetOption() const
TStringTQNFBase::getPathTag(const TString& tagname)
TQSampleDataReader*TQNFBase::getReader()
TStringgetResultsAsString(const TString& name)
TQTaggable*getResultsAsTags(const TString& name)
TQSampleFolder*TQNFBase::getSampleFolder()
virtual intgetStatus()
virtual TStringgetStatusMessage()
boolTQTaggable::getTag(const TString& key, double& value)
boolTQTaggable::getTag(const TString& key, int& value)
boolTQTaggable::getTag(const TString& key, bool& value)
boolTQTaggable::getTag(const TString& key, TString& value)
intTQTaggable::getTag(const TString& key, vector<TString>& vec)
intTQTaggable::getTag(const TString& key, vector<int>& vec)
intTQTaggable::getTag(const TString& key, vector<double>& vec)
intTQTaggable::getTag(const TString& key, vector<bool>& vec)
intTQTaggable::getTag(const TString& key, TList* l)
boolTQTaggable::getTag(const TString& key, double& value, bool recursive)
boolTQTaggable::getTag(const TString& key, int& value, bool recursive)
boolTQTaggable::getTag(const TString& key, bool& value, bool recursive)
boolTQTaggable::getTag(const TString& key, TString& value, bool recursive)
boolTQTaggable::getTagAsString(const TString& key, TString& tag)
boolTQTaggable::getTagBool(const TString& key, bool& value)
boolTQTaggable::getTagBool(const TString& key, bool& value, bool recursive)
boolTQTaggable::getTagBoolDefault(const TString& key, bool defaultVal = false)
doubleTQTaggable::getTagDefault(const TString& key, double defaultVal)
intTQTaggable::getTagDefault(const TString& key, int defaultVal)
boolTQTaggable::getTagDefault(const TString& key, bool defaultVal)
TStringTQTaggable::getTagDefault(const TString& key, const TString& defaultVal)
TStringTQTaggable::getTagDefault(const TString& key, const char* defaultVal)
boolTQTaggable::getTagDouble(const TString& key, double& value)
boolTQTaggable::getTagDouble(const TString& key, double& value, bool recursive)
doubleTQTaggable::getTagDoubleDefault(const TString& key, double defaultVal = 0.)
virtual TList*TQTaggable::getTaggablesByName(const TString& name)
boolTQTaggable::getTagInteger(const TString& key, int& value)
boolTQTaggable::getTagInteger(const TString& key, int& value, bool recursive)
intTQTaggable::getTagIntegerDefault(const TString& key, int defaultVal = 0)
TList*TQTaggable::getTagList(const TString& key)
intTQTaggable::getTagListLength(const TString& key)
intTQTaggable::getTagsSize()
stringTQTaggable::getTagStandardStringDefault(const TString& key, const TString& defaultVal = "")
boolTQTaggable::getTagString(const TString& key, TString& value)
boolTQTaggable::getTagString(const TString& key, TString& value, bool recursive)
TStringTQTaggable::getTagStringDefault(const TString& key, const TString& defaultVal = "")
vector<bool>TQTaggable::getTagVBool(const TString& key)
vector<double>TQTaggable::getTagVDouble(const TString& key)
vector<int>TQTaggable::getTagVInt(const TString& key)
vector<int>TQTaggable::getTagVInteger(const TString& key)
vector<string>TQTaggable::getTagVStandardString(const TString& key)
vector<TString>TQTaggable::getTagVString(const TString& key)
vector<TString>TQNFBase::getTargetCuts(const vector<TString>& startCuts, const vector<TString>& stopCuts, bool applyToStopCut)
voidTQNFBase::getTargetCutsWorker(TList* targets, TQFolder* startCut, TList* stopCuts = __null, bool applyToStopCut = true)
virtual TStringTQNamedTaggable::getTitle()
virtual const char*TNamed::GetTitle() const
virtual const TString&TQNamedTaggable::getTitleConst() const
boolTQTaggable::getTypeOfTagAsString(const TString& key, TString& type)
virtual UInt_tTObject::GetUniqueID() const
static const TString&TQTaggable::getValidKeyCharacters()
boolTQTaggable::getValueOfTagAsString(const TString& key, TString& value)
TStringTQTaggable::getValuesOfTags(const TString& keys, const TString& sep = ", ")
virtual Bool_tTObject::HandleTimer(TTimer* timer)
boolTQTaggable::hasEquivalentTag(const TQValue* reference, bool recurseUp = true)
boolTQTaggable::hasEquivalentTag(const TQValue& reference, bool recurseUp = true)
boolTQTaggable::hasEquivalentTag(const TString& key, const TString& value)
boolTQTaggable::hasEquivalentTag(const TString& key, const double value)
boolTQTaggable::hasEquivalentTag(const TString& key, const int value)
boolTQTaggable::hasEquivalentTag(const TString& key, const bool value)
static boolTQTaggable::hasGlobalTaggable(const char* name)
static boolTQTaggable::hasGlobalTaggable(const TString& name)
virtual ULong_tTNamed::Hash() const
Bool_tTObject::HasInconsistentHash() const
boolTQTaggable::hasMatchingTag(const TString& name) const
boolTQTaggable::hasTag(const TString& key)
boolTQTaggable::hasTagBool(const TString& key)
boolTQTaggable::hasTagDouble(const TString& key)
boolTQTaggable::hasTagInteger(const TString& key)
boolTQTaggable::hasTagString(const TString& key)
boolTQTaggable::hasTagWithIndex(const TString& key)
boolTQTaggable::hasTagWithoutIndex(const TString& key)
virtual boolTQTaggable::hasUnreadKeys(const TString& filter = "")
intTQTaggable::importTag(TString tag, bool overwrite = true, bool keepStringQuotes = false)
intTQTaggable::importTags(TString tags, bool overwrite = true, bool keepStringQuotes = false)
intTQTaggable::importTags(const TQTaggable* tags, bool overwrite = true, bool recursive = false)
intTQTaggable::importTags(shared_ptr<TQTaggable> tags, bool overwrite = true, bool recursive = false)
intTQTaggable::importTags(const TQTaggable& tags, bool overwrite = true, bool recursive = false)
intTQTaggable::importTagsWithoutPrefix(const TQTaggable* tags, const TString& prefix, bool overwrite = true, bool recursive = false)
intTQTaggable::importTagsWithoutPrefix(const TQTaggable& tags, const TString& prefix, bool overwrite = true, bool recursive = false)
intTQTaggable::importTagsWithPrefix(TString tags, const TString& prefix, bool overwrite = true, bool keepStringQuotes = false, TString fallbackKey = "")
intTQTaggable::importTagsWithPrefix(const TQTaggable* tags, const TString& prefix, bool overwrite = true, bool recursive = false, TString fallbackKey = "")
intTQTaggable::importTagsWithPrefix(const TQTaggable& tags, const TString& prefix, bool overwrite = true, bool recursive = false, TString fallbackKey = "")
intTQTaggable::importTagWithPrefix(const TString& tag, const TString& prefix, bool overwrite = true, TString fallbackKey = "", bool keepStringQuotes = false)
virtual voidTObject::Info(const char* method, const char* msgfmt,...) const
virtual Bool_tTObject::InheritsFrom(const char* classname) const
virtual Bool_tTObject::InheritsFrom(const TClass* cl) const
boolTQNFBase::initialize()
virtual voidTObject::Inspect() constMENU
voidTObject::InvertBit(UInt_t f)
virtual TClass*IsA() const
Bool_tTObject::IsDestructed() const
virtual Bool_tTObject::IsEqual(const TObject* obj) const
virtual Bool_tTObject::IsFolder() const
Bool_tTObject::IsOnHeap() const
virtual Bool_tTNamed::IsSortable() const
boolTQTaggable::isTagOverwrittenByDescendants(TString key)
static boolTQTaggable::isValidKey(const TString& key)
Bool_tTObject::IsZombie() const
virtual voidTNamed::ls(Option_t* option = "") const
static TList*TQTaggable::makeListOfTags(TList* unTags)
voidTObject::MayNotUse(const char* method) const
virtual Bool_tTObject::Notify()
voidTObject::Obsolete(const char* method, const char* asOfVers, const char* removedFromVers) const
virtual voidTQTaggable::onAccess(TQValue* tag)
virtual voidTQTaggable::onRead(TQValue* tag)
virtual voidTQTaggable::onWrite(TQValue* tag)
voidTObject::operator delete(void* ptr)
voidTObject::operator delete(void* ptr, void* vp)
voidTObject::operator delete[](void* ptr)
voidTObject::operator delete[](void* ptr, void* vp)
void*TObject::operator new(size_t sz)
void*TObject::operator new(size_t sz, void* vp)
void*TObject::operator new[](size_t sz)
void*TObject::operator new[](size_t sz, void* vp)
TQNFCalculator&operator=(const TQNFCalculator&)
virtual voidTObject::Paint(Option_t* option = "")
static TQTaggable*TQTaggable::parseFlags(const TString& flags)
boolTQTaggable::parseKey(TString key, TString& bareKey, int& opUp, int& opDown)
static TQTaggable*TQTaggable::parseParameterList(const TString& parameter, const TString& sep = ",", bool trim = true, const TString& blocks = "", const TString& quotes = "")
virtual voidTObject::Pop()
virtual voidTNamed::Print(Option_t* option = "") const
intTQTaggable::printClaim(const TString& definition)
boolTQTaggable::printDiffOfTags(TQTaggable* tags, const TString& options = "")
boolTQTaggable::printDiffOfTags(TQTaggable* tags, TQTaggable& options)
voidprintMethods()
voidTQNFBase::printNFPaths()
voidprintRegions(ostream* os = &(std::cout))
voidprintResults(ostream* os = &(std::cout))
voidprintSamples(ostream* os = &(std::cout))
voidprintStatus()
voidTQTaggable::printTags(TString options = "r")
virtual Int_tTObject::Read(const char* name)
virtual boolreadConfiguration(TQFolder* f)
virtual voidTObject::RecursiveRemove(TObject* obj)
static boolTQTaggable::removeGlobalTaggable(const char* name)
static boolTQTaggable::removeGlobalTaggable(const TString& name)
intTQTaggable::removeTag(const TString& key)
intTQTaggable::removeTags(const TString& key)
boolTQTaggable::renameTag(const TString& oldKey, const TString& newKey)
intTQTaggable::renameTags(const TString& oldPrefix, const TString& newPrefix)
stringTQTaggable::replaceInStandardString(const TString& in, bool keepQuotes = false)
stringTQTaggable::replaceInStandardString(const TString& in, const char* prefix, bool keepQuotes = false)
stringTQTaggable::replaceInStandardString(const TString& in, const TString& prefix, bool keepQuotes = false)
stringTQTaggable::replaceInStandardStringRecursive(TString in, const TString& prefix = "", bool keepQuotes = false)
intTQTaggable::replaceInTags(TQTaggable& params, const TString& tagFilter = "*")
TStringTQTaggable::replaceInText(const TString& in, bool keepQuotes = false)
TStringTQTaggable::replaceInText(const TString& in, const char* prefix, bool keepQuotes = false)
TStringTQTaggable::replaceInText(const TString& in, const TString& prefix, bool keepQuotes = false)
TStringTQTaggable::replaceInText(const TString& in, int& nReplaced, int& nFailed, bool keepQuotes = false)
TStringTQTaggable::replaceInText(TString in, int& nReplaced, int& nFailed, const TString& prefix, bool keepQuotes = false)
TStringTQTaggable::replaceInTextRecursive(TString in, const TString& prefix = "", bool keepQuotes = false)
voidTObject::ResetBit(UInt_t f)
virtual voidTQTaggable::resetReadFlags()
virtual voidTObject::SaveAs(const char* filename = "", Option_t* option = "") constMENU
virtual voidTObject::SavePrimitive(ostream& out, Option_t* option = "")
boolscaleSample(const TString& name, double val)
voidTObject::SetBit(UInt_t f)
voidTObject::SetBit(UInt_t f, Bool_t set)
voidTQNFBase::setChainLoader(TQNFChainloader* loader)
voidTQNFBase::setCutInfoFolder(TQFolder* f)
voidsetDefaultDataPath(TString path)
virtual voidTObject::SetDrawOption(Option_t* option = "")MENU
static voidTObject::SetDtorOnly(void* obj)
voidsetEpsilon(double e)
voidTQTaggable::setGlobalIgnoreCase(bool globalIgnoreCase = true)
voidTQTaggable::setGlobalOverwrite(bool globalOverwrite = true)
voidTQNFBase::setInfoFolder(TQFolder* f)
virtual voidTQNamedTaggable::setName(const TString& newName)
virtual voidTNamed::SetName(const char* name)MENU
virtual voidTNamed::SetNameTitle(const char* name, const char* title)
voidsetNFsUnity()
static voidTObject::SetObjectStat(Bool_t stat)
voidTQNFBase::setOutputStream(const TString& outfile = "", int verbosity = 2)
voidTQNFBase::setReader(TQSampleDataReader* rd)
voidTQNFBase::setSampleFolder(TQSampleFolder* sf)
intTQTaggable::setTag(const TString& key, double value, const TString& destination = "")
intTQTaggable::setTag(const TString& key, int value, const TString& destination = "")
intTQTaggable::setTag(const TString& key, bool value, const TString& destination = "")
intTQTaggable::setTag(const TString& key, const TString& value, const TString& destination = "")
intTQTaggable::setTag(const TString& key, const char* value, const TString& destination = "")
intTQTaggable::setTag(const char* key, double value, const TString& destination = "")
intTQTaggable::setTag(const char* key, int value, const TString& destination = "")
intTQTaggable::setTag(const char* key, bool value, const TString& destination = "")
intTQTaggable::setTag(const char* key, const TString& value, const TString& destination = "")
intTQTaggable::setTag(const char* key, const char* value, const TString& destination = "")
intTQTaggable::setTagAuto(const TString& key, TString value, const TString& destination = "")
intTQTaggable::setTagBool(TString key, bool value, const TString& destination = "")
intTQTaggable::setTagDouble(TString key, double value, const TString& destination = "")
intTQTaggable::setTagInteger(TString key, int value, const TString& destination = "")
intTQTaggable::setTagList(const TString& key, TString value, const TString& destination = "")
intTQTaggable::setTagString(TString key, const TString& value, const TString& destination = "")
virtual voidTQNamedTaggable::setTitle(const TString& newTitle)
virtual voidTNamed::SetTitle(const char* title = "")MENU
virtual voidTObject::SetUniqueID(UInt_t uid)
voidTQNFBase::setVerbosity(int verbosity)
virtual voidShowMembers(TMemberInspector& insp) const
virtual Int_tTNamed::Sizeof() const
virtual voidStreamer(TBuffer&)
voidStreamerNVirtual(TBuffer& ClassDef_StreamerNVirtual_b)
virtual boolsuccess()
virtual voidTObject::SysError(const char* method, const char* msgfmt,...) const
boolTQTaggable::tagIsOfTypeBool(const TString& key)
boolTQTaggable::tagIsOfTypeDouble(const TString& key)
boolTQTaggable::tagIsOfTypeInteger(const TString& key)
boolTQTaggable::tagIsOfTypeString(const TString& key)
boolTQTaggable::tagsAreEquivalentTo(TQTaggable* tags, const TString& filter = "")
Bool_tTObject::TestBit(UInt_t f) const
Int_tTObject::TestBits(UInt_t f) const
TQNFCalculator(TQSampleFolder* f = __null)
TQNFCalculator(TQSampleDataReader* rd)
virtual voidTObject::UseCurrentStyle()
virtual voidTObject::Warning(const char* method, const char* msgfmt,...) const
virtual Int_tTObject::Write(const char* name = 0, Int_t option = 0, Int_t bufsize = 0)
virtual Int_tTObject::Write(const char* name = 0, Int_t option = 0, Int_t bufsize = 0) const
intwriteResultsToFile(const TString& filename)
intwriteResultsToStream(ostream* out)
protected:
intcalculateNFs(TQNFCalculator::Method method)
voidcalculateNFs_MatrixMode()
voidcalculateNFs_singleMode()
voidcalculateNFs_TFractionFitterMode()
intTQTaggable::countTagDown(const TString& key)
intTQTaggable::countTagUp(const TString& key)
virtual voidTObject::DoError(int level, const char* location, const char* fmt, va_list va) const
boolensurePositiveMC()
voidfail()
virtual boolfinalizeSelf()
size_tfindIndex(TString name)
TQValue*TQTaggable::findTag(TString name)
size_tgetFloatingSamples()
TList*TQTaggable::getListOfTags()
TQNFCalculator::MethodgetMethod(TString name)
TStringgetMethodName(TQNFCalculator::Method method)
boolTQTaggable::getOp(const TString& op, int& opCode)
TQTaggable*getResultsAsTags(size_t i)
boolTQTaggable::getTag(const TString& key, TQValue*& tag)
boolinitializeData()
boolinitializeMC()
virtual boolinitializeSelf()
voidTObject::MakeZombie()
intTQTaggable::setTag(TQValue* tag, const TString& destination = "")
intTQTaggable::setTag(TQValue* tag, const TString& destination, bool overwrite)
private:
virtual Bool_tCheckTObjectHashConsistency() const

Data Members

public:
static TQNFCalculator::MethodFAIL
static TQNFCalculator::MethodFractionFitter
static TQNFCalculator::MethodMatrixInversion
static TQNFCalculator::MethodSingle
static TQNFCalculator::MethodUNDEFINED
static TQNFCalculator::MethodUnity
static TObject::(anonymous)TObject::kBitMask
static TObject::EStatusBitsTObject::kCanDelete
static TObject::EStatusBitsTObject::kCannotPick
static TObject::EStatusBitsTObject::kHasUUID
static TObject::(anonymous)TObject::kInconsistent
static TObject::EStatusBitsTObject::kInvalidObject
static TObject::(anonymous)TObject::kIsOnHeap
static TObject::EStatusBitsTObject::kIsReferenced
static TObject::EStatusBitsTObject::kMustCleanup
static TObject::EStatusBitsTObject::kNoContextMenu
static TObject::(anonymous)TObject::kNotDeleted
static TObject::EDeprecatedStatusBitsTObject::kObjInCanvas
static TObject::(anonymous)TObject::kOverwrite
static TObject::(anonymous)TObject::kSingleKey
static TObject::(anonymous)TObject::kWriteDelete
static TObject::(anonymous)TObject::kZombie
protected:
vector<double>NFs
vector<double>NFuncertainties
TQNFChainloader*TQNFBase::chainLoader
TQFolder*TQNFBase::cutInfoFolder
vector<TString>cutNames
TH1F*data
vector<TString>dataPaths
TStringdefaultDataPath
doubleepsilon
boolTQTaggable::fGlobalIgnoreCase!
boolTQTaggable::fGlobalOverwrite!
TStringTNamed::fNameobject identifier
boolTQNFBase::fOwnerOfReader
TList*TQTaggable::fReadFlags!
TQSampleDataReader*TQNFBase::fReader
TList*TQTaggable::fTags
TStringTNamed::fTitleobject title
TQFolder*TQNFBase::infoFolder
boolTQNFBase::initialized
intTQNFBase::iterationNumber
static TObject::(anonymous)TObject::kOnlyPrepStep
static TQTaggable::(anonymous)TQTaggable::kOpADD
static TQTaggable::(anonymous)TQTaggable::kOpAND
static TQTaggable::(anonymous)TQTaggable::kOpCNT
static TQTaggable::(anonymous)TQTaggable::kOpMULT
static TQTaggable::(anonymous)TQTaggable::kOpNone
static TQTaggable::(anonymous)TQTaggable::kOpOR
static TQTaggable::(anonymous)TQTaggable::kOpRec
TObjArray*mc
vector<bool>mcFixed
vector<TString>mcNames
vector<TString>mcPaths
TQMessageStreamTQNFBase::messages!
vector<TQNFCalculator::Method>methods
vector<double>nfBoundLower
vector<double>nfBoundUpper
static map<TString,shared_ptr<TQTaggable> >TQTaggable::sGlobalTaggables
intstatus
vector<TString>TQNFBase::vNFpathsthe non-abstract class has to keep this vector updated with the complete paths where NFs have been set, e.g. "/bkg/ee/Zjets/.default:CutZCR_VBF_C". It is handy to fill this vector if execute(0) is called, i.e. during the first iteration run by TQNFChainloader.
intTQNFBase::verbosity

Class Charts

Inheritance Chart:
TObject
TNamed
TQTaggable
TQNamedTaggable
TQNFBase
TQNFCalculator

Function documentation

TQNFCalculator(TQSampleFolder* f = __null)
 default constructor taking base sample folder
TQNFCalculator(TQSampleDataReader* rd)
 default constructor taking base sample folder
TString getDefaultDataPath()
 retrieve the default data path currently set
~TQNFCalculator()
 default destructor, cleaning up all pointer fields
int deployNF(const TString& name, const vector<TString>& startCutNames, const vector<TString>& stopAtCut = std::vector<TString>(), int overwrite = 1, bool applyToStopCut = true)
 deploys a selected NF in all known locations
 stop if this cut is an point of tree of cuts on which to apply the NFs

  std::cout<<"deployNF called with cutName = "<< cutName.Data()<<", stopAtCutNames:"<<std::endl;
  TQListUtils::print(stopAtCutNames);
  std::cout<<"This is where I'd apply NFs with the new code:"<<std::endl;
  std::vector<TString> startCuts;
  startCuts.push_back(cutName);
  std::vector<TString> targets = this->getTargetCuts(startCuts,stopAtCutNames);
  TQListUtils::print(targets);
  std::cout<<"Now go and compare if I did it right ;)"<<std::endl;

int deployResult(const vector<TString>& startCutNames, const vector<TString>& stopAtCut, int overwrite, bool applyToStopCut)
void clear()
 clear all names, paths and results
void setDefaultDataPath(TString path)
 set the default data path
 this path is going to be used if no path is supplied
 when adding regions via addRegion(...)
bool addRegion(TString cutName, TString myDataPath = "")
 add a new region. the region name will be the cut name
 optional argument: supply a data path from which data will be obtained
bool addSample(TString mcPath, TString name = "", bool fixed = false)
 add a new monte carlo sample group from the given location
 optional argument: supply a name for easy reference
bool addSample(TString mcPath, TString name, double boundLower, double boundUpper)
 add a new monte carlo sample group from the given location
 optional argument: supply a name for easy reference
bool addFixSample(TString mcPath, TString name = "")
 add a new monte carlo sample group from the given location
 as opposed to TQNFCalculator::addSample, no NF will be fitted
 instead, the NF will be fixed to 1
bool initializeData()
 initialize the data histogram
bool ensurePositiveMC()
 ensure positive mc for all samples
bool initializeMC()
 initialize all mc histograms
bool finalizeSelf()
bool initializeSelf()
 initialize the NF Calculator
 - initializes the data histogram
 - initializeds the mc histograms
 will set the initialize flag to true
 further calls of initialize will have no effect
 until clear is called
size_t getFloatingSamples()
 return the number of "floating" (i.e. non-fixed) samples
void calculateNFs_MatrixMode()
 in the case where the number of samples
 and the number of regions are identical
 the TFractionFitter cannot be used
 hence, this function implements a matrix calculation
 for this particular case
void calculateNFs_singleMode()
 in the case of only one sample group
 the TFractionFitter cannot be used
 hence, this function implements a manual calculation
 for the case of only one sample group
void calculateNFs_TFractionFitterMode()
 this is the worker function
 actually performing the NF calculation
 in the default case of more than one sample group
int calculateNFs(const TString& methodName)
 calculate the NFs with a certain method (given by the string)
 the following tags control the side-effects of this function:
 - saveLog: string, name of the log file to be used
 if not given, print to the console
 - writePreFitHistograms: string, name of the root file to be created
 if not given, nothing will be written
 - writePostFitHistograms: string, name of the root file to be created
 if not given, nothing will be written
 - saveResults: string, name of the text file to be used for result output
 if not given, nothing will be written
int calculateNFs()
 actually perform the NF calculation
 based on all information supplied earlier
 the following tags control the side-effects of this function:
 - saveLog: string, name of the log file to be used
 if not given, print to the console
 - writePreFitHistograms: string, name of the root file to be created
 if not given, nothing will be written
 - writePostFitHistograms: string, name of the root file to be created
 if not given, nothing will be written
 - saveResults: string, name of the text file to be used for result output
 if not given, nothing will be written
void setNFsUnity()
 set all the NFs to one
void fail()
 acquire failure state
int calculateNFs(TQNFCalculator::Method method)
 actually perform the NF calculation
 based on all information supplied earlier
size_t findIndex(TString name)
 get the contribution index coresponding to the given NF name
double getNF(TString name)
 get the value of the NF with the given name
double getNFUncertainty(TString name)
 get the uncertainty of the NF with the given name
bool getNFandUncertainty(TString name, double& nf, double& sigma)
 get the value and uncertainty of the NF with the given name
 store both in the values supplied as second and third argument
void printRegions(ostream* os = &(std::cout))
 print all regions scheduled for NF calculation
void printSamples(ostream* os = &(std::cout))
 print all sample groups scheduled for NF calculatrion
void printResults(ostream* os = &(std::cout))
 print the results of the evaluation
TH1* getHistogram(const TString& name)
 obtain the histogram associated with the given sample group
 will accept all mc names as well as "data" (for the data histogram)
bool scaleSample(const TString& name, double val)
 scale the histogram associated to the sample with the given name by the
 given value
const TString& getMCPath(const TString& name)
 retrieve the sample path
 corresponding to the sample
 with the given name
int getStatus()
 retrieve the status
TString getStatusMessage()
 decode the integer status code
void printStatus()
 print the status
int execute(int itrNumber = -1)
start calculation
bool success()
 return true if calculation was successful
 false otherwise
void setEpsilon(double e)
 set the epsilon deviation allowed for fixed samples
 smaller values will increase the accuracy of the calculation
 but also increase the probability of the fit to fail
double getEpsilon()
 get the current value of the epsilon deviation
 allowed for fixed samples
int writeResultsToFile(const TString& filename)
 dump the results of the NF calculation to a text file
TString getResultsAsString(const TString& name)
 dump the results of the NF calculation for a particular contribution
 into a string that is formatted according to the TQTaggable syntax
TQTaggable* getResultsAsTags(const TString& name)
 dump the results of the NF calculation for a particular contribution
 into an object of the TQTaggable type
TQTaggable* getResultsAsTags(size_t i)
 dump the results of the NF calculation for a particular entry
 into an object of the TQTaggable type
int writeResultsToStream(ostream* out)
 dump the results of the NF calculation to an output stream
bool readConfiguration(TQFolder* f)
 read a configuration from a TQFolder instance
 the following tags are interpreted:
 verbosity: integer, increasing value increases verbosity
 epsilon: double, the 'epsilon'-value for the calculation
 defaultDataPath: string, the default data path
 methods: list, methods to be used in order of priority
 all tags are copied to the calculator

 a subfolder 'samples' is expected
 each folder in 'samples/?' is interpreted as one sample group
 the following parameters are accepted and interpreted
 name: string, the name of this group
 path: string, the path of this group
 fixed: bool, true for fixed samples, false for floating ones
 upper: upper bound for this NF (recommended, but not required)
 lower: lower bound for this NF (recommended, but not required)

 a subfolder 'regions' is expected
 each folder in 'regions/?' is interpreted as one sample group
 the following parameters are accepted and interpreted
 name: string, the name of this region (name of the counter)
 datapath: string, the data path to be used for this region
 if not set, the defaultDataPath will be used
 active: bool. if false, this region is ignored. default is true.

 this function returns true if at least one region and at least one floating
 sample group have been found and added successfully.
TH1* getMCHistogram(const TString& name)
 retrieve the histogram
 corresponding to the sample
 with the given name
TQSampleFolder* exportHistograms(bool postFit = true)
 export the histograms to a new sample folder
bool exportHistogramsToFile(const TString& destination, bool recreate = true, bool postFit = true)
 export the histograms to some root file
 the 'recreate' flag controls if the file is opened in APPEND or RECREATE mode
 if postfit=true, the post-fit histograms are saved (if possible)
 if the calculation has not yet been performed or has failed, the pre-fit ones are saved instead
bool exportHistogramsToSampleFolder(TQSampleFolder* folder, bool postFit = true)
 export the histograms to an existing sample folder
 if postfit=true, the post-fit histograms are saved (if possible)
 if the calculation has not yet been performed or has failed, the pre-fit ones are saved instead
bool addMethod(const TString& methodName)
 add a method at the back of the queue
void clearMethods()
 empty the method queue
void printMethods()
 print all currently scheduled methods in order of priority
Method getMethod(TString name)
TString getMethodName(TQNFCalculator::Method method)