New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added configurable parameters for nValidHits, nMissIn, nMissMid, maxRelTrkIsoDeltaRp3, relTrkIsoDeltaRSize #5665
Changes from 3 commits
74e4fbd
9a558df
f136e85
49b37e2
3455dc5
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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,10 @@ HLTDeDxFilter::HLTDeDxFilter(const edm::ParameterSet& iConfig) : HLTFilter(iConf | |
minPT_ = iConfig.getParameter<double> ("minPT"); | ||
minNOM_ = iConfig.getParameter<double> ("minNOM"); | ||
maxETA_ = iConfig.getParameter<double> ("maxETA"); | ||
minNumValidHits_ = iConfig.getParameter<double> ("minNumValidHits"); | ||
maxNHitMissIn_ = iConfig.getParameter<double> ("maxNHitMissIn"); | ||
maxNHitMissMid_ = iConfig.getParameter<double> ("maxNHitMissMid"); | ||
maxRelTrkIsoDeltaRp3_ = iConfig.getParameter<double> ("maxRelTrkIsoDeltaRp3"); | ||
inputTracksTag_ = iConfig.getParameter< edm::InputTag > ("inputTracksTag"); | ||
inputdedxTag_ = iConfig.getParameter< edm::InputTag > ("inputDeDxTag"); | ||
inputTracksToken_ = consumes<reco::TrackCollection>(iConfig.getParameter< edm::InputTag > ("inputTracksTag")); | ||
|
@@ -58,6 +63,10 @@ void HLTDeDxFilter::fillDescriptions(edm::ConfigurationDescriptions& description | |
desc.add<double>("minPT",0.0); | ||
desc.add<double>("minNOM",0.0); | ||
desc.add<double>("maxETA",5.5); | ||
desc.add<double>("minNumValidHits",0); | ||
desc.add<double>("maxNHitMissIn",99); | ||
desc.add<double>("maxNHitMissMid",99); | ||
desc.add<double>("maxRelTrkIsoDeltaRp3", -1); | ||
desc.add<edm::InputTag>("inputTracksTag",edm::InputTag("hltL3Mouns")); | ||
desc.add<edm::InputTag>("inputDeDxTag",edm::InputTag("HLTdedxHarm2")); | ||
descriptions.add("hltDeDxFilter",desc); | ||
|
@@ -98,6 +107,9 @@ bool | |
reco::TrackRef track = reco::TrackRef( trackCollectionHandle, i ); | ||
if(track->pt()>minPT_ && fabs(track->eta())<maxETA_ && dEdxTrack[track].numberOfMeasurements()>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(); | ||
//SAVE DEDX INFORMATION AS IF IT WAS THE MASS OF THE PARTICLE | ||
|
@@ -109,6 +121,21 @@ bool | |
cand.setTrack(track); | ||
chargedCandidates->push_back(cand); | ||
} | ||
|
||
//calculate relative trk isolation only if parameter maxRelTrkIsoDeltaRp3 is different from default value of 99 | ||
if(maxRelTrkIsoDeltaRp3_ >= 0){ | ||
double ptCone = track->pt(); | ||
for(unsigned int j=0; j<trackCollection.size(); j++){ | ||
reco::TrackRef track2 = reco::TrackRef( trackCollectionHandle, j ); | ||
if (track->eta() == track2->eta() && track->phi() == track2->phi()) continue; // do not compare track to itself | ||
double trkDeltaR = deltaR(track->eta(), track->phi(), track2->eta(), track2->phi()); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Use deltaR2() and not deltaR(). There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. tracks do not store eta phi pt (candidate do) (there is selection on i so ptcone optimization is irrelevant) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hi Vincenzo, Could you clarify for me what your concerns are about the code as it I am not very familiar with the syntax you suggested so if you could point Thanks for your help! Cheers, On Fri, Oct 3, 2014 at 2:14 PM, Vincenzo Innocente <notifications@github.com
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. On 3 Oct, 2014, at 3:39 PM, Jessica Brinson jbrins1@gmail.com wrote:
v.= |
||
if (trkDeltaR < 0.3){ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Better not have such a parameter (0.3) in the middle of the code, better name it properly. |
||
ptCone+=track2->pt(); | ||
} | ||
} | ||
double relTrkIso = (ptCone - track->pt())/(track->pt()); | ||
if (relTrkIso > maxRelTrkIsoDeltaRp3_) continue; | ||
} | ||
accept=true; | ||
} | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add here if(i==j) continue;
Then you don't need eta and phi comparisons below (except if there are special cases of two tracks same parameters)