CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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,
GlobalTrackingGeometryRecord
globTkGeomToken_
 
edm::EDGetTokenT< reco::BeamSpotinputTagBeamSpot_
 
edm::EDGetTokenT
< reco::VertexCollection
inputTagMainVertex_
 Input tag for main vertex to cut of dxy of secondary tracks. More...
 
edm::EDGetTokenT
< reco::PFDisplacedVertexCandidateCollection
inputTagVertexCandidates_
 
const edm::ESGetToken
< MagneticField,
IdealMagneticFieldRecord
magFieldToken_
 
PFDisplacedVertexFinder pfDisplacedVertexFinder_
 Displaced Vertices finder. More...
 
const edm::ESGetToken
< TrackerGeometry,
TrackerDigiGeometryRecord
tkerGeomToken_
 
const edm::ESGetToken
< TrackerTopology,
TrackerTopologyRcd
tkerTopoToken_
 
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 ( const edm::ParameterSet iConfig)
explicit

Definition at line 64 of file PFDisplacedVertexProducer.cc.

References debug, edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), inputTagBeamSpot_, inputTagMainVertex_, inputTagVertexCandidates_, pfDisplacedVertexFinder_, PFDisplacedVertexFinder::setAVFParameters(), PFDisplacedVertexFinder::setDebug(), PFDisplacedVertexFinder::setParameters(), PFDisplacedVertexFinder::setTracksSelector(), PFDisplacedVertexFinder::setVertexIdentifier(), and verbose_.

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

Definition at line 127 of file PFDisplacedVertexProducer.cc.

127 {}

Member Function Documentation

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

Definition at line 129 of file PFDisplacedVertexProducer.cc.

References gather_cfg::cout, edm::EventID::event(), PFDisplacedVertexFinder::findDisplacedVertices(), edm::Event::getByToken(), edm::EventSetup::getData(), globTkGeomToken_, edm::EventBase::id(), inputTagBeamSpot_, inputTagMainVertex_, inputTagVertexCandidates_, LogDebug, magFieldToken_, eostools::move(), pfDisplacedVertexFinder_, edm::Event::put(), edm::EventID::run(), PFDisplacedVertexFinder::setEdmParameters(), PFDisplacedVertexFinder::setInput(), PFDisplacedVertexFinder::setPrimaryVertex(), str, tkerGeomToken_, tkerTopoToken_, PFDisplacedVertexFinder::transferDisplacedVertices(), and verbose_.

129  {
130  LogDebug("PFDisplacedVertexProducer") << "START event: " << iEvent.id().event() << " in run " << iEvent.id().run()
131  << endl;
132 
133  // Prepare useful information for the Finder
134 
135  auto const& theMagField = &iSetup.getData(magFieldToken_);
136  auto const& globTkGeom = &iSetup.getData(globTkGeomToken_);
137  auto const& tkerTopo = &iSetup.getData(tkerTopoToken_);
138  auto const& tkerGeom = &iSetup.getData(tkerGeomToken_);
139 
141  iEvent.getByToken(inputTagVertexCandidates_, vertexCandidates);
142 
143  Handle<reco::VertexCollection> mainVertexHandle;
144  iEvent.getByToken(inputTagMainVertex_, mainVertexHandle);
145 
146  Handle<reco::BeamSpot> beamSpotHandle;
147  iEvent.getByToken(inputTagBeamSpot_, beamSpotHandle);
148 
149  // Fill useful event information for the Finder
150  pfDisplacedVertexFinder_.setEdmParameters(theMagField, globTkGeom, tkerTopo, tkerGeom);
151  pfDisplacedVertexFinder_.setPrimaryVertex(mainVertexHandle, beamSpotHandle);
152  pfDisplacedVertexFinder_.setInput(vertexCandidates);
153 
154  // Run the finder
156 
157  if (verbose_) {
158  ostringstream str;
159  //str<<pfDisplacedVertexFinder_<<endl;
160  cout << pfDisplacedVertexFinder_ << endl;
161  LogInfo("PFDisplacedVertexProducer") << str.str() << endl;
162  }
163 
164  std::unique_ptr<reco::PFDisplacedVertexCollection> pOutputDisplacedVertexCollection(
166 
167  iEvent.put(std::move(pOutputDisplacedVertexCollection));
168 
169  LogDebug("PFDisplacedVertexProducer") << "STOP event: " << iEvent.id().event() << " in run " << iEvent.id().run()
170  << endl;
171 }
RunNumber_t run() const
Definition: EventID.h:38
const edm::ESGetToken< GlobalTrackingGeometry, GlobalTrackingGeometryRecord > globTkGeomToken_
EventNumber_t event() const
Definition: EventID.h:40
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.
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:133
const edm::ESGetToken< MagneticField, IdealMagneticFieldRecord > magFieldToken_
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:539
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_
bool getData(T &iHolder) const
Definition: EventSetup.h:128
def move
Definition: eostools.py:511
edm::EDGetTokenT< reco::PFDisplacedVertexCandidateCollection > inputTagVertexCandidates_
void setInput(const edm::Handle< reco::PFDisplacedVertexCandidateCollection > &)
Set input collections of tracks.
Log< level::Info, false > LogInfo
edm::EDGetTokenT< reco::VertexCollection > inputTagMainVertex_
Input tag for main vertex to cut of dxy of secondary tracks.
void setPrimaryVertex(edm::Handle< reco::VertexCollection > mainVertexHandle, edm::Handle< reco::BeamSpot > beamSpotHandle)
edm::EDGetTokenT< reco::BeamSpot > inputTagBeamSpot_
edm::EventID id() const
Definition: EventBase.h:59
tuple cout
Definition: gather_cfg.py:144
#define str(s)
#define LogDebug(id)

Member Data Documentation

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

Definition at line 47 of file PFDisplacedVertexProducer.cc.

Referenced by produce().

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

Definition at line 44 of file PFDisplacedVertexProducer.cc.

Referenced by PFDisplacedVertexProducer(), and produce().

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 PFDisplacedVertexProducer(), and produce().

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 PFDisplacedVertexProducer(), and produce().

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

Definition at line 46 of file PFDisplacedVertexProducer.cc.

Referenced by produce().

PFDisplacedVertexFinder PFDisplacedVertexProducer::pfDisplacedVertexFinder_
private

Displaced Vertices finder.

Definition at line 55 of file PFDisplacedVertexProducer.cc.

Referenced by PFDisplacedVertexProducer(), and produce().

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

Definition at line 49 of file PFDisplacedVertexProducer.cc.

Referenced by produce().

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

Definition at line 48 of file PFDisplacedVertexProducer.cc.

Referenced by produce().

bool PFDisplacedVertexProducer::verbose_
private

verbose ?

Definition at line 52 of file PFDisplacedVertexProducer.cc.

Referenced by PFDisplacedVertexProducer(), and produce().