Common Analysis Framework » QFRAMEWORK » TQCut

class TQCut: public TNamed


 TQCut

 The TQCut class is a representation of an event selection cut. Instances of this
 class ("cut") may build up a tree-like hierarchy. Every instance has zero or exactly one
 base instance and any number of descendant instances. Navigation in upward direction is
 possible by using getBase() and getRoot(), which return the base instance and the root
 instance of this instance respectively.

 Internally, a TQObservable is used to evaluate the cut on each individual event.

 The TQCut can be constructed from a string expression of the following syntax:

 cutName : parentCutName << cutExpression ;

 which passes events where cutExpression evaluates to true (1.)
 and fails events where cutExpression evaluates to false (0.)

 It is also possible to apply weights by extending the syntax as follows

 cutName : parentCutName << cutExpression : weightExpression ;

 where weightExpression may evaluate to any floating number that is multiplied
 to the event weight.

 Both, cutExpression and weightExpression, may use any type of expression
 that TQObservable::getTreeObservable function can make sense of. This
 especially includes arithmetic expressions using branch names present in the
 TTree.

 Please consider the following example cut definitions for guidance

 CutPreSelect << MET > 20000. ;
 CutLeptonPt : CutPreSelect << (lepPt0 > 22000. || lepPt1 > 22000.) ;
 CutBVeto : CutLeptonPt << nJets_Pt25_MV1_85 == 0 : bTagEventWeight ;
 CutZVeto : CutBVeto << abs(Mll - 91187.6) <= 15000 ;
 CutZttVeto : CutZVeto << !(x1 > 0 && x2 >0 && abs(Mtt - 91187.6) <= 25000.) ;

 It is also possible and even advisable to construct a TQCut based on an
 instance of TQFolder. Here, the tree-like folder structure can be mapped 1:1
 to the cut structure created, where each folder in the structure may contain
 tags that control the effect of the cut that is created:
 .name: name of this cut, leave empty or omit to use folder name
 .title: title of this cut, leave empty or omit to use name
 .cutExpression: cut expression, leave empty or omit to pass all events
 .weightExpression: weight expression, leave empty or omit to apply unity weight
 .cutObservableName: name of the cut observable to be used, leave empty or
 omit to use "CUTNAME_cut"
 .weightObservableName: name of the weight observable to be used, leave empty or
 omit to use "CUTNAME_weight"

 The expressions may contain placeholders that will be filled from tags in
 the sample folder structure. You may choose to use $(bTagWeightName) as a
 placeholder and set the tag "bTagWeightName=bTagEventWeight" on your base
 sample folder. The replacement will be performed each time a new sample is
 opened, which allows you to use different cut or weight expressions for
 different branches of your sample folder structure. For further details,
 please read the documentation of the function
 TQObservable::compileExpression.


This class is also known as (typedefs to this class)

TQCompiledCut, TQCompiledCut, TQCompiledCut, TQCompiledCut

Function Members (Methods)

public:
virtual~TQCut()
voidTObject::AbstractMethod(const char* method) const
booladdAnalysisJob(TQAnalysisJob* newJob_, const TString& cuts_ = "")
TQCut*addAndReturnCut(const TString& definition_)
booladdCut(const TString& definition_)
booladdCut(TQCut* cut)
booladdCut(TQCut* cut, const TString& baseCutName)
voidanalyse(double weight, bool useWeights)
virtual voidTObject::AppendPad(Option_t* option = "")
virtual voidTObject::Browse(TBrowser* b)
boolcanFinalize(TQSampleFolder* sf) const
boolcanInitialize(TQSampleFolder* sf) const
ULong_tTObject::CheckedHash()
static TClass*Class()
virtual const char*TObject::ClassName() const
virtual voidTNamed::Clear(Option_t* option = "")
voidclearAnalysisJobs()
virtual TObject*TNamed::Clone(const char* newname = "") const
virtual intCompare(const TObject* obj) const
voidconsolidate()
virtual voidTNamed::Copy(TObject& named) const
static TQCut*createCut(const TString& definition_)
static TQCut*createCut(const TString& name, const TString& cutExpr, const TString& weightExpr = "")
virtual voidTObject::Delete(Option_t* option = "")MENU
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
intdumpToFolder(TQFolder* folder)
virtual voidTObject::Error(const char* method, const char* msgfmt,...) const
virtual voidTObject::Execute(const char* method, const char* params, Int_t* error = 0)
virtual voidTObject::Execute(TMethod* method, TObjArray* params, Int_t* error = 0)
boolexecuteAnalysisJobs(double weight)
virtual voidTObject::ExecuteEvent(Int_t event, Int_t px, Int_t py)
TList*exportDefinitions(bool terminatingColon = false)
virtual voidTObject::Fatal(const char* method, const char* msgfmt,...) const
virtual voidTNamed::FillBuffer(char*& buffer)
virtual boolfinalize()
boolfinalizeSampleFolder(TQSampleFolder* sf)
virtual TObject*TObject::FindObject(const char* name) const
virtual TObject*TObject::FindObject(const TObject* obj) const
TStringgetActiveCutExpression() const
TStringgetActiveWeightExpression() const
TQCut*getBase()
const TQCut*getBaseConst() const
TQCut*getClone()
TQCut*getCompiledClone(TQTaggable* tags)
TStringgetCompiledCutExpression(TQTaggable* tags)
TStringgetCompiledWeightExpression(TQTaggable* tags)
TQCut*getCut(const TString& name)
const TString&getCutExpression() const
vector<TString>getCutNames(const TString& cutName)
TQObservable*getCutObservable()
TObjArray*getCuts()
intgetDepth() const
virtual Option_t*TObject::GetDrawOption() const
static Longptr_tTObject::GetDtorOnly()
TStringgetGlobalCutExpression(TQTaggable* tags = __null)
virtual doublegetGlobalWeight() const
TStringgetGlobalWeightExpression(TQTaggable* tags = __null)
virtual const char*TObject::GetIconName() const
const vector<TQSampleFolder*>&getInitializationHistory() const
TObjArray*getJobs()
virtual TObjArray*getListOfBranches()
TObjArray*getListOfCuts()
voidgetMatchingCuts(TObjArray& matchingCuts, const TString& name)
voidgetMatchingCuts(TObjArray& matchingCuts, const TObjArray& name_sep, int offset = 0)
virtual const char*TNamed::GetName() const
intgetNAnalysisJobs()
TStringgetNodeName()
virtual char*TObject::GetObjectInfo(Int_t px, Int_t py) const
static Bool_tTObject::GetObjectStat()
virtual Option_t*TObject::GetOption() const
TStringgetPath()
boolgetPrintResults() const
TQCut*getRoot()
TQSample*getSample()
TQCut*getSingleCut(TString name, TString excl_pattern = "PATTERNYOUWON'TSEE")
boolgetSkipAnalysisJobsGlobal() const
virtual const char*TNamed::GetTitle() const
virtual UInt_tTObject::GetUniqueID() const
virtual doublegetWeight(bool doPrint = false) const
const TString&getWeightExpression() const
TQObservable*getWeightObservable()
intgetWidth() const
virtual Bool_tTObject::HandleTimer(TTimer* timer)
virtual ULong_tTNamed::Hash() const
Bool_tTObject::HasInconsistentHash() const
static TQCut*importFromFolder(TQFolder* folder, TQTaggable* tags = __null)
boolincludeBase()
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
virtual boolinitialize(TQSample* sample)
boolinitializeSampleFolder(TQSampleFolder* sf)
virtual voidTObject::Inspect() constMENU
voidTObject::InvertBit(UInt_t f)
virtual TClass*IsA() const
boolisDescendantOf(TString cutName)
Bool_tTObject::IsDestructed() const
virtual Bool_tTObject::IsEqual(const TObject* obj) const
virtual Bool_tTObject::IsFolder() const
virtual boolisMergeable() const
Bool_tTObject::IsOnHeap() const
boolisResidualMatchingSegmentOptional(const TObjArray& name_segments, int offset = 0)
virtual Bool_tTNamed::IsSortable() const
static boolisTrivialFalse(const TString& expr)
static boolisTrivialTrue(const TString& expr)
static boolisValidName(const TString& name_)
Bool_tTObject::IsZombie() const
virtual voidTNamed::ls(Option_t* option = "") const
voidTObject::MayNotUse(const char* method) const
virtual Bool_tTObject::Notify()
voidTObject::Obsolete(const char* method, const char* asOfVers, const char* removedFromVers) const
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)
TQCut&operator=(const TQCut&)
virtual voidTObject::Paint(Option_t* option = "")
static boolparseCutDefinition(const TString& definition_, TString* name_, TString* baseCutName_, TString* cutExpr_, TString* weightExpr_)
static boolparseCutDefinition(TString definition_, TString& name_, TString& baseCutName_, TString& cutExpr_, TString& weightExpr_)
virtual boolpassed(bool doPrint = false) const
virtual boolpassedGlobally() const
virtual voidTObject::Pop()
voidprint(const TString& options = "r")
virtual voidTNamed::Print(Option_t* option = "") const
voidprintActiveCutExpression(size_t indent = 0) const
voidprintAnalysisJobs(const TString& options = "")
voidprintCut(const TString& options = "r")
voidprintCuts(const TString& options = "r")
boolprintDiagram(TQTaggable& options)
boolprintDiagram(const TString& options)
voidprintEvaluation() const
voidprintEvaluation(Long64_t iEvent) const
voidprintWeightComponents() const
voidprintWeightComponents(Long64_t iEvent) const
voidpropagateMatchingCuts(TObjArray& matchingCuts, const TObjArray& name_sep, int offset = 0)
virtual Int_tTObject::Read(const char* name)
virtual voidTObject::RecursiveRemove(TObject* obj)
boolremoveCut(const TString& name)
voidTObject::ResetBit(UInt_t f)
virtual voidTObject::SaveAs(const char* filename = "", Option_t* option = "") constMENU
virtual voidTObject::SavePrimitive(ostream& out, Option_t* option = "")
voidTObject::SetBit(UInt_t f)
voidTObject::SetBit(UInt_t f, Bool_t set)
voidsetCutExpression(const TString& cutExpression)
voidsetCuts(TObjArray* cuts)
virtual voidTObject::SetDrawOption(Option_t* option = "")MENU
static voidTObject::SetDtorOnly(void* obj)
virtual voidTNamed::SetName(const char* name)MENU
virtual voidTNamed::SetNameTitle(const char* name, const char* title)
static voidTObject::SetObjectStat(Bool_t stat)
voidsetPrintResults(int maxCount = 0)
voidsetSkipAnalysisJobsGlobal(bool skip = true)
virtual voidTNamed::SetTitle(const char* title = "")MENU
virtual voidTObject::SetUniqueID(UInt_t uid)
voidsetWeightExpression(const TString& weightExpression)
virtual voidShowMembers(TMemberInspector& insp) const
virtual Int_tTNamed::Sizeof() const
voidsort()
virtual voidStreamer(TBuffer&)
voidStreamerNVirtual(TBuffer& ClassDef_StreamerNVirtual_b)
virtual voidTObject::SysError(const char* method, const char* msgfmt,...) const
Bool_tTObject::TestBit(UInt_t f) const
Int_tTObject::TestBits(UInt_t f) const
TQCut()
TQCut(const TQCut&)
TQCut(const TString& name_, const TString& title_ = "", const TString& cutExpression = "", const TString& weightExpression = "")
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
static voidwriteDiagramFooter(ostream& os, TQTaggable& tags)
static voidwriteDiagramHeader(ostream& os, TQTaggable& tags)
intwriteDiagramText(ostream& os, TQTaggable& tags, TString pos = "")
boolwriteDiagramToFile(const TString& filename, const TString& options = "")
boolwriteDiagramToFile(const TString& filename, TQTaggable& tags)
TStringwriteDiagramToString(TQTaggable& tags)
protected:
voidanalyseVariants(const TQCut::VariantResults* preceedingResults, bool useWeights, double baseWeight = 1.)
static TQCut*createFromFolderInternal(TQFolder* folder, TQTaggable* tags)
intcreateVariantFolders(TQSampleFolder* sf, const TQCut::VariantDefinitionList* variantDefs)
TQCut::VariantStackElement*createVariantLayer(const vector<TQCut::VariantHandle>& preceedingHandles, TQSampleFolder* nextSF, const TQCut::VariantDefinitionList* variantDefs)
boolcreateVariants(TQSampleFolder* nextSF, const TQCut::VariantDefinitionList* variantDefs)
virtual voidTObject::DoError(int level, const char* location, const char* fmt, va_list va) const
virtual boolfinalizeObservables()
virtual boolfinalizeSelfSampleFolder(TQSampleFolder* sf)
boolfinalizeVariants()
boolfinalizeVariantsSampleFolder(TQSampleFolder* sf)
virtual TObjArray*getOwnBranches()
voidimportFromFolderInternal(TQFolder* folder, TQTaggable* tags)
boolinitialize(TQSample* sample, const TQCut::VariantDefinitionList* variantDefs)
virtual boolinitializeObservables()
boolinitializeSampleFolder(TQSampleFolder* sf, const TQCut::VariantDefinitionList* variantDefs)
virtual boolinitializeSelfSampleFolder(TQSampleFolder* sf)
boolinitializeVariants(TQSample* sample, bool hasNewVariantLayer)
boolinitializeVariantsSampleFolder(TQSampleFolder* sf, bool hasNewVariantLayer)
voidTObject::MakeZombie()
boolprintEvaluationStep(size_t indent) const
voidprintInternal(const TString& options, int indent)
voidsetBase(TQCut* base_)
boolskipAnalysisJobs(TQSampleFolder* sf)
boolverifyVariantSetup(const vector<TQCut::VariantHandle>& parentHandles)
private:
virtual Bool_tCheckTObjectHashConsistency() const

Data Members

public:
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:
TObjArray*fAnalysisJobs!
TQCut*fBase
TStringfCutExpression
TQCutIteratorfCutItr!
TQObservable*fCutObservable!
TObjArray*fCuts
vector<TQSampleFolder*>fInitializationHistory!
TQAnalysisJobIteratorfJobItr!
TStringTNamed::fNameobject identifier
intfPrintResultmax number of events for which cut decision (and weight value) should be printed
intfPrintResultCount! transient member keeping track of how many decisions have already been printed
TQSample*fSample!
boolfSkipAnalysisJobsset based on tags on sample folders
boolfSkipAnalysisJobsGlobalset based on tags during cut creation (from TQFolder)
TStringTNamed::fTitleobject title
TTree*fTree!
TQToken*fTreeToken!
TQCut::VariantResults*fVariantResults!
vector<TQCut::VariantStackElement*>fVariantStack!
TStringfWeightExpression
TQObservable*fWeightObservable!
static TObject::(anonymous)TObject::kOnlyPrepStep

Class Charts

Inheritance Chart:
TObject
TNamed
TQCut
TQUniqueCut

Function documentation

bool isValidName(const TString& name_)
 Check whether the string passed is a valid cut name. Return
 true if name is valid and false otherwise. Valid cut names
 may contain the letters a..z, A..Z, 0..9 and an underscore "_".
bool parseCutDefinition(const TString& definition_, TString* name_, TString* baseCutName_, TString* cutExpr_, TString* weightExpr_)
 parse the definition of the cut and deploy the parsed fields in the argument pointers
bool parseCutDefinition(TString definition_, TString& name_, TString& baseCutName_, TString& cutExpr_, TString& weightExpr_)
 parse the definition of the cut and deploy the parsed fields in the argument references
TQCut * createCut(const TString& definition_)
 create a new TQCut from the given definition
TQCut * createCut(const TString& name, const TString& cutExpr, const TString& weightExpr = "")
 create a new TQCut from the given parameters
TQCut* createFromFolderInternal(TQFolder* folder, TQTaggable* tags)
 import the cut from a folder created with TQCut::dumpToFolder(...)
void importFromFolderInternal(TQFolder* folder, TQTaggable* tags)
import descendent cuts from
TQCut * importFromFolder(TQFolder* folder, TQTaggable* tags = __null)
TQCut()
 default constructor, needed for streaming
TQCut(const TString& name_, const TString& title_ = "", const TString& cutExpression = "", const TString& weightExpression = "")
 constructor taking additioinal arguments
TList * exportDefinitions(bool terminatingColon = false)
 export all cut definitions as a TList
void setBase(TQCut* base_)
 set the base cut
TQCut * getBase()
 Return the base cut of this cut
TString getPath()
 Return the path to this cut
const TQCut * getBaseConst() const
 Return the base cut of this cut
TQCut * getRoot()
 Return the root cut of this cut hierarchy
void printEvaluation() const
 print the evaluation steps for this cut expression
 on the currently active event
 WARNING: THIS FUNCTION ONLY MAKES SENSE FOR PROPERLY INITIALIZED CUTS
 IT WILL PRODUCE SEVERAL OUTPUT LINES FOR EACH EVENT - EXTREMELY VERBOSE!
 USE FOR DEBUGGING ONLY!
void printWeightComponents() const
 print the evaluation steps for this weight expression
 on the currently active event
 WARNING: THIS FUNCTION ONLY MAKES SENSE FOR PROPERLY INITIALIZED CUTS
 IT WILL PRODUCE SEVERAL OUTPUT LINES FOR EACH EVENT - EXTREMELY VERBOSE!
 USE FOR DEBUGGING ONLY!
void printWeightComponents(Long64_t iEvent) const
 print the evaluation steps for this weight expression
 on event number iEvent
 WARNING: THIS FUNCTION ONLY MAKES SENSE FOR PROPERLY INITIALIZED CUTS
 IT WILL PRODUCE SEVERAL OUTPUT LINES FOR EACH EVENT - EXTREMELY VERBOSE!
 USE FOR DEBUGGING ONLY!
void printEvaluation(Long64_t iEvent) const
 print the evaluation steps for this cut expression
 on event number iEvent
 WARNING: THIS FUNCTION ONLY MAKES SENSE FOR PROPERLY INITIALIZED CUTS
 IT WILL PRODUCE SEVERAL OUTPUT LINES FOR EACH EVENT - EXTREMELY VERBOSE!
 USE FOR DEBUGGING ONLY!
bool printEvaluationStep(size_t indent) const
 print a single evaluation step for this cut
void setCutExpression(const TString& cutExpression)
 set the cut expression to some string
void setWeightExpression(const TString& weightExpression)
 set the weight expression to some string
TQObservable* getCutObservable()
 get the cut observable
TQObservable* getWeightObservable()
 get the weight observable
const TString& getCutExpression() const
 retrieve the cut expression
TString getActiveCutExpression() const
 retrieve the currently active cut expression
TString getCompiledCutExpression(TQTaggable* tags)
 retrieve the cut expression
TString getGlobalCutExpression(TQTaggable* tags = __null)
 retrieve the cut expression
const TString& getWeightExpression() const
 retrieve the weight expression
TString getActiveWeightExpression() const
 retrieve the currently active cut expression
TString getCompiledWeightExpression(TQTaggable* tags)
 retrieve the cut expression
TString getGlobalWeightExpression(TQTaggable* tags = __null)
 retrieve the weight expression
TQCut * addAndReturnCut(const TString& definition_)
 add a cut defined by a string and return it
bool addCut(const TString& definition_)
 add a cut defined by a string
 internally calles TQCut::addAndReturnCut
bool addCut(TQCut* cut, const TString& baseCutName)
 add a given instance of TQCut to a basecut identified by name
bool addCut(TQCut* cut)
 add a given instance of TQCut to a basecut identified by name
bool isMergeable() const
 returns true if this cut is mergeable, false otherwise
void consolidate()
 try to consolidate the cut hierarchy
 this function attempts to merge as many cuts as possibel
 without obstructing any existing analysis jobs
 STILL IN EXPERIMENTAL STATE
int getDepth() const
 return the maximum depth of this cut (branch)
int getWidth() const
 return the width of this cut (number of immediate child cuts)
int Compare(const TObject* obj) const
void sort()
 sort the cut hierarchy
 this will have no effect on the results of the analysis
 however, it will reorganize the layout of the cut diagrams
 in such a way that a vertical structure is most eminent
bool isTrivialTrue(const TString& expr)
 return true if this cut is trivally passed by every event
bool isTrivialFalse(const TString& expr)
 return true if this cut is trivally failed by every event
bool includeBase()
 merge this cut with its base cut
bool removeCut(const TString& name)
 remove a cut from the cut hierarchy (by name)
void printCut(const TString& options = "r")
 wrapper for the "print" function
void printActiveCutExpression(size_t indent = 0) const
 print the currently active cut expression for this cut and all parent cuts
void print(const TString& options = "r")
 Print a summary of this cut instance. The following options my be specified:
 - "r" (default) also print a summary of descendant cuts
void printCuts(const TString& options = "r")
 Print a summary of this cut instance. The following options my be specified:
 - "r" (default) also print a summary of descendant cuts
void printInternal(const TString& options, int indent)
 Print a summary of this cut instance. The following options my be specified:
 - "r" (default) also print a summary of descendant cuts
void writeDiagramHeader(ostream& os, TQTaggable& tags)
 write the header of the cut diagram file to a stream
void writeDiagramFooter(ostream& os, TQTaggable& tags)
 write the footer of the cut diagram file to a stream
TString getNodeName()
 retrieve the name of this node for display
int writeDiagramText(ostream& os, TQTaggable& tags, TString pos = "")
 write the code for the cut diagram corresponding to this node
bool writeDiagramToFile(const TString& filename, const TString& options = "")
 create a cut hierarchy diagram
bool writeDiagramToFile(const TString& filename, TQTaggable& tags)
 create a cut hierarchy diagram
bool printDiagram(const TString& options)
 create a cut hierarchy diagram
bool printDiagram(TQTaggable& options)
 create a cut hierarchy diagram
TString writeDiagramToString(TQTaggable& tags)
 create a cut hierarchy diagram (as TString)
int dumpToFolder(TQFolder* folder)
 dump the entire cut hierarchy to a TQFolder
TQCut * getCut(const TString& name)
 Return the cut matching "name". The hierarchy of cuts will be searched
 starting from this cut downwards. Please note: the result might be a null
 pointer, if no matching element can be found
void getMatchingCuts(TObjArray& matchingCuts, const TString& name)
 Add all cuts matching 'name' to the given TObjArray 'matchingCuts'. The
 syntax of matching cuts is borrowed from TQFolder: * matches any
 cuts/part of a cut name, ? matches exactly one cut level in the cut
 hierarchy.
std::vector<TString> getCutNames(const TString& cutName)
give the cut name as the input (e.g. GGF_0jet_*) and get all the cutnames which starts with GGF_0jet_ as a result in form of a vector.
void propagateMatchingCuts(TObjArray& matchingCuts, const TObjArray& name_sep, int offset = 0)
 Propagate getMatchingCuts to all attached cuts.
void getMatchingCuts(TObjArray& matchingCuts, const TObjArray& name_sep, int offset = 0)
 Same as getMatchingCuts(TObjArray& matchingCuts, const TString& name),
 but name is a tokenized by the directory delimiter.
 If offset != 0, it means that the first segments have already been
 parsed.
bool isResidualMatchingSegmentOptional(const TObjArray& name_segments, int offset = 0)
 check if residual parts are optional
TObjArray * getCuts()
 Return the list of descendant cuts of this instance
TObjArray * getJobs()
 Return the list of analysis jobs at this cut
void setCuts(TObjArray* cuts)
 set the internal list of descendant cuts to something different
void printAnalysisJobs(const TString& options = "")
 print the list of analysis jobs directly appended to this cut
TObjArray * getListOfCuts()
 Return a list of all cuts in the hierarchy of cuts starting
 from this cut downwards
TObjArray* getOwnBranches()
 add the branches needed by this cut to the internal branch list
TObjArray* getListOfBranches()
 collect all used branch names from cuts, weights and analysis jobs
 and return then in a TObjArray* of TObjString
bool addAnalysisJob(TQAnalysisJob* newJob_, const TString& cuts_ = "")
 add a new analysis job to this cut
 and any descendent cuts matching the string
bool executeAnalysisJobs(double weight)
 Execute analysis jobs attached to this cut instance. The parameter
 "weight" will be propagated to the job's execute(...) methods.
 Returns true if every job's execute(...) method returned true and
 false otherwise
int getNAnalysisJobs()
 Return the number of analysis jobs attached to
 this cut
bool passed(bool doPrint = false) const
 checks if the currently investigated event passes this cut
bool passedGlobally() const
 checks if the currently investigated event passes this cut and all parent cuts
double getWeight(bool doPrint = false) const
 retrieve the weight assigned to the current event at this cut
double getGlobalWeight() const
 retrieve the weight assigned to the current event by this cut and all parent cuts
bool skipAnalysisJobs(TQSampleFolder* sf)
 skips the analysis jobs for some folder
bool isDescendantOf(TString cutName)
 returns true if this cut is a descendant of the cut identified by the name given as argument
 returns false otherwise
bool initializeObservables()
 initialize the observables directly related to this cut on the given sample
bool finalizeObservables()
 finalize the observables directly related to this cut on the given sample
bool initializeVariants(TQSample* sample, bool hasNewVariantLayer)
bool verifyVariantSetup(const vector<TQCut::VariantHandle>& parentHandles)
bool initialize(TQSample* sample)
 publicly accessible interface
bool initialize(TQSample* sample, const TQCut::VariantDefinitionList* variantDefs)
 initialize this cut and all observables on the given sample
bool finalizeVariants()
bool finalize()
 finalize this cut and all observables on the given sample
bool canInitialize(TQSampleFolder* sf) const
 returns true if the sample folder is eligible for initializing this cut on
int createVariantFolders(TQSampleFolder* sf, const TQCut::VariantDefinitionList* variantDefs)
returns the number of variants folders created or -1 in case of an error
bool createVariants(TQSampleFolder* nextSF, const TQCut::VariantDefinitionList* variantDefs)
bool initializeVariantsSampleFolder(TQSampleFolder* sf, bool hasNewVariantLayer)
bool initializeSampleFolder(TQSampleFolder* sf)
 publicly accessible interface
bool initializeSampleFolder(TQSampleFolder* sf, const TQCut::VariantDefinitionList* variantDefs)
 initialize this cut and all observables on the given sample folder
bool canFinalize(TQSampleFolder* sf) const
 returns true if this cut was previously initialized on this sample folder
bool finalizeVariantsSampleFolder(TQSampleFolder* sf)
bool finalizeSampleFolder(TQSampleFolder* sf)
 finalize this cut and all observables on the given sample folder
~TQCut()
 destructor
void clearAnalysisJobs()
 clear all analysis jobs from this cut
TQCut * getSingleCut(TString name, TString excl_pattern = "PATTERNYOUWON'TSEE")
 Return the cut matching "name". The hierarchy of cuts will be searched
 starting from this cut downwards. Please note: the result might be a null
 pointer, if no matching element can be found
 The difference between this function and getCut() is that this function
 will return TQCut with standalone single cut (all the hierarchy collapsed
 down to the cut requested.)
TQSample* getSample()
 retrieve the sample currently assigned to this cut
TQCut* getClone()
 return a clone of this cut (and all descendants)
TQCut* getCompiledClone(TQTaggable* tags)
 return a clone of this cut (and all descendants)
void analyse(double weight, bool useWeights)
 apply this cut and execute the analyis jobs appended to this cut
void analyseVariants(const TQCut::VariantResults* preceedingResults, bool useWeights, double baseWeight = 1.)
baseWeight is only used if no valid preceedingResults_ is given (i.e. if it's a nullptr).
In this case reset our own VariantResult member to baseWeight and use it as
preceedingWeights. Note that this means we may not edit the pass/weight values more than once!
bool initializeSelfSampleFolder(TQSampleFolder* sf)
{ return true;}
bool finalizeSelfSampleFolder(TQSampleFolder* sf)
{ return true;}
VariantStackElement* createVariantLayer(const vector<TQCut::VariantHandle>& preceedingHandles, TQSampleFolder* nextSF, const TQCut::VariantDefinitionList* variantDefs)
TQCut()
void setSkipAnalysisJobsGlobal(bool skip = true)
{this->fSkipAnalysisJobsGlobal = skip;}
bool getSkipAnalysisJobsGlobal() const
{return this->fSkipAnalysisJobsGlobal;}
void setPrintResults(int maxCount = 0)
{this->fPrintResult = maxCount;}
bool getPrintResults() const
{return this->fPrintResult;}
const std::vector<TQSampleFolder*>& getInitializationHistory() const
{ return this->fInitializationHistory;}