-
Notifications
You must be signed in to change notification settings - Fork 0
/
JetWithTracks.h
94 lines (86 loc) · 3.78 KB
/
JetWithTracks.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 JETWITHTRACKS_H
#define JETWITHTRACKS_H
#include"Jet.h"
#include <vector>
#include <map>
//!
//! \brief Class for jets with towers
//!
//! \author Hartmut Stadie
//! \date 2008/12/25
//! $Id: JetWithTracks.h,v 1.15 2012/02/06 22:29:36 kirschen Exp $
// ---------------------------------------------------------------
class JetWithTracks : public Jet
{
public:
JetWithTracks(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 ~JetWithTracks();
virtual int nPar() const {return Jet::nPar() + trackpars_.size() * ntrackpars_;}
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);
void addTrack(float Et, float EmEt, float HadEt ,float OutEt, float E,
float eta,float phi,int TrackId, int TowerId, float DR, float DRout,
float etaOut, float phiOut, float EM1, float EM5, float Had1,
float Had5, float TrackChi2, int NValidHits, bool TrackQualityT,
float MuDR, float MuDE, float Efficiency, const Function& f,
float (*errfunc)(const float *x, const Measurement *xorig, float err));
virtual Jet* clone() const { return new JetWithTracks(*this);} //!< Clone this jet
protected:
virtual float expectedEt(float truth, float start, bool fast = false);
private:
JetWithTracks(const JetWithTracks& j); //!< disallow copies!
class Track : public TTrack {
public:
Track(float Et, float EmEt, float HadEt ,float OutEt, float E,
float eta,float phi, int TrackId, int TowerId, float DR, float DRout,
float etaOut, float phiOut, float EM1, float EM5, float Had1, float Had5,
float TrackChi2, int NValidHits, bool TrackQualityT, float MuDR, float MuDE,
float Efficiency, const Function& func,
float (*errfunc)(const float *x, const Measurement *xorig, float err));
virtual ~Track() {}
float Et() const {return Measurement::pt;}
float EmEt() const {return Measurement::EMF;}
float HadEt() const {return Measurement::HadF;}
float OutEt() const {return Measurement::OutF;}
float E() const {return Measurement::E;}
float eta() const {return Measurement::eta;}
float phi() const {return Measurement::phi;}
int trackId() const { return TTrack::TrackId;}
int towerId() const { return TTrack::TowerId;}
float dR() const { return TTrack::DR;}
float dRout() const { return TTrack::DRout;}
bool goodTrack() const { return TTrack::TrackQualityT;}
const Function& setParameters(Parameters* param);
float expectedEt() const;
float error() const {return 0;}
int nPar() const {return f_->nPars();}
int firstPar() const {return f_->parIndex();}
double *par() const {return f_->firstPar();}
private:
const Function* f_;
float (*errf_)(const float *x, const Measurement *xorig, float err);
friend class JetWithTracks;
};
typedef std::vector<Track*> TrackColl;
typedef TrackColl::iterator TrackCollIter;
typedef TrackColl::const_iterator TrackCollConstIter;
TrackColl tracks_;
int ntrackpars_;
std::map<int,double*> trackpars_;
mutable float expectedCaloEt_;
mutable float trackPt_;
};
#endif