-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPUEventWeightProcessor.h
47 lines (35 loc) · 1.25 KB
/
PUEventWeightProcessor.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
//
// $Id: PUEventWeightProcessor.h,v 1.2 2011/11/25 07:14:32 kirschen Exp $
//
#ifndef PU_EVENT_WEIGHT_PROCESSOR_H
#define PU_EVENT_WEIGHT_PROCESSOR_H
#include <vector>
#include <string>
#include "EventProcessor.h"
class Event;
class Parameters;
class TH1;
//! \brief Weight MC events to a PU scenario by number of added PU interactions
//!
//! The weighting function is specified as a histogram from
//! a ROOT file.
//!
//! \see https://twiki.cern.ch/twiki/bin/viewauth/CMS/PileupReweighting
// -----------------------------------------------------------------
class PUEventWeightProcessor : public EventProcessor {
public:
PUEventWeightProcessor(const std::string& configfile, Parameters* param);
int preprocess(std::vector<Event*>& data,
std::vector<Event*>& control1,
std::vector<Event*>& control2);
int postprocess(std::vector<Event*>& data,
std::vector<Event*>& control1,
std::vector<Event*>& control2) { return 0; }
private:
bool weightEvents_;
std::vector<double> weights_;
std::vector<double> generate_flat10_weights(const TH1* data_npu_estimated) const;
std::vector<double> generate_fall11_weights(const TH1* data_npu_estimated) const;
std::vector<double> generate_summer12_weights(const TH1* data_npu_estimated) const;
};
#endif