-
Notifications
You must be signed in to change notification settings - Fork 4.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
yaml --- r: 75613 b: "refs/heads/CMSSW_7_1_X" c: 2b11b20 h: "refs/heads/CMSSW_7_1_X" i: 75611: 1dc7ae7 v: v3
- Loading branch information
edwenger
committed
Oct 16, 2009
1 parent
2f0062f
commit 528e057
Showing
10 changed files
with
214 additions
and
62 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
--- | ||
refs/heads/gh-pages: 09c786f70121f131b3715aaf3464996502bbeb7e | ||
"refs/heads/CMSSW_7_1_X": ab81b3ed325a191a6ca2d0ff6e5a32b6e1bec3e4 | ||
"refs/heads/CMSSW_7_1_X": 2b11b20b1f2b797f1f30c01e4e1a10565d1af18d |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
#ifndef _HIPixelTrackFilter_h_ | ||
#define _HIPixelTrackFilter_h_ | ||
|
||
#include "RecoPixelVertexing/PixelLowPtUtilities/interface/ClusterShapeTrackFilter.h" | ||
#include "DataFormats/VertexReco/interface/Vertex.h" | ||
#include "DataFormats/VertexReco/interface/VertexFwd.h" | ||
#include "FWCore/ParameterSet/interface/InputTag.h" | ||
|
||
namespace edm { class ParameterSet; class EventSetup; class Event;} | ||
|
||
class HIPixelTrackFilter : public ClusterShapeTrackFilter { | ||
public: | ||
HIPixelTrackFilter(const edm::ParameterSet& ps, const edm::EventSetup& es); | ||
virtual ~HIPixelTrackFilter(); | ||
virtual bool operator() (const reco::Track*, const PixelTrackFilter::Hits & hits) const; | ||
virtual void update(edm::Event& ev); | ||
private: | ||
double theTIPMax, theNSigmaTipMaxTolerance; | ||
double theLIPMax, theNSigmaLipMaxTolerance; | ||
double theChi2Max, thePtMin; | ||
bool useClusterShape; | ||
edm::InputTag theVertexCollection; | ||
const reco::VertexCollection *theVertices; | ||
|
||
}; | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
<use name=RecoHI/HiTracking> | ||
<use name=RecoPixelVertexing/PixelLowPtUtilities> | ||
<library file="*.cc" name=RecoHIHiTrackingPlugins> | ||
<flags EDM_PLUGIN=1> | ||
</library> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
45 changes: 17 additions & 28 deletions
45
trunk/RecoHI/HiTracking/python/HIPixel3ProtoTracks_cfi.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,55 +1,44 @@ | ||
import FWCore.ParameterSet.Config as cms | ||
|
||
from RecoPixelVertexing.PixelTriplets.PixelTripletHLTGenerator_cfi import * | ||
from RecoHI.HiTracking.HIPixelTrackFilter_cfi import * | ||
from RecoHI.HiTracking.HITrackingRegionProducer_cfi import * | ||
|
||
hiPixel3ProtoTracks = cms.EDProducer( "PixelTrackProducer", | ||
|
||
passLabel = cms.string('Pixel triplet tracks for vertexing'), | ||
|
||
# Region | ||
# Region | ||
RegionFactoryPSet = cms.PSet( | ||
ComponentName = cms.string( "HITrackingRegionForPrimaryVtxProducer" ), | ||
RegionPSet = cms.PSet( | ||
ptMin = cms.double( 0.7 ), | ||
originRadius = cms.double( 0.1 ), | ||
nSigmaZ = cms.double(3.0), | ||
beamSpot = cms.InputTag("offlineBeamSpot"), | ||
precise = cms.bool( True ), | ||
siPixelRecHits = cms.string( "siPixelRecHits" ), | ||
directionXCoord = cms.double( 1.0 ), | ||
directionYCoord = cms.double( 1.0 ), | ||
directionZCoord = cms.double( 0.0 ) | ||
HiTrackingRegionForPrimaryVertexBlock | ||
) | ||
), | ||
|
||
# Ordered Hits | ||
# Ordered Hits | ||
OrderedHitsFactoryPSet = cms.PSet( | ||
ComponentName = cms.string( "StandardHitTripletGenerator" ), | ||
SeedingLayers = cms.string( "PixelLayerTriplets" ), | ||
SeedingLayers = cms.string( "PixelLayerTriplets" ), | ||
GeneratorPSet = cms.PSet( | ||
PixelTripletHLTGenerator | ||
PixelTripletHLTGenerator | ||
) | ||
), | ||
|
||
# Fitter | ||
# Fitter | ||
FitterPSet = cms.PSet( | ||
ComponentName = cms.string('PixelFitterByHelixProjections'), | ||
TTRHBuilder = cms.string('TTRHBuilderWithoutAngle4PixelTriplets') | ||
ComponentName = cms.string('PixelFitterByHelixProjections'), | ||
TTRHBuilder = cms.string('TTRHBuilderWithoutAngle4PixelTriplets') | ||
), | ||
|
||
# Filter | ||
useFilterWithES = cms.bool( False ), | ||
# Filter | ||
useFilterWithES = cms.bool( False ), | ||
FilterPSet = cms.PSet( | ||
nSigmaTipMaxTolerance = cms.double( 0.0 ), | ||
ComponentName = cms.string( "PixelTrackFilterByKinematics" ), | ||
nSigmaInvPtTolerance = cms.double( 0.0 ), | ||
ptMin = cms.double( 0.7 ), | ||
tipMax = cms.double( 1.0 ), | ||
chi2 = cms.double( 1000.0 ) | ||
KinematicFilterBlock | ||
), | ||
|
||
# Cleaner | ||
# Cleaner | ||
CleanerPSet = cms.PSet( | ||
ComponentName = cms.string( "PixelTrackCleanerBySharedHits" ) | ||
) | ||
) | ||
ComponentName = cms.string( "PixelTrackCleanerBySharedHits" ) | ||
) | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import FWCore.ParameterSet.Config as cms | ||
|
||
ClusterFilterBlock = cms.PSet( | ||
ComponentName = cms.string( "ClusterShapeTrackFilter" ), | ||
ptMin = cms.double( 1.5 ) | ||
) | ||
|
||
HiFilterBlock = cms.PSet( | ||
ComponentName = cms.string( "HIPixelTrackFilter" ), | ||
ptMin = cms.double( 1.5 ), | ||
chi2 = cms.double( 1000.0 ), | ||
useClusterShape = cms.bool( False ), | ||
VertexCollection = cms.InputTag("hiSelectedVertex"), | ||
nSigmaTipMaxTolerance = cms.double( 6.0 ), | ||
tipMax = cms.double( 0 ), | ||
nSigmaLipMaxTolerance = cms.double( 0 ), | ||
lipMax = cms.double( 0.3 ) | ||
) | ||
|
||
KinematicFilterBlock = cms.PSet( | ||
nSigmaTipMaxTolerance = cms.double( 0.0 ), | ||
ComponentName = cms.string( "PixelTrackFilterByKinematics" ), | ||
nSigmaInvPtTolerance = cms.double( 0.0 ), | ||
ptMin = cms.double( 0.7 ), | ||
tipMax = cms.double( 1.0 ), | ||
chi2 = cms.double( 1000.0 ) | ||
) |
26 changes: 26 additions & 0 deletions
26
trunk/RecoHI/HiTracking/python/HITrackingRegionProducer_cfi.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import FWCore.ParameterSet.Config as cms | ||
|
||
HiTrackingRegionWithVertexBlock = cms.PSet( | ||
ptMin = cms.double(1.5), | ||
originRadius = cms.double(0.2), | ||
nSigmaZ = cms.double(3.0), | ||
beamSpot = cms.InputTag("offlineBeamSpot"), | ||
precise = cms.bool(True), | ||
useFoundVertices = cms.bool(True), | ||
VertexCollection = cms.InputTag("hiSelectedVertex"), | ||
useFixedError = cms.bool(True), | ||
fixedError = cms.double(0.2), | ||
sigmaZVertex = cms.double(3.0) | ||
) | ||
|
||
HiTrackingRegionForPrimaryVertexBlock = cms.PSet( | ||
ptMin = cms.double( 0.7 ), | ||
originRadius = cms.double( 0.1 ), | ||
nSigmaZ = cms.double(3.0), | ||
beamSpot = cms.InputTag("offlineBeamSpot"), | ||
precise = cms.bool( True ), | ||
siPixelRecHits = cms.string( "siPixelRecHits" ), | ||
directionXCoord = cms.double( 1.0 ), | ||
directionYCoord = cms.double( 1.0 ), | ||
directionZCoord = cms.double( 0.0 ) | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
#include "RecoHI/HiTracking/interface/HIPixelTrackFilter.h" | ||
|
||
#include "FWCore/Framework/interface/Event.h" | ||
#include "FWCore/Framework/interface/EventSetup.h" | ||
#include "FWCore/Framework/interface/ESHandle.h" | ||
#include "FWCore/ParameterSet/interface/ParameterSet.h" | ||
#include "FWCore/MessageLogger/interface/MessageLogger.h" | ||
|
||
#include "DataFormats/TrackReco/interface/Track.h" | ||
#include "DataFormats/TrackReco/interface/TrackBase.h" | ||
|
||
using namespace std; | ||
using namespace edm; | ||
|
||
/*****************************************************************************/ | ||
HIPixelTrackFilter::HIPixelTrackFilter (const edm::ParameterSet& ps, const edm::EventSetup& es) : | ||
ClusterShapeTrackFilter(ps,es), | ||
theTIPMax( ps.getParameter<double>("tipMax") ), | ||
theNSigmaTipMaxTolerance( ps.getParameter<double>("nSigmaTipMaxTolerance")), | ||
theLIPMax( ps.getParameter<double>("lipMax") ), | ||
theNSigmaLipMaxTolerance( ps.getParameter<double>("nSigmaLipMaxTolerance")), | ||
theChi2Max( ps.getParameter<double>("chi2") ), | ||
thePtMin( ps.getParameter<double>("ptMin") ), | ||
useClusterShape( ps.getParameter<bool>("useClusterShape") ), | ||
theVertexCollection( ps.getParameter<edm::InputTag>("VertexCollection")), | ||
theVertices(0) | ||
{ | ||
} | ||
|
||
/*****************************************************************************/ | ||
HIPixelTrackFilter::~HIPixelTrackFilter() | ||
{ } | ||
|
||
/*****************************************************************************/ | ||
bool HIPixelTrackFilter::operator() (const reco::Track* track,const PixelTrackFilter::Hits & recHits) const | ||
{ | ||
|
||
if (!track) return false; | ||
if (track->chi2() > theChi2Max || track->pt() < thePtMin) return false; | ||
|
||
|
||
math::XYZPoint vtxPoint(0.0,0.0,0.0); | ||
double vzErr =0.0, vxErr=0.0, vyErr=0.0; | ||
|
||
if(theVertices->size()>0) { | ||
vtxPoint=theVertices->begin()->position(); | ||
vzErr=theVertices->begin()->zError(); | ||
vxErr=theVertices->begin()->xError(); | ||
vyErr=theVertices->begin()->yError(); | ||
} else { | ||
// THINK OF SOMETHING TO DO IF THERE IS NO VERTEX | ||
} | ||
|
||
double d0=0.0, dz=0.0, d0sigma=0.0, dzsigma=0.0; | ||
d0 = -1.*track->dxy(vtxPoint); | ||
dz = track->dz(vtxPoint); | ||
d0sigma = sqrt(track->d0Error()*track->d0Error()+vxErr*vyErr); | ||
dzsigma = sqrt(track->dzError()*track->dzError()+vzErr*vzErr); | ||
|
||
if (theTIPMax>0 && fabs(d0)>theTIPMax) return false; | ||
if (theNSigmaTipMaxTolerance>0 && (fabs(d0)/d0sigma)>theNSigmaTipMaxTolerance) return false; | ||
if (theLIPMax>0 && fabs(dz)>theLIPMax) return false; | ||
if (theNSigmaLipMaxTolerance>0 && (fabs(dz)/dzsigma)>theNSigmaLipMaxTolerance) return false; | ||
|
||
bool ok = true; | ||
if(useClusterShape) ok = ClusterShapeTrackFilter::operator() (track,recHits); | ||
|
||
return ok; | ||
} | ||
|
||
/*****************************************************************************/ | ||
void HIPixelTrackFilter::update(edm::Event& ev) | ||
{ | ||
|
||
// Get reco vertices | ||
edm::Handle<reco::VertexCollection> vc; | ||
ev.getByLabel(theVertexCollection, vc); | ||
theVertices = vc.product(); | ||
|
||
if(theVertices->size()>0) { | ||
LogInfo("HeavyIonVertexing") | ||
<< "[HIPixelTrackFilter] Pixel track selection based on best vertex" | ||
<< "\n vz = " << theVertices->begin()->z() | ||
<< "\n vz sigma = " << theVertices->begin()->zError(); | ||
} else { | ||
LogError("HeavyIonVertexing") // this can be made a warning when operator() is fixed | ||
<< "No vertex found in collection '" << theVertexCollection << "'"; | ||
} | ||
|
||
return; | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters