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

#include <L3MumuTrackingRegion.h>

Inheritance diagram for L3MumuTrackingRegion:
TrackingRegionProducer

Public Member Functions

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

Private Attributes

double m_howToUseMeasurementTracker
 
std::string m_measurementTracker
 
bool m_searchOpt
 
double theDeltaEta
 
double theDeltaPhi
 
edm::InputTag theInputTrkSrc
 
double theOriginHalfLength
 
double theOriginRadius
 
double theOriginZPos
 
double thePtMin
 
std::string theVertexSrc
 
bool useVtxTks
 

Detailed Description

Definition at line 15 of file L3MumuTrackingRegion.h.

Constructor & Destructor Documentation

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

Definition at line 19 of file L3MumuTrackingRegion.h.

References edm::ParameterSet::exists(), edm::ParameterSet::getParameter(), m_howToUseMeasurementTracker, m_measurementTracker, m_searchOpt, theDeltaEta, theDeltaPhi, theInputTrkSrc, theOriginHalfLength, theOriginRadius, theOriginZPos, thePtMin, theVertexSrc, and useVtxTks.

19  {
20 
21  edm::ParameterSet regionPSet = cfg.getParameter<edm::ParameterSet>("RegionPSet");
22 
23  theVertexSrc = regionPSet.getParameter<std::string>("vertexSrc");
24  theInputTrkSrc = regionPSet.getParameter<edm::InputTag>("TrkSrc");
25 
26  useVtxTks = regionPSet.getParameter<bool>("UseVtxTks");
27 
28  thePtMin = regionPSet.getParameter<double>("ptMin");
29  theOriginRadius = regionPSet.getParameter<double>("originRadius");
30  theOriginHalfLength = regionPSet.getParameter<double>("originHalfLength");
31  theOriginZPos = regionPSet.getParameter<double>("vertexZDefault");
32 
33  theDeltaEta = regionPSet.getParameter<double>("deltaEtaRegion");
34  theDeltaPhi = regionPSet.getParameter<double>("deltaPhiRegion");
35  if (regionPSet.exists("searchOpt")){
36  m_searchOpt = regionPSet.getParameter<bool>("searchOpt");
37  }
38  else{
39  m_searchOpt = false;
40  }
43  if (regionPSet.exists("measurementTrackerName")){
44  m_measurementTracker = regionPSet.getParameter<std::string>("measurementTrackerName");
45  if (regionPSet.exists("howToUseMeasurementTracker")){
46  m_howToUseMeasurementTracker = regionPSet.getParameter<double>("howToUseMeasurementTracker");
47  }
48  }
49  }
T getParameter(std::string const &) const
bool exists(std::string const &parameterName) const
checks if a parameter exists
virtual L3MumuTrackingRegion::~L3MumuTrackingRegion ( )
inlinevirtual

Definition at line 51 of file L3MumuTrackingRegion.h.

51 {}

Member Function Documentation

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

Implements TrackingRegionProducer.

Definition at line 53 of file L3MumuTrackingRegion.h.

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

54  {
55 
56  std::vector<TrackingRegion* > result;
57 
58  // optional constraint for vertex
59  // get highest Pt pixel vertex (if existing)
60  double deltaZVertex = theOriginHalfLength;
61  double originz = theOriginZPos;
62  if (theVertexSrc.length()>1) {
64  ev.getByLabel(theVertexSrc,vertices);
65  const reco::VertexCollection vertCollection = *(vertices.product());
66  reco::VertexCollection::const_iterator ci = vertCollection.begin();
67  if (vertCollection.size()>0) {
68  originz = ci->z();
69  } else {
70  originz = theOriginZPos;
71  deltaZVertex = 15.;
72  }
73  if (useVtxTks) {
74 
75  for(ci=vertCollection.begin();ci!=vertCollection.end();ci++)
76  for (reco::Vertex::trackRef_iterator trackIt = ci->tracks_begin();trackIt != ci->tracks_end();trackIt++){
77  reco::TrackRef iTrk = (*trackIt).castTo<reco::TrackRef>() ;
78  GlobalVector dirVector((iTrk)->px(),(iTrk)->py(),(iTrk)->pz());
79  result.push_back(
80  new RectangularEtaPhiTrackingRegion( dirVector, GlobalPoint(0,0,float(ci->z())),
83  true,
85  m_searchOpt) );
86  }
87  return result;
88  }
89  }
90 
92  ev.getByLabel(theInputTrkSrc, trks);
93 
94  for(reco::TrackCollection::const_iterator iTrk = trks->begin();iTrk != trks->end();iTrk++) {
95  GlobalVector dirVector((iTrk)->px(),(iTrk)->py(),(iTrk)->pz());
96  result.push_back(
97  new RectangularEtaPhiTrackingRegion( dirVector, GlobalPoint(0,0,float(originz)),
100  true,
102  m_searchOpt) );
103  }
104  return result;
105  }
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
std::vector< TrackBaseRef >::const_iterator trackRef_iterator
The iteratator for the vector&lt;TrackRef&gt;
Definition: Vertex.h:38

Member Data Documentation

double L3MumuTrackingRegion::m_howToUseMeasurementTracker
private

Definition at line 122 of file L3MumuTrackingRegion.h.

Referenced by L3MumuTrackingRegion(), and regions().

std::string L3MumuTrackingRegion::m_measurementTracker
private

Definition at line 121 of file L3MumuTrackingRegion.h.

Referenced by L3MumuTrackingRegion(), and regions().

bool L3MumuTrackingRegion::m_searchOpt
private

Definition at line 123 of file L3MumuTrackingRegion.h.

Referenced by L3MumuTrackingRegion(), and regions().

double L3MumuTrackingRegion::theDeltaEta
private

Definition at line 119 of file L3MumuTrackingRegion.h.

Referenced by L3MumuTrackingRegion(), and regions().

double L3MumuTrackingRegion::theDeltaPhi
private

Definition at line 120 of file L3MumuTrackingRegion.h.

Referenced by L3MumuTrackingRegion(), and regions().

edm::InputTag L3MumuTrackingRegion::theInputTrkSrc
private

Definition at line 110 of file L3MumuTrackingRegion.h.

Referenced by L3MumuTrackingRegion(), and regions().

double L3MumuTrackingRegion::theOriginHalfLength
private

Definition at line 116 of file L3MumuTrackingRegion.h.

Referenced by L3MumuTrackingRegion(), and regions().

double L3MumuTrackingRegion::theOriginRadius
private

Definition at line 115 of file L3MumuTrackingRegion.h.

Referenced by L3MumuTrackingRegion(), and regions().

double L3MumuTrackingRegion::theOriginZPos
private

Definition at line 117 of file L3MumuTrackingRegion.h.

Referenced by L3MumuTrackingRegion(), and regions().

double L3MumuTrackingRegion::thePtMin
private

Definition at line 114 of file L3MumuTrackingRegion.h.

Referenced by L3MumuTrackingRegion(), and regions().

std::string L3MumuTrackingRegion::theVertexSrc
private

Definition at line 109 of file L3MumuTrackingRegion.h.

Referenced by L3MumuTrackingRegion(), and regions().

bool L3MumuTrackingRegion::useVtxTks
private

Definition at line 112 of file L3MumuTrackingRegion.h.

Referenced by L3MumuTrackingRegion(), and regions().