CMS 3D CMS Logo

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

Producer for DisplacedVertices. More...

Inheritance diagram for PFDisplacedVertexCandidateProducer:
edm::stream::EDProducer<>

Public Member Functions

 PFDisplacedVertexCandidateProducer (const edm::ParameterSet &)
 
void produce (edm::Event &, const edm::EventSetup &) override
 
 ~PFDisplacedVertexCandidateProducer () override
 
- Public Member Functions inherited from edm::stream::EDProducer<>
 EDProducer ()=default
 
 EDProducer (const EDProducer &)=delete
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginProcessBlocks () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndProcessBlocks () const final
 
bool hasAbilityToProduceInEndRuns () const final
 
const EDProduceroperator= (const EDProducer &)=delete
 

Private Attributes

edm::EDGetTokenT< reco::BeamSpotinputTagBeamSpot_
 
edm::EDGetTokenT
< reco::VertexCollection
inputTagMainVertex_
 Input tag for main vertex to cut of dxy of secondary tracks. More...
 
edm::EDGetTokenT
< reco::TrackCollection
inputTagTracks_
 Reco Tracks used to spot the nuclear interactions. More...
 
const edm::ESGetToken
< MagneticField,
IdealMagneticFieldRecord
magneticFieldToken_
 
PFDisplacedVertexCandidateFinder pfDisplacedVertexCandidateFinder_
 Displaced Vertex Candidates finder. More...
 
bool verbose_
 verbose ? More...
 

Additional Inherited Members

- Public Types inherited from edm::stream::EDProducer<>
using CacheTypes = CacheContexts< T...>
 
using GlobalCache = typename CacheTypes::GlobalCache
 
using HasAbility = AbilityChecker< T...>
 
using InputProcessBlockCache = typename CacheTypes::InputProcessBlockCache
 
using LuminosityBlockCache = typename CacheTypes::LuminosityBlockCache
 
using LuminosityBlockContext = LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCache >
 
using LuminosityBlockSummaryCache = typename CacheTypes::LuminosityBlockSummaryCache
 
using RunCache = typename CacheTypes::RunCache
 
using RunContext = RunContextT< RunCache, GlobalCache >
 
using RunSummaryCache = typename CacheTypes::RunSummaryCache
 

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 24 of file PFDisplacedVertexCandidateProducer.cc.

Constructor & Destructor Documentation

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

Definition at line 55 of file PFDisplacedVertexCandidateProducer.cc.

References debug, edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), inputTagBeamSpot_, inputTagMainVertex_, inputTagTracks_, pfDisplacedVertexCandidateFinder_, PFDisplacedVertexCandidateFinder::setDebug(), PFDisplacedVertexCandidateFinder::setParameters(), and verbose_.

57  // --- Setup input collection names --- //
58  inputTagTracks_ = consumes<reco::TrackCollection>(iConfig.getParameter<InputTag>("trackCollection"));
59 
60  inputTagMainVertex_ = consumes<reco::VertexCollection>(iConfig.getParameter<InputTag>("mainVertexLabel"));
61 
62  inputTagBeamSpot_ = consumes<reco::BeamSpot>(iConfig.getParameter<InputTag>("offlineBeamSpotLabel"));
63 
64  verbose_ = iConfig.getUntrackedParameter<bool>("verbose");
65 
66  bool debug = iConfig.getUntrackedParameter<bool>("debug");
67 
68  // ------ Algo Parameters ------ //
69 
70  // Distance of minimal approach below which
71  // two tracks are considered as linked together
72  double dcaCut = iConfig.getParameter<double>("dcaCut");
73 
74  // Do not reconstruct vertices wich are
75  // too close to the beam pipe
76  double primaryVertexCut = iConfig.getParameter<double>("primaryVertexCut");
77 
78  //maximum distance between the DCA Point and the inner hit of the track
79  double dcaPInnerHitCut = iConfig.getParameter<double>("dcaPInnerHitCut");
80 
81  edm::ParameterSet ps_trk = iConfig.getParameter<edm::ParameterSet>("tracksSelectorParameters");
82 
83  // Collection to be produced
84  produces<reco::PFDisplacedVertexCandidateCollection>();
85 
86  // Vertex Finder parameters -----------------------------------
88  pfDisplacedVertexCandidateFinder_.setParameters(dcaCut, primaryVertexCut, dcaPInnerHitCut, ps_trk);
89 }
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.
const edm::ESGetToken< MagneticField, IdealMagneticFieldRecord > magneticFieldToken_
#define debug
Definition: HDRShower.cc:19
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
ESGetTokenH3DDVariant esConsumes(std::string const &Reccord, edm::ConsumesCollector &)
Definition: DeDxTools.cc:283
PFDisplacedVertexCandidateProducer::~PFDisplacedVertexCandidateProducer ( )
override

Definition at line 91 of file PFDisplacedVertexCandidateProducer.cc.

91 {}

Member Function Documentation

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

Definition at line 93 of file PFDisplacedVertexCandidateProducer.cc.

References gather_cfg::cout, edm::EventID::event(), PFDisplacedVertexCandidateFinder::findDisplacedVertexCandidates(), edm::Event::getByToken(), edm::EventSetup::getData(), edm::EventBase::id(), inputTagBeamSpot_, inputTagMainVertex_, inputTagTracks_, LogDebug, magneticFieldToken_, eostools::move(), pfDisplacedVertexCandidateFinder_, edm::Event::put(), edm::EventID::run(), PFDisplacedVertexCandidateFinder::setInput(), PFDisplacedVertexCandidateFinder::setPrimaryVertex(), str, HLT_FULL_cff::trackCollection, PFDisplacedVertexCandidateFinder::transferVertexCandidates(), and verbose_.

93  {
94  LogDebug("PFDisplacedVertexCandidateProducer")
95  << "START event: " << iEvent.id().event() << " in run " << iEvent.id().run() << endl;
96 
97  // Prepare and fill useful event information for the Finder
98  auto const& theMagField = &iSetup.getData(magneticFieldToken_);
99 
101  iEvent.getByToken(inputTagTracks_, trackCollection);
102 
103  Handle<reco::VertexCollection> mainVertexHandle;
104  iEvent.getByToken(inputTagMainVertex_, mainVertexHandle);
105 
106  Handle<reco::BeamSpot> beamSpotHandle;
107  iEvent.getByToken(inputTagBeamSpot_, beamSpotHandle);
108 
109  pfDisplacedVertexCandidateFinder_.setPrimaryVertex(mainVertexHandle, beamSpotHandle);
110  pfDisplacedVertexCandidateFinder_.setInput(trackCollection, theMagField);
111 
112  // Run the finder
114 
115  if (verbose_) {
116  ostringstream str;
117  str << pfDisplacedVertexCandidateFinder_ << endl;
119  LogInfo("PFDisplacedVertexCandidateProducer") << str.str() << endl;
120  }
121 
122  std::unique_ptr<reco::PFDisplacedVertexCandidateCollection> pOutputDisplacedVertexCandidateCollection(
124 
125  iEvent.put(std::move(pOutputDisplacedVertexCandidateCollection));
126 
127  LogDebug("PFDisplacedVertexCandidateProducer")
128  << "STOP event: " << iEvent.id().event() << " in run " << iEvent.id().run() << endl;
129 }
RunNumber_t run() const
Definition: EventID.h:38
void setInput(const edm::Handle< reco::TrackCollection > &trackh, const MagneticField *magField)
EventNumber_t event() const
Definition: EventID.h:40
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:133
edm::EDGetTokenT< reco::TrackCollection > inputTagTracks_
Reco Tracks used to spot the nuclear interactions.
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:539
void setPrimaryVertex(edm::Handle< reco::VertexCollection > mainVertexHandle, edm::Handle< reco::BeamSpot > beamSpotHandle)
PFDisplacedVertexCandidateFinder pfDisplacedVertexCandidateFinder_
Displaced Vertex Candidates finder.
bool getData(T &iHolder) const
Definition: EventSetup.h:128
edm::EDGetTokenT< reco::BeamSpot > inputTagBeamSpot_
def move
Definition: eostools.py:511
edm::EDGetTokenT< reco::VertexCollection > inputTagMainVertex_
Input tag for main vertex to cut of dxy of secondary tracks.
Log< level::Info, false > LogInfo
const edm::ESGetToken< MagneticField, IdealMagneticFieldRecord > magneticFieldToken_
tuple trackCollection
edm::EventID id() const
Definition: EventBase.h:59
void findDisplacedVertexCandidates()
-----— Main function which find vertices -----— ///
tuple cout
Definition: gather_cfg.py:144
std::unique_ptr< reco::PFDisplacedVertexCandidateCollection > transferVertexCandidates()
#define str(s)
#define LogDebug(id)

Member Data Documentation

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

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

Definition at line 37 of file PFDisplacedVertexCandidateProducer.cc.

Referenced by PFDisplacedVertexCandidateProducer(), and produce().

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

Reco Tracks used to spot the nuclear interactions.

Definition at line 34 of file PFDisplacedVertexCandidateProducer.cc.

Referenced by PFDisplacedVertexCandidateProducer(), and produce().

const edm::ESGetToken<MagneticField, IdealMagneticFieldRecord> PFDisplacedVertexCandidateProducer::magneticFieldToken_
private

Definition at line 40 of file PFDisplacedVertexCandidateProducer.cc.

Referenced by produce().

PFDisplacedVertexCandidateFinder PFDisplacedVertexCandidateProducer::pfDisplacedVertexCandidateFinder_
private

Displaced Vertex Candidates finder.

Definition at line 46 of file PFDisplacedVertexCandidateProducer.cc.

Referenced by PFDisplacedVertexCandidateProducer(), and produce().

bool PFDisplacedVertexCandidateProducer::verbose_
private

verbose ?

Definition at line 43 of file PFDisplacedVertexCandidateProducer.cc.

Referenced by PFDisplacedVertexCandidateProducer(), and produce().