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
GlobalTrackingRegionWithVerticesProducer Class Reference

#include <GlobalTrackingRegionWithVerticesProducer.h>

Inheritance diagram for GlobalTrackingRegionWithVerticesProducer:
TrackingRegionProducer

Public Member Functions

 GlobalTrackingRegionWithVerticesProducer (const edm::ParameterSet &cfg)
 
virtual std::vector
< TrackingRegion * > 
regions (const edm::Event &ev, const edm::EventSetup &) const
 
virtual ~GlobalTrackingRegionWithVerticesProducer ()
 
- Public Member Functions inherited from TrackingRegionProducer
virtual ~TrackingRegionProducer ()
 

Private Attributes

edm::InputTag theBeamSpotTag
 
double theFixedError
 
double theNSigmaZ
 
double theOriginRadius
 
bool thePrecise
 
double thePtMin
 
double theSigmaZVertex
 
bool theUseFixedError
 
bool theUseFoundVertices
 
edm::InputTag vertexCollName
 

Detailed Description

Definition at line 14 of file GlobalTrackingRegionWithVerticesProducer.h.

Constructor & Destructor Documentation

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

Definition at line 18 of file GlobalTrackingRegionWithVerticesProducer.h.

References edm::ParameterSet::getParameter(), theBeamSpotTag, theFixedError, theNSigmaZ, theOriginRadius, thePrecise, thePtMin, theSigmaZVertex, theUseFixedError, theUseFoundVertices, and vertexCollName.

19  {
20  edm::ParameterSet regionPSet = cfg.getParameter<edm::ParameterSet>("RegionPSet");
21 
22  thePtMin = regionPSet.getParameter<double>("ptMin");
23  theOriginRadius = regionPSet.getParameter<double>("originRadius");
24  theNSigmaZ = regionPSet.getParameter<double>("nSigmaZ");
25  theBeamSpotTag = regionPSet.getParameter<edm::InputTag>("beamSpot");
26  thePrecise = regionPSet.getParameter<bool>("precise");
27 
28  theSigmaZVertex = regionPSet.getParameter<double>("sigmaZVertex");
29  theFixedError = regionPSet.getParameter<double>("fixedError");
30 
31  theUseFoundVertices = regionPSet.getParameter<bool>("useFoundVertices");
32  theUseFixedError = regionPSet.getParameter<bool>("useFixedError");
33  vertexCollName = regionPSet.getParameter<edm::InputTag>("VertexCollection");
34  }
T getParameter(std::string const &) const
virtual GlobalTrackingRegionWithVerticesProducer::~GlobalTrackingRegionWithVerticesProducer ( )
inlinevirtual

Definition at line 36 of file GlobalTrackingRegionWithVerticesProducer.h.

36 {}

Member Function Documentation

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

Implements TrackingRegionProducer.

Definition at line 39 of file GlobalTrackingRegionWithVerticesProducer.h.

References edm::hlt::Exception, edm::Event::getByLabel(), edm::HandleBase::isValid(), query::result, reco::BeamSpot::sigmaZ(), theBeamSpotTag, theFixedError, theNSigmaZ, theOriginRadius, thePrecise, thePtMin, theSigmaZVertex, theUseFixedError, theUseFoundVertices, GoodVertex_cfg::vertexCollection, vertexCollName, reco::BeamSpot::x0(), reco::BeamSpot::y0(), and reco::BeamSpot::z0().

40  {
41  std::vector<TrackingRegion* > result;
42 
43  GlobalPoint theOrigin;
45  ev.getByLabel( theBeamSpotTag, bsHandle);
46  double bsSigmaZ;
47  if(bsHandle.isValid()) {
48  const reco::BeamSpot & bs = *bsHandle;
49  bsSigmaZ = theNSigmaZ*bs.sigmaZ();
50  theOrigin = GlobalPoint(bs.x0(), bs.y0(), bs.z0());
51  }else{
52  throw cms::Exception("Seeding") << "ERROR: input beamSpot is not valid in GlobalTrackingRegionWithVertices";
53  }
54 
56  {
58  ev.getByLabel(vertexCollName,vertexCollection);
59 
60  for(reco::VertexCollection::const_iterator iV=vertexCollection->begin(); iV != vertexCollection->end() ; iV++) {
61  if (iV->isFake() || !iV->isValid()) continue;
62  GlobalPoint theOrigin_ = GlobalPoint(iV->x(),iV->y(),iV->z());
63  double theOriginHalfLength_ = (theUseFixedError ? theFixedError : (iV->zError())*theSigmaZVertex);
64  result.push_back( new GlobalTrackingRegion(thePtMin, theOrigin_, theOriginRadius, theOriginHalfLength_, thePrecise) );
65  }
66 
67  if (result.empty()) {
68  result.push_back( new GlobalTrackingRegion(thePtMin, theOrigin, theOriginRadius, bsSigmaZ, thePrecise) );
69  }
70  }
71  else
72  {
73  result.push_back(
74  new GlobalTrackingRegion(thePtMin, theOrigin, theOriginRadius, bsSigmaZ, thePrecise) );
75  }
76 
77  return result;
78  }
double z0() const
z coordinate
Definition: BeamSpot.h:69
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
tuple vertexCollection
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 GlobalTrackingRegionWithVerticesProducer::theBeamSpotTag
private
double GlobalTrackingRegionWithVerticesProducer::theFixedError
private
double GlobalTrackingRegionWithVerticesProducer::theNSigmaZ
private
double GlobalTrackingRegionWithVerticesProducer::theOriginRadius
private
bool GlobalTrackingRegionWithVerticesProducer::thePrecise
private
double GlobalTrackingRegionWithVerticesProducer::thePtMin
private
double GlobalTrackingRegionWithVerticesProducer::theSigmaZVertex
private
bool GlobalTrackingRegionWithVerticesProducer::theUseFixedError
private
bool GlobalTrackingRegionWithVerticesProducer::theUseFoundVertices
private
edm::InputTag GlobalTrackingRegionWithVerticesProducer::vertexCollName
private