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::ProductRegistryHelper

Public Member Functions

virtual void beginJob ()
 
virtual void beginRun (edm::Run &r, const edm::EventSetup &c)
 
 PFDisplacedVertexCandidateProducer (const edm::ParameterSet &)
 
virtual void produce (edm::Event &, const edm::EventSetup &)
 
 ~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 &)
 
boost::function< void(const
BranchDescription &)> 
registrationCallback () const
 used by the fwk to register list of products More...
 
virtual ~ProducerBase ()
 

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
template<class TProducer , class TMethod >
void callWhenNewProductsRegistered (TProducer *iProd, TMethod iMethod)
 

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::beginJob ( void  )
virtual

Reimplemented from edm::EDProducer.

Definition at line 74 of file PFDisplacedVertexCandidateProducer.cc.

74 { }
void PFDisplacedVertexCandidateProducer::beginRun ( edm::Run r,
const edm::EventSetup c 
)
virtual

Reimplemented from edm::EDProducer.

Definition at line 77 of file PFDisplacedVertexCandidateProducer.cc.

78  { }
void PFDisplacedVertexCandidateProducer::produce ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
virtual

Implements edm::EDProducer.

Definition at line 82 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().

83  {
84 
85  LogDebug("PFDisplacedVertexCandidateProducer")<<"START event: "<<iEvent.id().event()
86  <<" in run "<<iEvent.id().run()<<endl;
87 
88  // Prepare and fill useful event information for the Finder
90  iSetup.get<IdealMagneticFieldRecord>().get(magField);
91  const MagneticField* theMagField = magField.product();
92 
93  Handle <reco::TrackCollection> trackCollection;
94  iEvent.getByLabel(inputTagTracks_, trackCollection);
95 
96  Handle< reco::VertexCollection > mainVertexHandle;
97  iEvent.getByLabel(inputTagMainVertex_, mainVertexHandle);
98 
99  Handle< reco::BeamSpot > beamSpotHandle;
100  iEvent.getByLabel(inputTagBeamSpot_, beamSpotHandle);
101 
102  pfDisplacedVertexCandidateFinder_.setPrimaryVertex(mainVertexHandle, beamSpotHandle);
103  pfDisplacedVertexCandidateFinder_.setInput( trackCollection, theMagField );
104 
105 
106  // Run the finder
108 
109 
110  if(verbose_) {
111  ostringstream str;
114  LogInfo("PFDisplacedVertexCandidateProducer") << str.str()<<endl;
115  }
116 
117 
118  auto_ptr< reco::PFDisplacedVertexCandidateCollection >
119  pOutputDisplacedVertexCandidateCollection(
121 
122 
123  iEvent.put(pOutputDisplacedVertexCandidateCollection);
124 
125  LogDebug("PFDisplacedVertexCandidateProducer")<<"STOP event: "<<iEvent.id().event()
126  <<" in run "<<iEvent.id().run()<<endl;
127 
128 }
#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:85
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:356
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 45 of file PFDisplacedVertexCandidateProducer.h.

edm::InputTag PFDisplacedVertexCandidateProducer::inputTagMainVertex_
private

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

Definition at line 44 of file PFDisplacedVertexCandidateProducer.h.

edm::InputTag PFDisplacedVertexCandidateProducer::inputTagTracks_
private

Reco Tracks used to spot the nuclear interactions.

Definition at line 41 of file PFDisplacedVertexCandidateProducer.h.

PFDisplacedVertexCandidateFinder PFDisplacedVertexCandidateProducer::pfDisplacedVertexCandidateFinder_
private

Displaced Vertex Candidates finder.

Definition at line 51 of file PFDisplacedVertexCandidateProducer.h.

bool PFDisplacedVertexCandidateProducer::verbose_
private

verbose ?

Definition at line 48 of file PFDisplacedVertexCandidateProducer.h.