Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
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
Show file tree
Hide file tree
Showing 10 changed files with 214 additions and 62 deletions.
2 changes: 1 addition & 1 deletion [refs]
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
27 changes: 27 additions & 0 deletions trunk/RecoHI/HiTracking/interface/HIPixelTrackFilter.h
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
1 change: 1 addition & 0 deletions trunk/RecoHI/HiTracking/plugins/BuildFile
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>
5 changes: 5 additions & 0 deletions trunk/RecoHI/HiTracking/plugins/modules.cc
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,8 @@ DEFINE_EDM_PLUGIN(TrackingRegionProducerFactory, HITrackingRegionProducer, "HITr

#include "HITrackingRegionForPrimaryVtxProducer.h"
DEFINE_EDM_PLUGIN(TrackingRegionProducerFactory, HITrackingRegionForPrimaryVtxProducer, "HITrackingRegionForPrimaryVtxProducer");

// Pixel track filter
#include "RecoHI/HiTracking/interface/HIPixelTrackFilter.h"
#include "RecoPixelVertexing/PixelTrackFitting/interface/PixelTrackFilterFactory.h"
DEFINE_EDM_PLUGIN(PixelTrackFilterWithESFactory, HIPixelTrackFilter, "HIPixelTrackFilter");
44 changes: 16 additions & 28 deletions trunk/RecoHI/HiTracking/python/HIPixel3PrimTracks_cfi.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
import FWCore.ParameterSet.Config as cms

from RecoPixelVertexing.PixelTriplets.PixelTripletHLTGenerator_cfi import *
from RecoPixelVertexing.PixelLowPtUtilities.ClusterShapeHitFilterESProducer_cfi import *
from RecoHI.HiTracking.HIPixelTrackFilter_cfi import *
from RecoHI.HiTracking.HITrackingRegionProducer_cfi import *

hiPixel3PrimTracks = cms.EDFilter("PixelTrackProducer",

Expand All @@ -10,48 +13,33 @@
RegionFactoryPSet = cms.PSet(
ComponentName = cms.string("GlobalTrackingRegionWithVerticesProducer"),
RegionPSet = 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("hiPixelAdaptiveVertex"),
useFixedError = cms.bool(True),
fixedError = cms.double(0.2),
sigmaZVertex = cms.double(3.0),
HiTrackingRegionWithVertexBlock
)
),

# Ordered Hits
# Ordered Hits
OrderedHitsFactoryPSet = cms.PSet(
ComponentName = cms.string( "StandardHitTripletGenerator" ),
ComponentName = cms.string( "StandardHitTripletGenerator" ),
SeedingLayers = cms.string( "PixelLayerTriplets" ),
GeneratorPSet = cms.PSet(
GeneratorPSet = cms.PSet(
PixelTripletHLTGenerator
)
)
),

# Fitter
# Fitter
FitterPSet = cms.PSet(
ComponentName = cms.string('PixelFitterByHelixProjections'),
TTRHBuilder = cms.string('TTRHBuilderWithoutAngle4PixelTriplets')
),

# Filter
useFilterWithES = cms.bool( False ),
# Filter
useFilterWithES = cms.bool( True ),
FilterPSet = cms.PSet(
nSigmaTipMaxTolerance = cms.double( 0.0 ),
ComponentName = cms.string( "PixelTrackFilterByKinematics" ),
nSigmaInvPtTolerance = cms.double( 0.0 ),
ptMin = cms.double( 1.5 ),
tipMax = cms.double( 0.2 ),
chi2 = cms.double( 1000.0 )
HiFilterBlock
),

# Cleaner
# Cleaner
CleanerPSet = cms.PSet(
#ComponentName = cms.string( "PixelTrackCleanerBySharedHits" )
ComponentName = cms.string( "none" )
)
)
ComponentName = cms.string( "TrackCleaner" )
)
)
45 changes: 17 additions & 28 deletions trunk/RecoHI/HiTracking/python/HIPixel3ProtoTracks_cfi.py
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" )
)
)
27 changes: 27 additions & 0 deletions trunk/RecoHI/HiTracking/python/HIPixelTrackFilter_cfi.py
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 trunk/RecoHI/HiTracking/python/HITrackingRegionProducer_cfi.py
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 )
)
92 changes: 92 additions & 0 deletions trunk/RecoHI/HiTracking/src/HIPixelTrackFilter.cc
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;

}
7 changes: 2 additions & 5 deletions trunk/RecoHI/HiTracking/test/testTracking_cfg.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

#global tags for conditions data: https://twiki.cern.ch/twiki/bin/view/CMS/SWGuideFrontierConditions
process.load("Configuration.StandardSequences.FrontierConditions_GlobalTag_cff")
process.GlobalTag.globaltag = 'MC_31X_V8::All'
process.GlobalTag.globaltag = 'MC_31X_V9::All'

##################################################################################

Expand All @@ -20,8 +20,7 @@

# setup any defaults you want
options.output = 'test_out.root'
options.files= '/store/relval/CMSSW_3_3_0_pre3/RelValHydjetQ_MinBias_4TeV/GEN-SIM-RAW/MC_31X_V8-v1/0015/DC571B73-43A1-DE11-BD0C-000423D98804.root'
#options.files= '/store/relval/CMSSW_3_3_0_pre3/RelValHydjetQ_B0_4TeV/GEN-SIM-RAW/MC_31X_V8-v1/0015/FE2B9E7D-4CA1-DE11-9FA1-000423D6CA02.root'
options.files= '/store/relval/CMSSW_3_4_0_pre1/RelValHydjetQ_MinBias_4TeV/GEN-SIM-RAW/MC_31X_V9-v1/0008/2EA3EA28-B7B5-DE11-9B7A-001D09F2B2CF.root'
options.maxEvents = 1

# get and parse the command line arguments
Expand Down Expand Up @@ -72,8 +71,6 @@
process.load("Configuration.StandardSequences.RawToDigi_cff") # RawToDigi
process.load("Configuration.StandardSequences.ReconstructionHeavyIons_cff") # full heavy ion reconstruction

#process.hiSelectedTracks.minZCut = 0.005

##############################################################################
# Output EDM File
process.load("Configuration.EventContent.EventContentHeavyIons_cff") #load keep/drop output commands
Expand Down

0 comments on commit 528e057

Please sign in to comment.