CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Attributes
PFDisplacedVertexProducer Class Reference

Producer for DisplacedVertices. More...

#include <PFDisplacedVertexProducer.h>

Inheritance diagram for PFDisplacedVertexProducer:
edm::EDProducer edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

 PFDisplacedVertexProducer (const edm::ParameterSet &)
 
virtual void produce (edm::Event &, const edm::EventSetup &) override
 
 ~PFDisplacedVertexProducer ()
 
- Public Member Functions inherited from edm::EDProducer
 EDProducer ()
 
virtual ~EDProducer ()
 
- Public Member Functions inherited from edm::ProducerBase
 ProducerBase ()
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription
const &)> 
registrationCallback () const
 used by the fwk to register list of products More...
 
virtual ~ProducerBase ()
 
- Public Member Functions inherited from edm::EDConsumerBase
 EDConsumerBase ()
 
ProductHolderIndex indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndex > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndex > &) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

Private Attributes

edm::InputTag inputTagBeamSpot_
 
edm::InputTag inputTagMainVertex_
 Input tag for main vertex to cut of dxy of secondary tracks. More...
 
edm::InputTag inputTagVertexCandidates_
 
PFDisplacedVertexFinder pfDisplacedVertexFinder_
 Displaced Vertices finder. More...
 
bool verbose_
 verbose ? More...
 

Additional Inherited Members

- Public Types inherited from edm::EDProducer
typedef EDProducer ModuleType
 
typedef WorkerT< EDProducerWorkerType
 
- Public Types inherited from edm::ProducerBase
typedef
ProductRegistryHelper::TypeLabelList 
TypeLabelList
 
- Static Public Member Functions inherited from edm::EDProducer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
- Protected Member Functions inherited from edm::EDProducer
CurrentProcessingContext const * currentContext () const
 
- Protected Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
- 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(), and edm::ParameterSet::getUntrackedParameter().

27  {
28 
29  // --- Setup input collection names --- //
30 
32  = iConfig.getParameter<InputTag>("vertexCandidatesLabel");
33 
35  = iConfig.getParameter<InputTag>("mainVertexLabel");
36 
38  = iConfig.getParameter<InputTag>("offlineBeamSpotLabel");
39 
40  verbose_ =
41  iConfig.getUntrackedParameter<bool>("verbose");
42 
43  bool debug =
44  iConfig.getUntrackedParameter<bool>("debug");
45 
46  // ------ Algo Parameters ------ //
47 
48  // Maximal transverse distance between two minimal
49  // approach points to be used together
50  double transvSize
51  = iConfig.getParameter< double >("transvSize");
52 
53  // Maximal longitudinal distance between two minimal
54  // approach points to be used together
55  double longSize
56  = iConfig.getParameter< double >("longSize");
57 
58  // Minimal radius below which we do not reconstruct interactions
59  // Typically the position of the first Pixel layer
60  double primaryVertexCut
61  = iConfig.getParameter< double >("primaryVertexCut");
62 
63  // Radius at which no secondary tracks are availables
64  // in the barrel.For the moment we exclude the TOB barrel
65  // since 5-th track step starts the latest at first TOB
66  // layer.
67  double tobCut
68  = iConfig.getParameter< double >("tobCut");
69 
70  // Radius at which no secondary tracks are availables
71  // in the endcaps.For the moment we exclude the TEC wheel.
72  double tecCut
73  = iConfig.getParameter< double >("tecCut");
74 
75  // The minimal accepted weight for the tracks calculated in the
76  // adaptive vertex fitter to be associated to the displaced vertex
77  double minAdaptWeight
78  = iConfig.getParameter< double >("minAdaptWeight");
79 
80  bool switchOff2TrackVertex
81  = iConfig.getUntrackedParameter< bool >("switchOff2TrackVertex");
82 
83  edm::ParameterSet ps_trk = iConfig.getParameter<edm::ParameterSet>("tracksSelectorParameters");
84  edm::ParameterSet ps_vtx = iConfig.getParameter<edm::ParameterSet>("vertexIdentifierParameters");
85  edm::ParameterSet ps_avf = iConfig.getParameter<edm::ParameterSet>("avfParameters");
86 
87  produces<reco::PFDisplacedVertexCollection>();
88 
89  // Vertex Finder parameters -----------------------------------
91  pfDisplacedVertexFinder_.setParameters(transvSize, longSize,
92  primaryVertexCut, tobCut,
93  tecCut, minAdaptWeight, switchOff2TrackVertex);
97 
98 }
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.
void setAVFParameters(const edm::ParameterSet &ps)
void setParameters(double transvSize, double longSize, double primaryVertexCut, double tobCut, double tecCut, double minAdaptWeight, bool switchOff2TrackVertex)
--—— Set different algo parameters --—— ///
edm::InputTag inputTagMainVertex_
Input tag for main vertex to cut of dxy of secondary tracks.
void setVertexIdentifier(const edm::ParameterSet &ps)
#define debug
Definition: MEtoEDMFormat.h:34
PFDisplacedVertexProducer::~PFDisplacedVertexProducer ( )

Definition at line 102 of file PFDisplacedVertexProducer.cc.

102 { }

Member Function Documentation

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

Implements edm::EDProducer.

Definition at line 107 of file PFDisplacedVertexProducer.cc.

References gather_cfg::cout, edm::EventID::event(), edm::EventSetup::get(), edm::Event::getByLabel(), edm::EventBase::id(), LogDebug, edm::ESHandle< class >::product(), edm::Event::put(), and edm::EventID::run().

108  {
109 
110  LogDebug("PFDisplacedVertexProducer")<<"START event: "<<iEvent.id().event()
111  <<" in run "<<iEvent.id().run()<<endl;
112 
113  // Prepare useful information for the Finder
114 
115  ESHandle<MagneticField> magField;
116  iSetup.get<IdealMagneticFieldRecord>().get(magField);
117  const MagneticField* theMagField = magField.product();
118 
119  ESHandle<GlobalTrackingGeometry> globTkGeomHandle;
120  iSetup.get<GlobalTrackingGeometryRecord>().get(globTkGeomHandle);
121 
122  ESHandle<TrackerGeometry> tkerGeomHandle;
123  iSetup.get<TrackerDigiGeometryRecord>().get(tkerGeomHandle);
124 
126  iEvent.getByLabel(inputTagVertexCandidates_, vertexCandidates);
127 
128  Handle< reco::VertexCollection > mainVertexHandle;
129  iEvent.getByLabel(inputTagMainVertex_, mainVertexHandle);
130 
131  Handle< reco::BeamSpot > beamSpotHandle;
132  iEvent.getByLabel(inputTagBeamSpot_, beamSpotHandle);
133 
134  // Fill useful event information for the Finder
135  pfDisplacedVertexFinder_.setEdmParameters(theMagField, globTkGeomHandle, tkerGeomHandle);
136  pfDisplacedVertexFinder_.setPrimaryVertex(mainVertexHandle, beamSpotHandle);
137  pfDisplacedVertexFinder_.setInput(vertexCandidates);
138 
139  // Run the finder
141 
142 
143  if(verbose_) {
144  ostringstream str;
145  //str<<pfDisplacedVertexFinder_<<endl;
147  LogInfo("PFDisplacedVertexProducer") << str.str()<<endl;
148  }
149 
150 
151  auto_ptr< reco::PFDisplacedVertexCollection >
152  pOutputDisplacedVertexCollection(
154 
155 
156 
157  iEvent.put(pOutputDisplacedVertexCollection);
158 
159  LogDebug("PFDisplacedVertexProducer")<<"STOP event: "<<iEvent.id().event()
160  <<" in run "<<iEvent.id().run()<<endl;
161 
162 }
#define LogDebug(id)
RunNumber_t run() const
Definition: EventID.h:42
EventNumber_t event() const
Definition: EventID.h:44
PFDisplacedVertexFinder pfDisplacedVertexFinder_
Displaced Vertices finder.
void setEdmParameters(const MagneticField *magField, edm::ESHandle< GlobalTrackingGeometry > globTkGeomHandle, edm::ESHandle< TrackerGeometry > tkerGeomHandle)
Sets parameters for track extrapolation and hits study.
void findDisplacedVertices()
-----— Main function which find vertices -----— ///
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:94
std::auto_ptr< reco::PFDisplacedVertexCollection > transferDisplacedVertices()
void setInput(const edm::Handle< reco::PFDisplacedVertexCandidateCollection > &)
Set input collections of tracks.
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:361
void setPrimaryVertex(edm::Handle< reco::VertexCollection > mainVertexHandle, edm::Handle< reco::BeamSpot > beamSpotHandle)
const T & get() const
Definition: EventSetup.h:55
T const * product() const
Definition: ESHandle.h:62
edm::EventID id() const
Definition: EventBase.h:56
edm::InputTag inputTagMainVertex_
Input tag for main vertex to cut of dxy of secondary tracks.
tuple cout
Definition: gather_cfg.py:121

Member Data Documentation

edm::InputTag PFDisplacedVertexProducer::inputTagBeamSpot_
private

Definition at line 42 of file PFDisplacedVertexProducer.h.

edm::InputTag PFDisplacedVertexProducer::inputTagMainVertex_
private

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

Definition at line 41 of file PFDisplacedVertexProducer.h.

edm::InputTag 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 48 of file PFDisplacedVertexProducer.h.

bool PFDisplacedVertexProducer::verbose_
private

verbose ?

Definition at line 45 of file PFDisplacedVertexProducer.h.