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, edm::ConsumesCollector &&iC)
 
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::EDGetTokenT
< reco::TrackCollection
theInputTrkToken
 
edm::EDGetTokenT
< MeasurementTrackerEvent
theMeasurementTrackerToken
 
double theOriginHalfLength
 
double theOriginRadius
 
double theOriginZPos
 
double thePtMin
 
edm::InputTag theVertexSrc
 
edm::EDGetTokenT
< reco::VertexCollection
theVertexToken
 
bool theVertexZconstrained
 

Detailed Description

Definition at line 16 of file IsolationRegionAroundL3Muon.h.

Constructor & Destructor Documentation

IsolationRegionAroundL3Muon::IsolationRegionAroundL3Muon ( const edm::ParameterSet cfg,
edm::ConsumesCollector &&  iC 
)
inline

Definition at line 20 of file IsolationRegionAroundL3Muon.h.

References edm::ParameterSet::getParameter(), AlCaHLTBitMon_QueryRunRegistry::string, theDeltaEta, theDeltaPhi, theInputTrkToken, theMeasurementTrackerToken, theOriginHalfLength, theOriginRadius, theOriginZPos, thePtMin, theVertexSrc, theVertexToken, and theVertexZconstrained.

21  {
22 
23  edm::ParameterSet regionPSet = cfg.getParameter<edm::ParameterSet>("RegionPSet");
24 
25  theVertexSrc = regionPSet.getParameter<edm::InputTag>("vertexSrc");
26  if (theVertexSrc.label().length()>1) theVertexToken = iC.consumes<reco::VertexCollection>(theVertexSrc);
28 
29  thePtMin = regionPSet.getParameter<double>("ptMin");
30  theOriginRadius = regionPSet.getParameter<double>("originRadius");
31  theOriginHalfLength = regionPSet.getParameter<double>("originHalfLength");
32  theVertexZconstrained = regionPSet.getParameter<bool>("vertexZConstrained");
33  theOriginZPos = regionPSet.getParameter<double>("vertexZDefault");
34 
35  theDeltaEta = regionPSet.getParameter<double>("deltaEtaRegion");
36  theDeltaPhi = regionPSet.getParameter<double>("deltaPhiRegion");
37  theMeasurementTrackerToken = iC.consumes<MeasurementTrackerEvent>(regionPSet.getParameter<std::string>("measurementTrackerName"));
38  }
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
T getParameter(std::string const &) const
edm::EDGetTokenT< MeasurementTrackerEvent > theMeasurementTrackerToken
std::vector< Track > TrackCollection
collection of Tracks
Definition: TrackFwd.h:10
std::vector< Vertex > VertexCollection
collection of Vertex objects
Definition: VertexFwd.h:9
edm::EDGetTokenT< reco::VertexCollection > theVertexToken
edm::EDGetTokenT< reco::TrackCollection > theInputTrkToken
virtual IsolationRegionAroundL3Muon::~IsolationRegionAroundL3Muon ( )
inlinevirtual

Definition at line 40 of file IsolationRegionAroundL3Muon.h.

40 {}

Member Function Documentation

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

Implements TrackingRegionProducer.

Definition at line 42 of file IsolationRegionAroundL3Muon.h.

References edm::Event::getByToken(), RectangularEtaPhiTrackingRegion::kForSiStrips, edm::InputTag::label(), edm::Handle< T >::product(), query::result, theDeltaEta, theDeltaPhi, theInputTrkToken, theMeasurementTrackerToken, theOriginHalfLength, theOriginRadius, theOriginZPos, thePtMin, theVertexSrc, theVertexToken, and theVertexZconstrained.

43  {
44 
45  std::vector<TrackingRegion* > result;
46 
47  // optional constraint for vertex
48  // get highest Pt pixel vertex (if existing)
49  double deltaZVertex = theOriginHalfLength;
50  double originz = theOriginZPos;
51  if (theVertexSrc.label().length()>1) {
53  ev.getByToken(theVertexToken,vertices);
54  const reco::VertexCollection vertCollection = *(vertices.product());
55  reco::VertexCollection::const_iterator ci = vertCollection.begin();
56  if (vertCollection.size()>0) {
57  originz = ci->z();
58  } else {
59  originz = theOriginZPos;
60  deltaZVertex = 15.;
61  }
62  }
63 
65  ev.getByToken(theInputTrkToken, trks);
66 
69  const MeasurementTrackerEvent *measurementTrackerEvent = hmte.product();
70 
71  for(reco::TrackCollection::const_iterator iTrk = trks->begin();iTrk != trks->end();iTrk++) {
72  double vz = (theVertexZconstrained) ? iTrk->dz() : originz;
73  GlobalVector dirVector((iTrk)->px(),(iTrk)->py(),(iTrk)->pz());
74  result.push_back(
75  new RectangularEtaPhiTrackingRegion( dirVector, GlobalPoint(0,0,float(vz)),
78  true,measurementTrackerEvent) );
79  }
80 
81  return result;
82  }
edm::EDGetTokenT< MeasurementTrackerEvent > theMeasurementTrackerToken
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:434
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
std::vector< Vertex > VertexCollection
collection of Vertex objects
Definition: VertexFwd.h:9
tuple result
Definition: query.py:137
edm::EDGetTokenT< reco::VertexCollection > theVertexToken
edm::EDGetTokenT< reco::TrackCollection > theInputTrkToken
T const * product() const
Definition: Handle.h:81
std::string const & label() const
Definition: InputTag.h:42

Member Data Documentation

double IsolationRegionAroundL3Muon::theDeltaEta
private

Definition at line 96 of file IsolationRegionAroundL3Muon.h.

Referenced by IsolationRegionAroundL3Muon(), and regions().

double IsolationRegionAroundL3Muon::theDeltaPhi
private

Definition at line 97 of file IsolationRegionAroundL3Muon.h.

Referenced by IsolationRegionAroundL3Muon(), and regions().

edm::EDGetTokenT<reco::TrackCollection> IsolationRegionAroundL3Muon::theInputTrkToken
private

Definition at line 88 of file IsolationRegionAroundL3Muon.h.

Referenced by IsolationRegionAroundL3Muon(), and regions().

edm::EDGetTokenT<MeasurementTrackerEvent> IsolationRegionAroundL3Muon::theMeasurementTrackerToken
private

Definition at line 98 of file IsolationRegionAroundL3Muon.h.

Referenced by IsolationRegionAroundL3Muon(), and regions().

double IsolationRegionAroundL3Muon::theOriginHalfLength
private

Definition at line 92 of file IsolationRegionAroundL3Muon.h.

Referenced by IsolationRegionAroundL3Muon(), and regions().

double IsolationRegionAroundL3Muon::theOriginRadius
private

Definition at line 91 of file IsolationRegionAroundL3Muon.h.

Referenced by IsolationRegionAroundL3Muon(), and regions().

double IsolationRegionAroundL3Muon::theOriginZPos
private

Definition at line 94 of file IsolationRegionAroundL3Muon.h.

Referenced by IsolationRegionAroundL3Muon(), and regions().

double IsolationRegionAroundL3Muon::thePtMin
private

Definition at line 90 of file IsolationRegionAroundL3Muon.h.

Referenced by IsolationRegionAroundL3Muon(), and regions().

edm::InputTag IsolationRegionAroundL3Muon::theVertexSrc
private

Definition at line 86 of file IsolationRegionAroundL3Muon.h.

Referenced by IsolationRegionAroundL3Muon(), and regions().

edm::EDGetTokenT<reco::VertexCollection> IsolationRegionAroundL3Muon::theVertexToken
private

Definition at line 87 of file IsolationRegionAroundL3Muon.h.

Referenced by IsolationRegionAroundL3Muon(), and regions().

bool IsolationRegionAroundL3Muon::theVertexZconstrained
private

Definition at line 93 of file IsolationRegionAroundL3Muon.h.

Referenced by IsolationRegionAroundL3Muon(), and regions().