diff --git a/RecoTracker/DeDx/plugins/HLTDeDxFilter.cc b/RecoTracker/DeDx/plugins/HLTDeDxFilter.cc index 1f8964ad92462..b5eeb178b999e 100644 --- a/RecoTracker/DeDx/plugins/HLTDeDxFilter.cc +++ b/RecoTracker/DeDx/plugins/HLTDeDxFilter.cc @@ -21,6 +21,7 @@ #include "FWCore/Framework/interface/EventSetup.h" #include "DataFormats/TrackReco/interface/DeDxData.h" //#include "DataFormats/Math/interface/deltaPhi.h" +#include "DataFormats/Math/interface/deltaR.h" #include "DataFormats/Common/interface/ValueMap.h" #include "FWCore/ParameterSet/interface/ConfigurationDescriptions.h" #include "FWCore/ParameterSet/interface/ParameterSetDescription.h" @@ -38,6 +39,11 @@ HLTDeDxFilter::HLTDeDxFilter(const edm::ParameterSet& iConfig) : HLTFilter(iConf minPT_ = iConfig.getParameter ("minPT"); minNOM_ = iConfig.getParameter ("minNOM"); maxETA_ = iConfig.getParameter ("maxETA"); + minNumValidHits_ = iConfig.getParameter ("minNumValidHits"); + maxNHitMissIn_ = iConfig.getParameter ("maxNHitMissIn"); + maxNHitMissMid_ = iConfig.getParameter ("maxNHitMissMid"); + maxRelTrkIsoDeltaRp3_ = iConfig.getParameter ("maxRelTrkIsoDeltaRp3"); + relTrkIsoDeltaRSize_ = iConfig.getParameter ("relTrkIsoDeltaRSize"); inputTracksTag_ = iConfig.getParameter< edm::InputTag > ("inputTracksTag"); inputdedxTag_ = iConfig.getParameter< edm::InputTag > ("inputDeDxTag"); inputTracksToken_ = consumes(iConfig.getParameter< edm::InputTag > ("inputTracksTag")); @@ -58,6 +64,11 @@ void HLTDeDxFilter::fillDescriptions(edm::ConfigurationDescriptions& description desc.add("minPT",0.0); desc.add("minNOM",0.0); desc.add("maxETA",5.5); + desc.add("minNumValidHits",0); + desc.add("maxNHitMissIn",99); + desc.add("maxNHitMissMid",99); + desc.add("maxRelTrkIsoDeltaRp3", -1); + desc.add("relTrkIsoDeltaRSize", 0.3); desc.add("inputTracksTag",edm::InputTag("hltL3Mouns")); desc.add("inputDeDxTag",edm::InputTag("HLTdedxHarm2")); descriptions.add("hltDeDxFilter",desc); @@ -94,12 +105,22 @@ bool bool accept=false; int NTracks = 0; + //fill local arrays for eta, phi, and pt + float eta[trackCollection.size()], phi[trackCollection.size()], pt[trackCollection.size()]; for(unsigned int i=0; ipt()>minPT_ && fabs(track->eta())minNOM_ && dEdxTrack[track].dEdx()>minDEDx_){ - NTracks++; + eta[i] = trackCollection[i].eta(); + phi[i] = trackCollection[i].phi(); + pt[i] = trackCollection[i].pt(); + } + for(unsigned int i=0; iminPT_ && fabs(eta[i])minNOM_ && dEdxTrack[track].dEdx()>minDEDx_){ + NTracks++; + if(track->numberOfValidHits() < minNumValidHits_) continue; + if(track->hitPattern().trackerLayersWithoutMeasurement( reco::HitPattern::MISSING_INNER_HITS) > maxNHitMissIn_) continue; + if(track->hitPattern().trackerLayersWithoutMeasurement( reco::HitPattern::TRACK_HITS) > maxNHitMissMid_) continue; if (saveTags()){ - Particle::Charge q = track->charge(); + Particle::Charge q = track->charge(); //SAVE DEDX INFORMATION AS IF IT WAS THE MASS OF THE PARTICLE Particle::LorentzVector p4(track->px(), track->py(), track->pz(), sqrt(pow(track->p(),2) + pow(dEdxTrack[track].dEdx(),2))); Particle::Point vtx(track->vx(),track->vy(), track->vz()); @@ -109,6 +130,21 @@ bool cand.setTrack(track); chargedCandidates->push_back(cand); } + + //calculate relative trk isolation only if parameter maxRelTrkIsoDeltaRp3 is less than 0 + if(maxRelTrkIsoDeltaRp3_ >= 0){ + auto ptCone = trackCollection[i].pt(); + for(unsigned int j=0; j maxRelTrkIsoDeltaRp3_) continue; + } accept=true; } } diff --git a/RecoTracker/DeDx/plugins/HLTDeDxFilter.h b/RecoTracker/DeDx/plugins/HLTDeDxFilter.h index 74d80ff2558b9..ae70848e4cb7c 100644 --- a/RecoTracker/DeDx/plugins/HLTDeDxFilter.h +++ b/RecoTracker/DeDx/plugins/HLTDeDxFilter.h @@ -33,6 +33,11 @@ class HLTDeDxFilter : public HLTFilter { double minPT_; double minNOM_; double maxETA_; + double minNumValidHits_; + double maxNHitMissIn_; + double maxNHitMissMid_; + double maxRelTrkIsoDeltaRp3_; + double relTrkIsoDeltaRSize_; edm::EDGetToken inputTracksToken_; edm::EDGetToken inputdedxToken_; edm::InputTag inputTracksTag_;