CMS 3D CMS Logo

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

Producer for DisplacedVertices. More...

#include <PFDisplacedVertexCandidateProducer.h>

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

Public Member Functions

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

Private Attributes

edm::EDGetTokenT< reco::BeamSpotinputTagBeamSpot_
 
edm::EDGetTokenT< reco::VertexCollectioninputTagMainVertex_
 Input tag for main vertex to cut of dxy of secondary tracks. More...
 
edm::EDGetTokenT< reco::TrackCollectioninputTagTracks_
 Reco Tracks used to spot the nuclear interactions. More...
 
PFDisplacedVertexCandidateFinder pfDisplacedVertexCandidateFinder_
 Displaced Vertex Candidates finder. More...
 
bool verbose_
 verbose ? More...
 

Additional Inherited Members

- Public Types inherited from edm::stream::EDProducer<>
typedef CacheContexts< T... > CacheTypes
 
typedef CacheTypes::GlobalCache GlobalCache
 
typedef AbilityChecker< T... > HasAbility
 
typedef CacheTypes::LuminosityBlockCache LuminosityBlockCache
 
typedef LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCacheLuminosityBlockContext
 
typedef CacheTypes::LuminosityBlockSummaryCache LuminosityBlockSummaryCache
 
typedef CacheTypes::RunCache RunCache
 
typedef RunContextT< RunCache, GlobalCacheRunContext
 
typedef CacheTypes::RunSummaryCache RunSummaryCache
 

Detailed Description

Producer for DisplacedVertices.

This producer makes use of DisplacedVertexCandidateFinder. This Finder loop recursively over reco::Tracks to find those which are linked together by the criterion which is by default the minimal approach distance.

Author
Maxime Gouzevitch
Date
November 2009

Definition at line 27 of file PFDisplacedVertexCandidateProducer.h.

Constructor & Destructor Documentation

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

Definition at line 19 of file PFDisplacedVertexCandidateProducer.cc.

References particleFlowDisplacedVertexCandidate_cfi::dcaCut, particleFlowDisplacedVertexCandidate_cfi::dcaPInnerHitCut, debug, edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), and particleFlowDisplacedVertex_cfi::primaryVertexCut.

19  {
20  // --- Setup input collection names --- //
21  inputTagTracks_ = consumes<reco::TrackCollection>(iConfig.getParameter<InputTag>("trackCollection"));
22 
23  inputTagMainVertex_ = consumes<reco::VertexCollection>(iConfig.getParameter<InputTag>("mainVertexLabel"));
24 
25  inputTagBeamSpot_ = consumes<reco::BeamSpot>(iConfig.getParameter<InputTag>("offlineBeamSpotLabel"));
26 
27  verbose_ = iConfig.getUntrackedParameter<bool>("verbose");
28 
29  bool debug = iConfig.getUntrackedParameter<bool>("debug");
30 
31  // ------ Algo Parameters ------ //
32 
33  // Distance of minimal approach below which
34  // two tracks are considered as linked together
35  double dcaCut = iConfig.getParameter<double>("dcaCut");
36 
37  // Do not reconstruct vertices wich are
38  // too close to the beam pipe
39  double primaryVertexCut = iConfig.getParameter<double>("primaryVertexCut");
40 
41  //maximum distance between the DCA Point and the inner hit of the track
42  double dcaPInnerHitCut = iConfig.getParameter<double>("dcaPInnerHitCut");
43 
44  edm::ParameterSet ps_trk = iConfig.getParameter<edm::ParameterSet>("tracksSelectorParameters");
45 
46  // Collection to be produced
47  produces<reco::PFDisplacedVertexCandidateCollection>();
48 
49  // Vertex Finder parameters -----------------------------------
52 }
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
edm::EDGetTokenT< reco::TrackCollection > inputTagTracks_
Reco Tracks used to spot the nuclear interactions.
PFDisplacedVertexCandidateFinder pfDisplacedVertexCandidateFinder_
Displaced Vertex Candidates finder.
edm::EDGetTokenT< reco::BeamSpot > inputTagBeamSpot_
void setDebug(bool debug)
sets debug printout flag
void setParameters(double dcaCut, double primaryVertexCut, double dcaPInnerHitCut, const edm::ParameterSet &ps_trk)
---—— Set different algo parameters —— ///
edm::EDGetTokenT< reco::VertexCollection > inputTagMainVertex_
Input tag for main vertex to cut of dxy of secondary tracks.
#define debug
Definition: HDRShower.cc:19
PFDisplacedVertexCandidateProducer::~PFDisplacedVertexCandidateProducer ( )
override

Definition at line 54 of file PFDisplacedVertexCandidateProducer.cc.

54 {}

Member Function Documentation

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

Definition at line 56 of file PFDisplacedVertexCandidateProducer.cc.

References gather_cfg::cout, edm::EventID::event(), edm::EventSetup::get(), edm::Event::getByToken(), edm::EventBase::id(), LogDebug, eostools::move(), edm::ESHandle< T >::product(), edm::Event::put(), edm::EventID::run(), str, and duplicaterechits_cfi::trackCollection.

56  {
57  LogDebug("PFDisplacedVertexCandidateProducer")
58  << "START event: " << iEvent.id().event() << " in run " << iEvent.id().run() << endl;
59 
60  // Prepare and fill useful event information for the Finder
62  iSetup.get<IdealMagneticFieldRecord>().get(magField);
63  const MagneticField* theMagField = magField.product();
64 
66  iEvent.getByToken(inputTagTracks_, trackCollection);
67 
68  Handle<reco::VertexCollection> mainVertexHandle;
69  iEvent.getByToken(inputTagMainVertex_, mainVertexHandle);
70 
71  Handle<reco::BeamSpot> beamSpotHandle;
72  iEvent.getByToken(inputTagBeamSpot_, beamSpotHandle);
73 
74  pfDisplacedVertexCandidateFinder_.setPrimaryVertex(mainVertexHandle, beamSpotHandle);
75  pfDisplacedVertexCandidateFinder_.setInput(trackCollection, theMagField);
76 
77  // Run the finder
79 
80  if (verbose_) {
81  ostringstream str;
82  str << pfDisplacedVertexCandidateFinder_ << endl;
84  LogInfo("PFDisplacedVertexCandidateProducer") << str.str() << endl;
85  }
86 
87  std::unique_ptr<reco::PFDisplacedVertexCandidateCollection> pOutputDisplacedVertexCandidateCollection(
89 
90  iEvent.put(std::move(pOutputDisplacedVertexCandidateCollection));
91 
92  LogDebug("PFDisplacedVertexCandidateProducer")
93  << "STOP event: " << iEvent.id().event() << " in run " << iEvent.id().run() << endl;
94 }
#define LogDebug(id)
RunNumber_t run() const
Definition: EventID.h:38
void setInput(const edm::Handle< reco::TrackCollection > &trackh, const MagneticField *magField)
EventNumber_t event() const
Definition: EventID.h:40
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:131
edm::EDGetTokenT< reco::TrackCollection > inputTagTracks_
Reco Tracks used to spot the nuclear interactions.
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:525
void setPrimaryVertex(edm::Handle< reco::VertexCollection > mainVertexHandle, edm::Handle< reco::BeamSpot > beamSpotHandle)
PFDisplacedVertexCandidateFinder pfDisplacedVertexCandidateFinder_
Displaced Vertex Candidates finder.
edm::EDGetTokenT< reco::BeamSpot > inputTagBeamSpot_
edm::EDGetTokenT< reco::VertexCollection > inputTagMainVertex_
Input tag for main vertex to cut of dxy of secondary tracks.
edm::EventID id() const
Definition: EventBase.h:59
T get() const
Definition: EventSetup.h:73
void findDisplacedVertexCandidates()
-----— Main function which find vertices -----— ///
std::unique_ptr< reco::PFDisplacedVertexCandidateCollection > transferVertexCandidates()
#define str(s)
T const * product() const
Definition: ESHandle.h:86
def move(src, dest)
Definition: eostools.py:511

Member Data Documentation

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

Definition at line 41 of file PFDisplacedVertexCandidateProducer.h.

edm::EDGetTokenT<reco::VertexCollection> PFDisplacedVertexCandidateProducer::inputTagMainVertex_
private

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

Definition at line 40 of file PFDisplacedVertexCandidateProducer.h.

edm::EDGetTokenT<reco::TrackCollection> PFDisplacedVertexCandidateProducer::inputTagTracks_
private

Reco Tracks used to spot the nuclear interactions.

Definition at line 37 of file PFDisplacedVertexCandidateProducer.h.

PFDisplacedVertexCandidateFinder PFDisplacedVertexCandidateProducer::pfDisplacedVertexCandidateFinder_
private

Displaced Vertex Candidates finder.

Definition at line 47 of file PFDisplacedVertexCandidateProducer.h.

bool PFDisplacedVertexCandidateProducer::verbose_
private

verbose ?

Definition at line 44 of file PFDisplacedVertexCandidateProducer.h.