#include <Stat.hpp>
Inheritance diagram for cafe::Stat:

Public Member Functions | |
| Stat (const char *name) | |
| What everyone else should use. | |
| Stat (const char *name, bool duplicate_ok) | |
| Use if you are trying to keep more than one around at once. | |
| ~Stat () | |
| double | eventWeight (const std::string &name="global", const std::string sample_name="not_specified") const |
| double | nevents (const std::string &name="Initial", const std::string &sample_name="not_specified") const |
| Return number of events by selection name. | |
| double | efficiencyCorrected (const std::string &sample_name="not_specified") const |
| return efficiency corrected by the global event weight | |
| double | efficiency (const std::string &sample_name="not_specified") const |
| return global efficiency | |
| double | syst_pos (const std::string &name, const std::string &sample_name="not_specified") const |
| return positive systematics with name name for the sample sample_name | |
| double | syst_neg (const std::string &name, const std::string &sample_name="not_specified") const |
| return negative systematics with name name for the sample sample_name | |
| double | systerr_pos (const std::string &name, const std::string &sample_name="not_specified") const |
| return error for the positive systematics with name name for the sample sample_name | |
| double | systerr_neg (const std::string &name, const std::string &sample_name="not_specified") const |
| return error for the positive systematics with name name for the sample sample_name | |
| std::vector< const cafe::StatSample * > | get_samples () const |
| retun list of samples | |
| std::vector< const cafe::Syst * > | get_syst () const |
| retun list of systematics samples | |
| void | begin () |
| initialization | |
| void | finish () |
| Print efficiencies. | |
| bool | processEvent (cafe::Event &event) |
| increase number of events before any selection | |
| void | EventSelected (const std::string &selection_name) |
| Increase number of event selected. If such selection does not exist it will be added. | |
| void | applyWeight (const std::string &weight_name, double weight, double weight_pos=-1.0, double weight_neg=-1.0) |
| apply weight to efficiency calculation. | |
| double | calculateGlobalWeight () |
| calculate global event weight | |
| void | eventEnd () |
| make clean in the end of the event | |
| StatSample & | add_sample (const std::string &name) |
| Add sample and return reference to it. | |
| void | add_syst (const std::string &name, StatSample *sample=0) |
| void | tag (const std::vector< std::string > &tags) |
| these tags will be added to the list to tag event in the begining ProcessEvent | |
| ostream & | print_html (ostream &os) const |
| output operator | |
| ostream & | print_tex (ostream &os, const std::string title="Efficiency") const |
| output operator | |
| void | chain (void) |
| void | unchain (void) |
| void | inheritWeights () |
| Get a list of all applied weights from the parent and apply them down here. | |
| ClassDef (Stat, 0) | |
Private Member Functions | |
| double | syst_pos (std::vector< Syst >::const_iterator jt) const |
| return positive systematics | |
| double | syst_neg (std::vector< Syst >::const_iterator jt) const |
| return negative systematics | |
| double | systerr_pos (std::vector< Syst >::const_iterator jt) const |
| return error for the positive systematics | |
| double | systerr_neg (std::vector< Syst >::const_iterator jt) const |
| return error for the positive systematics | |
Private Attributes | |
| std::vector< StatSample > | _samples |
| std::vector< Syst > | _syst |
| cafe::Event * | _event |
| std::vector< std::string > | _tags |
| bool | _ignoreauto |
| Stat * | _parent_stat |
| Pointer to the paretn Stat object if we are chained. | |
The Stat(name) call must be added to the directive cafe.Run ... (or to any other Cafe::Controller). To calculate efficiency relative to the all event, this call must be put in the beginning. In any other case only events selected before this call will be taken into account.
The efficiency could be calculated for the several different samples using the event tagging mechanism. First one need to specify sample names using the Sample configuration option, e.g.
.Sample: sample_name1, sample_name2.
If no Sample specified, the default sample with name equal to the Stat class name will be created. Than one specifies the event tags to be selected by the sample with given name. sample_name1.UseTag: tag1,tag2,tag3 If tag is not specified all selected events will be added to a sample. One event can be counted in the several samples.
Configuration options:
To add efficiency calculation for your one Processor, add following lines to the YourProcessor::processEvent(cafe::Event &event) method:
Stat* stat = 0 ;
event.get("Stat", stat) ;
... Selection 1 ...
stat->EventSelected("Selection 1 name") ;
... Selection 2 ....
stat->EventSelected("Selection 2 name") ;
Definition at line 89 of file cafe/cafe/Stat.hpp.
|
|
What everyone else should use. If we are the first one, we establish ourselves as the primere dude. Otherwise, we don't do anything. Errors will occur further down if the user tries to do two Stat at once without some careful shuffling. Definition at line 36 of file Stat.cpp. References cafe::Processor::name(), and STAT. |
|
||||||||||||
|
Use if you are trying to keep more than one around at once.
Definition at line 50 of file Stat.cpp. References cafe::Processor::name(), and STAT. |
|
|
|
|
|
Add sample and return reference to it.
Definition at line 177 of file cafe/cafe/Stat.hpp. References _samples. |
|
||||||||||||
|
Definition at line 706 of file Stat.cpp. References _samples, _syst, and cafe::StatSample::AddAndTags(). Referenced by begin(). |
|
||||||||||||||||||||
|
apply weight to efficiency calculation.
Definition at line 239 of file Stat.cpp. References _event, _samples, and _syst. Referenced by cafe::StatPointer::applyWeight(), inheritWeights(), and cafe::EventMultiSplitter::processPermutation(). |
|
|
initialization add systematics Reimplemented from cafe::Processor. Definition at line 114 of file Stat.cpp. References _ignoreauto, _samples, add_syst(), cafe::Config::get(), cafe::Config::getVString(), cafe::Processor::name(), and tag(). Referenced by cafe::EventMultiSplitter::EventMultiSplitter(). |
|
|
calculate global event weight
Definition at line 683 of file Stat.cpp. References _event, and _samples. Referenced by cafe::StatPointer::calculateGlobalWeight(). |
|
|
We can't chain if we are already in the chain! Definition at line 64 of file Stat.cpp. References _parent_stat, and STAT. Referenced by cafe::EventMultiSplitter::processEvent(). |
|
||||||||||||
|
|
|
|
return global efficiency
Definition at line 661 of file Stat.cpp. References _samples. |
|
|
return efficiency corrected by the global event weight
Definition at line 651 of file Stat.cpp. References _samples. |
|
|
make clean in the end of the event
Definition at line 176 of file Stat.cpp. References _event, _samples, and _syst. Referenced by cafe::EventBase::clear(), and cafe::EventMultiSplitter::processPermutation(). |
|
|
Increase number of event selected. If such selection does not exist it will be added.
Definition at line 221 of file Stat.cpp. References _event, _ignoreauto, _samples, and _syst. Referenced by cafe::StatPointer::EventSelected(), cafe::Processor::incEventCount(), and inheritWeights(). |
|
||||||||||||
|
Return event weight by name. Return global event weight for the first sample by default. If weight with specified name was not found or sample with name sample_name does not exist return -1.0 Definition at line 671 of file Stat.cpp. References _samples. |
|
|
Print efficiencies.
Reimplemented from cafe::Processor. Definition at line 153 of file Stat.cpp. References cafe::Config::get(), cafe::Processor::name(), print_html(), and print_tex(). Referenced by cafe::EventMultiSplitter::finish(). |
|
|
retun list of samples
Definition at line 784 of file Stat.cpp. References _samples. Referenced by inheritWeights(). |
|
|
retun list of systematics samples
Definition at line 791 of file Stat.cpp. References _syst. |
|
|
Get a list of all applied weights from the parent and apply them down here. Use only the first stat sample to do the weight mapping. Definition at line 87 of file Stat.cpp. References _parent_stat, applyWeight(), EventSelected(), cafe::StatSample::eventSelection(), get_samples(), cafe::StatSelection::isWeight(), cafe::StatSelection::name(), cafe::StatSample::size(), STAT, cafe::StatWeight::weight(), cafe::StatWeight::weight_neg(), and cafe::StatWeight::weight_pos(). Referenced by cafe::EventMultiSplitter::processPermutation(). |
|
||||||||||||
|
Return number of events by selection name.
Definition at line 690 of file Stat.cpp. References _samples. |
|
|
output operator
Definition at line 257 of file Stat.cpp. References _samples, _syst, syst_neg(), syst_pos(), systerr_neg(), systerr_pos(), and cafe::StatWeight::weight_average(). Referenced by finish(). |
|
||||||||||||
|
output operator
Definition at line 610 of file Stat.cpp. References _samples, _syst, syst_neg(), syst_pos(), systerr_neg(), and systerr_pos(). Referenced by finish(). |
|
|
increase number of events before any selection
Reimplemented from cafe::Processor. Definition at line 189 of file Stat.cpp. References _event, _samples, _syst, _tags, cafe::Processor::err(), cafe::EventBase::get(), cafe::Processor::name(), cafe::EventBase::put(), and cafe::EventBase::tag(). Referenced by cafe::EventMultiSplitter::processPermutation(). |
|
||||||||||||
|
return negative systematics with name name for the sample sample_name
Definition at line 766 of file Stat.cpp. References _syst, and syst_neg(). |
|
|
return negative systematics
Definition at line 753 of file Stat.cpp. Referenced by print_html(), print_tex(), and syst_neg(). |
|
||||||||||||
|
return positive systematics with name name for the sample sample_name
Definition at line 734 of file Stat.cpp. References _syst, and syst_pos(). |
|
|
return positive systematics
Definition at line 721 of file Stat.cpp. Referenced by print_html(), print_tex(), and syst_pos(). |
|
||||||||||||
|
return error for the positive systematics with name name for the sample sample_name
Definition at line 775 of file Stat.cpp. References _syst, and systerr_neg(). |
|
|
return error for the positive systematics
Definition at line 758 of file Stat.cpp. Referenced by print_html(), print_tex(), and systerr_neg(). |
|
||||||||||||
|
return error for the positive systematics with name name for the sample sample_name
Definition at line 743 of file Stat.cpp. References _syst, and systerr_pos(). |
|
|
return error for the positive systematics
Definition at line 726 of file Stat.cpp. Referenced by print_html(), print_tex(), and systerr_pos(). |
|
|
these tags will be added to the list to tag event in the begining ProcessEvent
Definition at line 700 of file Stat.cpp. References _tags. Referenced by begin(). |
|
|
Can't unchain if we aren't in a chain! Definition at line 74 of file Stat.cpp. References _parent_stat, and STAT. Referenced by cafe::EventMultiSplitter::processEvent(). |
|
|
Definition at line 93 of file cafe/cafe/Stat.hpp. Referenced by applyWeight(), calculateGlobalWeight(), eventEnd(), EventSelected(), and processEvent(). |
|
|
Definition at line 95 of file cafe/cafe/Stat.hpp. Referenced by begin(), and EventSelected(). |
|
|
Pointer to the paretn Stat object if we are chained.
Definition at line 110 of file cafe/cafe/Stat.hpp. Referenced by chain(), inheritWeights(), and unchain(). |
|
|
Definition at line 91 of file cafe/cafe/Stat.hpp. Referenced by add_sample(), add_syst(), applyWeight(), begin(), calculateGlobalWeight(), efficiency(), efficiencyCorrected(), eventEnd(), EventSelected(), eventWeight(), get_samples(), nevents(), print_html(), print_tex(), and processEvent(). |
|
|
Definition at line 92 of file cafe/cafe/Stat.hpp. Referenced by add_syst(), applyWeight(), eventEnd(), EventSelected(), get_syst(), print_html(), print_tex(), processEvent(), syst_neg(), syst_pos(), systerr_neg(), and systerr_pos(). |
|
|
Definition at line 94 of file cafe/cafe/Stat.hpp. Referenced by processEvent(), and tag(). |
1.3.4