Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-03-12 06:21:58

0001 // -*- C++ -*-
0002 //
0003 // Package:    PrimaryVertexProducer
0004 // Class:      PrimaryVertexProducer
0005 //
0006 /**\class PrimaryVertexProducer PrimaryVertexProducer.cc RecoVertex/PrimaryVertexProducer/src/PrimaryVertexProducer.cc
0007 
0008  Description: steers tracker primary vertex reconstruction and storage
0009 
0010  Implementation:
0011      <Notes on implementation>
0012 */
0013 //
0014 // Original Author:  Pascal Vanlaer
0015 //         Created:  Tue Feb 28 11:06:34 CET 2006
0016 //
0017 //
0018 
0019 // system include files
0020 #include <memory>
0021 
0022 // user include files
0023 #include "FWCore/Framework/interface/Frameworkfwd.h"
0024 #include "FWCore/Framework/interface/stream/EDProducer.h"
0025 
0026 #include "FWCore/Framework/interface/Event.h"
0027 #include "FWCore/Framework/interface/EventSetup.h"
0028 
0029 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0030 
0031 //#include "RecoVertex/PrimaryVertexProducer/interface/PrimaryVertexProducerAlgorithm.h"
0032 #include "TrackingTools/TransientTrack/interface/TransientTrack.h"
0033 #include "TrackingTools/TransientTrack/interface/TransientTrackBuilder.h"
0034 #include "TrackingTools/Records/interface/TransientTrackRecord.h"
0035 #include "RecoVertex/PrimaryVertexProducer/interface/TrackFilterForPVFindingBase.h"
0036 #include "RecoVertex/PrimaryVertexProducer/interface/TrackClusterizerInZ.h"
0037 #include "RecoVertex/PrimaryVertexProducer/interface/DAClusterizerInZ_vect.h"
0038 #include "RecoVertex/PrimaryVertexProducer/interface/DAClusterizerInZT_vect.h"
0039 
0040 #include "RecoVertex/PrimaryVertexProducer/interface/TrackFilterForPVFinding.h"
0041 #include "RecoVertex/PrimaryVertexProducer/interface/HITrackFilterForPVFinding.h"
0042 #include "RecoVertex/PrimaryVertexProducer/interface/GapClusterizerInZ.h"
0043 #include "RecoVertex/PrimaryVertexProducer/interface/DAClusterizerInZ.h"
0044 #include "RecoVertex/KalmanVertexFit/interface/KalmanVertexFitter.h"
0045 #include "RecoVertex/AdaptiveVertexFit/interface/AdaptiveVertexFitter.h"
0046 //#include "RecoVertex/VertexTools/interface/VertexDistanceXY.h"
0047 #include "RecoVertex/VertexPrimitives/interface/VertexException.h"
0048 #include <algorithm>
0049 #include "RecoVertex/PrimaryVertexProducer/interface/VertexHigherPtSquared.h"
0050 #include "RecoVertex/VertexTools/interface/VertexCompatibleWithBeam.h"
0051 #include "DataFormats/Common/interface/ValueMap.h"
0052 //
0053 // class declaration
0054 //
0055 
0056 class PrimaryVertexProducer : public edm::stream::EDProducer<> {
0057 public:
0058   PrimaryVertexProducer(const edm::ParameterSet&);
0059   ~PrimaryVertexProducer() override;
0060 
0061   void produce(edm::Event&, const edm::EventSetup&) override;
0062 
0063   static void fillDescriptions(edm::ConfigurationDescriptions& descriptions);
0064 
0065   // access to config
0066   edm::ParameterSet config() const { return theConfig; }
0067 
0068 private:
0069   // ----------member data ---------------------------
0070   const edm::ESGetToken<TransientTrackBuilder, TransientTrackRecord> theTTBToken;
0071 
0072   TrackFilterForPVFindingBase* theTrackFilter;
0073   TrackClusterizerInZ* theTrackClusterizer;
0074 
0075   // vtx fitting algorithms
0076   struct algo {
0077     VertexFitter<5>* fitter;
0078     VertexCompatibleWithBeam* vertexSelector;
0079     std::string label;
0080     bool useBeamConstraint;
0081     double minNdof;
0082   };
0083 
0084   std::vector<algo> algorithms;
0085 
0086   edm::ParameterSet theConfig;
0087   bool fVerbose;
0088 
0089   bool fRecoveryIteration;
0090   edm::EDGetTokenT<reco::VertexCollection> recoveryVtxToken;
0091 
0092   edm::EDGetTokenT<reco::BeamSpot> bsToken;
0093   edm::EDGetTokenT<reco::TrackCollection> trkToken;
0094   edm::EDGetTokenT<edm::ValueMap<float> > trkTimesToken;
0095   edm::EDGetTokenT<edm::ValueMap<float> > trkTimeResosToken;
0096 
0097   bool f4D;
0098 };