#include <GlobalTrackingRegionProducerFromBeamSpot.h>
Public Member Functions | |
GlobalTrackingRegionProducerFromBeamSpot (const edm::ParameterSet &cfg) | |
virtual std::vector < TrackingRegion * > | regions (const edm::Event &ev, const edm::EventSetup &) const |
virtual | ~GlobalTrackingRegionProducerFromBeamSpot () |
Private Attributes | |
edm::InputTag | theBeamSpotTag |
double | theNSigmaZ |
double | theOriginHalfLength |
double | theOriginRadius |
bool | thePrecise |
double | thePtMin |
Definition at line 11 of file GlobalTrackingRegionProducerFromBeamSpot.h.
GlobalTrackingRegionProducerFromBeamSpot::GlobalTrackingRegionProducerFromBeamSpot | ( | const edm::ParameterSet & | cfg | ) | [inline] |
Definition at line 15 of file GlobalTrackingRegionProducerFromBeamSpot.h.
References Exception, edm::ParameterSet::existsAs(), edm::ParameterSet::getParameter(), theBeamSpotTag, theNSigmaZ, theOriginHalfLength, theOriginRadius, thePrecise, and thePtMin.
{ edm::ParameterSet regionPSet = cfg.getParameter<edm::ParameterSet>("RegionPSet"); thePtMin = regionPSet.getParameter<double>("ptMin"); theOriginRadius = regionPSet.getParameter<double>("originRadius"); if (!regionPSet.existsAs<double>("nSigmaZ") && !regionPSet.existsAs<double>("originHalfLength")) { throw cms::Exception("Configuration") << "GlobalTrackingRegionProducerFromBeamSpot: at least one of nSigmaZ, originHalfLength must be present in the cfg.\n"; } theNSigmaZ = (regionPSet.existsAs<double>("nSigmaZ") ? regionPSet.getParameter<double>("nSigmaZ") : 0.0); theOriginHalfLength = (regionPSet.existsAs<double>("originHalfLength") ? regionPSet.getParameter<double>("originHalfLength") : 0.0); theBeamSpotTag = regionPSet.getParameter<edm::InputTag>("beamSpot"); thePrecise = regionPSet.getParameter<bool>("precise"); }
virtual GlobalTrackingRegionProducerFromBeamSpot::~GlobalTrackingRegionProducerFromBeamSpot | ( | ) | [inline, virtual] |
Definition at line 29 of file GlobalTrackingRegionProducerFromBeamSpot.h.
{}
virtual std::vector<TrackingRegion* > GlobalTrackingRegionProducerFromBeamSpot::regions | ( | const edm::Event & | ev, |
const edm::EventSetup & | |||
) | const [inline, virtual] |
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().
{ std::vector<TrackingRegion* > result; edm::Handle<reco::BeamSpot> bsHandle; ev.getByLabel( theBeamSpotTag, bsHandle); if(bsHandle.isValid()) { const reco::BeamSpot & bs = *bsHandle; GlobalPoint origin(bs.x0(), bs.y0(), bs.z0()); result.push_back( new GlobalTrackingRegion( thePtMin, origin, theOriginRadius, std::max(theNSigmaZ*bs.sigmaZ(), theOriginHalfLength), thePrecise)); } return result; }
Definition at line 53 of file GlobalTrackingRegionProducerFromBeamSpot.h.
Referenced by GlobalTrackingRegionProducerFromBeamSpot(), and regions().
double GlobalTrackingRegionProducerFromBeamSpot::theNSigmaZ [private] |
Definition at line 52 of file GlobalTrackingRegionProducerFromBeamSpot.h.
Referenced by GlobalTrackingRegionProducerFromBeamSpot(), and regions().
double GlobalTrackingRegionProducerFromBeamSpot::theOriginHalfLength [private] |
Definition at line 51 of file GlobalTrackingRegionProducerFromBeamSpot.h.
Referenced by GlobalTrackingRegionProducerFromBeamSpot(), and regions().
double GlobalTrackingRegionProducerFromBeamSpot::theOriginRadius [private] |
Definition at line 50 of file GlobalTrackingRegionProducerFromBeamSpot.h.
Referenced by GlobalTrackingRegionProducerFromBeamSpot(), and regions().
bool GlobalTrackingRegionProducerFromBeamSpot::thePrecise [private] |
Definition at line 54 of file GlobalTrackingRegionProducerFromBeamSpot.h.
Referenced by GlobalTrackingRegionProducerFromBeamSpot(), and regions().
double GlobalTrackingRegionProducerFromBeamSpot::thePtMin [private] |
Definition at line 49 of file GlobalTrackingRegionProducerFromBeamSpot.h.
Referenced by GlobalTrackingRegionProducerFromBeamSpot(), and regions().