CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
PFDisplacedVertexProducer Class Reference

Producer for DisplacedVertices. More...

Inheritance diagram for PFDisplacedVertexProducer:
edm::stream::EDProducer<>

Public Member Functions

 PFDisplacedVertexProducer (const edm::ParameterSet &)
 
void produce (edm::Event &, const edm::EventSetup &) override
 
 ~PFDisplacedVertexProducer () override
 
- Public Member Functions inherited from edm::stream::EDProducer<>
 EDProducer ()=default
 
 EDProducer (const EDProducer &)=delete
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginProcessBlocks () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndProcessBlocks () const final
 
bool hasAbilityToProduceInEndRuns () const final
 
const EDProduceroperator= (const EDProducer &)=delete
 

Private Attributes

const edm::ESGetToken< GlobalTrackingGeometry, GlobalTrackingGeometryRecordglobTkGeomToken_
 
const edm::EDGetTokenT< reco::BeamSpotinputTagBeamSpot_
 
const edm::EDGetTokenT< reco::VertexCollectioninputTagMainVertex_
 Input tag for main vertex to cut of dxy of secondary tracks. More...
 
const edm::EDGetTokenT< reco::PFDisplacedVertexCandidateCollectioninputTagVertexCandidates_
 
const edm::ESGetToken< MagneticField, IdealMagneticFieldRecordmagFieldToken_
 
PFDisplacedVertexFinder pfDisplacedVertexFinder_
 Displaced Vertices finder. More...
 
const edm::ESGetToken< TrackerGeometry, TrackerDigiGeometryRecordtkerGeomToken_
 
const edm::ESGetToken< TrackerTopology, TrackerTopologyRcdtkerTopoToken_
 
bool verbose_
 verbose ? More...
 

Additional Inherited Members

- Public Types inherited from edm::stream::EDProducer<>
using CacheTypes = CacheContexts< T... >
 
using GlobalCache = typename CacheTypes::GlobalCache
 
using HasAbility = AbilityChecker< T... >
 
using InputProcessBlockCache = typename CacheTypes::InputProcessBlockCache
 
using LuminosityBlockCache = typename CacheTypes::LuminosityBlockCache
 
using LuminosityBlockContext = LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCache >
 
using LuminosityBlockSummaryCache = typename CacheTypes::LuminosityBlockSummaryCache
 
using RunCache = typename CacheTypes::RunCache
 
using RunContext = RunContextT< RunCache, GlobalCache >
 
using RunSummaryCache = typename CacheTypes::RunSummaryCache
 

Detailed Description

Producer for DisplacedVertices.

This producer makes use of DisplacedVertexFinder. This Finder fit vertex candidates out of the DisplacedVertexCandidates which contain all tracks linked together by the criterion which is by default the minimal approach distance.

Author
Maxime Gouzevitch
Date
November 2009

Definition at line 28 of file PFDisplacedVertexProducer.cc.

Constructor & Destructor Documentation

◆ PFDisplacedVertexProducer()

PFDisplacedVertexProducer::PFDisplacedVertexProducer ( const edm::ParameterSet iConfig)
explicit

Definition at line 64 of file PFDisplacedVertexProducer.cc.

References debug, edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), particleFlowDisplacedVertex_cfi::longSize, particleFlowDisplacedVertex_cfi::minAdaptWeight, pfDisplacedVertexFinder_, particleFlowDisplacedVertex_cfi::primaryVertexCut, PFDisplacedVertexFinder::setAVFParameters(), PFDisplacedVertexFinder::setDebug(), PFDisplacedVertexFinder::setParameters(), PFDisplacedVertexFinder::setTracksSelector(), PFDisplacedVertexFinder::setVertexIdentifier(), particleFlowDisplacedVertex_cfi::switchOff2TrackVertex, particleFlowDisplacedVertex_cfi::tecCut, particleFlowDisplacedVertex_cfi::tobCut, particleFlowDisplacedVertex_cfi::transvSize, and verbose_.

65  : inputTagVertexCandidates_(consumes<reco::PFDisplacedVertexCandidateCollection>(
66  iConfig.getParameter<InputTag>("vertexCandidatesLabel"))),
67  inputTagMainVertex_(consumes<reco::VertexCollection>(iConfig.getParameter<InputTag>("mainVertexLabel"))),
68  inputTagBeamSpot_(consumes<reco::BeamSpot>(iConfig.getParameter<InputTag>("offlineBeamSpotLabel"))),
73  // --- Setup input collection names --- //
74 
75  verbose_ = iConfig.getUntrackedParameter<bool>("verbose");
76 
77  bool debug = iConfig.getUntrackedParameter<bool>("debug");
78 
79  // ------ Algo Parameters ------ //
80 
81  // Maximal transverse distance between two minimal
82  // approach points to be used together
83  double transvSize = iConfig.getParameter<double>("transvSize");
84 
85  // Maximal longitudinal distance between two minimal
86  // approach points to be used together
87  double longSize = iConfig.getParameter<double>("longSize");
88 
89  // Minimal radius below which we do not reconstruct interactions
90  // Typically the position of the first Pixel layer
91  double primaryVertexCut = iConfig.getParameter<double>("primaryVertexCut");
92 
93  // Radius at which no secondary tracks are availables
94  // in the barrel.For the moment we exclude the TOB barrel
95  // since 5-th track step starts the latest at first TOB
96  // layer.
97  double tobCut = iConfig.getParameter<double>("tobCut");
98 
99  // Radius at which no secondary tracks are availables
100  // in the endcaps.For the moment we exclude the TEC wheel.
101  double tecCut = iConfig.getParameter<double>("tecCut");
102 
103  // The minimal accepted weight for the tracks calculated in the
104  // adaptive vertex fitter to be associated to the displaced vertex
105  double minAdaptWeight = iConfig.getParameter<double>("minAdaptWeight");
106 
107  bool switchOff2TrackVertex = iConfig.getUntrackedParameter<bool>("switchOff2TrackVertex");
108 
109  edm::ParameterSet ps_trk = iConfig.getParameter<edm::ParameterSet>("tracksSelectorParameters");
110  edm::ParameterSet ps_vtx = iConfig.getParameter<edm::ParameterSet>("vertexIdentifierParameters");
111  edm::ParameterSet ps_avf = iConfig.getParameter<edm::ParameterSet>("avfParameters");
112 
113  produces<reco::PFDisplacedVertexCollection>();
114 
115  // Vertex Finder parameters -----------------------------------
122 }
const edm::EDGetTokenT< reco::BeamSpot > inputTagBeamSpot_
const edm::ESGetToken< GlobalTrackingGeometry, GlobalTrackingGeometryRecord > globTkGeomToken_
ESGetTokenH3DDVariant esConsumes(std::string const &Record, edm::ConsumesCollector &)
Definition: DeDxTools.cc:283
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
PFDisplacedVertexFinder pfDisplacedVertexFinder_
Displaced Vertices finder.
const edm::ESGetToken< MagneticField, IdealMagneticFieldRecord > magFieldToken_
const edm::EDGetTokenT< reco::PFDisplacedVertexCandidateCollection > inputTagVertexCandidates_
const edm::ESGetToken< TrackerGeometry, TrackerDigiGeometryRecord > tkerGeomToken_
const edm::ESGetToken< TrackerTopology, TrackerTopologyRcd > tkerTopoToken_
T getUntrackedParameter(std::string const &, T const &) const
const edm::EDGetTokenT< reco::VertexCollection > inputTagMainVertex_
Input tag for main vertex to cut of dxy of secondary tracks.
void setTracksSelector(const edm::ParameterSet &ps)
void setDebug(bool debug)
Sets debug printout flag.
void setAVFParameters(const edm::ParameterSet &ps)
#define debug
Definition: HDRShower.cc:19
void setParameters(double transvSize, double longSize, double primaryVertexCut, double tobCut, double tecCut, double minAdaptWeight, bool switchOff2TrackVertex)
--—— Set different algo parameters --—— ///
void setVertexIdentifier(const edm::ParameterSet &ps)

◆ ~PFDisplacedVertexProducer()

PFDisplacedVertexProducer::~PFDisplacedVertexProducer ( )
override

Definition at line 124 of file PFDisplacedVertexProducer.cc.

124 {}

Member Function Documentation

◆ produce()

void PFDisplacedVertexProducer::produce ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
override

Definition at line 126 of file PFDisplacedVertexProducer.cc.

References PFDisplacedVertexFinder::findDisplacedVertices(), edm::EventSetup::getData(), globTkGeomToken_, iEvent, inputTagBeamSpot_, inputTagMainVertex_, inputTagVertexCandidates_, LogDebug, magFieldToken_, eostools::move(), pfDisplacedVertexFinder_, PFDisplacedVertexFinder::setEdmParameters(), PFDisplacedVertexFinder::setInput(), PFDisplacedVertexFinder::setPrimaryVertex(), str, tkerGeomToken_, tkerTopoToken_, PFDisplacedVertexFinder::transferDisplacedVertices(), and verbose_.

126  {
127  LogDebug("PFDisplacedVertexProducer") << "START event: " << iEvent.id().event() << " in run " << iEvent.id().run();
128 
129  // Prepare useful information for the Finder
130 
131  auto const& theMagField = &iSetup.getData(magFieldToken_);
132  auto const& globTkGeom = &iSetup.getData(globTkGeomToken_);
133  auto const& tkerTopo = &iSetup.getData(tkerTopoToken_);
134  auto const& tkerGeom = &iSetup.getData(tkerGeomToken_);
135 
136  auto const& vertexCandidates = iEvent.getHandle(inputTagVertexCandidates_);
137  auto const& mainVertexHandle = iEvent.getHandle(inputTagMainVertex_);
138  auto const& beamSpotHandle = iEvent.getHandle(inputTagBeamSpot_);
139 
140  // Fill useful event information for the Finder
141  pfDisplacedVertexFinder_.setEdmParameters(theMagField, globTkGeom, tkerTopo, tkerGeom);
142  pfDisplacedVertexFinder_.setPrimaryVertex(mainVertexHandle, beamSpotHandle);
143  pfDisplacedVertexFinder_.setInput(vertexCandidates);
144 
145  // Run the finder
147 
148  if (verbose_) {
149  ostringstream str;
151  edm::LogInfo("PFDisplacedVertexProducer") << str.str();
152  }
153 
154  std::unique_ptr<reco::PFDisplacedVertexCollection> pOutputDisplacedVertexCollection(
156 
157  iEvent.put(std::move(pOutputDisplacedVertexCollection));
158 
159  LogDebug("PFDisplacedVertexProducer") << "STOP event: " << iEvent.id().event() << " in run " << iEvent.id().run();
160 }
const edm::EDGetTokenT< reco::BeamSpot > inputTagBeamSpot_
const edm::ESGetToken< GlobalTrackingGeometry, GlobalTrackingGeometryRecord > globTkGeomToken_
void setEdmParameters(const MagneticField *magField, edm::ESHandle< GlobalTrackingGeometry > globTkGeomHandle, const TrackerTopology *tkerTopo, const TrackerGeometry *tkerGeom)
Sets parameters for track extrapolation and hits study.
PFDisplacedVertexFinder pfDisplacedVertexFinder_
Displaced Vertices finder.
const edm::ESGetToken< MagneticField, IdealMagneticFieldRecord > magFieldToken_
T const & getData(const ESGetToken< T, R > &iToken) const noexcept(false)
Definition: EventSetup.h:119
const edm::EDGetTokenT< reco::PFDisplacedVertexCandidateCollection > inputTagVertexCandidates_
std::unique_ptr< reco::PFDisplacedVertexCollection > transferDisplacedVertices()
const edm::ESGetToken< TrackerGeometry, TrackerDigiGeometryRecord > tkerGeomToken_
void findDisplacedVertices()
-----— Main function which find vertices -----— ///
const edm::ESGetToken< TrackerTopology, TrackerTopologyRcd > tkerTopoToken_
const edm::EDGetTokenT< reco::VertexCollection > inputTagMainVertex_
Input tag for main vertex to cut of dxy of secondary tracks.
int iEvent
Definition: GenABIO.cc:224
void setInput(const edm::Handle< reco::PFDisplacedVertexCandidateCollection > &)
Set input collections of tracks.
Log< level::Info, false > LogInfo
void setPrimaryVertex(edm::Handle< reco::VertexCollection > mainVertexHandle, edm::Handle< reco::BeamSpot > beamSpotHandle)
#define str(s)
def move(src, dest)
Definition: eostools.py:511
#define LogDebug(id)

Member Data Documentation

◆ globTkGeomToken_

const edm::ESGetToken<GlobalTrackingGeometry, GlobalTrackingGeometryRecord> PFDisplacedVertexProducer::globTkGeomToken_
private

Definition at line 47 of file PFDisplacedVertexProducer.cc.

Referenced by produce().

◆ inputTagBeamSpot_

const edm::EDGetTokenT<reco::BeamSpot> PFDisplacedVertexProducer::inputTagBeamSpot_
private

Definition at line 44 of file PFDisplacedVertexProducer.cc.

Referenced by produce().

◆ inputTagMainVertex_

const edm::EDGetTokenT<reco::VertexCollection> PFDisplacedVertexProducer::inputTagMainVertex_
private

Input tag for main vertex to cut of dxy of secondary tracks.

Definition at line 43 of file PFDisplacedVertexProducer.cc.

Referenced by produce().

◆ inputTagVertexCandidates_

const edm::EDGetTokenT<reco::PFDisplacedVertexCandidateCollection> PFDisplacedVertexProducer::inputTagVertexCandidates_
private

Collection of DisplacedVertex Candidates used as input for the Displaced VertexFinder.

Definition at line 39 of file PFDisplacedVertexProducer.cc.

Referenced by produce().

◆ magFieldToken_

const edm::ESGetToken<MagneticField, IdealMagneticFieldRecord> PFDisplacedVertexProducer::magFieldToken_
private

Definition at line 46 of file PFDisplacedVertexProducer.cc.

Referenced by produce().

◆ pfDisplacedVertexFinder_

PFDisplacedVertexFinder PFDisplacedVertexProducer::pfDisplacedVertexFinder_
private

Displaced Vertices finder.

Definition at line 55 of file PFDisplacedVertexProducer.cc.

Referenced by PFDisplacedVertexProducer(), and produce().

◆ tkerGeomToken_

const edm::ESGetToken<TrackerGeometry, TrackerDigiGeometryRecord> PFDisplacedVertexProducer::tkerGeomToken_
private

Definition at line 49 of file PFDisplacedVertexProducer.cc.

Referenced by produce().

◆ tkerTopoToken_

const edm::ESGetToken<TrackerTopology, TrackerTopologyRcd> PFDisplacedVertexProducer::tkerTopoToken_
private

Definition at line 48 of file PFDisplacedVertexProducer.cc.

Referenced by produce().

◆ verbose_

bool PFDisplacedVertexProducer::verbose_
private

verbose ?

Definition at line 52 of file PFDisplacedVertexProducer.cc.

Referenced by PFDisplacedVertexProducer(), and produce().