1 |
dhidas |
1.1 |
/*
|
2 |
|
|
* CrossSections.h
|
3 |
|
|
*
|
4 |
|
|
* Created on: 29 Jul 2010
|
5 |
|
|
* Author: kreczko
|
6 |
|
|
*/
|
7 |
|
|
|
8 |
|
|
#ifndef EVENTWEIGHTPROVIDER_H_
|
9 |
|
|
#define EVENTWEIGHTPROVIDER_H_
|
10 |
|
|
//https://twiki.cern.ch/twiki/bin/view/CMS/CrossSections_3XSeries#crosssections
|
11 |
|
|
|
12 |
|
|
#include "DataTypes.h"
|
13 |
|
|
#include <vector>
|
14 |
|
|
#include <boost/array.hpp>
|
15 |
|
|
#include <boost/shared_ptr.hpp>
|
16 |
|
|
#include "TH1D.h"
|
17 |
|
|
|
18 |
|
|
namespace BAT {
|
19 |
|
|
namespace sevenTeV {
|
20 |
|
|
extern boost::array<float, DataType::NUMBER_OF_DATA_TYPES> getXSections();
|
21 |
|
|
}
|
22 |
|
|
|
23 |
|
|
|
24 |
|
|
class EventWeightProvider{
|
25 |
|
|
private:
|
26 |
|
|
float lumiInInversePb;
|
27 |
|
|
unsigned short tev;
|
28 |
|
|
bool useSkimEff;
|
29 |
|
|
boost::array<double, DataType::NUMBER_OF_DATA_TYPES> xsection;
|
30 |
|
|
boost::shared_ptr<TH1D> estimatedPileUp;
|
31 |
|
|
boost::array<double, 25> pileUpWeights;
|
32 |
|
|
unsigned long numberOfEventsWithTooHighPileUp;
|
33 |
|
|
// void defineNumberOfSkimmedEvents();
|
34 |
|
|
void defineNumberOfProducedEvents();
|
35 |
|
|
public:
|
36 |
|
|
|
37 |
|
|
|
38 |
|
|
EventWeightProvider(float lumiInInversePb, unsigned short tev = 7, std::string pileUpEstimationFile = "pileUp.root");
|
39 |
|
|
~EventWeightProvider();
|
40 |
|
|
|
41 |
|
|
// void useSkimEfficiency(bool use);
|
42 |
|
|
|
43 |
|
|
// float getExpectedNumberOfEvents(DataType::value type);
|
44 |
|
|
double getWeight(DataType::value type);
|
45 |
|
|
float reweightPileUp(unsigned int numberOfVertices);
|
46 |
|
|
boost::shared_ptr<TH1D> getPileUpHistogram(std::string pileUpEstimationFile);
|
47 |
|
|
void generate_flat10_weights();
|
48 |
|
|
unsigned long getNumberOfEventsWithTooHighPileUp() const;
|
49 |
|
|
boost::array<unsigned long, DataType::NUMBER_OF_DATA_TYPES> numberOfProcessedEvents;
|
50 |
|
|
boost::array<unsigned long, DataType::NUMBER_OF_DATA_TYPES> numberOfPattplSkimEvents;
|
51 |
|
|
boost::array<unsigned long, DataType::NUMBER_OF_DATA_TYPES> numberOfNtplSkimEvents;
|
52 |
|
|
boost::array<unsigned long, DataType::NUMBER_OF_DATA_TYPES> numberOfElectronSkimEvents;
|
53 |
|
|
boost::array<unsigned long, DataType::NUMBER_OF_DATA_TYPES> numberOfMuonSkimEvents;
|
54 |
|
|
|
55 |
|
|
};
|
56 |
|
|
}
|
57 |
|
|
|
58 |
|
|
#endif /* EVENTWEIGHTPROVIDER_H_ */
|