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

#include <IsolationRegionAroundL3Muon.h>

Inheritance diagram for IsolationRegionAroundL3Muon:
TrackingRegionProducer

Public Member Functions

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

Private Attributes

double theDeltaEta
 
double theDeltaPhi
 
edm::InputTag theInputTrkSrc
 
std::string theMeasurementTrackerName
 
double theOriginHalfLength
 
double theOriginRadius
 
double theOriginZPos
 
double thePtMin
 
std::string theVertexSrc
 
bool theVertexZconstrained
 

Detailed Description

Definition at line 14 of file IsolationRegionAroundL3Muon.h.

Constructor & Destructor Documentation

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

Definition at line 18 of file IsolationRegionAroundL3Muon.h.

References edm::ParameterSet::getParameter(), theDeltaEta, theDeltaPhi, theInputTrkSrc, theMeasurementTrackerName, theOriginHalfLength, theOriginRadius, theOriginZPos, thePtMin, theVertexSrc, and theVertexZconstrained.

18  {
19 
20  edm::ParameterSet regionPSet = cfg.getParameter<edm::ParameterSet>("RegionPSet");
21 
22  theVertexSrc = regionPSet.getParameter<std::string>("vertexSrc");
23  theInputTrkSrc = regionPSet.getParameter<edm::InputTag>("TrkSrc");
24 
25  thePtMin = regionPSet.getParameter<double>("ptMin");
26  theOriginRadius = regionPSet.getParameter<double>("originRadius");
27  theOriginHalfLength = regionPSet.getParameter<double>("originHalfLength");
28  theVertexZconstrained = regionPSet.getParameter<bool>("vertexZConstrained");
29  theOriginZPos = regionPSet.getParameter<double>("vertexZDefault");
30 
31  theDeltaEta = regionPSet.getParameter<double>("deltaEtaRegion");
32  theDeltaPhi = regionPSet.getParameter<double>("deltaPhiRegion");
33  theMeasurementTrackerName = regionPSet.getParameter<std::string>("measurementTrackerName");
34  }
T getParameter(std::string const &) const
virtual IsolationRegionAroundL3Muon::~IsolationRegionAroundL3Muon ( )
inlinevirtual

Definition at line 36 of file IsolationRegionAroundL3Muon.h.

36 {}

Member Function Documentation

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

Implements TrackingRegionProducer.

Definition at line 38 of file IsolationRegionAroundL3Muon.h.

References edm::Event::getByLabel(), edm::Handle< T >::product(), query::result, theDeltaEta, theDeltaPhi, theInputTrkSrc, theMeasurementTrackerName, theOriginHalfLength, theOriginRadius, theOriginZPos, thePtMin, theVertexSrc, and theVertexZconstrained.

39  {
40 
41  std::vector<TrackingRegion* > result;
42 
43  // optional constraint for vertex
44  // get highest Pt pixel vertex (if existing)
45  double deltaZVertex = theOriginHalfLength;
46  double originz = theOriginZPos;
47  if (theVertexSrc.length()>1) {
49  ev.getByLabel(theVertexSrc,vertices);
50  const reco::VertexCollection vertCollection = *(vertices.product());
51  reco::VertexCollection::const_iterator ci = vertCollection.begin();
52  if (vertCollection.size()>0) {
53  originz = ci->z();
54  } else {
55  originz = theOriginZPos;
56  deltaZVertex = 15.;
57  }
58  }
59 
61  ev.getByLabel(theInputTrkSrc, trks);
62 
63  for(reco::TrackCollection::const_iterator iTrk = trks->begin();iTrk != trks->end();iTrk++) {
64  double vz = (theVertexZconstrained) ? iTrk->dz() : originz;
65  GlobalVector dirVector((iTrk)->px(),(iTrk)->py(),(iTrk)->pz());
66  result.push_back(
67  new RectangularEtaPhiTrackingRegion( dirVector, GlobalPoint(0,0,float(vz)),
69  0,true,theMeasurementTrackerName) );
70  }
71 
72  return result;
73  }
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
std::vector< Vertex > VertexCollection
collection of Vertex objects
Definition: VertexFwd.h:9
tuple result
Definition: query.py:137
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:356
T const * product() const
Definition: Handle.h:74

Member Data Documentation

double IsolationRegionAroundL3Muon::theDeltaEta
private

Definition at line 86 of file IsolationRegionAroundL3Muon.h.

Referenced by IsolationRegionAroundL3Muon(), and regions().

double IsolationRegionAroundL3Muon::theDeltaPhi
private

Definition at line 87 of file IsolationRegionAroundL3Muon.h.

Referenced by IsolationRegionAroundL3Muon(), and regions().

edm::InputTag IsolationRegionAroundL3Muon::theInputTrkSrc
private

Definition at line 78 of file IsolationRegionAroundL3Muon.h.

Referenced by IsolationRegionAroundL3Muon(), and regions().

std::string IsolationRegionAroundL3Muon::theMeasurementTrackerName
private

Definition at line 88 of file IsolationRegionAroundL3Muon.h.

Referenced by IsolationRegionAroundL3Muon(), and regions().

double IsolationRegionAroundL3Muon::theOriginHalfLength
private

Definition at line 82 of file IsolationRegionAroundL3Muon.h.

Referenced by IsolationRegionAroundL3Muon(), and regions().

double IsolationRegionAroundL3Muon::theOriginRadius
private

Definition at line 81 of file IsolationRegionAroundL3Muon.h.

Referenced by IsolationRegionAroundL3Muon(), and regions().

double IsolationRegionAroundL3Muon::theOriginZPos
private

Definition at line 84 of file IsolationRegionAroundL3Muon.h.

Referenced by IsolationRegionAroundL3Muon(), and regions().

double IsolationRegionAroundL3Muon::thePtMin
private

Definition at line 80 of file IsolationRegionAroundL3Muon.h.

Referenced by IsolationRegionAroundL3Muon(), and regions().

std::string IsolationRegionAroundL3Muon::theVertexSrc
private

Definition at line 77 of file IsolationRegionAroundL3Muon.h.

Referenced by IsolationRegionAroundL3Muon(), and regions().

bool IsolationRegionAroundL3Muon::theVertexZconstrained
private

Definition at line 83 of file IsolationRegionAroundL3Muon.h.

Referenced by IsolationRegionAroundL3Muon(), and regions().