CMS 3D CMS Logo

Public Member Functions | Private Attributes

PFDisplacedVertexCandidateProducer Class Reference

Producer for DisplacedVertices. More...

#include <PFDisplacedVertexCandidateProducer.h>

Inheritance diagram for PFDisplacedVertexCandidateProducer:
edm::EDProducer edm::ProducerBase edm::ProductRegistryHelper

List of all members.

Public Member Functions

virtual void beginJob ()
virtual void beginRun (edm::Run &r, const edm::EventSetup &c)
 PFDisplacedVertexCandidateProducer (const edm::ParameterSet &)
virtual void produce (edm::Event &, const edm::EventSetup &)
 ~PFDisplacedVertexCandidateProducer ()

Private Attributes

edm::InputTag inputTagBeamSpot_
edm::InputTag inputTagMainVertex_
 Input tag for main vertex to cut of dxy of secondary tracks.
edm::InputTag inputTagTracks_
 Reco Tracks used to spot the nuclear interactions.
PFDisplacedVertexCandidateFinder pfDisplacedVertexCandidateFinder_
 Displaced Vertex Candidates finder.
bool verbose_
 verbose ?

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 25 of file PFDisplacedVertexCandidateProducer.h.


Constructor & Destructor Documentation

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

Definition at line 22 of file PFDisplacedVertexCandidateProducer.cc.

References debug, edm::ParameterSet::getParameter(), and edm::ParameterSet::getUntrackedParameter().

                                                                                                     {
  
  // --- Setup input collection names --- //
  inputTagTracks_ 
    = iConfig.getParameter<InputTag>("trackCollection");

  inputTagMainVertex_ 
    = iConfig.getParameter<InputTag>("mainVertexLabel");

  inputTagBeamSpot_ 
    = iConfig.getParameter<InputTag>("offlineBeamSpotLabel");

  verbose_ = 
    iConfig.getUntrackedParameter<bool>("verbose");

  bool debug = 
    iConfig.getUntrackedParameter<bool>("debug");

  // ------ Algo Parameters ------ //

  // Distance of minimal approach below which 
  // two tracks are considered as linked together
  double dcaCut 
    = iConfig.getParameter< double >("dcaCut");   

  // Do not reconstruct vertices wich are 
  // too close to the beam pipe
  double primaryVertexCut
    = iConfig.getParameter< double >("primaryVertexCut");   

  //maximum distance between the DCA Point and the inner hit of the track
  double dcaPInnerHitCut
    = iConfig.getParameter< double >("dcaPInnerHitCut");  

  edm::ParameterSet ps_trk 
    = iConfig.getParameter<edm::ParameterSet>("tracksSelectorParameters");

  // Collection to be produced
  produces<reco::PFDisplacedVertexCandidateCollection>();

  // Vertex Finder parameters  -----------------------------------
  pfDisplacedVertexCandidateFinder_.setDebug(debug);
  pfDisplacedVertexCandidateFinder_.setParameters(dcaCut, primaryVertexCut, dcaPInnerHitCut, ps_trk);
     
}
PFDisplacedVertexCandidateProducer::~PFDisplacedVertexCandidateProducer ( )

Definition at line 69 of file PFDisplacedVertexCandidateProducer.cc.

{ }

Member Function Documentation

void PFDisplacedVertexCandidateProducer::beginJob ( void  ) [virtual]

Reimplemented from edm::EDProducer.

Definition at line 74 of file PFDisplacedVertexCandidateProducer.cc.

{ }
void PFDisplacedVertexCandidateProducer::beginRun ( edm::Run r,
const edm::EventSetup c 
) [virtual]

Reimplemented from edm::EDProducer.

Definition at line 77 of file PFDisplacedVertexCandidateProducer.cc.

                                                    { }
void PFDisplacedVertexCandidateProducer::produce ( edm::Event iEvent,
const edm::EventSetup iSetup 
) [virtual]

Implements edm::EDProducer.

Definition at line 82 of file PFDisplacedVertexCandidateProducer.cc.

References gather_cfg::cout, edm::EventID::event(), edm::EventSetup::get(), edm::Event::getByLabel(), edm::EventBase::id(), LogDebug, edm::ESHandle< T >::product(), edm::Event::put(), and edm::EventID::run().

                                                   {
  
  LogDebug("PFDisplacedVertexCandidateProducer")<<"START event: "<<iEvent.id().event()
                             <<" in run "<<iEvent.id().run()<<endl;
  
  // Prepare and fill useful event information for the Finder
  edm::ESHandle<MagneticField> magField;
  iSetup.get<IdealMagneticFieldRecord>().get(magField);
  const MagneticField* theMagField = magField.product();

  Handle <reco::TrackCollection> trackCollection;
  iEvent.getByLabel(inputTagTracks_, trackCollection);
    
  Handle< reco::VertexCollection > mainVertexHandle;
  iEvent.getByLabel(inputTagMainVertex_, mainVertexHandle);

  Handle< reco::BeamSpot > beamSpotHandle;
  iEvent.getByLabel(inputTagBeamSpot_, beamSpotHandle);

  pfDisplacedVertexCandidateFinder_.setInput( trackCollection, theMagField );
  pfDisplacedVertexCandidateFinder_.setPrimaryVertex(mainVertexHandle, beamSpotHandle);


  // Run the finder
  pfDisplacedVertexCandidateFinder_.findDisplacedVertexCandidates();
  

  if(verbose_) {
    ostringstream  str;
    str<<pfDisplacedVertexCandidateFinder_<<endl;
    cout << pfDisplacedVertexCandidateFinder_<<endl;
    LogInfo("PFDisplacedVertexCandidateProducer") << str.str()<<endl;
  }    


  auto_ptr< reco::PFDisplacedVertexCandidateCollection > 
    pOutputDisplacedVertexCandidateCollection(
      pfDisplacedVertexCandidateFinder_.transferVertexCandidates() ); 
  
  
  iEvent.put(pOutputDisplacedVertexCandidateCollection);
 
  LogDebug("PFDisplacedVertexCandidateProducer")<<"STOP event: "<<iEvent.id().event()
                             <<" in run "<<iEvent.id().run()<<endl;

}

Member Data Documentation

Definition at line 45 of file PFDisplacedVertexCandidateProducer.h.

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

Definition at line 44 of file PFDisplacedVertexCandidateProducer.h.

Reco Tracks used to spot the nuclear interactions.

Definition at line 41 of file PFDisplacedVertexCandidateProducer.h.

Displaced Vertex Candidates finder.

Definition at line 51 of file PFDisplacedVertexCandidateProducer.h.

verbose ?

Definition at line 48 of file PFDisplacedVertexCandidateProducer.h.