-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathJetWithTowers.h
78 lines (73 loc) · 3.04 KB
/
JetWithTowers.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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
//
// Class for jets with towers
//
// first version: Hartmut Stadie 2008/12/25
// $Id: JetWithTowers.h,v 1.9 2009/02/24 22:13:52 stadie Exp $
//
#ifndef JETWITHTOWERS_H
#define JETWITHTOWERS_H
#include"Jet.h"
#include <vector>
#include <map>
class JetWithTowers : public Jet
{
public:
JetWithTowers(double Et, double EmEt, double HadEt ,double OutEt, double E,
double eta,double phi, Flavor flavor,const Function& f,
double (*errfunc)(const double *x, const TMeasurement *xorig, double err),
const Function& gf, double Etmin = 0);
virtual ~JetWithTowers();
virtual int nPar() const {return Jet::nPar() + towerpars.size() * ntowerpars;}
virtual void ChangeParAddress(double* oldpar, double* newpar);
virtual double correctedEt(double Et,bool fast = false) const;
virtual double Error() const;
virtual double expectedError(double truth) const;
// varies all parameters for this jet by eps and returns a vector of the
// parameter id and the Et for the par + eps and par - eps variation
virtual const VariationColl& varyPars(double eps, double Et, double start);
virtual const VariationColl& varyParsDirectly(double eps);
void addTower(double Et, double EmEt, double HadEt ,double OutEt, double E,
double eta,double phi,const Function& f,
double (*errfunc)(const double *x, const TMeasurement *xorig, double err));
private:
class Tower : public TMeasurement {
public:
Tower(double Et, double EmEt, double HadEt ,double OutEt, double E,
double eta,double phi, double alpha, const Function& func,
double (*errfunc)(const double *x, const TMeasurement *xorig, double err));
virtual ~Tower() {}
double Et() const {return pt;}
double EmEt() const {return EMF;}
double HadEt() const {return HadF;}
double OutEt() const {return OutF;}
double E() const {return TMeasurement::E;}
double eta() const {return TMeasurement::eta;}
double phi() const {return TMeasurement::phi;}
double projectionToJetAxis() const {return alpha;}
double fractionOfJetHadEt() const { return fraction;}
void setFractionOfJetHadEt(double frac) const { fraction = frac;}
void ChangeParAddress(double* oldpar, double* newpar) {f.changeParBase(oldpar,newpar);}
double correctedHadEt(double HadEt) const;
double lastCorrectedHadEt() const { return lastCorHadEt;}
double Error() const {return errf(&(TMeasurement::pt),this,0);}
double expectedError(double truth) const { return errf(&truth,this,0);}
int nPar() const {return f.nPars();}
int FirstPar() const {return f.parIndex();}
double *Par() const {return f.firstPar();}
private:
double alpha;
double error;
mutable TMeasurement temp;
mutable double lastCorHadEt;
mutable double fraction;
Function f;
double (*errf)(const double *x, const TMeasurement *xorig, double err);
};
typedef std::vector<Tower*> TowerColl;
typedef TowerColl::iterator TowerCollIter;
typedef TowerColl::const_iterator TowerCollConstIter;
TowerColl towers;
int ntowerpars;
std::map<int,double*> towerpars;
};
#endif