-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathJetWithTowers.h
94 lines (88 loc) · 4.18 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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
#ifndef JETWITHTOWERS_H
#define JETWITHTOWERS_H
#include"Jet.h"
#include <vector>
#include <map>
//!
//! \brief Class for jets with towers
//!
//! \author Hartmut Stadie
//! \date 2008/12/25
//! $Id: JetWithTowers.h,v 1.13 2009/04/27 13:49:07 mschrode Exp $
// ----------------------------------------------------------------
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);
JetWithTowers(double Et, double EmEt, double HadEt ,double OutEt, double E,
double eta,double phi, Flavor flavor,double genPt, double dR, double ZSPcor,
double JPTcor, double L2cor, double L3cor,double L2L3cor,
double L2L3JPTcor, 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 et) 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));
Tower(double Et, double EmEt, double HadEt ,double OutEt, double E,
double EmEttrue, double HadEttrue, double OutEttrue,
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 et) const { return errf(&et,this,0);}
int nPar() const {return f.nPars();}
int FirstPar() const {return f.parIndex();}
double *Par() const {return f.firstPar();}
private:
double alpha; //!< Projection factor onto jet axis
double error; //!< Error for constant error mode
double mEttrue; //!< True total transverse energy
double mEmEttrue; //!< True Et from the ECAL part of the tower
double mHadEttrue; //!< True Et from the HCAL part of the towers
double mOutEttrue; //!< True Et from the HO part of the tower
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