CMS 3D CMS Logo

PFDisplacedVertexCandidateProducer.cc
Go to the documentation of this file.
7 
8 #include <set>
9 
10 using namespace std;
11 using namespace edm;
12 
14  : magneticFieldToken_(esConsumes()) {
15  // --- Setup input collection names --- //
16  inputTagTracks_ = consumes<reco::TrackCollection>(iConfig.getParameter<InputTag>("trackCollection"));
17 
18  inputTagMainVertex_ = consumes<reco::VertexCollection>(iConfig.getParameter<InputTag>("mainVertexLabel"));
19 
20  inputTagBeamSpot_ = consumes<reco::BeamSpot>(iConfig.getParameter<InputTag>("offlineBeamSpotLabel"));
21 
22  verbose_ = iConfig.getUntrackedParameter<bool>("verbose");
23 
24  bool debug = iConfig.getUntrackedParameter<bool>("debug");
25 
26  // ------ Algo Parameters ------ //
27 
28  // Distance of minimal approach below which
29  // two tracks are considered as linked together
30  double dcaCut = iConfig.getParameter<double>("dcaCut");
31 
32  // Do not reconstruct vertices wich are
33  // too close to the beam pipe
34  double primaryVertexCut = iConfig.getParameter<double>("primaryVertexCut");
35 
36  //maximum distance between the DCA Point and the inner hit of the track
37  double dcaPInnerHitCut = iConfig.getParameter<double>("dcaPInnerHitCut");
38 
39  edm::ParameterSet ps_trk = iConfig.getParameter<edm::ParameterSet>("tracksSelectorParameters");
40 
41  // Collection to be produced
42  produces<reco::PFDisplacedVertexCandidateCollection>();
43 
44  // Vertex Finder parameters -----------------------------------
47 }
48 
50 
52  LogDebug("PFDisplacedVertexCandidateProducer")
53  << "START event: " << iEvent.id().event() << " in run " << iEvent.id().run() << endl;
54 
55  // Prepare and fill useful event information for the Finder
56  auto const& theMagField = &iSetup.getData(magneticFieldToken_);
57 
60 
61  Handle<reco::VertexCollection> mainVertexHandle;
62  iEvent.getByToken(inputTagMainVertex_, mainVertexHandle);
63 
64  Handle<reco::BeamSpot> beamSpotHandle;
65  iEvent.getByToken(inputTagBeamSpot_, beamSpotHandle);
66 
67  pfDisplacedVertexCandidateFinder_.setPrimaryVertex(mainVertexHandle, beamSpotHandle);
69 
70  // Run the finder
72 
73  if (verbose_) {
74  ostringstream str;
77  LogInfo("PFDisplacedVertexCandidateProducer") << str.str() << endl;
78  }
79 
80  std::unique_ptr<reco::PFDisplacedVertexCandidateCollection> pOutputDisplacedVertexCandidateCollection(
82 
83  iEvent.put(std::move(pOutputDisplacedVertexCandidateCollection));
84 
85  LogDebug("PFDisplacedVertexCandidateProducer")
86  << "STOP event: " << iEvent.id().event() << " in run " << iEvent.id().run() << endl;
87 }
MessageLogger.h
PFDisplacedVertexCandidateFinder::setPrimaryVertex
void setPrimaryVertex(edm::Handle< reco::VertexCollection > mainVertexHandle, edm::Handle< reco::BeamSpot > beamSpotHandle)
Definition: PFDisplacedVertexCandidateFinder.cc:32
ESHandle.h
PFDisplacedVertexCandidateFinder::setInput
void setInput(const edm::Handle< reco::TrackCollection > &trackh, const MagneticField *magField)
Definition: PFDisplacedVertexCandidateFinder.cc:49
edm
HLT enums.
Definition: AlignableModifier.h:19
gather_cfg.cout
cout
Definition: gather_cfg.py:144
PFDisplacedVertexCandidateProducer::inputTagTracks_
edm::EDGetTokenT< reco::TrackCollection > inputTagTracks_
Reco Tracks used to spot the nuclear interactions.
Definition: PFDisplacedVertexCandidateProducer.h:37
PFDisplacedVertexCandidateProducer::verbose_
bool verbose_
verbose ?
Definition: PFDisplacedVertexCandidateProducer.h:46
edm::ParameterSet::getUntrackedParameter
T getUntrackedParameter(std::string const &, T const &) const
edm::LogInfo
Log< level::Info, false > LogInfo
Definition: MessageLogger.h:125
PFDisplacedVertexCandidateProducer::pfDisplacedVertexCandidateFinder_
PFDisplacedVertexCandidateFinder pfDisplacedVertexCandidateFinder_
Displaced Vertex Candidates finder.
Definition: PFDisplacedVertexCandidateProducer.h:49
edm::Handle< reco::TrackCollection >
FileInPath.h
PFDisplacedVertexCandidateProducer::inputTagMainVertex_
edm::EDGetTokenT< reco::VertexCollection > inputTagMainVertex_
Input tag for main vertex to cut of dxy of secondary tracks.
Definition: PFDisplacedVertexCandidateProducer.h:40
debug
#define debug
Definition: HDRShower.cc:19
particleFlowDisplacedVertexCandidate_cfi.dcaPInnerHitCut
dcaPInnerHitCut
Definition: particleFlowDisplacedVertexCandidate_cfi.py:24
PFDisplacedVertexCandidateProducer.h
str
#define str(s)
Definition: TestProcessor.cc:52
particleFlowDisplacedVertexCandidate_cfi.dcaCut
dcaCut
Definition: particleFlowDisplacedVertexCandidate_cfi.py:17
PFDisplacedVertexCandidateProducer::produce
void produce(edm::Event &, const edm::EventSetup &) override
Definition: PFDisplacedVertexCandidateProducer.cc:51
PFDisplacedVertexCandidateFinder::setDebug
void setDebug(bool debug)
sets debug printout flag
Definition: PFDisplacedVertexCandidateFinder.h:53
LogDebug
#define LogDebug(id)
Definition: MessageLogger.h:233
PFDisplacedVertexCandidateFinder::setParameters
void setParameters(double dcaCut, double primaryVertexCut, double dcaPInnerHitCut, const edm::ParameterSet &ps_trk)
------— Set different algo parameters ---— ///
Definition: PFDisplacedVertexCandidateFinder.h:42
edm::ParameterSet
Definition: ParameterSet.h:47
PFDisplacedVertexCandidateProducer::inputTagBeamSpot_
edm::EDGetTokenT< reco::BeamSpot > inputTagBeamSpot_
Definition: PFDisplacedVertexCandidateProducer.h:41
duplicaterechits_cfi.trackCollection
trackCollection
Definition: duplicaterechits_cfi.py:4
iEvent
int iEvent
Definition: GenABIO.cc:224
edm::EventSetup
Definition: EventSetup.h:58
edm::EventSetup::getData
bool getData(T &iHolder) const
Definition: EventSetup.h:127
particleFlowDisplacedVertex_cfi.primaryVertexCut
primaryVertexCut
Definition: particleFlowDisplacedVertex_cfi.py:21
PFDisplacedVertexCandidateProducer::magneticFieldToken_
const edm::ESGetToken< MagneticField, IdealMagneticFieldRecord > magneticFieldToken_
Definition: PFDisplacedVertexCandidateProducer.h:43
eostools.move
def move(src, dest)
Definition: eostools.py:511
std
Definition: JetResolutionObject.h:76
PFDisplacedVertexCandidateFinder::transferVertexCandidates
std::unique_ptr< reco::PFDisplacedVertexCandidateCollection > transferVertexCandidates()
Definition: PFDisplacedVertexCandidateFinder.h:60
EventSetup.h
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
Exception.h
PFDisplacedVertexCandidateFinder::findDisplacedVertexCandidates
void findDisplacedVertexCandidates()
-----— Main function which find vertices -----— ///
Definition: PFDisplacedVertexCandidateFinder.cc:81
PFDisplacedVertexCandidateProducer::PFDisplacedVertexCandidateProducer
PFDisplacedVertexCandidateProducer(const edm::ParameterSet &)
Definition: PFDisplacedVertexCandidateProducer.cc:13
PFDisplacedVertexCandidateProducer::~PFDisplacedVertexCandidateProducer
~PFDisplacedVertexCandidateProducer() override
Definition: PFDisplacedVertexCandidateProducer.cc:49
DeDxTools::esConsumes
ESGetTokenH3DDVariant esConsumes(std::string const &Reccord, edm::ConsumesCollector &)
Definition: DeDxTools.cc:283
edm::Event
Definition: Event.h:73
edm::InputTag
Definition: InputTag.h:15