20 forestLabel_ ( cfg.getParameter<
std::
string>(
"GBRForestLabel") ),
21 dbFileName_ ( cfg.getParameter<
std::
string>(
"GBRForestFileName") ),
22 useForestFromDB_( (!forestLabel_.
empty()) & dbFileName_.
empty())
26 if(!dbFileName_.empty()){
27 TFile gbrfile(dbFileName_.c_str());
28 forestFromFile_.reset((
GBRForest*)gbrfile.Get(forestLabel_.c_str()));
33 forest_ = forestFromFile_.get();
37 forest_ = forestHandle.
product();
45 auto tmva_pt_ = trk.
pt();
46 auto tmva_ndof_ = trk.
ndof();
52 float chi2n_no1Dmod =
chi2n;
56 const auto &
hit = *(*ith);
57 if (
hit.dimension()==1) ++count1dhits;
60 if (count1dhits > 0) {
63 chi2n = (chi2+count1dhits)/
float(ndof+count1dhits);
65 auto tmva_chi2n_ =
chi2n;
66 auto tmva_chi2n_no1dmod_ = chi2n_no1Dmod;
67 auto tmva_eta_ = trk.
eta();
72 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_;
104 return forest_->GetClassifier(gbrVals_);
108 static const char *
name();
115 std::unique_ptr<GBRForest> forestFromFile_;
119 const bool useForestFromDB_;
double normalizedChi2() const
chi-squared divided by n.d.o.f. (or chi-squared * 1e6 if n.d.o.f. is zero)
#define DEFINE_FWK_MODULE(type)
unsigned short numberOfLostHits() const
number of cases where track crossed a layer without getting a hit.
std::vector< Vertex > VertexCollection
collection of Vertex objects
int pixelLayersWithMeasurement() const
int trackerLayersWithMeasurement() const
double eta() const
pseudorapidity of momentum vector
int numberOfValidStripLayersWithMonoAndStereo(uint16_t stripdet, uint16_t layer) const
double chi2() const
chi-squared of the fit
double ndof() const
number of degrees of freedom of the fit
double pt() const
track transverse momentum
double ptError() const
error on Pt (set to 1000 TeV if charge==0 for safety)
Abs< T >::type abs(const T &t)
unsigned short numberOfValidHits() const
number of valid hits found
trackingRecHit_iterator recHitsBegin() const
Iterator to first hit on the track.
ParameterDescriptionBase * add(U const &iLabel, T const &value)
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...
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
const HitPattern & hitPattern() const
Access the hit pattern, indicating in which Tracker layers the track has hits.
int numberOfLostHits(HitCategory category) const
int trackerLayersWithoutMeasurement(HitCategory category) const
Point getBestVertex(reco::Track const &trk, reco::VertexCollection const &vertices, const size_t minNtracks=2)
const Point & position() const
position
double dxy() const
dxy parameter. (This is the transverse impact parameter w.r.t. to (0,0,0) ONLY if refPoint is close t...
T const * product() const
trackingRecHit_iterator recHitsEnd() const
Iterator to last hit on the track.