Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:28:57

0001 #ifndef RecoTracker_TkTrackingRegions_VertexBeamspotOrigins_h
0002 #define RecoTracker_TkTrackingRegions_VertexBeamspotOrigins_h
0003 
0004 #include "FWCore/Framework/interface/Event.h"
0005 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0006 #include "FWCore/ParameterSet/interface/ParameterSetDescription.h"
0007 #include "FWCore/Framework/interface/ConsumesCollector.h"
0008 #include "DataFormats/BeamSpot/interface/BeamSpot.h"
0009 #include "DataFormats/VertexReco/interface/Vertex.h"
0010 #include "DataFormats/VertexReco/interface/VertexFwd.h"
0011 
0012 #include <vector>
0013 #include <utility>
0014 
0015 class VertexBeamspotOrigins {
0016 public:
0017   using Origins = std::vector<std::pair<GlobalPoint, float> >;  // (origin, half-length in z)
0018   enum class OperationMode { BEAM_SPOT_FIXED, BEAM_SPOT_SIGMA, VERTICES_FIXED, VERTICES_SIGMA };
0019 
0020   VertexBeamspotOrigins(const edm::ParameterSet& regPSet, edm::ConsumesCollector&& iC)
0021       : VertexBeamspotOrigins(regPSet, iC) {}
0022   VertexBeamspotOrigins(const edm::ParameterSet& regPSet, edm::ConsumesCollector& iC);
0023   ~VertexBeamspotOrigins() = default;
0024 
0025   static void fillDescriptions(edm::ParameterSetDescription& desc,
0026                                const std::string& defaultBeamSpot = "offlineBeamSpot",
0027                                const std::string& defaultVertex = "firstStepPrimaryVertices",
0028                                int defaultMaxVertices = -1);
0029 
0030   Origins origins(const edm::Event& iEvent) const;
0031 
0032 private:
0033   OperationMode m_operationMode;
0034 
0035   edm::EDGetTokenT<reco::VertexCollection> token_vertex;
0036   edm::EDGetTokenT<reco::BeamSpot> token_beamSpot;
0037 
0038   int m_maxNVertices;
0039 
0040   float m_nSigmaZBeamSpot;
0041   float m_zErrorBeamSpot;
0042   float m_nSigmaZVertex;
0043   float m_zErrorVertex;
0044 };
0045 
0046 #endif