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<> edm::stream::EDProducerBase 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::stream::EDProducer<>
 EDProducer ()=default
 
- Public Member Functions inherited from edm::stream::EDProducerBase
 EDProducerBase ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDProducerBase ()
 
- 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 ()
 
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, std::unordered_multimap< std::string, edm::ProductResolverIndex > 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::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
 
- Public Types inherited from edm::stream::EDProducerBase
typedef EDProducerAdaptorBase ModuleType
 
- Public Types inherited from edm::ProducerBase
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 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 20 of file PFDisplacedVertexCandidateProducer.cc.

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

20  {
21 
22  // --- Setup input collection names --- //
23  inputTagTracks_ = consumes<reco::TrackCollection>(iConfig.getParameter<InputTag>("trackCollection"));
24 
25  inputTagMainVertex_=consumes<reco::VertexCollection>(iConfig.getParameter<InputTag>("mainVertexLabel"));
26 
27  inputTagBeamSpot_ =consumes<reco::BeamSpot>(iConfig.getParameter<InputTag>("offlineBeamSpotLabel"));
28 
29  verbose_ =
30  iConfig.getUntrackedParameter<bool>("verbose");
31 
32  bool debug =
33  iConfig.getUntrackedParameter<bool>("debug");
34 
35  // ------ Algo Parameters ------ //
36 
37  // Distance of minimal approach below which
38  // two tracks are considered as linked together
39  double dcaCut
40  = iConfig.getParameter< double >("dcaCut");
41 
42  // Do not reconstruct vertices wich are
43  // too close to the beam pipe
44  double primaryVertexCut
45  = iConfig.getParameter< double >("primaryVertexCut");
46 
47  //maximum distance between the DCA Point and the inner hit of the track
48  double dcaPInnerHitCut
49  = iConfig.getParameter< double >("dcaPInnerHitCut");
50 
51  edm::ParameterSet ps_trk
52  = iConfig.getParameter<edm::ParameterSet>("tracksSelectorParameters");
53 
54  // Collection to be produced
55  produces<reco::PFDisplacedVertexCandidateCollection>();
56 
57  // Vertex Finder parameters -----------------------------------
60 
61 }
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 ( )

Definition at line 64 of file PFDisplacedVertexCandidateProducer.cc.

64 { }

Member Function Documentation

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

Definition at line 68 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(), harvestTrackValidationPlots::str, and findElectronsInSiStrips_cfi::trackCollection.

69  {
70 
71  LogDebug("PFDisplacedVertexCandidateProducer")<<"START event: "<<iEvent.id().event()
72  <<" in run "<<iEvent.id().run()<<endl;
73 
74  // Prepare and fill useful event information for the Finder
76  iSetup.get<IdealMagneticFieldRecord>().get(magField);
77  const MagneticField* theMagField = magField.product();
78 
80  iEvent.getByToken(inputTagTracks_, trackCollection);
81 
82  Handle< reco::VertexCollection > mainVertexHandle;
83  iEvent.getByToken(inputTagMainVertex_, mainVertexHandle);
84 
85  Handle< reco::BeamSpot > beamSpotHandle;
86  iEvent.getByToken(inputTagBeamSpot_, beamSpotHandle);
87 
88  pfDisplacedVertexCandidateFinder_.setPrimaryVertex(mainVertexHandle, beamSpotHandle);
89  pfDisplacedVertexCandidateFinder_.setInput( trackCollection, theMagField );
90 
91 
92  // Run the finder
94 
95 
96  if(verbose_) {
97  ostringstream str;
100  LogInfo("PFDisplacedVertexCandidateProducer") << str.str()<<endl;
101  }
102 
103 
104  std::unique_ptr<reco::PFDisplacedVertexCandidateCollection> pOutputDisplacedVertexCandidateCollection(
106 
107 
108  iEvent.put(std::move(pOutputDisplacedVertexCandidateCollection));
109 
110  LogDebug("PFDisplacedVertexCandidateProducer")<<"STOP event: "<<iEvent.id().event()
111  <<" in run "<<iEvent.id().run()<<endl;
112 
113 }
#define LogDebug(id)
RunNumber_t run() const
Definition: EventID.h:39
void setInput(const edm::Handle< reco::TrackCollection > &trackh, const MagneticField *magField)
EventNumber_t event() const
Definition: EventID.h:41
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:122
edm::EDGetTokenT< reco::TrackCollection > inputTagTracks_
Reco Tracks used to spot the nuclear interactions.
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:460
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.
const T & get() const
Definition: EventSetup.h:55
edm::EventID id() const
Definition: EventBase.h:60
void findDisplacedVertexCandidates()
-----— Main function which find vertices -----— ///
T const * product() const
Definition: ESHandle.h:86
std::auto_ptr< reco::PFDisplacedVertexCandidateCollection > transferVertexCandidates()
def move(src, dest)
Definition: eostools.py:510

Member Data Documentation

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

Definition at line 43 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 42 of file PFDisplacedVertexCandidateProducer.h.

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

Reco Tracks used to spot the nuclear interactions.

Definition at line 39 of file PFDisplacedVertexCandidateProducer.h.

PFDisplacedVertexCandidateFinder PFDisplacedVertexCandidateProducer::pfDisplacedVertexCandidateFinder_
private

Displaced Vertex Candidates finder.

Definition at line 49 of file PFDisplacedVertexCandidateProducer.h.

bool PFDisplacedVertexCandidateProducer::verbose_
private

verbose ?

Definition at line 46 of file PFDisplacedVertexCandidateProducer.h.