CMS 3D CMS Logo

List of all members | Public Member Functions | Static 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
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 

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...
 
const edm::ESGetToken< MagneticField, IdealMagneticFieldRecordmagneticFieldToken_
 
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::PFDisplacedVertexCandidateProducer ( const edm::ParameterSet iConfig)
explicit

Definition at line 95 of file PFDisplacedVertexCandidateProducer.cc.

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

97  // --- Setup input collection names --- //
98  inputTagTracks_ = consumes<reco::TrackCollection>(iConfig.getParameter<InputTag>("trackCollection"));
99 
100  inputTagMainVertex_ = consumes<reco::VertexCollection>(iConfig.getParameter<InputTag>("mainVertexLabel"));
101 
102  inputTagBeamSpot_ = consumes<reco::BeamSpot>(iConfig.getParameter<InputTag>("offlineBeamSpotLabel"));
103 
104  verbose_ = iConfig.getUntrackedParameter<bool>("verbose");
105 
106  bool debug = iConfig.getUntrackedParameter<bool>("debug");
107 
108  // ------ Algo Parameters ------ //
109 
110  // Distance of minimal approach below which
111  // two tracks are considered as linked together
112  double dcaCut = iConfig.getParameter<double>("dcaCut");
113 
114  // Do not reconstruct vertices wich are
115  // too close to the beam pipe
116  double primaryVertexCut = iConfig.getParameter<double>("primaryVertexCut");
117 
118  //maximum distance between the DCA Point and the inner hit of the track
119  double dcaPInnerHitCut = iConfig.getParameter<double>("dcaPInnerHitCut");
120 
121  edm::ParameterSet ps_trk = iConfig.getParameter<edm::ParameterSet>("tracksSelectorParameters");
122 
123  // Collection to be produced
124  produces<reco::PFDisplacedVertexCandidateCollection>();
125 
126  // Vertex Finder parameters -----------------------------------
128  pfDisplacedVertexCandidateFinder_.setParameters(dcaCut, primaryVertexCut, dcaPInnerHitCut, ps_trk);
129 }
ESGetTokenH3DDVariant esConsumes(std::string const &Record, edm::ConsumesCollector &)
Definition: DeDxTools.cc:283
T getParameter(std::string const &) const
Definition: ParameterSet.h:307
edm::EDGetTokenT< reco::TrackCollection > inputTagTracks_
Reco Tracks used to spot the nuclear interactions.
PFDisplacedVertexCandidateFinder pfDisplacedVertexCandidateFinder_
Displaced Vertex Candidates finder.
T getUntrackedParameter(std::string const &, T const &) const
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

◆ ~PFDisplacedVertexCandidateProducer()

PFDisplacedVertexCandidateProducer::~PFDisplacedVertexCandidateProducer ( )
override

Definition at line 131 of file PFDisplacedVertexCandidateProducer.cc.

131 {}

Member Function Documentation

◆ fillDescriptions()

void PFDisplacedVertexCandidateProducer::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 53 of file PFDisplacedVertexCandidateProducer.cc.

References edm::ConfigurationDescriptions::add(), submitPVResolutionJobs::desc, and muonDTDigis_cfi::pset.

53  {
55  // The track collection use for the fitting. May be any collection.
56  // The only condition is that it shall contain the hit pattern information
57  desc.add<edm::InputTag>("trackCollection", {"generalTracks"});
58  // verbosity
59  desc.addUntracked<bool>("verbose", false);
60  // Debug flag
61  desc.addUntracked<bool>("debug", false);
62  // maximum dca distance for two tracks to be linked
63  desc.add<double>("dcaCut", 0.5);
64  // minimum distance of secondary vertex with respect to the primary
65  desc.add<double>("primaryVertexCut", 1.8);
66  // maximum distance between the DCA Point and the inner hit of the track
67  // not used for the moment
68  desc.add<double>("dcaPInnerHitCut", 1000.0);
69  // Primary vertex information used for dxy calculation
70  desc.add<edm::InputTag>("mainVertexLabel", {"offlinePrimaryVertices", ""});
71  desc.add<edm::InputTag>("offlineBeamSpotLabel", {"offlineBeamSpot", ""});
72  // Tracks preselection to reduce the combinatorics in PFDisplacedVertexCandidates
73  // this cuts are repeated then in a smarter way in the PFDisplacedVertexFinder
74  // be sure you are consistent between them.
75  {
77  // selection parameters for secondary tracks
78  pset.add<double>("nChi2_max", 5.);
79  pset.add<double>("pt_min", 0.2);
80  // if the tracks is not a good candidate to be a secondary (dxy cut) restrict in minimal pt
81  // this cut reduce drastically the combinatorics. It is very useful to reduce the
82  // PFDisplacedVertex timing
83  pset.add<double>("pt_min_prim", 0.8);
84  pset.add<double>("dxy", 0.2);
85  pset.add<double>("qoverpError_max", 1.0e+7);
86 
87  desc.add<edm::ParameterSetDescription>("tracksSelectorParameters", pset);
88  }
89  descriptions.add("particleFlowDisplacedVertexCandidate", desc);
90 }
void add(std::string const &label, ParameterSetDescription const &psetDescription)

◆ produce()

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

Definition at line 133 of file PFDisplacedVertexCandidateProducer.cc.

References gather_cfg::cout, PFDisplacedVertexCandidateFinder::findDisplacedVertexCandidates(), edm::EventSetup::getData(), iEvent, inputTagBeamSpot_, inputTagMainVertex_, inputTagTracks_, LogDebug, magneticFieldToken_, eostools::move(), pfDisplacedVertexCandidateFinder_, PFDisplacedVertexCandidateFinder::setInput(), PFDisplacedVertexCandidateFinder::setPrimaryVertex(), str, JetHT_cfg::trackCollection, PFDisplacedVertexCandidateFinder::transferVertexCandidates(), and verbose_.

133  {
134  LogDebug("PFDisplacedVertexCandidateProducer")
135  << "START event: " << iEvent.id().event() << " in run " << iEvent.id().run() << endl;
136 
137  // Prepare and fill useful event information for the Finder
138  auto const& theMagField = &iSetup.getData(magneticFieldToken_);
139 
142 
143  Handle<reco::VertexCollection> mainVertexHandle;
144  iEvent.getByToken(inputTagMainVertex_, mainVertexHandle);
145 
146  Handle<reco::BeamSpot> beamSpotHandle;
147  iEvent.getByToken(inputTagBeamSpot_, beamSpotHandle);
148 
149  pfDisplacedVertexCandidateFinder_.setPrimaryVertex(mainVertexHandle, beamSpotHandle);
151 
152  // Run the finder
154 
155  if (verbose_) {
156  ostringstream str;
159  LogInfo("PFDisplacedVertexCandidateProducer") << str.str() << endl;
160  }
161 
162  std::unique_ptr<reco::PFDisplacedVertexCandidateCollection> pOutputDisplacedVertexCandidateCollection(
164 
165  iEvent.put(std::move(pOutputDisplacedVertexCandidateCollection));
166 
167  LogDebug("PFDisplacedVertexCandidateProducer")
168  << "STOP event: " << iEvent.id().event() << " in run " << iEvent.id().run() << endl;
169 }
void setInput(const edm::Handle< reco::TrackCollection > &trackh, const MagneticField *magField)
T const & getData(const ESGetToken< T, R > &iToken) const noexcept(false)
Definition: EventSetup.h:119
edm::EDGetTokenT< reco::TrackCollection > inputTagTracks_
Reco Tracks used to spot the nuclear interactions.
void setPrimaryVertex(edm::Handle< reco::VertexCollection > mainVertexHandle, edm::Handle< reco::BeamSpot > beamSpotHandle)
PFDisplacedVertexCandidateFinder pfDisplacedVertexCandidateFinder_
Displaced Vertex Candidates finder.
edm::EDGetTokenT< reco::BeamSpot > inputTagBeamSpot_
int iEvent
Definition: GenABIO.cc:224
edm::EDGetTokenT< reco::VertexCollection > inputTagMainVertex_
Input tag for main vertex to cut of dxy of secondary tracks.
trackCollection
Definition: JetHT_cfg.py:51
Log< level::Info, false > LogInfo
const edm::ESGetToken< MagneticField, IdealMagneticFieldRecord > magneticFieldToken_
void findDisplacedVertexCandidates()
-----— Main function which find vertices -----— ///
std::unique_ptr< reco::PFDisplacedVertexCandidateCollection > transferVertexCandidates()
#define str(s)
def move(src, dest)
Definition: eostools.py:511
#define LogDebug(id)

Member Data Documentation

◆ inputTagBeamSpot_

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

◆ inputTagMainVertex_

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

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

Definition at line 38 of file PFDisplacedVertexCandidateProducer.cc.

Referenced by PFDisplacedVertexCandidateProducer(), and produce().

◆ inputTagTracks_

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

Reco Tracks used to spot the nuclear interactions.

Definition at line 35 of file PFDisplacedVertexCandidateProducer.cc.

Referenced by PFDisplacedVertexCandidateProducer(), and produce().

◆ magneticFieldToken_

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

Definition at line 41 of file PFDisplacedVertexCandidateProducer.cc.

Referenced by produce().

◆ pfDisplacedVertexCandidateFinder_

PFDisplacedVertexCandidateFinder PFDisplacedVertexCandidateProducer::pfDisplacedVertexCandidateFinder_
private

Displaced Vertex Candidates finder.

Definition at line 47 of file PFDisplacedVertexCandidateProducer.cc.

Referenced by PFDisplacedVertexCandidateProducer(), and produce().

◆ verbose_

bool PFDisplacedVertexCandidateProducer::verbose_
private

verbose ?

Definition at line 44 of file PFDisplacedVertexCandidateProducer.cc.

Referenced by PFDisplacedVertexCandidateProducer(), and produce().