CMS 3D CMS Logo

GlobalTrackingRegionWithVerticesProducer Class Reference

#include <RecoTracker/TkTrackingRegions/plugins/GlobalTrackingRegionWithVerticesProducer.h>

Inheritance diagram for GlobalTrackingRegionWithVerticesProducer:

TrackingRegionProducer

List of all members.

Public Member Functions

 GlobalTrackingRegionWithVerticesProducer (const edm::ParameterSet &cfg)
virtual std::vector
< TrackingRegion * > 
regions (const edm::Event &ev, const edm::EventSetup &) const
virtual ~GlobalTrackingRegionWithVerticesProducer ()

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.

00019   { 
00020     edm::ParameterSet regionPSet = cfg.getParameter<edm::ParameterSet>("RegionPSet");
00021 
00022     thePtMin            = regionPSet.getParameter<double>("ptMin");
00023     theOriginRadius     = regionPSet.getParameter<double>("originRadius");
00024     theNSigmaZ          = regionPSet.getParameter<double>("nSigmaZ");
00025     theBeamSpotTag      = regionPSet.getParameter<edm::InputTag>("beamSpot");
00026     thePrecise          = regionPSet.getParameter<bool>("precise"); 
00027 
00028     theSigmaZVertex     = regionPSet.getParameter<double>("sigmaZVertex");
00029     theFixedError       = regionPSet.getParameter<double>("fixedError");
00030 
00031     theUseFoundVertices = regionPSet.getParameter<bool>("useFoundVertices");
00032     theUseFixedError    = regionPSet.getParameter<bool>("useFixedError");
00033     vertexCollName      = regionPSet.getParameter<edm::InputTag>("VertexCollection");
00034   }   

virtual GlobalTrackingRegionWithVerticesProducer::~GlobalTrackingRegionWithVerticesProducer (  )  [inline, virtual]

Definition at line 36 of file GlobalTrackingRegionWithVerticesProducer.h.

00036 {}


Member Function Documentation

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

Implements TrackingRegionProducer.

Definition at line 39 of file GlobalTrackingRegionWithVerticesProducer.h.

References Exception, edm::Event::getByLabel(), edm::Handle< T >::isValid(), HLT_VtxMuL3::result, reco::BeamSpot::sigmaZ(), theBeamSpotTag, theFixedError, theNSigmaZ, theOriginRadius, thePrecise, thePtMin, theSigmaZVertex, theUseFixedError, theUseFoundVertices, vertexCollName, reco::BeamSpot::x0(), reco::BeamSpot::y0(), and reco::BeamSpot::z0().

00040   {
00041     std::vector<TrackingRegion* > result;
00042 
00043     GlobalPoint theOrigin;
00044     edm::Handle<reco::BeamSpot> bsHandle;
00045     ev.getByLabel( theBeamSpotTag, bsHandle);
00046     double bsSigmaZ;
00047     if(bsHandle.isValid()) {
00048       const reco::BeamSpot & bs = *bsHandle; 
00049       bsSigmaZ = theNSigmaZ*bs.sigmaZ();
00050       theOrigin = GlobalPoint(bs.x0(), bs.y0(), bs.z0());
00051     }else{
00052       throw cms::Exception("Seeding") << "ERROR: input beamSpot is not valid in GlobalTrackingRegionWithVertices";
00053     }
00054 
00055     if(theUseFoundVertices)
00056     {
00057       edm::Handle<reco::VertexCollection> vertexCollection;
00058       ev.getByLabel(vertexCollName,vertexCollection);
00059 
00060       if(vertexCollection->size() > 0) {
00061         for(reco::VertexCollection::const_iterator iV=vertexCollection->begin(); iV != vertexCollection->end() ; iV++) {
00062           GlobalPoint theOrigin_       = GlobalPoint(iV->x(),iV->y(),iV->z());
00063           double theOriginHalfLength_; 
00064           if(!theUseFixedError) {
00065             theOriginHalfLength_ = (iV->zError())*theSigmaZVertex; 
00066           }
00067           if(theUseFixedError) {
00068             theOriginHalfLength_ = theFixedError;
00069           }
00070           result.push_back( new GlobalTrackingRegion(thePtMin, theOrigin_, theOriginRadius, theOriginHalfLength_, thePrecise) );
00071         }
00072       }
00073       
00074       else {
00075         result.push_back( new GlobalTrackingRegion(thePtMin, theOrigin, theOriginRadius, bsSigmaZ, thePrecise) );
00076       }
00077     }
00078     else
00079     {
00080       result.push_back(
00081         new GlobalTrackingRegion(thePtMin, theOrigin, theOriginRadius, bsSigmaZ, thePrecise) );
00082     }
00083 
00084     return result;
00085   }


Member Data Documentation

edm::InputTag GlobalTrackingRegionWithVerticesProducer::theBeamSpotTag [private]

Definition at line 91 of file GlobalTrackingRegionWithVerticesProducer.h.

Referenced by GlobalTrackingRegionWithVerticesProducer(), and regions().

double GlobalTrackingRegionWithVerticesProducer::theFixedError [private]

Definition at line 94 of file GlobalTrackingRegionWithVerticesProducer.h.

Referenced by GlobalTrackingRegionWithVerticesProducer(), and regions().

double GlobalTrackingRegionWithVerticesProducer::theNSigmaZ [private]

Definition at line 90 of file GlobalTrackingRegionWithVerticesProducer.h.

Referenced by GlobalTrackingRegionWithVerticesProducer(), and regions().

double GlobalTrackingRegionWithVerticesProducer::theOriginRadius [private]

Definition at line 89 of file GlobalTrackingRegionWithVerticesProducer.h.

Referenced by GlobalTrackingRegionWithVerticesProducer(), and regions().

bool GlobalTrackingRegionWithVerticesProducer::thePrecise [private]

Definition at line 95 of file GlobalTrackingRegionWithVerticesProducer.h.

Referenced by GlobalTrackingRegionWithVerticesProducer(), and regions().

double GlobalTrackingRegionWithVerticesProducer::thePtMin [private]

Definition at line 88 of file GlobalTrackingRegionWithVerticesProducer.h.

Referenced by GlobalTrackingRegionWithVerticesProducer(), and regions().

double GlobalTrackingRegionWithVerticesProducer::theSigmaZVertex [private]

Definition at line 93 of file GlobalTrackingRegionWithVerticesProducer.h.

Referenced by GlobalTrackingRegionWithVerticesProducer(), and regions().

bool GlobalTrackingRegionWithVerticesProducer::theUseFixedError [private]

Definition at line 98 of file GlobalTrackingRegionWithVerticesProducer.h.

Referenced by GlobalTrackingRegionWithVerticesProducer(), and regions().

bool GlobalTrackingRegionWithVerticesProducer::theUseFoundVertices [private]

Definition at line 97 of file GlobalTrackingRegionWithVerticesProducer.h.

Referenced by GlobalTrackingRegionWithVerticesProducer(), and regions().

edm::InputTag GlobalTrackingRegionWithVerticesProducer::vertexCollName [private]

Definition at line 99 of file GlobalTrackingRegionWithVerticesProducer.h.

Referenced by GlobalTrackingRegionWithVerticesProducer(), and regions().


The documentation for this class was generated from the following file:
Generated on Tue Jun 9 18:21:49 2009 for CMSSW by  doxygen 1.5.4