Skip to content

Commit

Permalink
Revert "Fix for trkMVA branch in trackTree" (cms-sw#164)
Browse files Browse the repository at this point in the history
  • Loading branch information
bi-ran committed Nov 8, 2018
1 parent a360403 commit f793d57
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 11 deletions.
4 changes: 1 addition & 3 deletions HeavyIonsAnalysis/TrackAnalysis/python/TrkAnalyzers_cff.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,7 @@
trackSrc = cms.InputTag("hiGeneralTracks"),
vertexSrc = cms.vstring('hiSelectedVertex'),
mvaSrc = cms.InputTag('hiGeneralTracks','MVAVals'),
pfCandSrc = cms.InputTag("particleFlowTmp"),
doMVA = False
)
pfCandSrc = cms.InputTag("particleFlowTmp"))

pixelTrack = anaTrack.clone(
trackPtMin = 0.4,
Expand Down
4 changes: 2 additions & 2 deletions HeavyIonsAnalysis/TrackAnalysis/python/trackAnalyzer_cfi.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
simTrackPtMin = cms.untracked.double(0.1),
vertexSrc = cms.vstring('offlinePrimaryVertices'),
trackSrc = cms.InputTag('generalTracks'),
mvaSrc = cms.InputTag("generalTracks","MVAValues"),
mvaSrc = cms.InputTag("generalTracks","MVAVals"),
particleSrc = cms.InputTag('genParticles'),
pfCandSrc = cms.InputTag('particleFlow'),
beamSpotSrc = cms.untracked.InputTag('offlineBeamSpot'),
Expand All @@ -20,6 +20,6 @@
tpEffSrc = cms.untracked.InputTag('mix','MergedTrackTruth'),
# associateChi2 = cms.bool(False),
associatorMap = cms.InputTag('tpRecoAssocHiGeneralTracks'),
doMVA = cms.untracked.bool(True),
doMVA = cms.untracked.bool(False),
fillSimTrack = cms.untracked.bool(False)
)
12 changes: 6 additions & 6 deletions HeavyIonsAnalysis/TrackAnalysis/src/TrackAnalyzer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ class TrackAnalyzer : public edm::EDAnalyzer {
edm::EDGetTokenT<edm::View<reco::Track>> trackSrcView_;
edm::EDGetTokenT<std::vector<reco::Track>> trackSrc_;
edm::InputTag mvaSrcLabel_;
edm::EDGetTokenT<std::vector<float>> mvaSrc_;
edm::EDGetTokenT<edm::ValueMap<float>> mvaSrc_;
edm::EDGetTokenT<reco::GenParticleCollection> particleSrc_;
edm::EDGetTokenT<TrackingParticleCollection> tpEffSrc_;
edm::EDGetTokenT<reco::PFCandidateCollection> pfCandSrc_;
Expand Down Expand Up @@ -334,7 +334,7 @@ TrackAnalyzer::TrackAnalyzer(const edm::ParameterSet& iConfig)
trackSrcView_ = consumes<edm::View<reco::Track>>(trackSrcLabel_);
if (doMVA_) {
mvaSrcLabel_ = iConfig.getParameter<edm::InputTag>("mvaSrc");
mvaSrc_ = consumes<std::vector<float>>(mvaSrcLabel_);
mvaSrc_ = consumes<edm::ValueMap<float>>(mvaSrcLabel_);
}
if (doSimTrack_) {
particleSrc_ = consumes<reco::GenParticleCollection>(iConfig.getParameter<edm::InputTag>("particleSrc"));
Expand Down Expand Up @@ -540,7 +540,7 @@ TrackAnalyzer::fillTracks(const edm::Event& iEvent, const edm::EventSetup& iSetu
iEvent.getByToken(DeDxSrc_, DeDxMap);
}

edm::Handle<std::vector<float>> mvaoutput;
edm::Handle<edm::ValueMap<float>> mvaoutput;
if (doMVA_) {
iEvent.getByToken(mvaSrc_, mvaoutput);
}
Expand Down Expand Up @@ -629,7 +629,7 @@ TrackAnalyzer::fillTracks(const edm::Event& iEvent, const edm::EventSetup& iSetu
else
pev_.trkMVA[pev_.nTrk] = -1;
} else {
pev_.trkMVA[pev_.nTrk] = (*mvaoutput)[it];//non algo = 11 behavior
pev_.trkMVA[pev_.nTrk] = (*mvaoutput)[trackRef];//non algo = 11 behavior
}

if (mvaSrcLabel_.label() == "generalTracks") {
Expand Down Expand Up @@ -893,9 +893,9 @@ TrackAnalyzer::fillSimTracks(const edm::Event& iEvent, const edm::EventSetup& iS
}

if (mvaSrcLabel_.label() == "generalTracks") {
pev_.mtrkMVALoose[pev_.nParticle] = mtrk->quality(reco::TrackBase::qualityByName("highPurity"));
pev_.mtrkMVALoose[pev_.nParticle] = (!((pev_.mtrkAlgo[pev_.nParticle] == 4 && pev_.mtrkMVA[pev_.nParticle] < -0.7) || (pev_.mtrkAlgo[pev_.nParticle] == 5 && pev_.mtrkMVA[pev_.nParticle] < -0.1) || (pev_.mtrkAlgo[pev_.nParticle] == 6 && pev_.mtrkMVA[pev_.nParticle] < 0.3) || (pev_.mtrkAlgo[pev_.nParticle] == 7 && pev_.mtrkMVA[pev_.nParticle] < 0.4) || (pev_.mtrkAlgo[pev_.nParticle] == 8 && pev_.mtrkMVA[pev_.nParticle] < -0.2) || (pev_.mtrkAlgo[pev_.nParticle] == 9 && pev_.mtrkMVA[pev_.nParticle] < 0.0) ||(pev_.mtrkAlgo[pev_.nParticle] == 10 && pev_.mtrkMVA[pev_.nParticle] < -0.3)) || pev_.mtrkMVA[pev_.nParticle] == -99) && mtrk->quality(reco::TrackBase::qualityByName("highPurity"));

pev_.mtrkMVATight[pev_.nParticle] = mtrk->quality(reco::TrackBase::qualityByName("highPurity"));
pev_.mtrkMVATight[pev_.nParticle] = (!((pev_.mtrkAlgo[pev_.nParticle] == 4 && pev_.mtrkMVA[pev_.nParticle] < -0.7) || (pev_.mtrkAlgo[pev_.nParticle] == 5 && pev_.mtrkMVA[pev_.nParticle] < -0.1) || (pev_.mtrkAlgo[pev_.nParticle] == 6 && pev_.mtrkMVA[pev_.nParticle] < 0.3) || (pev_.mtrkAlgo[pev_.nParticle] == 7 && pev_.mtrkMVA[pev_.nParticle] < 0.5) || (pev_.mtrkAlgo[pev_.nParticle] == 8 && pev_.mtrkMVA[pev_.nParticle] < 0.5) || (pev_.mtrkAlgo[pev_.nParticle] == 9 && pev_.mtrkMVA[pev_.nParticle] < 0.4) ||(pev_.mtrkAlgo[pev_.nParticle] == 10 && pev_.mtrkMVA[pev_.nParticle] < 0)) || pev_.mtrkMVA[pev_.nParticle] == -99) && mtrk->quality(reco::TrackBase::qualityByName("highPurity"));
} else if (mvaSrcLabel_.label() == "hiGeneralTracks") {
pev_.mtrkMVATight[pev_.nParticle] = (!((pev_.mtrkAlgo[pev_.nParticle] == 4 && pev_.mtrkMVA[pev_.nParticle] < -0.77) || (pev_.mtrkAlgo[pev_.nParticle] == 5 && pev_.mtrkMVA[pev_.nParticle] < 0.35) || (pev_.mtrkAlgo[pev_.nParticle] == 6 && pev_.mtrkMVA[pev_.nParticle] < 0.77) || (pev_.mtrkAlgo[pev_.nParticle] == 7 && pev_.mtrkMVA[pev_.nParticle] < 0.35)) || pev_.mtrkMVA[pev_.nParticle] == -99) && mtrk->quality(reco::TrackBase::qualityByName("highPurity"));
}
Expand Down

0 comments on commit f793d57

Please sign in to comment.