CMS 3D CMS Logo

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

Producer for DisplacedVertices. More...

#include <PFDisplacedVertexProducer.h>

Inheritance diagram for PFDisplacedVertexProducer:
edm::stream::EDProducer<> edm::stream::EDProducerBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

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
 
- Public Member Functions inherited from edm::stream::EDProducerBase
 EDProducerBase ()
 
ModuleDescription const & moduleDescription () const
 
 ~EDProducerBase () override
 
- Public Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
std::vector< edm::ProductResolverIndex > const & indiciesForPutProducts (BranchType iBranchType) const
 
 ProducerBase ()
 
std::vector< edm::ProductResolverIndex > const & putTokenIndexToProductResolverIndex () const
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription const &)> registrationCallback () const
 used by the fwk to register list of products More...
 
void resolvePutIndicies (BranchType iBranchType, ModuleToResolverIndicies const &iIndicies, std::string const &moduleLabel)
 
virtual ~ProducerBase () noexcept(false)
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
void convertCurrentProcessAlias (std::string const &processName)
 Convert "@currentProcess" in InputTag process names to the actual current process name. More...
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
ProductResolverIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
std::vector< ProductResolverIndexAndSkipBit > const & itemsToGetFrom (BranchType iType) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
virtual ~EDConsumerBase () noexcept(false)
 

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::PFDisplacedVertexCandidateCollectioninputTagVertexCandidates_
 
PFDisplacedVertexFinder pfDisplacedVertexFinder_
 Displaced Vertices 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
 
- Public Types inherited from edm::stream::EDProducerBase
typedef EDProducerAdaptorBase ModuleType
 
- Public Types inherited from edm::ProducerBase
using ModuleToResolverIndicies = std::unordered_multimap< std::string, std::tuple< edm::TypeID const *, const char *, edm::ProductResolverIndex >>
 
typedef ProductRegistryHelper::TypeLabelList TypeLabelList
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Static Public Member Functions inherited from edm::stream::EDProducerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 

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 25 of file PFDisplacedVertexProducer.h.

Constructor & Destructor Documentation

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

Definition at line 27 of file PFDisplacedVertexProducer.cc.

References debug, edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), particleFlowDisplacedVertex_cfi::longSize, particleFlowDisplacedVertex_cfi::minAdaptWeight, particleFlowDisplacedVertex_cfi::primaryVertexCut, particleFlowDisplacedVertex_cfi::switchOff2TrackVertex, particleFlowDisplacedVertex_cfi::tecCut, particleFlowDisplacedVertex_cfi::tobCut, and particleFlowDisplacedVertex_cfi::transvSize.

27  {
28 
29  // --- Setup input collection names --- //
30 
31  inputTagVertexCandidates_= consumes<reco::PFDisplacedVertexCandidateCollection>(iConfig.getParameter<InputTag>("vertexCandidatesLabel"));
32 
33  inputTagMainVertex_ = consumes<reco::VertexCollection>(iConfig.getParameter<InputTag>("mainVertexLabel"));
34 
35 
36  inputTagBeamSpot_ =consumes<reco::BeamSpot> (iConfig.getParameter<InputTag>("offlineBeamSpotLabel"));
37 
38  verbose_ =
39  iConfig.getUntrackedParameter<bool>("verbose");
40 
41  bool debug =
42  iConfig.getUntrackedParameter<bool>("debug");
43 
44  // ------ Algo Parameters ------ //
45 
46  // Maximal transverse distance between two minimal
47  // approach points to be used together
48  double transvSize
49  = iConfig.getParameter< double >("transvSize");
50 
51  // Maximal longitudinal distance between two minimal
52  // approach points to be used together
53  double longSize
54  = iConfig.getParameter< double >("longSize");
55 
56  // Minimal radius below which we do not reconstruct interactions
57  // Typically the position of the first Pixel layer
58  double primaryVertexCut
59  = iConfig.getParameter< double >("primaryVertexCut");
60 
61  // Radius at which no secondary tracks are availables
62  // in the barrel.For the moment we exclude the TOB barrel
63  // since 5-th track step starts the latest at first TOB
64  // layer.
65  double tobCut
66  = iConfig.getParameter< double >("tobCut");
67 
68  // Radius at which no secondary tracks are availables
69  // in the endcaps.For the moment we exclude the TEC wheel.
70  double tecCut
71  = iConfig.getParameter< double >("tecCut");
72 
73  // The minimal accepted weight for the tracks calculated in the
74  // adaptive vertex fitter to be associated to the displaced vertex
75  double minAdaptWeight
76  = iConfig.getParameter< double >("minAdaptWeight");
77 
79  = iConfig.getUntrackedParameter< bool >("switchOff2TrackVertex");
80 
81  edm::ParameterSet ps_trk = iConfig.getParameter<edm::ParameterSet>("tracksSelectorParameters");
82  edm::ParameterSet ps_vtx = iConfig.getParameter<edm::ParameterSet>("vertexIdentifierParameters");
83  edm::ParameterSet ps_avf = iConfig.getParameter<edm::ParameterSet>("avfParameters");
84 
85  produces<reco::PFDisplacedVertexCollection>();
86 
87  // Vertex Finder parameters -----------------------------------
95 
96 }
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
PFDisplacedVertexFinder pfDisplacedVertexFinder_
Displaced Vertices finder.
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_
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 ( )
override

Definition at line 100 of file PFDisplacedVertexProducer.cc.

100 { }

Member Function Documentation

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

Definition at line 105 of file PFDisplacedVertexProducer.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(), and harvestTrackValidationPlots::str.

106  {
107 
108  LogDebug("PFDisplacedVertexProducer")<<"START event: "<<iEvent.id().event()
109  <<" in run "<<iEvent.id().run()<<endl;
110 
111  // Prepare useful information for the Finder
112 
113  ESHandle<MagneticField> magField;
114  iSetup.get<IdealMagneticFieldRecord>().get(magField);
115  const MagneticField* theMagField = magField.product();
116 
117  ESHandle<GlobalTrackingGeometry> globTkGeomHandle;
118  iSetup.get<GlobalTrackingGeometryRecord>().get(globTkGeomHandle);
119 
120  ESHandle<TrackerTopology> tkerTopoHandle;
121  iSetup.get<TrackerTopologyRcd>().get(tkerTopoHandle);
122 
123  ESHandle<TrackerGeometry> tkerGeomHandle;
124  iSetup.get<TrackerDigiGeometryRecord>().get(tkerGeomHandle);
125 
127  iEvent.getByToken(inputTagVertexCandidates_, vertexCandidates);
128 
129  Handle< reco::VertexCollection > mainVertexHandle;
130  iEvent.getByToken(inputTagMainVertex_, mainVertexHandle);
131 
132  Handle< reco::BeamSpot > beamSpotHandle;
133  iEvent.getByToken(inputTagBeamSpot_, beamSpotHandle);
134 
135  // Fill useful event information for the Finder
136  pfDisplacedVertexFinder_.setEdmParameters(theMagField, globTkGeomHandle, tkerTopoHandle.product(), tkerGeomHandle.product());
137  pfDisplacedVertexFinder_.setPrimaryVertex(mainVertexHandle, beamSpotHandle);
138  pfDisplacedVertexFinder_.setInput(vertexCandidates);
139 
140  // Run the finder
142 
143 
144  if(verbose_) {
145  ostringstream str;
146  //str<<pfDisplacedVertexFinder_<<endl;
148  LogInfo("PFDisplacedVertexProducer") << str.str()<<endl;
149  }
150 
151 
152  std::unique_ptr<reco::PFDisplacedVertexCollection>
153  pOutputDisplacedVertexCollection(
155 
156 
157 
158  iEvent.put(std::move(pOutputDisplacedVertexCollection));
159 
160  LogDebug("PFDisplacedVertexProducer")<<"STOP event: "<<iEvent.id().event()
161  <<" in run "<<iEvent.id().run()<<endl;
162 
163 }
#define LogDebug(id)
RunNumber_t run() const
Definition: EventID.h:39
EventNumber_t event() const
Definition: EventID.h:41
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:127
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:508
void findDisplacedVertices()
-----— Main function which find vertices -----— ///
std::auto_ptr< reco::PFDisplacedVertexCollection > transferDisplacedVertices()
edm::EDGetTokenT< reco::PFDisplacedVertexCandidateCollection > inputTagVertexCandidates_
void setInput(const edm::Handle< reco::PFDisplacedVertexCandidateCollection > &)
Set input collections of tracks.
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_
const T & get() const
Definition: EventSetup.h:55
edm::EventID id() const
Definition: EventBase.h:60
T const * product() const
Definition: ESHandle.h:86
def move(src, dest)
Definition: eostools.py:510

Member Data Documentation

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

Definition at line 43 of file PFDisplacedVertexProducer.h.

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

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

Definition at line 42 of file PFDisplacedVertexProducer.h.

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

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

Definition at line 38 of file PFDisplacedVertexProducer.h.

PFDisplacedVertexFinder PFDisplacedVertexProducer::pfDisplacedVertexFinder_
private

Displaced Vertices finder.

Definition at line 49 of file PFDisplacedVertexProducer.h.

bool PFDisplacedVertexProducer::verbose_
private

verbose ?

Definition at line 46 of file PFDisplacedVertexProducer.h.