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)
 
virtual std::vector
< TrackingRegion * > 
regions (const edm::Event &ev, const edm::EventSetup &) const
 
virtual ~GlobalTrackingRegionProducerFromBeamSpot ()
 
- Public Member Functions inherited from TrackingRegionProducer
virtual ~TrackingRegionProducer ()
 

Private Attributes

edm::InputTag theBeamSpotTag
 
double theNSigmaZ
 
double theOriginHalfLength
 
double theOriginRadius
 
bool thePrecise
 
double thePtMin
 

Detailed Description

Definition at line 11 of file GlobalTrackingRegionProducerFromBeamSpot.h.

Constructor & Destructor Documentation

GlobalTrackingRegionProducerFromBeamSpot::GlobalTrackingRegionProducerFromBeamSpot ( const edm::ParameterSet cfg)
inline

Definition at line 15 of file GlobalTrackingRegionProducerFromBeamSpot.h.

References edm::hlt::Exception, edm::ParameterSet::existsAs(), edm::ParameterSet::getParameter(), theBeamSpotTag, theNSigmaZ, theOriginHalfLength, theOriginRadius, thePrecise, and thePtMin.

15  {
16 
17  edm::ParameterSet regionPSet = cfg.getParameter<edm::ParameterSet>("RegionPSet");
18  thePtMin = regionPSet.getParameter<double>("ptMin");
19  theOriginRadius = regionPSet.getParameter<double>("originRadius");
20  if (!regionPSet.existsAs<double>("nSigmaZ") && !regionPSet.existsAs<double>("originHalfLength")) {
21  throw cms::Exception("Configuration") << "GlobalTrackingRegionProducerFromBeamSpot: at least one of nSigmaZ, originHalfLength must be present in the cfg.\n";
22  }
23  theNSigmaZ = (regionPSet.existsAs<double>("nSigmaZ") ? regionPSet.getParameter<double>("nSigmaZ") : 0.0);
24  theOriginHalfLength = (regionPSet.existsAs<double>("originHalfLength") ? regionPSet.getParameter<double>("originHalfLength") : 0.0);
25  theBeamSpotTag = regionPSet.getParameter<edm::InputTag>("beamSpot");
26  thePrecise = regionPSet.getParameter<bool>("precise");
27  }
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:187
virtual GlobalTrackingRegionProducerFromBeamSpot::~GlobalTrackingRegionProducerFromBeamSpot ( )
inlinevirtual

Definition at line 29 of file GlobalTrackingRegionProducerFromBeamSpot.h.

29 {}

Member Function Documentation

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

Implements TrackingRegionProducer.

Definition at line 31 of file GlobalTrackingRegionProducerFromBeamSpot.h.

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

Referenced by PhotonConversionTrajectorySeedProducerFromQuadrupletsAlgo::analyze(), and PhotonConversionTrajectorySeedProducerFromSingleLegAlgo::analyze().

31  {
32  std::vector<TrackingRegion* > result;
34  ev.getByLabel( theBeamSpotTag, bsHandle);
35  if(bsHandle.isValid()) {
36 
37  const reco::BeamSpot & bs = *bsHandle;
38 
39  GlobalPoint origin(bs.x0(), bs.y0(), bs.z0());
40 
41  result.push_back( new GlobalTrackingRegion(
43 
44  }
45  return result;
46  }
double z0() const
z coordinate
Definition: BeamSpot.h:69
const T & max(const T &a, const T &b)
tuple result
Definition: query.py:137
bool isValid() const
Definition: HandleBase.h:76
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:361
double sigmaZ() const
sigma z
Definition: BeamSpot.h:81
double y0() const
y coordinate
Definition: BeamSpot.h:67
double x0() const
x coordinate
Definition: BeamSpot.h:65

Member Data Documentation

edm::InputTag GlobalTrackingRegionProducerFromBeamSpot::theBeamSpotTag
private
double GlobalTrackingRegionProducerFromBeamSpot::theNSigmaZ
private
double GlobalTrackingRegionProducerFromBeamSpot::theOriginHalfLength
private
double GlobalTrackingRegionProducerFromBeamSpot::theOriginRadius
private
bool GlobalTrackingRegionProducerFromBeamSpot::thePrecise
private
double GlobalTrackingRegionProducerFromBeamSpot::thePtMin
private