NAGASH 0.9.8
Next Generation Analysis System
|
Store the cut flow with user defined cuts. More...
#include "NAGASH/CutFlowCounter.h"
Public Member Functions | |
CutFlowCounter (std::shared_ptr< MSGTool > msg, std::shared_ptr< ConfigTool > config, const TString &name, const TString &fname="") | |
Constructor. | |
void | BookCutPoint (const std::string &name) |
Book a cut point. | |
void | Combine (std::shared_ptr< Result > result) |
Combine the cut flow with another cut flow. | |
double | GetEntries (const std::string &point) |
Get the total entries of a cut point. | |
double | GetEntries (uint32_t point) |
Get the total entries of a cut point. | |
double | GetSumW (const std::string &point) |
Get the sum of weights of a cut point. | |
double | GetSumW (uint32_t point) |
Get the sum of weights of a cut point. | |
void | PrintSummary () |
Print the summary of the cut flow. | |
void | Record (const std::string &point, double w=1) |
Record a entry that pass a cut. | |
void | Record (uint64_t point, double w=1) |
Record a entry that pass a cut. | |
Public Member Functions inherited from NAGASH::Result | |
const TString & | GetOutputFileName () |
Return the name of the result. | |
const TString & | GetResultName () |
virtual void | WriteToFile () |
Private Attributes | |
std::map< std::string, uint64_t > | CutPointNames |
std::vector< std::string > | CutPointNamesVector |
std::vector< double > | SumE |
std::vector< double > | SumW |
Additional Inherited Members | |
Protected Member Functions inherited from NAGASH::Result | |
Result ()=delete | |
Result (const Result &result)=delete | |
Result (Result &&result)=delete | |
Result (std::shared_ptr< MSGTool > MSG, std::shared_ptr< ConfigTool > c, const TString &rname, const TString &fname="") | |
virtual interface to write the result to a file. | |
virtual | ~Result ()=default |
std::shared_ptr< ConfigTool > | ConfigUser () |
Return the internal ConfigTool.> | |
std::shared_ptr< MSGTool > | MSGUser () |
Return the internal MSGTool. | |
Result & | operator= (const Result &result)=delete |
Result & | operator= (Result &&result)=delete |
void | SetOutputFileName (const TString &fileName) |
Set the output file name of the result. | |
Toolkit * | ToolkitUser () |
Return the internal Toolkit. | |
Store the cut flow with user defined cuts.
Basic usage: ~~~ {c++} suppose you are using the CutFlowCounter inside a LoopEvent. NAGASH::StatusCode UserLoopEvent::InitializeUser() { ......... other initialization......... MyCutFlow = ResultGroupUser()->BookResult<CutFlowCounter>("MyCutFlow"); MyCutFlow->BookCutPoint("c0"); MyCutFlow->BookCutPoint("c1"); MyCutFlow->BookCutPoint("c2"); }
NAGASH::StatusCode UserLoopEvent::Execute() { if(pass_cut_0) { ....... other stuff ...... MyCutFlow->Record("c0", 1); if (pass_cut_1) { ...... other stuff...... MyCutFlow->Record("c1", 1); if (pass_cut_2) { ....... other stuff ...... MyCutFlow->Record("c2", 1); } } } } ~~~
After that you can get your cut flow as: ~~~ {c++} MyCutFlow->PrintSummary(); ~~~ This will show the entries, sum of weights after each cut, with the effiency of each cut and the relative efficiency between each adjacent cut.
Definition at line 55 of file CutFlowCounter.h.
|
inline |
Constructor.
msg | input NAGASH::MSGTool. |
config | input NAGASH::ConfigTool. |
name | the name of the result. |
fname | the output file name of the result, not used in this class. |
Definition at line 69 of file CutFlowCounter.h.
|
inline |
Book a cut point.
name | name of the cut point. |
Definition at line 74 of file CutFlowCounter.h.
|
inlinevirtual |
Combine the cut flow with another cut flow.
result | input CutFlowCounter to be combined. |
Reimplemented from NAGASH::Result.
Definition at line 118 of file CutFlowCounter.h.
|
inline |
Get the total entries of a cut point.
point | the name of the cut point. |
Definition at line 155 of file CutFlowCounter.h.
|
inline |
Get the total entries of a cut point.
point | index of the cut point. |
Definition at line 140 of file CutFlowCounter.h.
|
inline |
Get the sum of weights of a cut point.
point | the name of the cut point. |
Definition at line 185 of file CutFlowCounter.h.
|
inline |
Get the sum of weights of a cut point.
point | the index of the cut point. |
Definition at line 170 of file CutFlowCounter.h.
|
inline |
Print the summary of the cut flow.
Definition at line 199 of file CutFlowCounter.h.
|
inline |
Record a entry that pass a cut.
point | the name of the cut point. |
w | the weight of this entry. |
Definition at line 102 of file CutFlowCounter.h.
|
inline |
Record a entry that pass a cut.
point | the index of the cut point. |
w | the weight of this entry. |
Definition at line 85 of file CutFlowCounter.h.
|
private |
Definition at line 60 of file CutFlowCounter.h.
|
private |
Definition at line 61 of file CutFlowCounter.h.
|
private |
Definition at line 58 of file CutFlowCounter.h.
|
private |
Definition at line 59 of file CutFlowCounter.h.