Skip to content

Commit

Permalink
Merge pull request #22987 from Sam-Harper/GsfTrackVarProducerBugFix102X
Browse files Browse the repository at this point in the history
Fixing Default Values of EgammaHLTGsfTrackVarProducer to be only used if there is a track found : 102X
  • Loading branch information
cmsbuild committed Apr 18, 2018
2 parents e0488ed + fc9b9dc commit 2e29ae5
Showing 1 changed file with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -134,10 +134,13 @@ void EgammaHLTGsfTrackVarProducer::produce(edm::Event& iEvent, const edm::EventS
float oneOverESuperMinusOneOverPValue=999999;
float oneOverESeedMinusOneOverPValue=999999;

if(static_cast<int>(gsfTracks.size())>=upperTrackNrToRemoveCut_ ||
static_cast<int>(gsfTracks.size())<=lowerTrackNrToRemoveCut_ ||
(isBarrel && useDefaultValuesForBarrel_) ||
(!isBarrel && useDefaultValuesForEndcap_)){
const int nrTracks = gsfTracks.size();
const bool rmCutsDueToNrTracks = nrTracks <= lowerTrackNrToRemoveCut_ ||
nrTracks >= upperTrackNrToRemoveCut_;
//to use the default values, we require at least one track...
const bool useDefaultValues = isBarrel ? useDefaultValuesForBarrel_ && nrTracks>=1 : useDefaultValuesForEndcap_ && nrTracks>=1;

if(rmCutsDueToNrTracks || useDefaultValues){
dEtaInValue=0;
dEtaSeedInValue=0;
dPhiInValue=0;
Expand Down

0 comments on commit 2e29ae5

Please sign in to comment.