1 #ifndef ICHiggsTauTau_EventInfo_hh
2 #define ICHiggsTauTau_EventInfo_hh
23 typedef std::map<std::string, double> SDMap;
24 typedef std::map<std::string, bool> SBMap;
25 typedef std::map<std::size_t, float> TBMap;
30 virtual void Print()
const;
34 inline bool is_data()
const {
return is_data_; }
38 inline unsigned long long event()
const {
return event_; }
41 inline int run()
const {
return run_; }
50 inline double jet_rho()
const {
return jet_rho_; }
56 inline double gen_ht()
const {
return gen_ht_; }
60 inline double gen_mll()
const {
return gen_mll_; }
121 inline double weight(std::string label)
const {
122 SDMap::const_iterator it = weights_.find(label);
123 if (it != weights_.end()) {
126 std::cerr <<
"Weight \"" << label <<
"\" not found!" << std::endl;
136 SDMap::const_iterator it = weights_.find(label);
137 return it != weights_.end();
147 bool const& enabled) {
148 if (weight != weight) {
149 std::cerr <<
" -- weight " << label <<
" has NAN value, setting to 1..."
151 weights_[label] = 1.;
155 weight_status_[label] = enabled;
167 if (label.size() > 0) {
168 if (label.at(0) ==
'!') {
173 if (weight != weight) {
174 std::cerr <<
" -- weight " << label <<
" has NAN value, setting to 1..."
176 weights_[label] = 1.0;
180 weight_status_[label] = enabled;
185 SDMap::const_iterator it;
187 for (it = weights_.begin(); it != weights_.end(); ++it) {
188 SBMap::const_iterator st_it = weight_status_.find(it->first);
189 if (st_it != weight_status_.end()) {
190 if (!st_it->second)
continue;
192 weight = it->second *
weight;
200 return weight_status_[label];
209 weight_status_[label] =
true;
216 weight_status_[label] =
false;
223 inline std::map<std::size_t, float>
const&
filters()
const {
242 TBMap::const_iterator it = filters_.find(
CityHash64(label));
243 if (it != filters_.end()) {
246 std::cerr <<
"Filter \"" << label <<
"\" not found!" << std::endl;
253 TBMap::const_iterator it;
255 for (it = filters_.begin(); it != filters_.end(); ++it) {
256 result = it->second && result;
264 unsigned long long event_;
271 unsigned n_outgoing_partons_;
274 SBMap weight_status_;
275 unsigned good_vertices_;
278 #ifndef SKIP_CINT_DICT
void set_weight(std::string const &label, double const &weight, bool const &enabled)
Add a new weight, overriding any existing value with the same label.
void set_is_data(bool const &is_data)
If event is real data returns true, otherwise false
std::map< std::size_t, float > const & filters() const
Get the map containing all filter results. The map key is the hash of the original string chosen to i...
void set_filter_result(std::string const &label, bool const &result)
Set the filter result for label to result, overwriting any existing filter result with this label...
uint64 CityHash64(const char *buf, size_t len)
double jet_rho() const
Energy density used for the jet energy corrections in this event.
unsigned n_outgoing_partons() const
Number of outgoing partons at generator level, used for combining n-jet binned samples with inclusive...
void set_n_outgoing_partons(unsigned const &n_outgoing_partons)
Number of outgoing partons at generator level, used for combining n-jet binned samples with inclusive...
void set_filters(std::map< std::size_t, float > const &filters)
Set the complete filter result map to a new value.
void set_gen_ht(double const &gen_ht)
Generator level HT, used for combining HT binned samples with inclusive samples.
double weight(std::string label) const
Get the the value of a specific weight.
unsigned good_vertices() const
Number of reconstructed vertices passing some baseline quality requirements.
void set_lepton_rho(double const &lepton_rho)
Energy density used for calculating lepton isolation in this event.
void set_run(int const &run)
Run number.
double gen_mll() const
Generator level M_ll.
int lumi_block() const
Lumisection number.
void set_gen_mll(double const &gen_mll)
Generator level M_ll.
double total_weight() const
Calculate the product of all stored and enabled weights.
bool is_data() const
If event is real data returns true, otherwise false
bool weight_defined(std::string label) const
Check if a specific weight is defined.
double gen_ht() const
Generator level HT, used for combining HT binned samples with inclusive samples.
void set_weight(std::string label, double const &weight)
Add a new weight.
virtual void Print() const
Stores core event information such as run, lumi and event number, as well as event weights and filter...
double lepton_rho() const
Energy density used for calculating lepton isolation in this event.
void set_lumi_block(int const &lumi_block)
Lumisection number.
unsigned long long event() const
Event number.
bool total_filter_result() const
Returns true if all filter results are true, false otherwise.
bool weight_is_enabled(std::string label)
Return true if the weight with label is enabled, false otherwise.
void set_good_vertices(unsigned const &good_vertices)
Number of reconstructed vertices passing some baseline quality requirements.
void set_event(unsigned long long const &event)
Event number.
void disable_weight(std::string label)
Disable the weight with label in the total_weight() calculation.
void enable_weight(std::string label)
Enable the weight with label in the total_weight() calculation.
bool filter_result(std::string const &label)
Get the filter result for label, return true if not defined.
int bunch_crossing() const
Bunch crossing number.
void set_bunch_crossing(int const &bunch_crossing)
Bunch crossing number.
void set_jet_rho(double const &jet_rho)
Energy density used for the jet energy corrections in this event.
int run() const
Run number.