9 #include "TMVA/Reader.h" 10 #include "TMVA/MethodBDT.h" 15 constexpr char softmuon_mva_name[] =
"BDT";
20 TMVA::Reader tmvaReader(
"!Color:!Silent:Error");
27 tmvaReader.AddVariable(
"kinkFinder", &
trkKink_);
30 tmvaReader.AddVariable(
"outerChi2", &
outerChi2_);
31 tmvaReader.AddVariable(
"innerChi2", &
innerChi2_);
34 tmvaReader.AddVariable(
"Qprod", &
qProd_);
36 tmvaReader.AddSpectator(
"pID", &
pID_);
37 tmvaReader.AddSpectator(
"pt", &
pt_);
38 tmvaReader.AddSpectator(
"eta", &
eta_);
39 tmvaReader.AddSpectator(
"MomID", &
momID_);
41 auto temp{ tmvaReader.BookMVA(softmuon_mva_name, weightsfile.c_str()) };
42 gbrForest_ = std::make_unique<GBRForest>(
dynamic_cast<TMVA::MethodBDT*
>(
temp ) );
49 kSegmentCompatibility,
54 kLayersWithMeasurement,
105 var[kIValidFraction] = iTrack->validFraction();
106 var[kInnerChi2] = iTrack->normalizedChi2();
107 var[kLayersWithMeasurement] = iTrack->hitPattern().trackerLayersWithMeasurement();
109 var[kOuterChi2] = oTrack->normalizedChi2();
111 var[kQProd] = iTrack->charge()*oTrack->charge();
117 std::vector<int> fvDThits = {0,0,0,0};
118 std::vector<int> fvRPChits = {0,0,0,0};
119 std::vector<int> fvCSChits = {0,0,0,0};
121 var[kVMuonHitComb] = 0;
129 if (muStation0 >=0 && muStation0 < 4){
140 var[kVMuonHitComb] += (fvDThits[
station])/2.;
141 var[kVMuonHitComb] += fvRPChits[
station];
144 var[kVMuonHitComb] += 6;
146 var[kVMuonHitComb] += fvCSChits[
station];
151 if(var[kChi2LocalMomentum] < 5000 and var[kChi2LocalPosition] < 2000 and
152 var[kGlbTrackProbability] < 5000 and var[kTrkKink] < 900 and
153 var[kLog2PlusGlbKink] < 50 and var[kTimeAtIpInOutErr] < 4 and
154 var[kOuterChi2] < 1000 and var[kInnerChi2] < 10 and var[kTrkRelChi2] < 3)
156 return gbrForest_->GetAdaBoostClassifier(var);
float chi2LocalPosition
chi2 value for the STA-TK matching of local position
bool isNonnull() const
Checks for non-null.
double eta() const final
momentum pseudorapidity
float chi2LocalMomentum
chi2 value for the STA-TK matching of local momentum
example_track example_track const char *const kPt
float glbKink
value of the kink algorithm applied to the global track
float glbTrackProbability
the tail probability (-ln(P)) of the global fit
double pt() const final
transverse momentum
float trkKink
value of the kink algorithm applied to the inner track stub
float trkRelChi2
chi2 value for the inner track stub with respect to the global track
MuonTime time() const
get DT/CSC combined timing information
float layersWithMeasurement_
static bool validHitFilter(uint16_t pattern)
double segmentCompatibility(reco::Muon::ArbitrationType arbitrationType=reco::Muon::SegmentAndTrackArbitration) const
Returns the segment compatibility, using muon::segmentCompatibility (DataFormats/MuonReco/interface/M...
reco::TrackRef innerTrack() const override
reference to Track reconstructed in the tracker only (reimplemented from reco::Muon) ...
SoftMuonMvaEstimator(const std::string &weightsfile)
reco::TrackRef outerTrack() const override
reference to Track reconstructed in the muon detector only (reimplemented from reco::Muon) ...
static bool muonCSCHitFilter(uint16_t pattern)
int numberOfAllHits(HitCategory category) const
MuonQuality combinedQuality() const
get energy deposition information
float glbTrackProbability_
reco::TrackRef globalTrack() const override
reference to Track reconstructed in both tracked and muon detector (reimplemented from reco::Muon) ...
static bool muonDTHitFilter(uint16_t pattern)
std::unique_ptr< const GBRForest > gbrForest_
static uint16_t getMuonStation(uint16_t pattern)
Muon station (1-4). Only valid for muon patterns, of course. only for patterns from muon...
float computeMva(const pat::Muon &imuon) const
float segmentCompatibility_
uint16_t getHitPattern(HitCategory category, int position) const
static bool muonRPCHitFilter(uint16_t pattern)
Analysis-level muon class.