-
Notifications
You must be signed in to change notification settings - Fork 0
/
JetConstraintEvent.h
63 lines (54 loc) · 1.88 KB
/
JetConstraintEvent.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
//
// Class for constraints on the jet correction
//
// first version: Hartmut Stadie 2009/07/23
// $Id: JetConstraintEvent.h,v 1.10 2010/11/01 15:47:40 stadie Exp $
//
#ifndef JETCONSTRAINTEVENT_H
#define JETCONSTRAINTEVENT_H
#include <map>
#include <vector>
#include"CalibData.h"
#include "Jet.h"
//interface to Data
class JetConstraintEvent : public Event
{
public:
JetConstraintEvent(double minpt, double maxpt, double mineta, double maxeta,
double w)
: Event(w), minpt_(minpt),maxpt_(maxpt),mineta_(mineta),maxeta_(maxeta),trusum_(0),
trusum2_(0),error_(0) {}
~JetConstraintEvent();
void addJet(double truePt, const Jet* j, Function* globalFunc = 0);
//interface from TData
Measurement *mess() const {return jets_[0];}
double truth() const { return jets_.size() ? trusum_ / jets_.size() : 0;}
double parametrizedMess() const { return jets_[0]->correctedEt(jets_[0]->Et());}
void setParameters(Parameters* param);
DataType type() const { return JetConstraint;}
double chi2() const;
double chi2_plots() const { return chi2plots_; }
double chi2_fast(double * temp_derivative1, double * temp_derivative2, double * temp_derivative3, double * temp_derivative4, const double* epsilon) const;
void updateError() { }
double minEta() const { return mineta_;}
double maxEta() const { return maxeta_;}
double minPt() const { return minpt_;}
double maxPt() const { return maxpt_;}
int nJets() const { return jets_.size();}
private:
struct Variation{
double uppersum_;
double lowersum_;
Variation() : uppersum_(0), lowersum_(0) {}
};
double minpt_,maxpt_;
double mineta_,maxeta_;
typedef std::map<int, Variation> VarMap;
mutable VarMap varmap_;
std::vector<Jet*> jets_;
double trusum_;
double trusum2_;
double error_;
mutable double chi2plots_; //!< Store chi2 value from last iteration for plots
};
#endif