CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
PFDisplacedVertexCandidateProducer.cc
Go to the documentation of this file.
2 
4 
8 
10 
13 
16 
17 #include <set>
18 
19 using namespace std;
20 using namespace edm;
21 
23 
24  // --- Setup input collection names --- //
25  inputTagTracks_
26  = iConfig.getParameter<InputTag>("trackCollection");
27 
28  verbose_ =
29  iConfig.getUntrackedParameter<bool>("verbose");
30 
31  bool debug =
32  iConfig.getUntrackedParameter<bool>("debug");
33 
34  // ------ Algo Parameters ------ //
35 
36  // Distance of minimal approach below which
37  // two tracks are considered as linked together
38  double dcaCut
39  = iConfig.getParameter< double >("dcaCut");
40 
41  // Do not reconstruct vertices wich are
42  // too close to the beam pipe
43  double primaryVertexCut
44  = iConfig.getParameter< double >("primaryVertexCut");
45 
46  //maximum distance between the DCA Point and the inner hit of the track
47  double dcaPInnerHitCut
48  = iConfig.getParameter< double >("dcaPInnerHitCut");
49 
50  edm::ParameterSet ps_trk
51  = iConfig.getParameter<edm::ParameterSet>("tracksSelectorParameters");
52 
53  // Collection to be produced
54  produces<reco::PFDisplacedVertexCandidateCollection>();
55 
56  // Vertex Finder parameters -----------------------------------
57  pfDisplacedVertexCandidateFinder_.setDebug(debug);
58  pfDisplacedVertexCandidateFinder_.setParameters(dcaCut, primaryVertexCut, dcaPInnerHitCut, ps_trk);
59 
60 }
61 
62 
64 
65 
66 
67 void
69 
70 void
72  const edm::EventSetup & es) { }
73 
74 
75 void
77  const EventSetup& iSetup) {
78 
79  LogDebug("PFDisplacedVertexCandidateProducer")<<"START event: "<<iEvent.id().event()
80  <<" in run "<<iEvent.id().run()<<endl;
81 
82  // Prepare and fill useful event information for the Finder
84  iSetup.get<IdealMagneticFieldRecord>().get(magField);
85  const MagneticField* theMagField = magField.product();
86 
88  iEvent.getByLabel(inputTagTracks_, trackCollection);
89 
90  pfDisplacedVertexCandidateFinder_.setInput( trackCollection, theMagField );
91 
92 
93  // Run the finder
94  pfDisplacedVertexCandidateFinder_.findDisplacedVertexCandidates();
95 
96 
97  if(verbose_) {
98  ostringstream str;
99  str<<pfDisplacedVertexCandidateFinder_<<endl;
100  cout << pfDisplacedVertexCandidateFinder_<<endl;
101  LogInfo("PFDisplacedVertexCandidateProducer") << str.str()<<endl;
102  }
103 
104 
105  auto_ptr< reco::PFDisplacedVertexCandidateCollection >
106  pOutputDisplacedVertexCandidateCollection(
107  pfDisplacedVertexCandidateFinder_.transferVertexCandidates() );
108 
109 
110  iEvent.put(pOutputDisplacedVertexCandidateCollection);
111 
112  LogDebug("PFDisplacedVertexCandidateProducer")<<"STOP event: "<<iEvent.id().event()
113  <<" in run "<<iEvent.id().run()<<endl;
114 
115 }
#define LogDebug(id)
RunNumber_t run() const
Definition: EventID.h:42
T getParameter(std::string const &) const
EventNumber_t event() const
Definition: EventID.h:44
T getUntrackedParameter(std::string const &, T const &) const
int iEvent
Definition: GenABIO.cc:243
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:84
virtual void beginRun(edm::Run &r, const edm::EventSetup &c)
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:359
const T & get() const
Definition: EventSetup.h:55
T const * product() const
Definition: ESHandle.h:62
edm::EventID id() const
Definition: EventBase.h:56
tuple cout
Definition: gather_cfg.py:41
#define debug
Definition: MEtoEDMFormat.h:34
virtual void produce(edm::Event &, const edm::EventSetup &)
Definition: Run.h:31