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
PFDisplacedVertexCandidateProducer Class Reference

Producer for DisplacedVertices. More...

#include <PFDisplacedVertexCandidateProducer.h>

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

Public Member Functions

 PFDisplacedVertexCandidateProducer (const edm::ParameterSet &)
 
virtual void produce (edm::Event &, const edm::EventSetup &) override
 
 ~PFDisplacedVertexCandidateProducer ()
 
- 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 inputTagTracks_
 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::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 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 25 of file PFDisplacedVertexCandidateProducer.h.

Constructor & Destructor Documentation

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

Definition at line 22 of file PFDisplacedVertexCandidateProducer.cc.

References debug, edm::ParameterSet::getParameter(), and edm::ParameterSet::getUntrackedParameter().

22  {
23 
24  // --- Setup input collection names --- //
26  = iConfig.getParameter<InputTag>("trackCollection");
27 
29  = iConfig.getParameter<InputTag>("mainVertexLabel");
30 
32  = iConfig.getParameter<InputTag>("offlineBeamSpotLabel");
33 
34  verbose_ =
35  iConfig.getUntrackedParameter<bool>("verbose");
36 
37  bool debug =
38  iConfig.getUntrackedParameter<bool>("debug");
39 
40  // ------ Algo Parameters ------ //
41 
42  // Distance of minimal approach below which
43  // two tracks are considered as linked together
44  double dcaCut
45  = iConfig.getParameter< double >("dcaCut");
46 
47  // Do not reconstruct vertices wich are
48  // too close to the beam pipe
49  double primaryVertexCut
50  = iConfig.getParameter< double >("primaryVertexCut");
51 
52  //maximum distance between the DCA Point and the inner hit of the track
53  double dcaPInnerHitCut
54  = iConfig.getParameter< double >("dcaPInnerHitCut");
55 
56  edm::ParameterSet ps_trk
57  = iConfig.getParameter<edm::ParameterSet>("tracksSelectorParameters");
58 
59  // Collection to be produced
60  produces<reco::PFDisplacedVertexCandidateCollection>();
61 
62  // Vertex Finder parameters -----------------------------------
64  pfDisplacedVertexCandidateFinder_.setParameters(dcaCut, primaryVertexCut, dcaPInnerHitCut, ps_trk);
65 
66 }
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
edm::InputTag inputTagMainVertex_
Input tag for main vertex to cut of dxy of secondary tracks.
PFDisplacedVertexCandidateFinder pfDisplacedVertexCandidateFinder_
Displaced Vertex Candidates finder.
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 —— ///
#define debug
Definition: MEtoEDMFormat.h:34
edm::InputTag inputTagTracks_
Reco Tracks used to spot the nuclear interactions.
PFDisplacedVertexCandidateProducer::~PFDisplacedVertexCandidateProducer ( )

Definition at line 69 of file PFDisplacedVertexCandidateProducer.cc.

69 { }

Member Function Documentation

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

Implements edm::EDProducer.

Definition at line 73 of file PFDisplacedVertexCandidateProducer.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().

74  {
75 
76  LogDebug("PFDisplacedVertexCandidateProducer")<<"START event: "<<iEvent.id().event()
77  <<" in run "<<iEvent.id().run()<<endl;
78 
79  // Prepare and fill useful event information for the Finder
81  iSetup.get<IdealMagneticFieldRecord>().get(magField);
82  const MagneticField* theMagField = magField.product();
83 
84  Handle <reco::TrackCollection> trackCollection;
85  iEvent.getByLabel(inputTagTracks_, trackCollection);
86 
87  Handle< reco::VertexCollection > mainVertexHandle;
88  iEvent.getByLabel(inputTagMainVertex_, mainVertexHandle);
89 
90  Handle< reco::BeamSpot > beamSpotHandle;
91  iEvent.getByLabel(inputTagBeamSpot_, beamSpotHandle);
92 
93  pfDisplacedVertexCandidateFinder_.setPrimaryVertex(mainVertexHandle, beamSpotHandle);
94  pfDisplacedVertexCandidateFinder_.setInput( trackCollection, theMagField );
95 
96 
97  // Run the finder
99 
100 
101  if(verbose_) {
102  ostringstream str;
105  LogInfo("PFDisplacedVertexCandidateProducer") << str.str()<<endl;
106  }
107 
108 
109  auto_ptr< reco::PFDisplacedVertexCandidateCollection >
110  pOutputDisplacedVertexCandidateCollection(
112 
113 
114  iEvent.put(pOutputDisplacedVertexCandidateCollection);
115 
116  LogDebug("PFDisplacedVertexCandidateProducer")<<"STOP event: "<<iEvent.id().event()
117  <<" in run "<<iEvent.id().run()<<endl;
118 
119 }
#define LogDebug(id)
RunNumber_t run() const
Definition: EventID.h:42
void setInput(const edm::Handle< reco::TrackCollection > &trackh, const MagneticField *magField)
EventNumber_t event() const
Definition: EventID.h:44
edm::InputTag 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)
PFDisplacedVertexCandidateFinder pfDisplacedVertexCandidateFinder_
Displaced Vertex Candidates finder.
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:94
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:361
const T & get() const
Definition: EventSetup.h:55
T const * product() const
Definition: ESHandle.h:62
edm::EventID id() const
Definition: EventBase.h:56
void findDisplacedVertexCandidates()
-----— Main function which find vertices -----— ///
tuple cout
Definition: gather_cfg.py:121
edm::InputTag inputTagTracks_
Reco Tracks used to spot the nuclear interactions.
std::auto_ptr< reco::PFDisplacedVertexCandidateCollection > transferVertexCandidates()

Member Data Documentation

edm::InputTag PFDisplacedVertexCandidateProducer::inputTagBeamSpot_
private

Definition at line 41 of file PFDisplacedVertexCandidateProducer.h.

edm::InputTag PFDisplacedVertexCandidateProducer::inputTagMainVertex_
private

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

Definition at line 40 of file PFDisplacedVertexCandidateProducer.h.

edm::InputTag 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.