Skip to content

Commit

Permalink
Merge pull request cms-sw#4162 from cerati/JetCoreStepFrom710pre8_fixed
Browse files Browse the repository at this point in the history
Jet core step from710pre8 fixed
  • Loading branch information
ktf committed Jun 13, 2014
2 parents 08bc0b1 + f7e6c67 commit c3b2c12
Show file tree
Hide file tree
Showing 13 changed files with 252 additions and 35 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@
)
#RECO content
RecoLocalCaloRECO = cms.PSet(
outputCommands = cms.untracked.vstring('keep *_hbhereco_*_*',
outputCommands = cms.untracked.vstring('keep *_hbhereco_*_*',
'keep *_hbheprereco_*_*',
'keep *_hfreco_*_*',
'keep *_horeco_*_*',
'keep HBHERecHitsSorted_hbherecoMB_*_*',
Expand Down
2 changes: 2 additions & 0 deletions RecoParticleFlow/PFProducer/src/PFAlgo.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1939,6 +1939,7 @@ void PFAlgo::processBlock( const reco::PFBlockRef& blockref,
case TrackBase::iter2:
case TrackBase::iter3:
case TrackBase::iter4:
case TrackBase::iter7:
blowError = 1.;
break;
case TrackBase::iter5:
Expand Down Expand Up @@ -2396,6 +2397,7 @@ void PFAlgo::processBlock( const reco::PFBlockRef& blockref,
case TrackBase::iter2:
case TrackBase::iter3:
case TrackBase::iter4:
case TrackBase::iter7:
break;
case TrackBase::iter5:
case TrackBase::iter6:
Expand Down
1 change: 1 addition & 0 deletions RecoParticleFlow/PFProducer/src/PFEGammaAlgo.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2519,6 +2519,7 @@ unsigned int PFEGammaAlgo::whichTrackAlgo(const reco::TrackRef& trackRef) {
case TrackBase::iter0:
case TrackBase::iter1:
case TrackBase::iter2:
case TrackBase::iter7:
Algo = 0;
break;
case TrackBase::iter3:
Expand Down
1 change: 1 addition & 0 deletions RecoParticleFlow/PFProducer/src/PFEGammaFilters.cc
Original file line number Diff line number Diff line change
Expand Up @@ -371,6 +371,7 @@ unsigned int PFEGammaFilters::whichTrackAlgo(const reco::TrackRef& trackRef) {
case TrackBase::iter0:
case TrackBase::iter1:
case TrackBase::iter2:
case TrackBase::iter7:
Algo = 0;
break;
case TrackBase::iter3:
Expand Down
1 change: 1 addition & 0 deletions RecoParticleFlow/PFTracking/plugins/PFElecTkProducer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -500,6 +500,7 @@ bool PFElecTkProducer::isFifthStep(reco::PFRecTrackRef pfKfTrack) {
case TrackBase::iter0:
case TrackBase::iter1:
case TrackBase::iter2:
case TrackBase::iter7:
Algo = 0;
break;
case TrackBase::iter3:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import FWCore.ParameterSet.Config as cms


import RecoTracker.FinalTrackSelectors.DuplicateTrackMerger_cfi

duplicateTrackCandidates = RecoTracker.FinalTrackSelectors.DuplicateTrackMerger_cfi.duplicateTrackMerger.clone(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,25 @@
import RecoTracker.FinalTrackSelectors.trackListMerger_cfi
earlyGeneralTracks = RecoTracker.FinalTrackSelectors.trackListMerger_cfi.trackListMerger.clone(
TrackProducers = (cms.InputTag('initialStepTracks'),
cms.InputTag('jetCoreRegionalStepTracks'),
cms.InputTag('lowPtTripletStepTracks'),
cms.InputTag('pixelPairStepTracks'),
cms.InputTag('detachedTripletStepTracks'),
cms.InputTag('mixedTripletStepTracks'),
cms.InputTag('pixelLessStepTracks'),
cms.InputTag('tobTecStepTracks')),
hasSelector=cms.vint32(1,1,1,1,1,1,1),
indivShareFrac=cms.vdouble(1.0,0.16,0.19,0.13,0.11,0.11,0.09),
hasSelector=cms.vint32(1,1,1,1,1,1,1,1),
indivShareFrac=cms.vdouble(1.0,0.19,0.16,0.19,0.13,0.11,0.11,0.09),#using 0.19 for jetCoreRegionalStep?
selectedTrackQuals = cms.VInputTag(cms.InputTag("initialStep"),
cms.InputTag("jetCoreRegionalStepSelector","jetCoreRegionalStep"),
cms.InputTag("lowPtTripletStepSelector","lowPtTripletStep"),
cms.InputTag("pixelPairStepSelector","pixelPairStep"),
cms.InputTag("detachedTripletStep"),
cms.InputTag("mixedTripletStep"),
cms.InputTag("pixelLessStep"),
cms.InputTag("tobTecStepSelector","tobTecStep")
),
setsToMerge = cms.VPSet( cms.PSet( tLists=cms.vint32(0,1,2,3,4,5,6), pQual=cms.bool(True) )
setsToMerge = cms.VPSet( cms.PSet( tLists=cms.vint32(0,1,2,3,4,5,6,7), pQual=cms.bool(True) )
),
copyExtras = True,
makeReKeyedSeeds = cms.untracked.bool(False)
Expand Down
3 changes: 2 additions & 1 deletion RecoTracker/FinalTrackSelectors/src/TrackListMerger.cc
Original file line number Diff line number Diff line change
Expand Up @@ -336,8 +336,9 @@ namespace cms

algo[i]=track->algo();
int validHits=track->numberOfValidHits();
int validPixelHits=track->hitPattern().numberOfValidPixelHits();
int lostHits=track->numberOfLostHits();
score[i] = foundHitBonus_*validHits - lostHitPenalty_*lostHits - track->chi2();
score[i] = foundHitBonus_*validPixelHits+foundHitBonus_*validHits - lostHitPenalty_*lostHits - track->chi2();


rh1[i].reserve(validHits) ;
Expand Down
163 changes: 163 additions & 0 deletions RecoTracker/IterativeTracking/python/JetCoreRegionalStep_cff.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,163 @@
import FWCore.ParameterSet.Config as cms

# This step runs over all clusters

# run only if there are high pT jets
from RecoJets.JetProducers.TracksForJets_cff import trackRefsForJets
iter0TrackRefsForJets = trackRefsForJets.clone(src = cms.InputTag('initialStepTracks'))
from RecoJets.JetProducers.ak4CaloJets_cfi import ak4CaloJets
from RecoLocalCalo.CaloTowersCreator.calotowermaker_cfi import calotowermaker
caloTowerForTrk = calotowermaker.clone(hbheInput=cms.InputTag('hbheprereco'))
ak4CaloJetsForTrk = ak4CaloJets.clone(srcPVs = cms.InputTag('pixelVertices'), src= cms.InputTag('caloTowerForTrk'))
jetsForCoreTracking = cms.EDFilter("CandPtrSelector", src = cms.InputTag("ak4CaloJetsForTrk"), cut = cms.string("pt > 100 && abs(eta) < 2.5"))

# care only at tracks from main PV
import RecoVertex.PrimaryVertexProducer.OfflinePrimaryVertices_cfi
firstStepPrimaryVertices=RecoVertex.PrimaryVertexProducer.OfflinePrimaryVertices_cfi.offlinePrimaryVertices.clone()
firstStepPrimaryVertices.TrackLabel = cms.InputTag("initialStepTracks")
firstStepGoodPrimaryVertices = cms.EDFilter("PrimaryVertexObjectFilter",
filterParams = cms.PSet(
minNdof = cms.double(25.0),
maxZ = cms.double(15.0),
maxRho = cms.double(2.0)
),
src=cms.InputTag('firstStepPrimaryVertices')
)

# SEEDING LAYERS
jetCoreRegionalStepSeedLayers = cms.EDProducer("SeedingLayersEDProducer",
layerList = cms.vstring('BPix1+BPix2', 'BPix1+BPix3', 'BPix2+BPix3',
'BPix1+FPix1_pos', 'BPix1+FPix1_neg',
'BPix2+FPix1_pos', 'BPix2+FPix1_neg',
'FPix1_pos+FPix2_pos', 'FPix1_neg+FPix2_neg',
#'BPix2+TIB1','BPix2+TIB2',
'BPix3+TIB1','BPix3+TIB2'),
TIB = cms.PSet(
matchedRecHits = cms.InputTag("siStripMatchedRecHits","matchedRecHit"),
TTRHBuilder = cms.string('WithTrackAngle')
),
BPix = cms.PSet(
useErrorsFromParam = cms.bool(True),
hitErrorRPhi = cms.double(0.0027),
hitErrorRZ = cms.double(0.006),
TTRHBuilder = cms.string('TTRHBuilderWithoutAngle4MixedPairs'),
HitProducer = cms.string('siPixelRecHits'),
#skipClusters = cms.InputTag('jetCoreRegionalStepClusters')
),
FPix = cms.PSet(
useErrorsFromParam = cms.bool(True),
hitErrorRPhi = cms.double(0.0051),
hitErrorRZ = cms.double(0.0036),
TTRHBuilder = cms.string('TTRHBuilderWithoutAngle4MixedPairs'),
HitProducer = cms.string('siPixelRecHits'),
#skipClusters = cms.InputTag('jetCoreRegionalStepClusters')
)
)

# SEEDS
import RecoTracker.TkSeedGenerator.GlobalSeedsFromPairsWithVertices_cff
jetCoreRegionalStepSeeds = RecoTracker.TkSeedGenerator.GlobalSeedsFromPairsWithVertices_cff.globalSeedsFromPairsWithVertices.clone()
jetCoreRegionalStepSeeds.RegionFactoryPSet = cms.PSet(
ComponentName = cms.string( "TauRegionalPixelSeedGenerator" ),#not so nice to depend on RecoTau...
RegionPSet = cms.PSet(
precise = cms.bool( True ),
originRadius = cms.double( 0.2 ),
ptMin = cms.double( 10. ),
originHalfLength = cms.double( 0.2 ),
deltaPhiRegion = cms.double( 0.20 ),
deltaEtaRegion = cms.double( 0.20 ),
JetSrc = cms.InputTag( "jetsForCoreTracking" ),
# JetSrc = cms.InputTag( "ak5CaloJets" ),
vertexSrc = cms.InputTag( "firstStepGoodPrimaryVertices" ),
measurementTrackerName = cms.string( "MeasurementTrackerEvent" ),
howToUseMeasurementTracker = cms.double( -1.0 )
)
)
jetCoreRegionalStepSeeds.OrderedHitsFactoryPSet.SeedingLayers = 'jetCoreRegionalStepSeedLayers'
jetCoreRegionalStepSeeds.SeedComparitorPSet = cms.PSet(
ComponentName = cms.string('none'),
#PixelClusterShapeSeedComparitor'),
# FilterAtHelixStage = cms.bool(True),
# FilterPixelHits = cms.bool(True),
# FilterStripHits = cms.bool(False),
# ClusterShapeHitFilterName = cms.string('ClusterShapeHitFilter')
)
jetCoreRegionalStepSeeds.SeedCreatorPSet.forceKinematicWithRegionDirection = cms.bool( True )

# QUALITY CUTS DURING TRACK BUILDING
import TrackingTools.TrajectoryFiltering.TrajectoryFilter_cff
jetCoreRegionalStepTrajectoryFilter = TrackingTools.TrajectoryFiltering.TrajectoryFilter_cff.CkfBaseTrajectoryFilter_block.clone(
minimumNumberOfHits = 3,
minPt = 0.1
)

import TrackingTools.KalmanUpdators.Chi2MeasurementEstimatorESProducer_cfi
jetCoreRegionalStepChi2Est = TrackingTools.KalmanUpdators.Chi2MeasurementEstimatorESProducer_cfi.Chi2MeasurementEstimator.clone(
ComponentName = cms.string('jetCoreRegionalStepChi2Est'),
nSigma = cms.double(3.0),
MaxChi2 = cms.double(30.0)
)

# TRACK BUILDING
import RecoTracker.CkfPattern.GroupedCkfTrajectoryBuilder_cfi
jetCoreRegionalStepTrajectoryBuilder = RecoTracker.CkfPattern.GroupedCkfTrajectoryBuilder_cfi.GroupedCkfTrajectoryBuilder.clone(
MeasurementTrackerName = '',
trajectoryFilter = cms.PSet(refToPSet_ = cms.string('jetCoreRegionalStepTrajectoryFilter')),
#clustersToSkip = cms.InputTag('jetCoreRegionalStepClusters'),
maxCand = 50,
estimator = cms.string('jetCoreRegionalStepChi2Est'),
maxDPhiForLooperReconstruction = cms.double(2.0),
maxPtForLooperReconstruction = cms.double(0.7)
)

# MAKING OF TRACK CANDIDATES
import RecoTracker.CkfPattern.CkfTrackCandidates_cfi
jetCoreRegionalStepTrackCandidates = RecoTracker.CkfPattern.CkfTrackCandidates_cfi.ckfTrackCandidates.clone(
src = cms.InputTag('jetCoreRegionalStepSeeds'),
maxSeedsBeforeCleaning = cms.uint32(10000),
TrajectoryBuilderPSet = cms.PSet( refToPSet_ = cms.string('jetCoreRegionalStepTrajectoryBuilder')),
NavigationSchool = cms.string('SimpleNavigationSchool'),
### these two parameters are relevant only for the CachingSeedCleanerBySharedInput
#numHitsForSeedCleaner = cms.int32(50),
#onlyPixelHitsForSeedCleaner = cms.bool(True),
)


# TRACK FITTING
import RecoTracker.TrackProducer.TrackProducer_cfi
jetCoreRegionalStepTracks = RecoTracker.TrackProducer.TrackProducer_cfi.TrackProducer.clone(
AlgorithmName = cms.string('iter7'),
src = 'jetCoreRegionalStepTrackCandidates',
Fitter = cms.string('FlexibleKFFittingSmoother')
)

# Final selection
import RecoTracker.IterativeTracking.LowPtTripletStep_cff
import RecoTracker.FinalTrackSelectors.multiTrackSelector_cfi
jetCoreRegionalStepSelector = RecoTracker.FinalTrackSelectors.multiTrackSelector_cfi.multiTrackSelector.clone(
src='jetCoreRegionalStepTracks',
trackSelectors= cms.VPSet(
RecoTracker.FinalTrackSelectors.multiTrackSelector_cfi.looseMTS.clone(
name = 'jetCoreRegionalStepLoose',
), #end of pset
RecoTracker.FinalTrackSelectors.multiTrackSelector_cfi.tightMTS.clone(
name = 'jetCoreRegionalStepTight',
preFilterName = 'jetCoreRegionalStepLoose',
),
RecoTracker.FinalTrackSelectors.multiTrackSelector_cfi.highpurityMTS.clone(
name = 'jetCoreRegionalStep',
preFilterName = 'jetCoreRegionalStepTight',
),
) #end of vpset
) #end of clone

# Final sequence
JetCoreRegionalStep = cms.Sequence(iter0TrackRefsForJets*caloTowerForTrk*ak4CaloJetsForTrk*jetsForCoreTracking*
firstStepPrimaryVertices*
firstStepGoodPrimaryVertices*
#jetCoreRegionalStepClusters*
jetCoreRegionalStepSeedLayers*
jetCoreRegionalStepSeeds*
jetCoreRegionalStepTrackCandidates*
jetCoreRegionalStepTracks*
jetCoreRegionalStepSelector)
6 changes: 2 additions & 4 deletions RecoTracker/IterativeTracking/python/iterativeTk_cff.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,9 @@
from RecoTracker.IterativeTracking.LowPtTripletStep_cff import *
from RecoTracker.IterativeTracking.PixelPairStep_cff import *
from RecoTracker.IterativeTracking.MixedTripletStep_cff import *

from RecoTracker.IterativeTracking.PixelLessStep_cff import *
#from RecoTracker.IterativeTracking.PixelLessTripletStep_cff import *

from RecoTracker.IterativeTracking.TobTecStep_cff import *
#from RecoTracker.IterativeTracking.TobTecHybridStep_cff import *
from RecoTracker.IterativeTracking.JetCoreRegionalStep_cff import *

from RecoTracker.FinalTrackSelectors.earlyGeneralTracks_cfi import *
from RecoTracker.IterativeTracking.MuonSeededStep_cff import *
Expand All @@ -25,6 +22,7 @@
MixedTripletStep*
PixelLessStep*
TobTecStep*
JetCoreRegionalStep *
earlyGeneralTracks*
muonSeededStep*
preDuplicateMergingGeneralTracks*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
#include "TrackingTools/TrajectoryState/interface/TrajectoryStateTransform.h"
#include "TrackingTools/TrajectoryState/interface/TrajectoryStateOnSurface.h"
#include "RecoTracker/TkSeedingLayers/interface/SeedComparitor.h"
#include "RecoTracker/TkTrackingRegions/interface/RectangularEtaPhiTrackingRegion.h"

namespace {

Expand Down Expand Up @@ -63,6 +64,38 @@ void SeedFromConsecutiveHitsCreator::makeSeed(TrajectorySeedCollection & seedCol

CurvilinearTrajectoryError error = initialError(sin2Theta);
FreeTrajectoryState fts(kine, error);
if(region->direction().x()!=0 && forceKinematicWithRegionDirection_) // a direction was given, check if it is an etaPhi region
{
const RectangularEtaPhiTrackingRegion * etaPhiRegion = dynamic_cast<const RectangularEtaPhiTrackingRegion *>(region);
if(etaPhiRegion) {

//the following completely reset the kinematics, perhaps it makes no sense and newKine=kine would do better
GlobalVector direction=region->direction()/region->direction().mag();
GlobalVector momentum=direction*fts.momentum().mag();
GlobalPoint position=region->origin()+5*direction;
GlobalTrajectoryParameters newKine(position,momentum,fts.charge(),&fts.parameters().magneticField());

GlobalError vertexErr( sqr(region->originRBound()), 0, sqr(region->originRBound()),
0, 0, sqr(region->originZBound()));

float ptMin = region->ptMin();
AlgebraicSymMatrix55 C = ROOT::Math::SMatrixIdentity();

float minC00 = 0.4;
C[0][0] = std::max(sin2Theta/sqr(ptMin), minC00);
float zErr = vertexErr.czz();
float transverseErr = vertexErr.cxx(); // assume equal cxx cyy
float deltaEta = (etaPhiRegion->etaRange().first-etaPhiRegion->etaRange().second)/2.;
float deltaPhi = (etaPhiRegion->phiMargin().right()+etaPhiRegion->phiMargin().left())/2.;
C[1][1] = deltaEta*deltaEta*4; //2 sigma of what given in input
C[2][2] = deltaPhi*deltaPhi*4;
C[3][3] = transverseErr;
C[4][4] = zErr*sin2Theta + transverseErr*(1-sin2Theta);
CurvilinearTrajectoryError newError(C);
fts = FreeTrajectoryState(newKine,newError);
}
}


buildSeed(seedCollection,hits,fts);
}
Expand Down
Loading

0 comments on commit c3b2c12

Please sign in to comment.