|
|
Go to the documentation of this file.
17 template <
bool PROMPT>
20 : forestLabel_(
cfg.getParameter<
std::
string>(
"GBRForestLabel")),
21 dbFileName_(
cfg.getParameter<
std::
string>(
"GBRForestFileName")),
22 useForestFromDB_((!forestLabel_.
empty()) & dbFileName_.
empty()) {}
25 if (!dbFileName_.empty()) {
26 TFile gbrfile(dbFileName_.c_str());
27 forestFromFile_.reset((
GBRForest *)gbrfile.Get(forestLabel_.c_str()));
32 forest_ = forestFromFile_.get();
33 if (useForestFromDB_) {
36 forest_ = forestHandle.
product();
43 auto tmva_pt_ = trk.
pt();
44 auto tmva_ndof_ = trk.
ndof();
46 auto tmva_nlayers3D_ =
50 float chi2n_no1Dmod =
chi2n;
54 const auto &
hit = *(*ith);
55 if (
hit.dimension() == 1)
59 if (count1dhits > 0) {
64 auto tmva_chi2n_ =
chi2n;
65 auto tmva_chi2n_no1dmod_ = chi2n_no1Dmod;
66 auto tmva_eta_ = trk.
eta();
71 auto tmva_minlost_ =
std::min(lostIn, lostOut);
75 float gbrVals_[PROMPT ? 16 : 12];
76 gbrVals_[0] = tmva_pt_;
77 gbrVals_[1] = tmva_lostmidfrac_;
78 gbrVals_[2] = tmva_minlost_;
79 gbrVals_[3] = tmva_nhits_;
80 gbrVals_[4] = tmva_relpterr_;
81 gbrVals_[5] = tmva_eta_;
82 gbrVals_[6] = tmva_chi2n_no1dmod_;
83 gbrVals_[7] = tmva_chi2n_;
84 gbrVals_[8] = tmva_nlayerslost_;
85 gbrVals_[9] = tmva_nlayers3D_;
86 gbrVals_[10] = tmva_nlayers_;
87 gbrVals_[11] = tmva_ndof_;
94 auto tmva_absdzPV_ =
std::abs(trk.
dz(bestVertex));
96 gbrVals_[12] = tmva_absd0PV_;
97 gbrVals_[13] = tmva_absdzPV_;
98 gbrVals_[14] = tmva_absdz_;
99 gbrVals_[15] = tmva_absd0_;
102 return forest_->GetClassifier(gbrVals_);
105 static const char *
name();
112 std::unique_ptr<GBRForest> forestFromFile_;
116 const bool useForestFromDB_;
123 return "TrackMVAClassifierDetached";
127 return "TrackMVAClassifierPrompt";
T const * product() const
ParameterDescriptionBase * add(U const &iLabel, T const &value)
double ptError() const
error on Pt (set to 1000 TeV if charge==0 for safety)
int trackerLayersWithoutMeasurement(HitCategory category) const
trackingRecHit_iterator recHitsBegin() const
Iterator to first hit on the track.
std::vector< Vertex > VertexCollection
collection of Vertex objects
double ndof() const
number of degrees of freedom of the fit
int numberOfLostHits(HitCategory category) const
unsigned short numberOfValidHits() const
number of valid hits found
int pixelLayersWithMeasurement() const
double pt() const
track transverse momentum
#define DEFINE_FWK_MODULE(type)
int trackerLayersWithMeasurement() const
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
trackingRecHit_iterator recHitsEnd() const
Iterator to last hit on the track.
unsigned short numberOfLostHits() const
number of cases where track crossed a layer without getting a hit.
double dz() const
dz parameter (= dsz/cos(lambda)). This is the track z0 w.r.t (0,0,0) only if the refPoint is close to...
Structure Point Contains parameters of Gaussian fits to DMRs.
double eta() const
pseudorapidity of momentum vector
double chi2() const
chi-squared of the fit
double normalizedChi2() const
chi-squared divided by n.d.o.f. (or chi-squared * 1e6 if n.d.o.f. is zero)
const HitPattern & hitPattern() const
Access the hit pattern, indicating in which Tracker layers the track has hits.
Abs< T >::type abs(const T &t)
double dxy() const
dxy parameter. (This is the transverse impact parameter w.r.t. to (0,0,0) ONLY if refPoint is close t...
int numberOfValidStripLayersWithMonoAndStereo(uint16_t stripdet, uint16_t layer) const
Point getBestVertex(reco::Track const &trk, reco::VertexCollection const &vertices, const size_t minNtracks=2)