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.
virtual | ~TQCut() |
void | TObject::AbstractMethod(const char* method) const |
bool | addAnalysisJob(TQAnalysisJob* newJob_, const TString& cuts_ = "") |
TQCut* | addAndReturnCut(const TString& definition_) |
bool | addCut(const TString& definition_) |
bool | addCut(TQCut* cut) |
bool | addCut(TQCut* cut, const TString& baseCutName) |
void | analyse(double weight, bool useWeights) |
virtual void | TObject::AppendPad(Option_t* option = "") |
virtual void | TObject::Browse(TBrowser* b) |
bool | canFinalize(TQSampleFolder* sf) const |
bool | canInitialize(TQSampleFolder* sf) const |
ULong_t | TObject::CheckedHash() |
static TClass* | Class() |
virtual const char* | TObject::ClassName() const |
virtual void | TNamed::Clear(Option_t* option = "") |
void | clearAnalysisJobs() |
virtual TObject* | TNamed::Clone(const char* newname = "") const |
virtual int | Compare(const TObject* obj) const |
void | consolidate() |
virtual void | TNamed::Copy(TObject& named) const |
static TQCut* | createCut(const TString& definition_) |
static TQCut* | createCut(const TString& name, const TString& cutExpr, const TString& weightExpr = "") |
virtual void | TObject::Delete(Option_t* option = "")MENU |
virtual Int_t | TObject::DistancetoPrimitive(Int_t px, Int_t py) |
virtual void | TObject::Draw(Option_t* option = "") |
virtual void | TObject::DrawClass() constMENU |
virtual TObject* | TObject::DrawClone(Option_t* option = "") constMENU |
virtual void | TObject::Dump() constMENU |
int | dumpToFolder(TQFolder* folder) |
virtual void | TObject::Error(const char* method, const char* msgfmt,...) const |
virtual void | TObject::Execute(const char* method, const char* params, Int_t* error = 0) |
virtual void | TObject::Execute(TMethod* method, TObjArray* params, Int_t* error = 0) |
bool | executeAnalysisJobs(double weight) |
virtual void | TObject::ExecuteEvent(Int_t event, Int_t px, Int_t py) |
TList* | exportDefinitions(bool terminatingColon = false) |
virtual void | TObject::Fatal(const char* method, const char* msgfmt,...) const |
virtual void | TNamed::FillBuffer(char*& buffer) |
virtual bool | finalize() |
bool | finalizeSampleFolder(TQSampleFolder* sf) |
virtual TObject* | TObject::FindObject(const char* name) const |
virtual TObject* | TObject::FindObject(const TObject* obj) const |
TString | getActiveCutExpression() const |
TString | getActiveWeightExpression() const |
TQCut* | getBase() |
const TQCut* | getBaseConst() const |
TQCut* | getClone() |
TQCut* | getCompiledClone(TQTaggable* tags) |
TString | getCompiledCutExpression(TQTaggable* tags) |
TString | getCompiledWeightExpression(TQTaggable* tags) |
TQCut* | getCut(const TString& name) |
const TString& | getCutExpression() const |
vector<TString> | getCutNames(const TString& cutName) |
TQObservable* | getCutObservable() |
TObjArray* | getCuts() |
int | getDepth() const |
virtual Option_t* | TObject::GetDrawOption() const |
static Longptr_t | TObject::GetDtorOnly() |
TString | getGlobalCutExpression(TQTaggable* tags = __null) |
virtual double | getGlobalWeight() const |
TString | getGlobalWeightExpression(TQTaggable* tags = __null) |
virtual const char* | TObject::GetIconName() const |
const vector<TQSampleFolder*>& | getInitializationHistory() const |
TObjArray* | getJobs() |
virtual TObjArray* | getListOfBranches() |
TObjArray* | getListOfCuts() |
void | getMatchingCuts(TObjArray& matchingCuts, const TString& name) |
void | getMatchingCuts(TObjArray& matchingCuts, const TObjArray& name_sep, int offset = 0) |
virtual const char* | TNamed::GetName() const |
int | getNAnalysisJobs() |
TString | getNodeName() |
virtual char* | TObject::GetObjectInfo(Int_t px, Int_t py) const |
static Bool_t | TObject::GetObjectStat() |
virtual Option_t* | TObject::GetOption() const |
TString | getPath() |
bool | getPrintResults() const |
TQCut* | getRoot() |
TQSample* | getSample() |
TQCut* | getSingleCut(TString name, TString excl_pattern = "PATTERNYOUWON'TSEE") |
bool | getSkipAnalysisJobsGlobal() const |
virtual const char* | TNamed::GetTitle() const |
virtual UInt_t | TObject::GetUniqueID() const |
virtual double | getWeight(bool doPrint = false) const |
const TString& | getWeightExpression() const |
TQObservable* | getWeightObservable() |
int | getWidth() const |
virtual Bool_t | TObject::HandleTimer(TTimer* timer) |
virtual ULong_t | TNamed::Hash() const |
Bool_t | TObject::HasInconsistentHash() const |
static TQCut* | importFromFolder(TQFolder* folder, TQTaggable* tags = __null) |
bool | includeBase() |
virtual void | TObject::Info(const char* method, const char* msgfmt,...) const |
virtual Bool_t | TObject::InheritsFrom(const char* classname) const |
virtual Bool_t | TObject::InheritsFrom(const TClass* cl) const |
virtual bool | initialize(TQSample* sample) |
bool | initializeSampleFolder(TQSampleFolder* sf) |
virtual void | TObject::Inspect() constMENU |
void | TObject::InvertBit(UInt_t f) |
virtual TClass* | IsA() const |
bool | isDescendantOf(TString cutName) |
Bool_t | TObject::IsDestructed() const |
virtual Bool_t | TObject::IsEqual(const TObject* obj) const |
virtual Bool_t | TObject::IsFolder() const |
virtual bool | isMergeable() const |
Bool_t | TObject::IsOnHeap() const |
bool | isResidualMatchingSegmentOptional(const TObjArray& name_segments, int offset = 0) |
virtual Bool_t | TNamed::IsSortable() const |
static bool | isTrivialFalse(const TString& expr) |
static bool | isTrivialTrue(const TString& expr) |
static bool | isValidName(const TString& name_) |
Bool_t | TObject::IsZombie() const |
virtual void | TNamed::ls(Option_t* option = "") const |
void | TObject::MayNotUse(const char* method) const |
virtual Bool_t | TObject::Notify() |
void | TObject::Obsolete(const char* method, const char* asOfVers, const char* removedFromVers) const |
void | TObject::operator delete(void* ptr) |
void | TObject::operator delete(void* ptr, void* vp) |
void | TObject::operator delete[](void* ptr) |
void | TObject::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 void | TObject::Paint(Option_t* option = "") |
static bool | parseCutDefinition(const TString& definition_, TString* name_, TString* baseCutName_, TString* cutExpr_, TString* weightExpr_) |
static bool | parseCutDefinition(TString definition_, TString& name_, TString& baseCutName_, TString& cutExpr_, TString& weightExpr_) |
virtual bool | passed(bool doPrint = false) const |
virtual bool | passedGlobally() const |
virtual void | TObject::Pop() |
void | print(const TString& options = "r") |
virtual void | TNamed::Print(Option_t* option = "") const |
void | printActiveCutExpression(size_t indent = 0) const |
void | printAnalysisJobs(const TString& options = "") |
void | printCut(const TString& options = "r") |
void | printCuts(const TString& options = "r") |
bool | printDiagram(TQTaggable& options) |
bool | printDiagram(const TString& options) |
void | printEvaluation() const |
void | printEvaluation(Long64_t iEvent) const |
void | printWeightComponents() const |
void | printWeightComponents(Long64_t iEvent) const |
void | propagateMatchingCuts(TObjArray& matchingCuts, const TObjArray& name_sep, int offset = 0) |
virtual Int_t | TObject::Read(const char* name) |
virtual void | TObject::RecursiveRemove(TObject* obj) |
bool | removeCut(const TString& name) |
void | TObject::ResetBit(UInt_t f) |
virtual void | TObject::SaveAs(const char* filename = "", Option_t* option = "") constMENU |
virtual void | TObject::SavePrimitive(ostream& out, Option_t* option = "") |
void | TObject::SetBit(UInt_t f) |
void | TObject::SetBit(UInt_t f, Bool_t set) |
void | setCutExpression(const TString& cutExpression) |
void | setCuts(TObjArray* cuts) |
virtual void | TObject::SetDrawOption(Option_t* option = "")MENU |
static void | TObject::SetDtorOnly(void* obj) |
virtual void | TNamed::SetName(const char* name)MENU |
virtual void | TNamed::SetNameTitle(const char* name, const char* title) |
static void | TObject::SetObjectStat(Bool_t stat) |
void | setPrintResults(int maxCount = 0) |
void | setSkipAnalysisJobsGlobal(bool skip = true) |
virtual void | TNamed::SetTitle(const char* title = "")MENU |
virtual void | TObject::SetUniqueID(UInt_t uid) |
void | setWeightExpression(const TString& weightExpression) |
virtual void | ShowMembers(TMemberInspector& insp) const |
virtual Int_t | TNamed::Sizeof() const |
void | sort() |
virtual void | Streamer(TBuffer&) |
void | StreamerNVirtual(TBuffer& ClassDef_StreamerNVirtual_b) |
virtual void | TObject::SysError(const char* method, const char* msgfmt,...) const |
Bool_t | TObject::TestBit(UInt_t f) const |
Int_t | TObject::TestBits(UInt_t f) const |
TQCut() | |
TQCut(const TQCut&) | |
TQCut(const TString& name_, const TString& title_ = "", const TString& cutExpression = "", const TString& weightExpression = "") | |
virtual void | TObject::UseCurrentStyle() |
virtual void | TObject::Warning(const char* method, const char* msgfmt,...) const |
virtual Int_t | TObject::Write(const char* name = 0, Int_t option = 0, Int_t bufsize = 0) |
virtual Int_t | TObject::Write(const char* name = 0, Int_t option = 0, Int_t bufsize = 0) const |
static void | writeDiagramFooter(ostream& os, TQTaggable& tags) |
static void | writeDiagramHeader(ostream& os, TQTaggable& tags) |
int | writeDiagramText(ostream& os, TQTaggable& tags, TString pos = "") |
bool | writeDiagramToFile(const TString& filename, const TString& options = "") |
bool | writeDiagramToFile(const TString& filename, TQTaggable& tags) |
TString | writeDiagramToString(TQTaggable& tags) |
virtual Bool_t | CheckTObjectHashConsistency() const |
static TObject::(anonymous) | TObject::kBitMask | |
static TObject::EStatusBits | TObject::kCanDelete | |
static TObject::EStatusBits | TObject::kCannotPick | |
static TObject::EStatusBits | TObject::kHasUUID | |
static TObject::(anonymous) | TObject::kInconsistent | |
static TObject::EStatusBits | TObject::kInvalidObject | |
static TObject::(anonymous) | TObject::kIsOnHeap | |
static TObject::EStatusBits | TObject::kIsReferenced | |
static TObject::EStatusBits | TObject::kMustCleanup | |
static TObject::EStatusBits | TObject::kNoContextMenu | |
static TObject::(anonymous) | TObject::kNotDeleted | |
static TObject::EDeprecatedStatusBits | TObject::kObjInCanvas | |
static TObject::(anonymous) | TObject::kOverwrite | |
static TObject::(anonymous) | TObject::kSingleKey | |
static TObject::(anonymous) | TObject::kWriteDelete | |
static TObject::(anonymous) | TObject::kZombie |
TObjArray* | fAnalysisJobs | ! |
TQCut* | fBase | |
TString | fCutExpression | |
TQCutIterator | fCutItr | ! |
TQObservable* | fCutObservable | ! |
TObjArray* | fCuts | |
vector<TQSampleFolder*> | fInitializationHistory | ! |
TQAnalysisJobIterator | fJobItr | ! |
TString | TNamed::fName | object identifier |
int | fPrintResult | max number of events for which cut decision (and weight value) should be printed |
int | fPrintResultCount | ! transient member keeping track of how many decisions have already been printed |
TQSample* | fSample | ! |
bool | fSkipAnalysisJobs | set based on tags on sample folders |
bool | fSkipAnalysisJobsGlobal | set based on tags during cut creation (from TQFolder) |
TString | TNamed::fTitle | object title |
TTree* | fTree | ! |
TQToken* | fTreeToken | ! |
TQCut::VariantResults* | fVariantResults | ! |
vector<TQCut::VariantStackElement*> | fVariantStack | ! |
TString | fWeightExpression | |
TQObservable* | fWeightObservable | ! |
static TObject::(anonymous) | TObject::kOnlyPrepStep |
Inheritance Chart: | |||||||||||||||||
|
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 "_".
parse the definition of the cut and deploy the parsed fields in the argument pointers
parse the definition of the cut and deploy the parsed fields in the argument references
create a new TQCut from the given parameters
import the cut from a folder created with TQCut::dumpToFolder(...)
constructor taking additioinal arguments
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!
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!
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!
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!
add a cut defined by a string internally calles TQCut::addAndReturnCut
add a given instance of TQCut to a basecut identified by name
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
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
print the currently active cut expression for this cut and all parent cuts
write the header of the cut diagram file to a stream
write the footer of the cut diagram file to a stream
write the code for the cut diagram corresponding to this node
create a cut hierarchy diagram
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
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.
Propagate getMatchingCuts to all attached cuts.
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.
check if residual parts are optional
print the list of analysis jobs directly appended to this cut
Return a list of all cuts in the hierarchy of cuts starting from this cut downwards
collect all used branch names from cuts, weights and analysis jobs and return then in a TObjArray* of TObjString
add a new analysis job to this cut and any descendent cuts matching the string
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
checks if the currently investigated event passes this cut and all parent cuts
retrieve the weight assigned to the current event at this cut
retrieve the weight assigned to the current event by this cut and all parent cuts
returns true if this cut is a descendant of the cut identified by the name given as argument returns false otherwise
initialize the observables directly related to this cut on the given sample
finalize the observables directly related to this cut on the given sample
initialize this cut and all observables on the given sample
returns true if the sample folder is eligible for initializing this cut on
returns the number of variants folders created or -1 in case of an error
initialize this cut and all observables on the given sample folder
returns true if this cut was previously initialized on this sample folder
finalize this cut and all observables on the given sample folder
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.)
apply this cut and execute the analyis jobs appended to this cut
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!
{ return this->fInitializationHistory;}