-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDiJetEventBinning.h
64 lines (54 loc) · 1.76 KB
/
DiJetEventBinning.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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
//
// $Id: DiJetEventWeighting.h,v 1.1 2010/12/20 11:08:13 stadie Exp $
//
#ifndef DIJETEVENTBINNING_H
#define DIJETEVENTBINNING_H
#include "EventProcessor.h"
#include <map>
class Parameters;
class TwoJetsPtBalanceEvent;
class TwoJetsPtBalanceBinnedEvent;
// -----------------------------------------------------------------
class DiJetEventBinning : public EventProcessor
{
public:
DiJetEventBinning(const std::string& configfile, Parameters* param);
virtual ~DiJetEventBinning();
protected:
virtual int preprocess(std::vector<Event*>& data,
std::vector<Event*>& control1,
std::vector<Event*>& control2);
virtual int postprocess(std::vector<Event*>& data,
std::vector<Event*>& control1,
std::vector<Event*>& control2) { return data.size();}
private:
class EtaPtKey {
private:
const double mineta_,minpt_;
public:
EtaPtKey(double mineta = 0, double minpt = 0) : mineta_(mineta),minpt_(minpt) {}
double eta() const {return mineta_;}
double pt() const {return minpt_;}
bool operator<(const EtaPtKey& k) const {
if(eta() < k.eta()) return true;
if(eta() > k.eta()) return false;
if(pt() < k.pt()) return true;
return false;
}
};
typedef std::map<EtaPtKey,TwoJetsPtBalanceBinnedEvent*> EventMap;
EventMap::const_iterator getIterator(double eta, double pt,
const EventMap& map) const;
TwoJetsPtBalanceBinnedEvent* getEvent(double eta, double pt,
const EventMap& map) const {
EventMap::const_iterator i = getIterator(eta,pt,map);
if(i != map.end()) return i->second;
return 0;
}
void split(double eta, double pt);
static const int Nalpha_ = 4;
unsigned int minEvents_;
std::vector<double> etavalues_;
EventMap databins_[Nalpha_],controlbins_[Nalpha_];
};
#endif