-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathJetWithTowers.h
96 lines (89 loc) · 4.06 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
95
96
#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.26 2012/02/06 22:29:37 kirschen Exp $
// ----------------------------------------------------------------
class JetWithTowers : public Jet
{
public:
JetWithTowers(float Et, float EmEt, float HadEt ,float OutEt, float E,
float eta,float phi, float phiphi, float etaeta,
Flavor flavor,
float fCH, float fNH, float fPH, float fEL, float fHFEm, float fHFHad,
float genPt, float dR, CorFactors* corFactors,
const Function& f,
float (*errfunc)(const float *x, const Measurement *xorig, float err),
const Function& gf);
virtual ~JetWithTowers();
virtual int nPar() const {return Jet::nPar() + towerpars_.size() * ntowerpars_;}
virtual void setParameters(Parameters* param);
virtual float correctedEt(float Et,bool fast = false) const;
virtual float error() const;
virtual float expectedError(float 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 Parameters::VariationColl& varyPars(const double* eps, float Et, float start);
virtual const Parameters::VariationColl& varyParsDirectly(const double* eps, bool computeDeriv = false);
void addTower(float Et, float EmEt, float HadEt ,float OutEt, float E,
float eta,float phi, const Function& f,
float (*errfunc)(const float *x, const Measurement *xorig, float err));
virtual Jet* clone() const { return new JetWithTowers(*this);} //!< Clone this jet
private:
JetWithTowers(const JetWithTowers& j); //!< disallow copies!
class Tower : public Measurement {
public:
Tower(float Et, float EmEt, float HadEt ,float OutEt, float E,
float eta,float phi, float alpha, const Function& func,
float (*errfunc)(const float *x, const Measurement *xorig, float err));
Tower(float Et, float EmEt, float HadEt ,float OutEt, float E,
float EmEttrue, float HadEttrue, float OutEttrue,
float eta,float phi, float alpha, const Function& func,
float (*errfunc)(const float *x, const Measurement *xorig, float err));
virtual ~Tower() {}
float Et() const {return pt;}
float EmEt() const {return EMF;}
float HadEt() const {return HadF;}
float OutEt() const {return OutF;}
float E() const {return Measurement::E;}
float eta() const {return Measurement::eta;}
float phi() const {return Measurement::phi;}
float projectionToJetAxis() const {return alpha_;}
float fractionOfJetHadEt() const { return fraction_;}
void setFractionOfJetHadEt(float frac) const { fraction_ = frac;}
const Function& setParameters(Parameters* param);
float correctedHadEt(float HadEt) const;
float lastCorrectedHadEt() const { return lastCorHadEt_;}
float error() const {return errf_(&(Measurement::pt),this,error_);}
float expectedError(float et) const { return errf_(&et,this,error_);}
int nPar() const {return f_->nPars();}
int firstPar() const {return f_->parIndex();}
double *par() const {return f_->firstPar();}
private:
float alpha_; //!< Projection factor onto jet axis
float error_; //!< Error for constant error mode
float mEttrue_; //!< True total transverse energy
float mEmEttrue_; //!< True Et from the ECAL part of the tower
float mHadEttrue_; //!< True Et from the HCAL part of the towers
float mOutEttrue_; //!< True Et from the HO part of the tower
mutable Measurement temp_;
mutable float lastCorHadEt_;
mutable float fraction_;
const Function* f_;
float (*errf_)(const float *x, const Measurement *xorig, float err);
friend class JetWithTowers;
};
typedef std::vector<Tower*> TowerColl;
typedef TowerColl::iterator TowerCollIter;
typedef TowerColl::const_iterator TowerCollConstIter;
TowerColl towers_;
int ntowerpars_;
std::map<int,double*> towerpars_;
};
#endif