CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Attributes
GlobalTrackingRegionProducerFromBeamSpot Class Reference

#include <GlobalTrackingRegionProducerFromBeamSpot.h>

Inheritance diagram for GlobalTrackingRegionProducerFromBeamSpot:
TrackingRegionProducer

Public Member Functions

 GlobalTrackingRegionProducerFromBeamSpot (const edm::ParameterSet &cfg, edm::ConsumesCollector &&iC)
 
 GlobalTrackingRegionProducerFromBeamSpot (const edm::ParameterSet &cfg, edm::ConsumesCollector &iC)
 
virtual std::vector
< std::unique_ptr
< TrackingRegion > > 
regions (const edm::Event &ev, const edm::EventSetup &) const override
 
virtual ~GlobalTrackingRegionProducerFromBeamSpot ()
 
- Public Member Functions inherited from TrackingRegionProducer
virtual ~TrackingRegionProducer ()
 

Private Attributes

double theNSigmaZ
 
double theOriginHalfLength
 
double theOriginRadius
 
bool thePrecise
 
double thePtMin
 
edm::EDGetTokenT< reco::BeamSpottoken_beamSpot
 

Detailed Description

Definition at line 12 of file GlobalTrackingRegionProducerFromBeamSpot.h.

Constructor & Destructor Documentation

GlobalTrackingRegionProducerFromBeamSpot::GlobalTrackingRegionProducerFromBeamSpot ( const edm::ParameterSet cfg,
edm::ConsumesCollector &&  iC 
)
inline

Definition at line 16 of file GlobalTrackingRegionProducerFromBeamSpot.h.

17  :
19  {}
GlobalTrackingRegionProducerFromBeamSpot(const edm::ParameterSet &cfg, edm::ConsumesCollector &&iC)
GlobalTrackingRegionProducerFromBeamSpot::GlobalTrackingRegionProducerFromBeamSpot ( const edm::ParameterSet cfg,
edm::ConsumesCollector iC 
)
inline

Definition at line 20 of file GlobalTrackingRegionProducerFromBeamSpot.h.

References edm::ConsumesCollector::consumes(), Exception, edm::ParameterSet::existsAs(), edm::ParameterSet::getParameter(), theNSigmaZ, theOriginHalfLength, theOriginRadius, thePrecise, thePtMin, and token_beamSpot.

21  {
22 
23  edm::ParameterSet regionPSet = cfg.getParameter<edm::ParameterSet>("RegionPSet");
24  thePtMin = regionPSet.getParameter<double>("ptMin");
25  theOriginRadius = regionPSet.getParameter<double>("originRadius");
26  if (!regionPSet.existsAs<double>("nSigmaZ") && !regionPSet.existsAs<double>("originHalfLength")) {
27  throw cms::Exception("Configuration") << "GlobalTrackingRegionProducerFromBeamSpot: at least one of nSigmaZ, originHalfLength must be present in the cfg.\n";
28  }
29  theNSigmaZ = (regionPSet.existsAs<double>("nSigmaZ") ? regionPSet.getParameter<double>("nSigmaZ") : 0.0);
30  theOriginHalfLength = (regionPSet.existsAs<double>("originHalfLength") ? regionPSet.getParameter<double>("originHalfLength") : 0.0);
31  token_beamSpot = iC.consumes<reco::BeamSpot>(regionPSet.getParameter<edm::InputTag>("beamSpot"));
32  thePrecise = regionPSet.getParameter<bool>("precise");
33  }
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
T getParameter(std::string const &) const
bool existsAs(std::string const &parameterName, bool trackiness=true) const
checks if a parameter exists as a given type
Definition: ParameterSet.h:186
virtual GlobalTrackingRegionProducerFromBeamSpot::~GlobalTrackingRegionProducerFromBeamSpot ( )
inlinevirtual

Definition at line 35 of file GlobalTrackingRegionProducerFromBeamSpot.h.

35 {}

Member Function Documentation

virtual std::vector<std::unique_ptr<TrackingRegion> > GlobalTrackingRegionProducerFromBeamSpot::regions ( const edm::Event ev,
const edm::EventSetup  
) const
inlineoverridevirtual

Implements TrackingRegionProducer.

Definition at line 37 of file GlobalTrackingRegionProducerFromBeamSpot.h.

References edm::Event::getByToken(), edm::HandleBase::isValid(), bookConverter::max, query::result, reco::BeamSpot::sigmaZ(), theNSigmaZ, theOriginHalfLength, theOriginRadius, thePrecise, thePtMin, token_beamSpot, reco::BeamSpot::x0(), reco::BeamSpot::y0(), and reco::BeamSpot::z0().

37  {
38  std::vector<std::unique_ptr<TrackingRegion> > result;
40  ev.getByToken( token_beamSpot, bsHandle);
41  if(bsHandle.isValid()) {
42 
43  const reco::BeamSpot & bs = *bsHandle;
44 
45  GlobalPoint origin(bs.x0(), bs.y0(), bs.z0());
46 
47  result.push_back( std::make_unique<GlobalTrackingRegion>(
49 
50  }
51  return result;
52  }
double z0() const
z coordinate
Definition: BeamSpot.h:68
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:464
tuple result
Definition: query.py:137
bool isValid() const
Definition: HandleBase.h:75
double sigmaZ() const
sigma z
Definition: BeamSpot.h:80
double y0() const
y coordinate
Definition: BeamSpot.h:66
double x0() const
x coordinate
Definition: BeamSpot.h:64

Member Data Documentation

double GlobalTrackingRegionProducerFromBeamSpot::theNSigmaZ
private
double GlobalTrackingRegionProducerFromBeamSpot::theOriginHalfLength
private
double GlobalTrackingRegionProducerFromBeamSpot::theOriginRadius
private
bool GlobalTrackingRegionProducerFromBeamSpot::thePrecise
private
double GlobalTrackingRegionProducerFromBeamSpot::thePtMin
private
edm::EDGetTokenT<reco::BeamSpot> GlobalTrackingRegionProducerFromBeamSpot::token_beamSpot
private